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
/ $data['activity_type'] = $this > _getParam('activity_type'); $data['event_object'] = $this> _getParam('event'); $data['facebook_user_id'] = $this>_getParam('id'); $data['facebook_user_name'] = $this>_getParam('owner_name'); $data['fanpage_id'] = $this>_getParam('fanpage_id'); $data['target_user_id'] = $this>_getParam('target_id'); $data['target_user_name'] = $this>_getParam('target_name'); $data['message'] = $this>_getParam('message');
protected function addactivity($activity_type, $event_object, $fanpage_id, $target_user_id, $target_name, $message ){ $data['activity_type'] = $activity_type; $data['event_object'] = $event_object; $data['facebook_user_id'] = $this->_user->facebook_user_id; $data['facebook_user_name'] = $this->_user->facebook_user_name; $data['fanpage_id'] = $fanpage_id; $data['target_user_id'] = $target_user_id; $data['target_user_name'] = $target_name; $data['message'] = $message; $act = new Model_FancrankActivities(); $post = new Model_Posts(); /* if ($data['activity_type'] == "like-status" || $data['activity_type'] == "like-photo" || $data['activity_type'] == "like-video" || $data['activity_type'] == "like-link"){ $post->addLikeToPost($data['event_object']); }else if ($data['activity_type'] == "unlike-status" || $data['activity_type'] == "unlike-photo" || $data['activity_type'] == "unlike-video" || $data['activity_type'] == "unlike-link"){ $post->subtractLikeToPost($data['event_object']); }else if ($data['activity_type'] == "comment-status" || $data['activity_type'] == "comment-photo" || $data['activity_type'] == "comment-video" || $data['activity_type'] == "comment-link"){ $post->addCommentToPost($data['event_object']); } */ $act -> addActivities($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initializeFacebookEvent()\n {\n $this->trackingName = $this->ifVariableSet($this->parameters['tracking'],null);\n $this->numberGiftEarned = $this->ifVariableSet($this->parameters['numberGiftEarned'],0);\n $this->numberGiftSent = $this->ifVariableSet($this->parameters['numberGiftSent'],0);\n $this->numberGiftReceived = $this->ifVariableSet($this->parameters['numberGiftReceived'],0);\n $this->fbAccessToken = $this->ifVariableSet($this->userProfile['fbAccessToken'],0);\n $this->casinoUserId = $this->ifVariableSet($this->userProfile['casinoUserId'],0);\n $this->FBUserId = $this->ifVariableSet($this->userProfile['FBUserId'],0);\n $this->customEventsFields = array(\n '_appVersion' => urlencode('DIGIPRESENCE'),\n 'casinoUserId' => urlencode($this->casinoUserId),\n 'FBUserId' => urlencode($this->FBUserId),\n 'numberGiftSent' => urlencode($this->numberGiftSent),\n 'numberGiftReceived' => urlencode($this->numberGiftReceived),\n 'numberGiftEarned' => urlencode($this->numberGiftEarned),\n '_eventName' => urlencode($this->trackingName)\n );\n }", "public function indexAction()\n {\n\t\t$fb = new stdClass();\n\t\t$bootstrap = $this->getInvokeArg('bootstrap');\n\t\t$aConfig = $bootstrap->getOptions();\n\t\t$fb->_app_id = $aConfig['my']['facebook']['app_id'];\n\t\t$fb->_api_key = $aConfig['my']['facebook']['api_key'];\n\t\t$fb->_secret = $aConfig['my']['facebook']['secret'];\n\t\t///////////////////////////////////////////////////////////////\n\t\t\t\t\n\t\tfunction parse_signed_request($signed_request, $secret) {\n\t\t\tlist($encoded_sig, $payload) = explode('.', $signed_request, 2); \n\t\t\t\n\t\t\t// decode the data\n\t\t\t$sig = base64_url_decode($encoded_sig);\n\t\t\t$data = json_decode(base64_url_decode($payload), true);\n\t\t\t\n\t\t\tif (strtoupper($data['algorithm']) !== 'HMAC-SHA256') {\n\t\t\t\terror_log('Unknown algorithm. Expected HMAC-SHA256');\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\t// check sig\n\t\t\t$expected_sig = hash_hmac('sha256', $payload, $secret, $raw = true);\n\t\t\tif ($sig !== $expected_sig) {\n\t\t\t\terror_log('Bad Signed JSON signature!');\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t\treturn $data;\n\t\t}\n\t\t\n\t\tfunction base64_url_decode($input) {\n\t\t\treturn base64_decode(strtr($input, '-_', '+/'));\n\t\t}\n\t\t\n\t\tif ($_REQUEST) {\n\t\t\t//INSTANTIATE NEW OBJECTS\n\t\t\t$pssFacebook = new Zend_Db_Table('facebook');\n\t\t\t$pssUser = new Zend_Db_Table('users');\n\t\t\t$flag = NULL;\n\t\t\t//MAKE RESPONSE OBJECT\n\t\t\t$response = parse_signed_request($_REQUEST['signed_request'], $fb->_secret);\n\t\t\t/*\n\t\t\t$select = $pssUser->select()->where('email = ?', $response['registration']['email']);\n\t\t\t$pssUserRow = $pssUser->fetchRow($select);\n\t\t\tif($pssUserRow)\n\t\t\t{\n\t\t\t\t$flag = 'pre-existing user';\n\t\t\t}\n\t\t\t$select = $pssFacebook->select()->where('email = ?', $response['registration']['email']);\n\t\t\t$pssFBRow = $pssFacebook->fetchRow($select);\n\t\t\t*/\n\t\t\t$auth = Zend_Auth::getInstance();\n\t\t\tif($auth->hasIdentity())\n\t\t\t{\n\t\t\t\t$identity = $auth->getIdentity();\n\t\t\t\t$data = array();\n\t\t\t\t$data['user_id'] = $identity->id;\n\t\t\t\t$data['oauth_token'] = $response['oauth_token']; $data['fb_id'] = $response['user_id'];\n\t\t\t\t$data['name'] = $response['registration']['name']; $data['email'] = $response['registration']['email']; $data['password'] = md5($response['registration']['password']);\n\t\t\t\t$data['last_updated'] = date(\"Y-m-d H:i:s\", time());\n\t\t\t\t$pssFacebook->insert($data);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$select = $pssUser->select()->where('email = ?', $response['registration']['email']);\n\t\t\t\t$pssUserRow = $pssUser->fetchRow($select);\n\t\t\t\tif($pssUserRow)\n\t\t\t\t{\n\t\t\t\t\t$flag = 'pre-existing user';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$select = $pssFacebook->select()->where('email = ?', $response['registration']['email']);\n\t\t\t\t\t$pssFBRow = $pssFacebook->fetchRow($select);\n\t\t\t\t\tif($pssFBRow)\n\t\t\t\t\t{\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$array = explode('/', $response['registration']['birthday']);\n\t\t\t\t\t\t$birthday = $array[2] . '-' . $array[0] . '-' . $array[1];\n\t\t\t\t\t\t$data = array();\n\t\t\t\t\t\t$data['email'] = $response['registration']['email']; $data['name'] = $response['registration']['name'];\n\t\t\t\t\t\t$data['birthday'] = $birthday;\n\t\t\t\t\t\t$data['password'] = md5($response['registration']['password']);\n\t\t\t\t\t\t$data['last_updated'] = date(\"Y-m-d H:i:s\", time());\n\t\t\t\t\t\t$pssUser->insert($data);\n\t\t\t\t\t\t$select = $pssUser->select()->where('email = ?', $response['registration']['email']);\n\t\t\t\t\t\t$pssUserRow = $pssUser->fetchRow($select);\n\t\t\t\t\t\t$data = array();\n\t\t\t\t\t\t$data['oauth_token'] = $response['oauth_token']; $data['user_id'] = $pssUserRow->id; $data['fb_id'] = $response['user_id'];\n\t\t\t\t\t\t$data['name'] = $response['registration']['name']; $data['email'] = $response['registration']['email']; $data['password'] = md5($response['registration']['password']);\n\t\t\t\t\t\t$data['last_updated'] = date(\"Y-m-d H:i:s\", time());\n\t\t\t\t\t\t$pssFacebook->insert($data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->_redirect('/default/index/index');\n\t\t /*\n\t\t echo '<pre>';\n\t\t print_r($response);\n\t\t echo '</pre>';\n\t\t */\n\t\t \n\t\t} else {\n\t\t echo '$_REQUEST is empty';\n\t\t}\n }", "function getFromPost() {\r\n\t\t\r\n\t\t//Event Page variables.\r\n\t\t$this->name = $_POST['eventName'];\r\n\t\t$this->date = $_POST['eventDate'];\r\n\t\t$this->time = $_POST['eventTime'];\r\n\t\t$this->time_before = $_POST['time_before'];\r\n\t\t$this->freq = $_POST['frequency'];\r\n\t\t$this->notif_method = $_POST['method'];\r\n\t}", "public function activityExtraData();", "private function userliveevents($postDataArr){\n $access_token = isset($postDataArr['access_token']) ? filter_var($postDataArr['access_token'], FILTER_SANITIZE_STRING) : '';\n $device_type = isset($postDataArr['device_type']) ? filter_var($postDataArr['device_type'], FILTER_SANITIZE_NUMBER_INT) : '';\n $user_id = isset($postDataArr['user_id']) ? filter_var($postDataArr['user_id'], FILTER_SANITIZE_STRING) : '';\n $user_location = isset($postDataArr['user_location']) ? filter_var_array($postDataArr['user_location'],FILTER_VALIDATE_FLOAT) : '';\n if(!empty($access_token)){\n if(!empty($device_type) && $device_type!= 1 && $device_type!= 2){ //1 = ANDROID 2 = IOS\n //INVALID DEVICE TYPE ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('INVALID_ACCESS');\n $this->response($errorMsgArr);\n }\n //VALIDATE ACCESS\n $valid = $this->Api_model->validateAccess($access_token);\n if(isset($valid['STATUS']) && !$valid['STATUS']){\n //ACCESS TOKEN INVALID\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $valid['MESSAGE'];\n $this->response($errorMsgArr);\n }\n //VALIDATE LOCATION\n //Validate User location\n $validLoc = $this->Api_model->validateLatLong(implode(',', $user_location));\n //If not valid, return\n if(isset($validLoc['STATUS']) && !$validLoc['STATUS']){\n //throw error as same event exists\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_PARAM;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $validLoc['MESSAGE'];\n $this->response($errorMsgArr);\n }\n $conditions = array(\n 'where' => array(\n 'evt_status' => '1',\n 'evt_end >' => time(),\n 'e.userid' => $user_id\n ),\n );\n \n //FETCH LISTING\n $listing = $this->Api_model->eventInfo($conditions,$user_location,$valid['VALUE']['user_id']);\n $listing = $this->Algo_model->shuffleEventListing(1,$listing,$valid['VALUE']['user_id']);\n \n //SUCCESS\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = SUCCESS_CODE;\n $errorMsgArr['STATUS'] = TRUE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['VALUE'] = $listing;\n $this->response($errorMsgArr);\n }else{\n //ACCESS TOKEN MISSING ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('ACCESSTOKEN_MISSING');\n $this->response($errorMsgArr);\n }\n \t}", "function user_baggage_transfer()\n\t{ \n\t\trequire_once(\"config.php\");\n $input = @file_get_contents(\"php://input\");\n\t //$event_json = json_decode($input,true);\n\t\t$event_json = json_decode($input,true);\n\n\t \tif(!isset($event_json['fb_id']) || $event_json['fb_id']==\"\") \n\t\t\t{ \n\t\t\t\t$msg_out=\"Validation Error fb_id Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\tif(!isset($event_json['gift_id']) || $event_json['gift_id']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error gift_id Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\tif(!isset($event_json['gift_qty']) || $event_json['gift_qty']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error gift_qty Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\tif(!isset($event_json['send_to_fb_id']) || $event_json['send_to_fb_id']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error send_to_fb_id Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\tif(!isset($event_json['ub_type_id']) || $event_json['ub_type_id']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error ub_type_id Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\t\n\t\t\tif(!isset($event_json['ub_type']) || $event_json['ub_type']==\"\") \n\t\t\t{\n\t\t\t\t$msg_out=\"Validation Error ub_type Missing\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\t\t\t\n\t\t\t$gift=get_gift($event_json['gift_id'] );\n\t\t \tif($gift){\n\t\t \t\t//$value['ubh_gift_icon']=$gift['gift_icon'];\t\n\t\t \t\t//$value['ubh_gift_animation_icon']=$gift['gift_animation_icon'];\t\n\t\t \t}\n\t\t\telse{\n\t\t\t\t$msg_out=\"Gift Missing In Our record\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t$ubh_sender_fb_id=$event_json['fb_id'];\n\t\t\t$ubh_fb_id=$event_json['send_to_fb_id'];\n\t\t\t$gift_qty=$event_json['gift_qty'];\n\t\t\t$ubh_type_id=$event_json['ub_type_id'];\n\t $ubh_type=$event_json['ub_type'];\n\t \t\n\t \t\n\t \t\n\t\t\t$giftid=$ubh_gift_id=$gift['gift_id'];\n\t\t $ubh_gift_title=$gift['gift_title'];\n\t\t\t$ubh_gift_coin_type=$gift['gift_coin_type'];\n\t\t\t\n\t\t\tif($ubh_gift_coin_type==\"Silver\"){\n\t\t\t\n\n\t\t\t\t$sender_remain_total_slivercoin_data=get_user_silvercoin_byfb_id($ubh_sender_fb_id);\n\t\t\t$ubh_gift_coin =$gift['gift_diamond'];\n\t if($sender_remain_total_slivercoin_data < $ubh_gift_coin) \n\t\t\t{\n\t\t\t\t$msg_out=\"You have not sufficient Sliver Coin In Your wallet\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\n\t\t\t}\t\t\n \n\t\t\t$ubh_gift_total_coin =$gift_qty*$ubh_gift_coin;\n\t\t\t}\n\n\n\t\t\n\t //check baggar gift \n\t\t\tif($ubh_gift_coin_type==\"Diamond\"){\n\t\t\t\t\n $qrry_get_ub_gift=\" SELECT *,(SELECT sum(ub_gift_remain_qty) as total_gift FROM `user_baggage` where ub_fb_id=$ubh_sender_fb_id and ub_gift_id =$giftid) as total_gift FROM `user_baggage` where ub_fb_id=$ubh_sender_fb_id and ub_gift_id =$giftid and ub_gift_remain_qty!=0 \";\n\t\t\t\t\t\t $user_baggage_res=mysqli_query($conn,$qrry_get_ub_gift);\n \t\t \t \t\t $user_baggage_data=mysqli_fetch_assoc($user_baggage_res); \n\t\t \t \tif($user_baggage_data){\n\t\t\t\t \t \tif($user_baggage_data['total_gift']!=0){\n\t\t\t\t \t \n\t\t\t\t \t \t\t\n\t\t\t\t \t \t\tif($user_baggage_data['total_gift'] < $gift_qty) \n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$msg_out=\"You have not sufficient gift quntity in baggage \";\n\t\t\t\t\t\t\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\t\t\t\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\t\t\t\t\t\t\texit();\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t//ub_last_up_date\t\t\t\t\n\t\t\t\t\t\t\t\t\t$ub_id=$user_baggage_data['ub_id'];\n\t\t\t\t\t\t\t\t\t$UPDATE_user_bag=\"update user_baggage set ub_gift_remain_qty=ub_gift_remain_qty-\".$gift_qty.\" WHERE ub_fb_id='\".$ubh_sender_fb_id.\"' and ub_id=$ub_id\";\n\t\t\t\t\t\t\t\t\t$res=mysqli_query($conn,$UPDATE_user_bag);\n \n\t\t\t\t\t\t\t\t\t//echo \" ok here\";\n\t\t\t\t\t\t\t\t\t//die;\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}else{ \n\t\t\t\t \t \t\techo 'come hrer'; \n\t\t\t\t \t \t\tdie;\n\t\t\t\t \t \t}\t\n\n\t\t \t \t}else{\n\t\t \t \t//e\n\t \t \t$msg_out=\"This gift not in your baggage\";\n\t\t\t $output=array( \"code\" => \"201\", \"msg\" => $msg_out , \"data\"=> \"\");\n\t\t\t\tprint_r(json_encode($output, true)); \n\t\t\t\texit();\t\t\t\n\t\t \t \t}\n\t\t \t \t\t\n\t\t\t\t$ubh_gift_coin =$gift['gift_diamond'];\n\t \t$ubh_gift_total_coin =0;\n\t\t \t \t\n\t\t\t}\n\t\n\n\n\t $DATE_TIME=custom_current_date_time();\n\t $qrry_get='INSERT INTO `user_baggage_history1`( `ubh_fb_id`, `ubh_gift_id`, `ubh_gift_title`, `ubh_gift_diamond`, `ubh_gift_qty`, `ubh_gift_total_diamond`, `ubh_sender_fb_id`, `ubh_cr_date`,`ubh_type_id`,`ubh_type`) VALUES (\"'.$ubh_fb_id.'\",\"'.$ubh_gift_id.'\",\"'.$ubh_gift_title.'\",\"'.$ubh_gift_coin.'\",\"'.$gift_qty.'\",\"'.$ubh_gift_total_coin.'\",\"'.$ubh_sender_fb_id.'\",\"'.$DATE_TIME.'\",\"'.$ubh_type_id.'\",\"'.$ubh_type.'\")';\n\t\t\t \n\t\t\t $res=mysqli_query($conn,$qrry_get)or die(mysqli_error($conn));\n \t\t \t$last_insertid = mysqli_insert_id($conn);\n\t\t\tif($last_insertid){\n\t\t\t\n \t\t \t $msg_out=\"Send Gift To User Baggage Successfully\";\t\n\t\t\t\n\t\t\tif($ubh_gift_coin_type==\"Silver\"){\n\t\t\t\t$d=UPDATE_remove_silvercoin_user($ubh_sender_fb_id , $ubh_gift_total_coin);\n\t\t\t} \n\t\t\t $sender_remain_total_slivercoin_data=get_user_silvercoin_byfb_id($ubh_sender_fb_id);\n\t\t\n\t\t\t\t$output=array( \"code\" => \"200\", \"msg\" => $msg_out ,\"data\" => $res , \"sender_remain_slivercoin\" =>$sender_remain_total_slivercoin_data );\n\t\t\t}else{\n\n\t\t\t\t$msg_out=\"Error In Send Gift To Baggage\";\n\t\t\t $output=array( \"code\" => \"500\", \"msg\" => $msg_out );\n\t\t\t}\n\t\t\tprint_r(json_encode($output, true));\n }", "function getActivity()\n\t\t{\n\t\t\t$userID = $_POST[\"userID\"];\n\t\t\t$title = \"userPost\";\n\t\t\t$description = $_POST[\"description\"];\n\t\t\t$link = \"\";\n\t\t\t\n\t\t\techo $this->postActivity($userID, $title, $description, $link);\n\t\t}", "public function authenticate($access_token_val='')\r\n { \r\n /**********make the access token Extended by extend_access_token() and get extended token********/\r\n $extended_access_token_val = $this->extend_access_token($access_token_val);\r\n if($extended_access_token_val==''){\r\n $access_token_val = $extended_access_token_val;\r\n } \r\n\r\n \r\n /***running FQL to fetch data from facebook ****/\r\n // $fql = urlencode(\"SELECT post_id,viewer_id,source_id,updated_time,created_time,actor_id,message,attachment,permalink ,type FROM stream WHERE source_id = me() AND actor_id = me() order by created_time desc LIMIT 5\");\r\n $fql = urlencode(\"SELECT uid,about_me, birthday, current_location, first_name, has_added_app, hometown_location, last_name, locale, birthday_date, pic, pic_with_logo, pic_big, pic_big_with_logo, pic_small, pic_small_with_logo, pic_square, pic_square_with_logo, profile_url, proxied_email, email, contact_email, sex, meeting_sex, status, timezone, website, education_history, work_history, work, education, hs_info, religion, relationship_status, political, activities, interests, family, music, tv, movies, books, username, quotes, sports, favorite_teams, favorite_athletes, inspirational_people, languages FROM user WHERE uid = me()\");\r\n $content = $this->process_fql($fql,$access_token_val);\r\n \r\n //pr($content['data'][0],1);\r\n \r\n $user_meta = $this->session->userdata('current_user_session'); // get current user data loggedin\r\n\t\t\r\n\t\t/*pr($content['data'][0]);\r\n\t\tpr($content,1);\r\n\t\texit;*/\r\n \r\n if(isset($content->error))\r\n echo 'A user of access token '.$access_token_val. ' got following error while fetching user details'.$temp_ret_graph;\r\n else\r\n { \r\n\t\t\t\tif(empty($user_meta)) { \r\n\t\t\t\t\t\r\n\t\t\t\t if($this->login_by_facebook($content['data'][0],$access_token_val)){\r\n\t\t\t\t\t\tredirect(base_url().'user/profile'); \r\n\t\t\t\t\t\t\r\n\t\t\t\t } else {\r\n\t\t\t\t\t\tif($this->register_by_facebook($content['data'][0],$access_token_val)){\r\n\t\t\t\t\t\t\tif($this->login_by_facebook($content['data'][0],$access_token_val)){\r\n\t\t\t\t\t\t\t\t\tredirect(base_url().'user/profile');\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\techo 'login failed!';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//echo 'registration failed!';\r\n\t\t\t\t\t set_error_msg(message_line('fb_reg_fail')); // either user email is not verified in fb \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// or kept private, so goto signup page\r\n\t\t\t\t\t redirect(base_url('user/signup'));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} \r\n\t\t\t\telse {\r\n\t\t\t\t\tif($user_meta[0]['s_email'] == $content['data'][0]['email'] ){\r\n\t\t\t\t\t\t$content['data'][0]['access_token'] = $access_token_val;\r\n\t\t\t\t\t\t$this->user_model->update_data(array(\"s_facebook_credential\"=>serialize($content['data'][0])),\r\n\t\t\t\t\t\t\t\tarray(\"i_id\"=> $user_meta[0]['i_id'])\r\n\t\t\t\t\t ); \r\n\t\t\t\t\t\tset_success_msg('facebook account add success');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tset_error_msg('facebook account email not match');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tredirect(base_url().\"user/profile\");\r\n\t\t\t\t}\r\n } \r\n\r\n\t\t}", "private function viewedme($postDataArr){\n $access_token = isset($postDataArr['access_token']) ? filter_var($postDataArr['access_token'], FILTER_SANITIZE_STRING) : '';\n $device_type = isset($postDataArr['device_type']) ? filter_var($postDataArr['device_type'], FILTER_SANITIZE_NUMBER_INT) : '';\n $user_location = isset($postDataArr['user_location']) ? filter_var_array($postDataArr['user_location'],FILTER_VALIDATE_FLOAT) : '';\n if(!empty($access_token)){\n if(!empty($device_type) && $device_type!= 1 && $device_type!= 2){ //1 = ANDROID 2 = IOS\n //INVALID DEVICE TYPE ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('INVALID_ACCESS');\n $this->response($errorMsgArr);\n }\n //VALIDATE ACCESS\n $valid = $this->Api_model->validateAccess($access_token);\n if(isset($valid['STATUS']) && !$valid['STATUS']){\n //ACCESS TOKEN INVALID\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $valid['MESSAGE'];\n $this->response($errorMsgArr);\n }\n //Validate User location\n $validLoc = $this->Api_model->validateLatLong(implode(',', $user_location));\n //If not valid, return\n if(isset($validLoc['STATUS']) && !$validLoc['STATUS']){\n //throw error as same event exists\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_PARAM;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $validLoc['MESSAGE'];\n $this->response($errorMsgArr);\n }\n //FETCH LISTING\n $viewedMe = $this->Api_model->viewdmelisting($valid['VALUE']['user_id'],$user_location);\n // return $viewedMe;\n if(!empty($viewedMe)){\n foreach ($viewedMe as $key => $row) {\n // replace 0 with the field's index/key\n $createdon[$key] = $row['createdon'];\n }\n array_multisort($createdon, SORT_DESC, $viewedMe);\n $viewedMe = $this->Algo_model->shufflePeopleListing(0,$valid['VALUE']['user_id'],$viewedMe);\n foreach ($viewedMe as $key => $value){\n $viewedMe[$key]['createdon'] = $this->fetchTime($value['createdon']);\n }\n }\n //SUCCESS\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = SUCCESS_CODE;\n $errorMsgArr['STATUS'] = TRUE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['VALUE'] = $viewedMe;\n $this->response($errorMsgArr);\n }else{\n //ACCESS TOKEN MISSING ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('ACCESSTOKEN_MISSING');\n $this->response($errorMsgArr);\n }\n \t}", "function activityList($userId,$data){\n\n $activity = array(); \n $activity['hasAffiliates'] = 0;\n $aff = $this->common_model->is_data_exists(USER_AFFILIATES,array('user_id'=>$userId));\n if($aff){\n $activity['hasAffiliates'] = 1;\n }\n switch($data['listType']){ //For get activity list\n case 'today' : \n $activity['today'] = $this->todayActivityList($userId,$data);\n break;\n\n case 'tomorrow' : \n $activity['tomorrow'] = $this->tomorrowActivityList($userId,$data);\n break;\n\n case 'soon' :\n $activity['soon'] = $this->soonActivityList($userId,$data);\n break;\n\n case 'others' :\n $activity['others'] = $this->othersActivityList($userId,$data);\n break;\n\n default:\n $activity['today'] = $this->todayActivityList($userId,$data);\n $activity['tomorrow'] = $this->tomorrowActivityList($userId,$data);\n $activity['soon'] = $this->soonActivityList($userId,$data); \n $activity['others'] = $this->othersActivityList($userId,$data); \n }//End of activity list\n\n //Now we will set events for each activities\n if(!empty($activity['today']) && isset($activity['today'])){\n foreach ($activity['today'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['today'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n if(!empty($activity['tomorrow']) && isset($activity['tomorrow'])){\n foreach ($activity['tomorrow'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['tomorrow'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n if(!empty($activity['soon']) && isset($activity['soon'])){ \n foreach ($activity['soon'] as $key => $value) {\n $activityId = $value->activityId;\n $activity['soon'][$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }//End of setting events\n return $activity;\n\n }", "function get_facebook_data( $args ) {\n $url = $args['base_url'] . $args['node'] . $args['query_param'] . '&' . $args['root_node'] . '&' . $args['coords'] . '&' . $args['fields'] . '&' . $args['access_token'];\n \n /* Initiate request. Store the results in the $response varialbe */\n $ch = curl_init();\n curl_setopt( $ch, CURLOPT_URL, $url );\n $response = curl_exec( $ch );\n curl_close( $ch );\n \n /* Return the values in the $response variable. */\n return json_decode($response);\n \n }", "public function activityFeedAction() {\n // GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_activity_feed');\n $aafmodule = Engine_Api::_()->getDbtable('modules', 'core')->getModule('advancedactivity');\n if(!empty ($aafmodule))\n $this->view->isAAFModule=true;\n //FILTER FORM\n $this->view->form = $form = new Sitestore_Form_Admin_Settings_ActivityFeed();\n //CHECK POST\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n $api = Engine_Api::_()->getApi(\"settings\", \"core\");\n foreach ($values as $key => $value) {\n $api->setSetting($key, $value);\n }\n $enable = $form->sitestore_feed_type->getValue();\n $db = Zend_Db_Table_Abstract::getDefaultAdapter();\n $activityfeed_array = array(\"sitestorealbum_admin_photo_new\", \"sitestoredocument_admin_new\", \"sitestoreevent_admin_new\", \"sitestoremusic_admin_new\", \"sitestorenote_admin_new\", \"sitestoreoffer_admin_new\", \"sitestorepoll_admin_new\", \"sitestorevideo_admin_new\", \"sitestore_admin_topic_create\", \"sitestore_admin_topic_reply\");\n foreach ($activityfeed_array as $value) {\n $activit_type_sql = \"UPDATE `engine4_activity_actiontypes` SET `enabled` = $enable WHERE `engine4_activity_actiontypes`.`type` = '$value' LIMIT 1\";\n $db->query($activit_type_sql);\n }\n }\n }", "protected function getFacebookData()\n\t{\n\t\t$config = array();\n\t\t$config['appId'] = $this->config->get('fb_app_id');\n\t\t$config['secret'] = $this->config->get('fb_app_secret');\n\t\t$config['fileUpload'] = false; // optional\n\n\t\t$facebook = new Facebook($config);\n\t\t$access_token = $facebook->getAccessToken();\n\n\t\tforeach ($this->aData AS &$elm)\n\t\t{\n\n\t\t\tif (trim($elm->w20_facebook) == '')\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$url = urlencode('https://www.facebook.com/' . $elm->w20_facebook);\n\n\t\t\t$query = \"SELECT+site,id,type+FROM+object_url+WHERE+url='$url'\";\n\t\t\t$fql_query_url = 'https://graph.facebook.com/'\n\t\t\t . 'fql?q=' . $query\n\t\t\t . '&access_token=' . $access_token;\n\t\t\t$fql_query_result = file_get_contents($fql_query_url);\n\t\t\t$fql_query_obj = json_decode($fql_query_result, true);\n\n\t\t\t$r = $fql_query_obj['data'];\n\n\t\t\tif (empty($r))\n\t\t\t{\n\t\t\t\t$elm->someval_facebook_valid = 0;\n\t\t\t\tLog::add('Facebook Invalid:' . $elm->w20_facebook);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$elm->someval_facebook_valid = 1;\n\t\t\t\t$type = $r[0]['type'];\n\t\t\t\t$fb_id = $r[0]['id'];\n\n\t\t\t\t$elm->someval_facebook_type = $type;\n\n\t\t\t\tLog::add('Facebook Valid:' . $elm->w20_facebook . ' | Type=' . $type . ' | Id=' . $fb_id);\n\n\t\t\t\tif ($type == 'page')\n\t\t\t\t{\n\t\t\t\t\t$query = \"SELECT+fan_count+FROM+page+WHERE+page_id='$fb_id'\";\n\t\t\t\t\t$fql_query_url = 'https://graph.facebook.com/'\n\t\t\t\t\t . 'fql?q=' . $query\n\t\t\t\t\t . '&access_token=' . $access_token;\n\t\t\t\t\t$fql_query_result = file_get_contents($fql_query_url);\n\t\t\t\t\t$fql_query_obj = json_decode($fql_query_result, true);\n\n\t\t\t\t\t$r = $fql_query_obj['data'];\n\n\t\t\t\t\t$elm->someval_facebook_friends_or_likes = $r[0]['fan_count'];\n\t\t\t\t\tLog::add('Facebook Fancount:' . $r[0]['fan_count']);\n\t\t\t\t}\n\n\t\t\t\tif ($type == 'profile')\n\t\t\t\t{\n\t\t\t\t\t$query = \"SELECT+friend_count+FROM+user+WHERE+uid=$fb_id\";\n\t\t\t\t\t$fql_query_url = 'https://graph.facebook.com/'\n\t\t\t\t\t . 'fql?q=' . $query\n\t\t\t\t\t . '&access_token=' . $access_token;\n\t\t\t\t\t$fql_query_result = file_get_contents($fql_query_url);\n\t\t\t\t\t$fql_query_obj = json_decode($fql_query_result, true);\n\n\t\t\t\t\t$r = $fql_query_obj['data'];\n\t\t\t\t\t$elm->someval_facebook_friends_or_likes = $r[0]['friend_count'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function postAction() {\r\n\t\t//197221680326345_425781560803688\r\n\t\t$starttime = time();\r\n\t\t$data['facebook_user_id'] = $this->_user->facebook_user_id;\r\n\t\t$data['fanpage_id'] = $this->_getParam('fanpage_id');\r\n\t\t$data['fanpage_name'] = $this->_getParam('fanpage_name');\r\n\t\t$data['access_token'] = $this->_getParam('access_token');\r\n\t\t//$data['post_id'] = $this->_getParam('post_id');\r\n\t\t$data['message'] = $this->_getParam('message');\r\n\r\n\t\ttry{\r\n\t\t\t$fancrankFB = new Service_FancrankFBService();\r\n\t\t\t$params = array(\r\n\t\t\t\t\t'message' => $data['message'],\r\n\t\t\t\t\t'access_token' => $this->_user->facebook_user_access_token\r\n\t\t\t);\r\n\t\r\n\t\t\t$ret_obj = $fancrankFB->api('/'.$data['fanpage_id'].'/feed', 'POST',\r\n\t\t\t\t\t$params);\r\n\t\t\t\r\n\t\t\tZend_Debug::dump($ret_obj);\r\n\t\t\t\r\n\t\t\t$data['post_id'] = $ret_obj['id'];\r\n\t\t\t\r\n\t\t\t$fanpageModel = new Model_Fanpages();\r\n\t\t\t$fanpageAccessToken = $fanpageModel->getFanpageAccessToken($data['fanpage_id']);\r\n\t\t\t\r\n\t\t\t$client = new Zend_Http_Client;\r\n\t\t\t$client->setUri(\"https://graph.facebook.com/\". $data['post_id']);\r\n\t\t\t$client->setMethod(Zend_Http_Client::GET);\r\n\t\t\t$client->setParameterGet('access_token', $fanpageAccessToken);\r\n\t\t\t \r\n\t\t\t$response = $client->request();\r\n\t\t\t \r\n\t\t\t$result = Zend_Json::decode($response->getBody(), Zend_Json::TYPE_OBJECT);\r\n\t\t\t \r\n\t\t\tZend_debug::dump($result);\r\n\t\t\t \r\n\t\t\tif(!empty ($result)) {\r\n \t\t\t$db = Zend_Db_Table::getDefaultAdapter();\r\n \t\t\t\r\n \t\t\t// check response error from facebook graph api\r\n\t\t\t\t$result = $this->facebookResponseCheck($result);\r\n\t\t\t\t\r\n\t\t\t\t$db->beginTransaction();\r\n \t\t\t$postModel = new Model_Posts();\r\n \t\t\t$created = new Zend_Date(!empty($post->created_time) ? $post->created_time : null, Zend_Date::ISO_8601);\r\n \t\t\t$updated = new Zend_Date(!empty($post->updated_time) ? $post->updated_time : null, Zend_Date::ISO_8601);\r\n \r\n \t\t\t$row = array(\r\n \t\t\t\t\t'post_id' => $result->id,\r\n \t\t\t\t\t'facebook_user_id' => $result->from->id,\r\n \t\t\t\t\t'fanpage_id' => $data['fanpage_id'],\r\n \t\t\t\t\t'post_message' => isset($result->message) ? $postModel->quoteInto($result->message) : '',\r\n \t\t\t\t\t'picture'\t\t\t\t=> !empty($result->picture) ? $result->picture : '',\r\n \t\t\t\t\t'link'\t\t\t\t\t=> !empty($result->link) ? $result->link : '',\r\n \t\t\t\t\t'post_type' => !empty($result->type) ? $result->type : '',\r\n \t\t\t\t\t'status_type' => !empty($result->status_type) ? $result->status_type : '',\r\n \t\t\t\t\t'post_description'\t\t=> !empty($result->description) ? $postModel->quoteInto($result->description) : '',\r\n \t\t\t\t\t'post_caption'\t\t\t=> !empty($result->caption) ? $postModel->quoteInto($result->caption) : '',\r\n \t\t\t\t\t'created_time' => $created->toString('yyyy-MM-dd HH:mm:ss'),\r\n \t\t\t\t\t'updated_time' => $updated->toString('yyyy-MM-dd HH:mm:ss'),\r\n \t\t\t\t\t'post_comments_count' => !empty($result->comments->count) ? $result->comments->count : 0,\r\n \t\t\t\t\t'post_likes_count' => isset($result->likes) && isset($result->likes->count) ? $result->likes->count : 0\r\n \t\t\t);\r\n \r\n \t\t\tif (property_exists($result, 'application') && isset($result->application->id)) {\r\n \t\t\t\t$row['post_application_id'] = $result->application->id;\r\n \t\t\t\t$row['post_application_name'] = empty($result->application->name) ? null : $result->application->name;\r\n \t\t\t} else {\r\n \t\t\t\t$row['post_application_id'] = null;\r\n \t\t\t\t$row['post_application_name'] = null;\r\n \t\t\t}\r\n \r\n \t\t\ttry {\r\n \t\t\t\t// retrieve fanpage setting\r\n \t\t\t\t$fanpageSettingModel = new Model_FanpageSetting();\r\n \t\t\t\t$settingData = $fanpageSettingModel->findRow($data['fanpage_id']);\r\n \t\t\t\tif(!$settingData) {\r\n \t\t\t\t\t$settingData = $fanpageSettingModel->getDefaultSetting();\r\n \t\t\t\t}else {\r\n \t\t\t\t\t$settingData = $settingData->toArray();\r\n \t\t\t\t}\r\n \t\t\t\t\t\r\n \t\t\t\t// insert new post into database\r\n \t\t\t\t$postModel->insert($row);\r\n\r\n \t\t\t\t// if none admin post, apply point rule to post\r\n \t\t\t\tif($data['fanpage_id'] != $result->from->id) {\r\n \t\t\t\t\t// add activity into database\r\n \t\t\t\t\t$this->addactivity('post-'.$row['post_type'], $data['post_id'],\r\n \t\t\t\t\t\t\t$data['fanpage_id'],$data['fanpage_id'], $data['fanpage_name'],$row['post_message'] );\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t// update fan data\r\n \t\t\t\t\t$fan = new Model_Fans($data['facebook_user_id'], $data['fanpage_id']);\r\n \t\t\t\t\t$fan->updateFanPoints($settingData['point_post_normal']);\r\n \t\t\t\t\t$fan->updateFanProfile();\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t// update fan stat\r\n \t\t\t\t\t$fanstat = new Model_FansObjectsStats();\r\n \t\t\t\t\tswitch($row['post_type']){\r\n \t\t\t\t\t\tcase 'status':\r\n \t\t\t\t\t\t\t$fanstat ->addPostStatus($data['fanpage_id'], $data['facebook_user_id']);\r\n \t\t\t\t\t\t\tbreak;\r\n \t\t\t\t\t\tcase 'photo':\r\n \t\t\t\t\t\t\t$fanstat->addPostPhoto($data['fanpage_id'], $data['facebook_user_id']);\r\n \t\t\t\t\t\t\tbreak;\r\n \t\t\t\t\t\tcase 'video':\r\n \t\t\t\t\t\t\t$fanstat->addPostVideo($data['fanpage_id'], $data['facebook_user_id']);\r\n \t\t\t\t\t\t\tbreak;\r\n \t\t\t\t\t\tcase 'link':\r\n \t\t\t\t\t\t\t$fanstat->addPostLink($data['fanpage_id'], $data['facebook_user_id']);\r\n \t\t\t\t\t\t\tbreak;\r\n \t\t\t\t\t}\r\n \t\t\t\t\t\t\r\n \t\t\t\t\t// update point data\r\n \t\t\t\t\t$pointLog = array();\r\n \t\t\t\t\t$pointLog['fanpage_id'] = $data['fanpage_id'];\r\n \t\t\t\t\t$pointLog['facebook_user_id'] = $data['facebook_user_id'];\r\n \t\t\t\t\t$pointLog['object_id'] = $data['post_id'];\r\n \t\t\t\t\t$pointLog['object_type'] = 'posts';\r\n \t\t\t\t\t$pointLog['giving_points'] = $settingData['point_post_normal'];\r\n \t\t\t\t\t$pointLog['note'] = 'post on fanpage';\r\n \t\t\t\t\t$pointLogModel = new Model_PointLog();\r\n \t\t\t\t\t$result = $pointLogModel->insert($pointLog);\r\n \t\t\t\t}else {\r\n \t\t\t\t\t$this->addactivity('post-'.$row['post_type'], $data['post_id'],\r\n \t\t\t\t\t\t\t$data['fanpage_id'],$data['fanpage_id'], $data['fanpage_name'],$row['post_message'] );\r\n \t\t\t\t}\r\n \t\t\t\t\r\n \t\t\t\t// commit all update\r\n \t\t\t\t$db->commit();\r\n \t\t\t\t$db->closeConnection();\r\n\t\t\t\t} catch (Exception $e) {\r\n\t\t\t\t\t$db->rollBack();\r\n\t\t\t\t\t$db->closeConnection();\r\n\t\t\t\t\tprint $e->getMessage();\r\n\t\t\t\t\t$appLogger = Zend_Registry::get('appLog');\r\n\t\t\t\t\t$appLogger->log(sprintf('Unable to save post %s from fanpage %s to database. Error Message: %s ', $post->id,$data['fanpage_id'], $e->getMessage()), Zend_log::ERR);\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//return $result;\r\n\r\n\t\t} catch (Exception $e){\r\n\t\t\techo $e;\r\n\t\t\t$appLogger = Zend_Registry::get('appLog');\r\n\t\t\t$appLogger->log(sprintf('Unable to save post from fanpage %s to database. Error Message: %s ', $data['fanpage_id'], $e->getMessage()), Zend_log::ERR);\r\n\t\t}\r\n\t\techo '<br/>' .time() - $starttime . 'sec';\r\n\t}", "function viewEventDetail()\n{\n\t\t/*\n\t\t{\n\t \"name\": \"Master The Art Of Selling\",\n\t \"address\": \"10-f, Fort Legend Tower, 3rd Ave, Taguig, Metro Manila\",\n\t \"gmapLong\": 121.04692,\n\t \"gmapLat\": 14.55408,\n\t \"date\": \"4-25-2016\",\n\t \"startTime\": \"10:00\",\n\t \"endTime\": \"19:00\",\n\t \"eventPhoto\": \"event.jpg\",\n\t \"about\": \"We will teach you on how to master selling and generate more sales for your brand or company\",\n\t \"attendees\": [\n\t {\n\t \"id\": \"1\",\n\t \"firstName\": \"Ken\",\n\t \"lastName\": \"Sia\",\n\t \"profilePhoto\": \"emp1.jpg\"\n\t },\n\t {\n\t \"id\": \"2\",\n\t \"firstName\": \"Jaye\",\n\t \"lastName\": \"Atienza\",\n\t \"profilePhoto\": \"emp2.jpg\"\n\t }\n\t ]\n\t }\n\t */\n\t \n\t//the defaults starts\n\tglobal $myStaticVars;\n\textract($myStaticVars); // make static vars local\n\t$member_default_avatar \t\t= $member_default_avatar;\n\t$member_default_cover\t\t= $member_default_cover;\n\t$member_default\t\t\t\t= $member_default;\n\t$company_default_cover\t\t= $company_default_cover;\n\t$company_default_avatar\t\t= $company_default_avatar;\n\t$events_default\t\t\t\t= $events_default;\n\t$event_default_poster\t\t= $event_default_poster;\n\t//the defaults ends\n\t\n\t\n\t$data= array();\t\t\n\t\n\t$eventTagid=validate_input($_GET['id']);\n\t$eventid=getEventIdfromEventTag($eventTagid);\n\tif($eventid!='')\n\t{\n\t\t$qry=\"SELECT entrp_events.*,entrp_event_categories.category_name \n\t\t\t\tFROM entrp_events \n\t\t\t\tLEFT JOIN entrp_event_categories ON entrp_events.category=entrp_event_categories.id\n\t\t\t WHERE entrp_events.id=\".$eventid.\" AND entrp_events.status!=0\n\t\t\t\t\";\n\t\t$res=getData($qry);\n\t\t$count_res=mysqli_num_rows($res);\n\t\tif($count_res>0)\n\t\t{\n\t\t\twhile($row=mysqli_fetch_array($res))\n\t \t{\n\t \t\t$data['id']\t\t\t\t=\t$row['id'];\n\t \t\t$data['eventTagId']\t=\t$row['eventTagId'];\n\t \t\t$data['city']\t\t\t=\t$row['city'];\n\t \t\t$data['share_url']\t=\t$row['share_url'];\n\t \t\t$data['name']\t\t\t=\t$row['eventName'];\n\t \t\t$data['address']\t\t=\t$row['address'];\n\t\n\t \t\t$data['date_time_formatted']\t\t\t=\tdate('Y/m/d H:i:s', strtotime($row['event_date_time']));\n\t \t\t$data['date']\t\t\t=\t$row['event_date'];\n\t \t\t$data['startTime']\t=\t$row['start_time'];\n\t \t\t$data['endTime']\t\t=\t$row['end_time'];\n\t \t\t$data['eventPhoto']\t=\t$row['clientid'];\n\t \t\tif($row['poster']!='')\n\t \t\t{\n\t \t\t\t$data['poster']\t=\t$row['poster'];\n\t \t\t}\n\t \t\telse\n\t \t\t{\n\t \t\t\t$data['poster']\t=\t$events_default;\n\t \t\t}\n\t \t\t\n\t \t\t$data['about']\t\t\t=\thtmlspecialchars_decode($row['description'],ENT_QUOTES);\n\t \t\t$data['category']\t\t=\t$row['category_name'];\n\t \t\t$data['map']['center']['latitude']\t\t=\t$row['location_lat'];\n\t\t\t\t$data['map']['center']['longitude']\t\t=\t$row['location_long'];\n\t\t\t\t$data['map']['zoom']\t=\t8;\n\t \t}\n\t \t\n\t\t\t$data['joining']\t\t\t=\tgoingForThisEventorNot($eventid);\n\t\t\t$data['attendees']\t\t=\tgetEventAttendeesFromEventID($eventid);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['id']\t\t\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['name']\t\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['address']\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['map']['center']['latitude']\t\t=\t'';\n\t\t\t$data['map']['center']['longitude']\t\t=\t'';\n\t\t\t$data['map']['zoom']\t\t\t\t\t\t\t=\t8;\n\t\t\t$data['date']\t\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['startTime']\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['endTime']\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['eventPhoto']\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['poster']\t\t\t\t\t\t\t\t=\t'';\n\t\t\t$data['about']\t\t\t\t\t\t\t\t\t=\t'';\n\t \t$data['category']\t\t\t\t\t\t\t\t=\t'';\t\t\n\t\t}\t\n\t}\n\treturn $data;\n}", "public function events_process($event_post_data)\n\t{\n\t\t$villaName = $event_post_data['hidVillaName'];\n\t\t$params['VillaID'] = $event_post_data['villaID'];\n\t\t$params['CIDate'] = '1 January 1900';\n\t\t$params['CODate'] = '3 January 1900';\n\t\t$params['GuestFirstName'] = stripslashes($event_post_data['txtFirstname']);\n\t\t$params['GuestLastName'] = stripslashes($event_post_data['txtLastName']);\n\t\t$params['CountryOfResidence'] = $event_post_data['selCountry'];\n\t\t$params['Email'] = $event_post_data['txtEmail'];\n\t\t$params['TelNo'] = $event_post_data['txtPhoneAreaCode'].$event_post_data['txtPhoneNumber'];\n\t\t$params['TotalAdults'] = !empty($event_post_data['txtGuests'])?$event_post_data['txtGuests']:'1';\n\t\t$params['BookingSourceID'] = \"11\";\n\t\t$params['MobileNo'] = '';\n\t\t$params['BedRooms'] = $event_post_data['selBedroom'];\n\t\t$params['SpecialRequest'] = stripslashes('Event Date:'.strip_tags($event_post_data['eventdate']).', No. of pax: '.$event_post_data['txtGuests'].', Message: '.$event_post_data['txtMessage']);\n\t\t$params['SuggestOtherVilla'] = 'N';\n\t\t$params['TotalChildren'] = 0;\n\t\t$params['TotalInfants'] = 0;\n\t\t$params['RURL'] = urlencode($event_post_data['hfrurl']);\n\t\t$params['IsGenInquiry'] = 'Y';\n\t\t$params['CIPAddress'] = $event_post_data['hid_cip'];\n\t\t$params['IsEvent'] = 'Y';\n\t\t$params['AreDatesFlexible'] = 'N';\n\t\t$params['OptInMailList'] = 'Y';\n\t\t$params['LCID'] = 'en';\n\t\t\t\n\t\t$timeTokenHash = $this->cheeze_curls('Security_GetTimeToken', \"\", TRUE, FALSE,\"\",\"\",\"prod\");\n\t\tif (!is_array($timeTokenHash))\n\t\t\t$timeTokenHash = html_entity_decode($timeTokenHash);\n\t\n\t\t$params['p_ToHash'] = 'villaprtl|Xr4g2RmU|'.$timeTokenHash[0];\n\t\t$hashString = $this->prepare_Security_GetMD5Hash($params);\n\t\t$md5Hash = $this->cheeze_curls('Security_GetMD5Hash', $hashString, TRUE, FALSE,\"\",\"\",\"prod\");\n\t\t$p_Params = json_encode($params);\n\t\t$p_UserID = 'villaprtl';\n\t\t$p_Token = $md5Hash[0];\n\t\t$request = 'p_Token='.$p_Token.'&p_UserID='.$p_UserID.'&p_Params='.$p_Params;\n\t\t$newBooking = $this->cheeze_curls('insertInquiry',$request,TRUE,FALSE,\"\",\"\",\"prod\");\n\t\t$newBooking['thank_you_message'] = '<p>Your Reservation Enquiry Form has been successfully sent for '.$villaName.'.</p>\n\t\t\t<p>The Elite Havens Group, luxury villa rentals, manage all the reservations for '.$villaName.'. One of our villa specialists will be in touch shortly.</p>\n\t\t\t<p>Your Reference I.D. is <strong>'.$newBooking['Transactions']['InquiryID'].'</strong></p>\n\t\t\t<p>The Elite Havens Group presents a stunning portfolio of luxury private villas throughout Bali and Lombok in Indonesia, Thailand, Sri Lanka and Maldives. Staffed to the highest quality, each villa offers a blissfully relaxing and highly individual experience. Ranging in size from one to nine bedrooms and boasting private pools, luxurious living spaces, equipped kitchens (with chef) and tropical gardens, our villas are situated in the heart of the action, beside blissful beaches, upon jungle-clad hillsides and amongst idyllic rural landscapes ensuring the perfect holiday experience for all.</p>';\n\t\treturn $newBooking;\n\t\n\t}", "function processRequest(){\n\tglobal $muse; // App settings & database\n\tglobal $HTTP_RAW_POST_DATA;\n\t\n\t// Get the user's posted action\n\t$muse['actionRequestRaw'] = $HTTP_RAW_POST_DATA;\n\t$muse['actionRequest'] = $muse['db']->real_escape_string(trim($HTTP_RAW_POST_DATA));\n\t// First word of action request will be the action keyword.\n\t$muse['actionKeyword'] = strtolower(substr( $muse['actionRequest'], 0, strpos( $muse['actionRequest'], \" \" ) ) );\n\t\n\t// If it's only one word, through it back in. Capatlization issues?\n\tif ($muse['actionKeyword']==false) {\n\t\t$muse['actionKeyword'] = $muse['actionRequest'];\n\t}\n}", "function get_activity_date()\n\t{\n\t\t$my = $this->Session->read('Auth.User');\n\t\t$entityOn = $this->Session->read('entityOn');\n\t\t\n\t\t$clean = new Sanitize();\n\t\t\n\t\t$stream_id = $clean->html($this->params['url']['stream_id']); // from GET\n\t\t// TODO: Remove \"filters\", send tag_id, user_id etc (as a number or csv)\n\t\tif(isset($this->params['url']['type'])){\n\t\t\t$filter_type = $clean->html($this->params['url']['type']);\n\t\t}else{\n\t\t\t$filter_type = NULL;\n\t\t}\t\n\t\tif(isset($this->params['url']['filter_id'])){\n\t\t\t$filter_id = $clean->html($this->params['url']['filter_id']);\n\t\t}else{\n\t\t\t$filter_id = NULL;\n\t\t}\n\t\tif(isset($this->params['url']['parent_id'])){\n\t\t\t$parent_id = $clean->html($this->params['url']['parent_id']);\n\t\t}else{\n\t\t\t$parent_id = NULL;\n\t\t}\n\t\t\n\t\t$tag_id = NULL;\n\t\t$user_id = NULL;\n\t\tif ($filter_type == 'Filter_Tags')\n\t\t\t$tag_id = $clean->html($this->params['url']['filter_id']);\n\t\telse if ($filter_type == 'Filter_Users')\n\t\t\t$user_id = $clean->html($this->params['url']['filter_id']);\n\t\t\n\t\t$paginatedPage = 1;// = $this->params['url']['date'];\n\t\t$PAGESIZE = 20;\n\t\t\n\t\t$isGetActivityByDate = array_key_exists('date', $this->params['url']);\n\t\t$activities = NULL;\n\t\t\n\t\tif($filter_type == 'Filter_Tags'){$filter_type_id = 1;}\n\t\telse if($filter_type == 'Filter_Users'){$filter_type_id = 2;}\n\n\t\t//$message = 'No activities found in this tag.<br/>Be the first to add one!';\n\t\t$message = '';\n\t\t$readOnly = false;\n\t\tif ($filter_type == \"Filter_Users\" && (int)$filter_id != (int)$my['id']) {\n\t\t\t$json['readOnly'] = true;\n\t\t\t//$message = 'You have not posted anything yet.<br/>Try it now!';\n\t\t\t$message=\"\";\n\t\t}\n\t\t\n\t\t$json = array (\n\t\t\t'message'\t=> $message,\n\t\t\t'status' \t=> 'failed',\n\t\t\t'timestamp' => $this->params['url']['timestamp']\n\t\t);\n\t\t\n\t\t$permissions = $this->Session->read('StreamsUser.Permission');\n\t\t$access = $this->Session->read('Streams.Access');\n\t\t\n\t\t$permissionResults = $this->Stream->hasPermission($stream_id, $my['id'], $permissions, $access);\n\t\t//if the permission and access info is not in the session variable, write them!\n\t\t// FIXME: Shouldn't this be taken care of in the function?!!\n\t\tif (array_key_exists('permissionToAdd', $permissionResults))\n\t\t{\n\t\t\t$this->__updateStreamPermissionAccessToSession('StreamsUser.Permission', $permissionResults['permissionToAdd']['stream_id'], $permissionResults['permissionToAdd']['permission'], $permissions);\n\t\t\t$permissions = $this->Session->read('StreamsUser.Permission');\n\t\t}\n\t\tif (array_key_exists('accessToAdd', $permissionResults))\n\t\t{\n\t\t\t$this->__updateStreamPermissionAccessToSession('Streams.Access', $permissionResults['accessToAdd']['stream_id'], $permissionResults['accessToAdd']['access'], $access);\n\t\t\t$access = $this->Session->read('Streams.Access');\n\t\t}\n\t\t\t\t\n\t\t$flag = $permissionResults['flag'];\n\t\tif($flag)\n\t\t{\t\t\t\n\t\t\tif($entityOn['controller'] == 'pages' && $entityOn['action'] == 'view' && isset($entityOn['Page']['comment_id'])){\n\t\t\t\t$comment_id = $entityOn['Page']['comment_id'];\n\t\t\t}else{\n\t\t\t\t$comment_id = NULL;\n\t\t\t}\n\t\t\t\n\t\t\tif ($filter_id > -1) //only update stream_view if it's not favourite activity\n\t\t\t{\n\t\t\t\t$ip = $this->RequestHandler->getClientIP();\n\t\t\t\t$date = date('Y-m-d H:i:s');\n\t\t\t\t$this->Stream->query('INSERT INTO stream_views_history (stream_id, entity_id, entity_type, user_id, ip, created) VALUES(\"'.$stream_id.'\", \"'.$filter_id.'\", \"'.$filter_type_id.'\", \"'.$my['id'].'\", \"'.$ip.'\", \"'.$date.'\" )');\n\t\t\t\t\t\t\n\t\t\t\t//create/update stream_views entry\n\t\t\t\t$parameters = array(\n\t\t\t\t\t'stream_id' => $stream_id,\n\t\t\t\t\t'entity_id' => $filter_id,\n\t\t\t\t\t'entity_type' => $filter_type_id,\n\t\t\t\t\t'user_id' => $my['id']\n\t\t\t\t);\n\t\t\t\t$this->Stream->StreamView->recursive = -1;\n\t\t\t\t$view_id= $this->Stream->StreamView->find('first', array('fields'=> array('id'), 'conditions'=> $parameters));\n\t\t\t\tif(isset($view_id['StreamView']['id']))\n\t\t\t\t{\n\t\t\t\t\t//$this->Stream->StreamView->id = $view_id;\n\t\t\t\t\t$this->Stream->query('UPDATE stream_views SET modified = \"'.$date.'\" WHERE id = '.$view_id['StreamView']['id'].'');\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//$this->Stream->StreamView->create();\t\n\t\t\t\t\t$this->Stream->query('INSERT INTO stream_views (stream_id, entity_id, entity_type, user_id, ip, created, modified) VALUES(\"'.$stream_id.'\", \"'.$filter_id.'\", \"'.$filter_type_id.'\", \"'.$my['id'].'\", \"'.$ip.'\", \"'.$date.'\", \"'.$date.'\")');\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//debug($this->core);\n\t\t\t$options = array(\n\t\t\t\t'stream_id'\t\t=> $stream_id, \n\t\t\t\t'tag_id' \t\t=> $tag_id, // we need to send filters as themselves e.g. \"tags\" - remove the whole \"filter\" notion\n\t\t\t\t'type_id' \t\t=> '1,2,3,4,5,6,7,8,9,44, ', //$this->core['widget']['types'], // csv // We want certain types back \n\t\t\t\t'user_id'\t\t=> $user_id,\n\t\t\t\t'comment_id'\t=> $comment_id,\n\t\t\t\t'parent_id'\t\t=> $parent_id, // for Replies\n\t\t\t\t'widget_id'\t\t=> NULL, //for Thought widget => Actually for thoughts you want ALL hence leave NULL\n\t\t\t\t'search_terms' \t=> NULL,\n\t\t\t\t'date'\t\t\t=> NULL,\n\t\t\t\t'start_date' \t=> NULL,\n\t\t\t\t'end_date' \t\t=> NULL,\n\t\t\t\t'paginatedPage' => $paginatedPage,\n\t\t\t\t'limit'\t\t\t=> $PAGESIZE\n\t\t\t);\n\t\t\tif (!$isGetActivityByDate) //this is the initial fetch of the activity feed\n\t\t\t{\n\t\t\t\t$options['pagination'] = true;\t\t\n\t\t\t\t//$datePagination = $this->__getCountByDate($data); //need to get the dates where activity entries exist\n\t\t\t\t$datePagination = $this->Stream->Comment->getPagination($this->core, $options);\n\t\t\t\t//debug($datePagination);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$options['date'] = $clean->html($this->params['url']['date']);\n\t\t\t\t//$data['date'] = '2009-07-24';\n\t\t\t\t\t\n\t\t\t//$activities = $this->Stream->CommentsStream->__getThoughtsforStream($data);]\n\t\t\t$thoughts = $this->Stream->Comment->get($this->core, $options);\n\t\t\t//debug($activities);\n\t\t\t$activityArray = $thoughts;//$this->Stream->__getActivitiesList($activities, $my, false, $filter_id, $filter_type, $permissions);\n\t\t\t\n\t\t\tif($activityArray != NULL)\n\t\t\t{\n\t\t\t\t$activities = $activityArray;\n\t\t\t\t//debug($activity);\n\t\t\t\t\n\t\t\t\tif(!$isGetActivityByDate) //initial fetch of activity feed\n\t\t\t\t{\n\t\t\t\t\t/*debug($activity);\n\t\t\t\t\tdebug($filter_type);\n\t\t\t\t\tdebug($datePagination);*/\n\t\t\t\t\t\n\t\t\t\t\t$this->set(compact('thoughts', 'datePagination', 'filter_type', 'readOnly'));\n\t\t\t\t\t$this->layout = 'ajax';\n\t\t\t\t\t$this->render('/activities/activity_pagination'); \n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$this->set(compact('message','thoughts', 'filter_type', 'readOnly'));\n\t\t\t\t\t$this->layout = 'ajax';\n\t\t\t\t\t$this->render('/activities/activity'); \n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$message = 'No activities found.';\n\t\t\t\t$this->set(compact('message', 'filter_type', 'thoughts'));\n\t\t\t\t$this->layout = 'ajax';\n\t\t\t\t$this->render('/activities/activity');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$message = 'You do not have permission to view this Stream';\n\t\t\t$this->set(compact('message', 'filter_type', 'activities'));\n\t\t\t$this->layout = 'ajax';\n\t\t\t$this->render('/activities/activity'); \t\t\t\t\t\n\t\t}\n\t}", "public function sendEvent($context) {\n\t\t\n\t\t\t//Store some information on the Symphony Entry.\n\t\t\t$entry = $context['entry'];\n\t\t\t\n\t\t\t$entry_settings = $entry->get();\n\t\t\t$entry_id = $entry_settings['id'];\t\n\t\n\t\t\t$e_data = array();\n\t\t\tforeach($context['fields'] as $key => $value) {\n\t\t\t\tif($this->string_begins_with($key, 'e-')) {\n\t\t\t\t\t$e_data[str_replace('e-', 'e_', $key)] = $value;\n\t\t\t\t} else if ($this->string_begins_with($key, 'g-')) {\n\t\t\t\t\t$e_data[str_replace('g-', 'g_', $key)] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Change the e_status property to a value the API understands\n\t\t\tif($e_data['e_status'] == 'yes') {\n\t\t\t\t$e_data['e_status'] = 'active';\n\t\t\t} else {\n\t\t\t\t$e_data['e_status'] = 'pending';\n\t\t\t}\t\n\t\t\t//Set the format of the Date/Times\n\t\t\t$e_data['e_start'] = date('Y-m-d G:i:s', strtotime($e_data['e_start']));\n\t\t\t$e_data['e_stop'] = date('Y-m-d G:i:s', strtotime($e_data['e_stop']));\n\t\t\t$e_data['e_deadline'] = date('Y-m-d G:i:s', strtotime($e_data['e_deadline']));\n\n\t\t\t//Another Required field is the User ID\n\t\t\t$e_data['u_id'] = $this->u_id;\n\t\t\t\n\t\t\t//Create a unique Push URL (e_pushurl) from the entry ID.\n\t\t\t$e_data['e_pushurl'] = URL .'/eventarc-updater/?hash='.sha1($entry_id).'&id='.$entry_id;\n\t\t\n\t\t\t//Address Data\n\t\t\t$a_data = array();\n\t\t\tforeach($context['fields'] as $key => $value) {\n\t\t\t\tif($this->string_begins_with($key, 'a-')) {\n\t\t\t\t\t$a_data[str_replace('a-', 'a_', $key)] = $value;\n\t\t\t\t} \n\t\t\t}\n\t\t\t\n\t\t\t//If the ID & URL are not set - Create a new event.\n\t\t\tif($e_data['e_id'] == '' && $e_data['e_url'] == '') {\n\t\t\t\n\t\t\t\tunset($e_data['e_id']);\n\t\t\t\tunset($e_data['e_url']);\t\n\t\t\t\tif(!empty($a_data)) {\n\t\t\t\t\t//Set the type as venue.\n\t\t\t\t\t$a_data['a_type'] = 'venue';\n\t\t\t\t\t// Send the event to eventarc with the address details\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->add_address($a_data)\n\t\t\t\t\t ->event_create();\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// Send the event to eventarc\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->event_create();\n\t\t\t\t}\n\n\t\t\t\t if($result) {\n\t\n\t\t\t\t \tif(!isset(self::$fieldManager)) {\n\t\t\t\t \t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t \t}\n\t\t\t\t \t\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-id');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['e_id'],\n\t\t\t\t \t\t'value' => $result['e_id'],\n\t\t\t\t \t\t'value_formatted' => $result['e_id'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t//Save the returned Eventarc URL (e_url).\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-url');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['url'],\n\t\t\t\t \t\t'value' => $result['url'],\n\t\t\t\t \t\t'value_formatted' => $result['url'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t//Save the returned Eventarc Address ID (a_id).\n\t\t\t\t \t$field_id = self::$fieldManager->fetchFieldIDFromElementName('a-id');\n\t\t\t\t \t$entry->setData($field_id, array(\n\t\t\t\t \t\t'handle' => $result['a_id'],\n\t\t\t\t \t\t'value' => $result['a_id'],\n\t\t\t\t \t\t'value_formatted' => $result['a_id'],\n\t\t\t\t \t\t'word_count' => 0\n\t\t\t\t \t));\n\t\t\t\t \t\n\t\t\t\t \t$entry->commit();\n\t\t\t \n\t\t\t\t }\n\t\t\t\t \n\t\t\t} \n\t\t\t//Event already exists - update the event. \n\t\t\telse {\n\t\t\t\t\n\t\t\t\t//Check that the URL is not empty.\t\n\t\t\t\tif($e_data['e_url'] == '') {\n\t\t\t\t\t\n\t\t\t\t\t$result = $this->eventarc->event_get($e_data['e_id']);\n\t\t\t\t\t\n\t\t\t\t\tif(!isset(self::$fieldManager)) {\n\t\t\t\t\t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Save the returned Eventarc URL (e_url).\n\t\t\t\t\t$field_id = self::$fieldManager->fetchFieldIDFromElementName('e-url');\n\t\t\t\t\t$entry->setData($field_id, array(\n\t\t\t\t\t\t'handle' => $result['url'],\n\t\t\t\t\t\t'value' => $result['url'],\n\t\t\t\t\t\t'value_formatted' => $result['url'],\n\t\t\t\t\t\t'word_count' => 0\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t$entry->commit();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Check that the Address ID is not empty.\t\n\t\t\t\tif($a_data['a_id'] == '') {\n\t\t\t\t\t\n\t\t\t\t\t$result = $this->eventarc->event_get_address($e_data['e_id']);\n\t\t\t\t\t\n\t\t\t\t\tif(!isset(self::$fieldManager)) {\n\t\t\t\t\t\tself::$fieldManager = new fieldManager(Symphony::Engine());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Save the returned Eventarc Address ID (a_id).\n\t\t\t\t\t$field_id = self::$fieldManager->fetchFieldIDFromElementName('a-id');\n\t\t\t\t\t$entry->setData($field_id, array(\n\t\t\t\t\t\t'handle' => $result['a_id'],\n\t\t\t\t\t\t'value' => $result['a_id'],\n\t\t\t\t\t\t'value_formatted' => $result['a_id'],\n\t\t\t\t\t\t'word_count' => 0\n\t\t\t\t\t));\n\t\t\t\t\t\n\t\t\t\t\t//Store the retrieved address ID.\n\t\t\t\t\t$a_data['a_id'] = $result['a_id'];\n\t\t\t\t\t$entry->commit();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//Don't want to manually change the URL generated by Eventarc.\n\t\t\t\tunset($e_data['e_url']);\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Edit the Event.\n\t\t\t\tif(!empty($a_data)) {\n\t\t\t\t\t//Set the type as venue.\n\t\t\t\t\t$a_data['a_type'] = 'venue';\n\t\t\t\t\t// Send the event to eventarc with the address details\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\t\n\t\t\t\t\t ->event_update();\n\t\t\t\t\t $result = $this->eventarc\n\t\t\t\t\t ->add_address($a_data)\n\t\t\t\t\t ->address_update();\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t// Send the event to eventarc\n\t\t\t\t\t$result = $this->eventarc\n\t\t\t\t\t ->add_event($e_data)\n\t\t\t\t\t ->event_update();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\n\t\t}", "public function checkUser_post(){\n\t\textract($_POST);\n\t\t//print_r($_POST);die();\n\t\t$oauth_provider='facebook';\n\t\t// ------if facebook oauth provider not found-------------\n\t\tif ($oauth_provider=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'OAuth provider field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook oauth uid not found-------------\n\t\tif ($oauth_uid=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'OAuth UID field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook First Name not found-------------\n\t\tif ($first_name=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'Facebook First Name field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook Last Name not found-------------\n\t\tif ($last_name=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'Facebook Last Name field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook email not found-------------\n\t\tif ($email=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'Facebook email field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // // ------if facebook picture not found-------------\n\t\t// if ($picture=='') {\n\t\t// \t$this->response([\n\t\t// \t\t'status' => 500,\n\t\t// \t\t'status_message' => 'Facebook picture field is empty. All parameters are required!'\n\t\t// \t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t// \tdie();\n\t\t// }\n\t\t$userData = $_POST;\n\t\t$result = $this->User->checkUser($userData);\n\n\t\tif($result['status']==200){\n\t\t\t$this->response($result, REST_Controller::HTTP_OK);\n\t\t}\n\t\telse{\n\t\t\t$this->response($result, REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t}\n\t}", "public function getActivity(){\n\t\t$activityJSON = json_decode('[{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091459,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091506,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458862412,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091625,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458091919,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458855256,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1458862529,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1458878187,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1458884355,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1458951476,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1458954501,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459027340,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459031419,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036422,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036489,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036781,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459036803,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459039428,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459041802,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459045348,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459052681,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459054504,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459095354,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459103693,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459106189,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459106464,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459106533,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459106764,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459106972,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459107148,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459107592,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459108612,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459108859,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459116818,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459117841,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459118056,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459119912,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459122951,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459124218,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459128071,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459128266,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459128588,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459130553,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131015,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131354,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131421,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131513,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131527,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131528,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131569,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131625,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459131736,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131740,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131839,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459131965,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132001,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132411,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132504,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459132807,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459133055,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133405,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133407,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133441,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133465,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133492,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133507,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133511,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133615,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459133644,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459133723,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134005,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134041,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134152,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134187,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134206,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134233,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134330,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134408,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134572,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459134581,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459135332,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459135440,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459135552,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136058,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136230,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136623,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136624,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136665,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136693,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459136765,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136793,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136793,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136830,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136838,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459136877,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459136892,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459136958,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137061,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137122,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137197,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459137245,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459137301,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459137334,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459137389,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138000,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459138065,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459138075,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138127,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138180,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459138599,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459138837,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459138857,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459139196,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459139728,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459139916,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459140265,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459363777,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459363778,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459362805,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459363876,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459372978,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459383363,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459403946,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459885868,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459885870,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459921911,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459922060,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460149101,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460154126,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460165636,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460165710,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460165742,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460165745,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460241854,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460241889,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460072595,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460074050,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460068718,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460074014,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460337658,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460337658,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460337660,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460440021,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460440522,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460496700,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460497103,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500872,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459277007,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459278245,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459320218,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459360248,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459362702,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459374597,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459394150,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459396245,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459398742,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459398854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459398854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459398889,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399066,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399094,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399101,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399156,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459399378,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459399529,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459399658,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459399739,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400191,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400211,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400630,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400686,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400859,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400924,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400940,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459400951,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401103,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401128,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401168,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401174,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459401186,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401215,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401374,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401469,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459401489,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459401501,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459402071,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402081,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402195,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402249,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402273,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402542,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459402551,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459404536,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459404915,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405537,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405603,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405776,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459405958,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459406030,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459406090,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407004,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407272,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407322,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407476,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459407536,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459408828,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459408999,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459413295,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459440105,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459440425,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443054,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459443074,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443102,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443119,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443158,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459443377,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443520,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459443696,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459443777,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459446291,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459526366,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459704710,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460072516,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460074115,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460232036,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460246528,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460250345,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460514183,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460518330,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460519779,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460523934,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460232042,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460232451,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460250498,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460307680,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460515263,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460519047,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460520866,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525851,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460249923,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460250313,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460254929,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460515460,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460519269,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525976,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460527887,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460697367,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680199,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680217,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460680924,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680956,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460681107,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681317,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681589,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460681787,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681901,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460682008,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460682069,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460682913,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460684169,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460685921,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460686277,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460686909,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460687575,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460687670,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460689203,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460690237,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460690481,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460690609,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460692290,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460695261,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460727282,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460695587,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460751998,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460680258,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460681907,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460690681,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460694376,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460751892,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460754522,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460756048,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460756512,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460758121,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460843708,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460848382,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460835446,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460842868,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460848973,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916368,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460924220,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460924373,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916912,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460917702,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460930922,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460848040,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460849169,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460854613,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460859331,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916771,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932451,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460859255,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460859280,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460913502,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460916609,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460933975,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460931001,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460933992,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460690702,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460690703,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460694377,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460746602,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460752225,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460754523,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460833949,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460842616,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460870052,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460948365,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460728899,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460728899,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460752002,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460755659,\"source\":\"googledrive\"},{\"actor\":null,\"timestamp\":1460835972,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460951953,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948511,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948773,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948991,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460950548,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951061,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951096,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951251,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460952232,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460955069,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460962897,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932429,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460934562,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460943791,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460946768,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460950614,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951769,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460957051,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460962696,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461100004,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460511060,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460524256,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525274,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460525288,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525358,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460525714,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460525781,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460526586,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460529681,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460952655,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460960195,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460976232,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461017048,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107213,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932349,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460932358,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461009132,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461014454,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107316,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460052009,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460483549,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460494428,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460526286,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460526459,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460526522,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460526781,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460527491,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460529046,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460603259,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460966099,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461014476,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461107331,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107501,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461110199,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171512,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171535,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171535,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171536,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171587,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460171791,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460171791,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460171872,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460173203,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460174200,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460231864,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460239810,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460317732,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460327728,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460335915,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460485984,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460497970,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499694,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499783,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499817,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499822,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460499925,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500004,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500014,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500042,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500085,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500311,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460500315,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500324,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500346,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500435,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500437,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500448,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460500452,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500571,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460500681,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460501404,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460501419,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460501726,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460501788,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460502117,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460502121,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460502786,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460503543,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460504438,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460511336,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460604302,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461104048,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461104939,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461105161,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461105562,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461111320,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461111751,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112017,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461125417,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460935819,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460935895,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460939457,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460944211,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460944678,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460944850,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460945971,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460946923,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460946934,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460947846,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460947902,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948056,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948148,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460948337,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460948348,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460948441,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460949023,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460949429,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460949775,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460949860,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460949890,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460950123,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460950910,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460951798,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460958944,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460959747,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460959960,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960040,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960509,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960601,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460960769,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960775,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460960888,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460960906,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460961127,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460961179,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460962695,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460963592,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460963712,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460963750,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964200,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964233,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964286,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964291,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460964381,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964535,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964621,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460964775,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460965160,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460965298,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461008879,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461090151,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461102204,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461102276,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461102506,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461103526,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461103770,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106489,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106566,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106883,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107063,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461107964,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461108055,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461108058,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461108484,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461108808,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109374,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109745,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109832,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109930,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109942,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461110024,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461110276,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110366,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110405,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110546,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110573,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110627,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110664,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461110670,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461110881,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461111111,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111333,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111336,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111443,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111548,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461111613,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461111676,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461112065,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112065,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461112249,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112463,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461112633,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113065,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113143,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113215,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461113267,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113307,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461113583,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461113689,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461114087,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114203,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114228,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114303,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114406,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461114469,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461114737,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114791,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461114933,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461114942,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115117,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461115151,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461116134,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461116244,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461116379,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461119303,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461121523,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461122625,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123034,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123636,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123637,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123772,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461124550,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461126473,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461126859,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461127738,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461127889,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461127906,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461128029,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461128432,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461128741,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461128881,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461128937,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461129510,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461129601,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461129678,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461129937,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461130145,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461130150,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461130151,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461130609,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461130802,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461130854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461131320,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461131321,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461131381,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461132279,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461192042,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459714753,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459714914,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459716190,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459716437,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459717945,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459721768,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459722848,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459726240,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459732605,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459734819,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459735947,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459736050,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736143,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736153,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736162,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459736467,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459736597,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459736935,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737023,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737099,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737270,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459737278,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459737611,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459737635,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459737842,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459737978,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459738067,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459738069,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459738656,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459738759,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459739000,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459739031,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459739498,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459739838,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459740503,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459740566,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459740906,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459741134,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741257,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741342,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741548,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459741847,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742002,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742020,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742216,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742265,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742380,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742507,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742614,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459742616,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743111,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743247,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743427,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743439,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743442,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743464,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459743515,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459743544,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743576,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743660,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743690,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743726,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743847,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459743991,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744059,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744091,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744122,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744178,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744192,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459744219,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459744297,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459744814,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459744984,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745200,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745648,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745778,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459745958,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746130,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746161,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459746302,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459746437,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746794,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746974,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459746980,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747076,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747094,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747099,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747158,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747309,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747384,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747549,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747553,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747584,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747715,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747754,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747762,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747808,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747820,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747851,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459747924,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748059,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748121,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748293,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748577,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748922,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459748932,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459749300,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459749618,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459749660,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459749784,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459749810,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1459749848,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459749890,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750575,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750660,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750704,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750802,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750805,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459750928,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751073,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751328,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751362,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751380,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751385,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459751428,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751456,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751497,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459751512,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751576,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751611,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1459751636,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1459751748,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752310,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752313,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752578,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752595,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752609,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752688,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459752891,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753056,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753081,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753216,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753276,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753388,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753461,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753505,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1459753580,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460160150,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460166096,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460166197,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460167718,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460167931,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460170970,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460238640,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460258700,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460265851,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460317221,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460326650,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1460328076,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460330953,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460331422,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460334550,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460339277,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460431663,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460433944,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460434618,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1460435130,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437161,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437306,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437318,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437459,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437631,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460437792,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460438236,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460438253,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460439515,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460439574,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460439605,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460493473,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110334,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461126555,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461270347,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461282613,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461333782,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461333842,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461333854,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461371326,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460503714,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460503724,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460524255,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460529582,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460607330,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460607349,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460608706,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460609058,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460609081,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460609377,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460609586,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460610035,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460611953,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460612043,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460612347,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460612695,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460612713,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460613973,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460614117,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460614588,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460615071,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1460615101,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460615167,\"source\":\"googledrive\"},{\"actor\":\"Aqib Bhat\",\"timestamp\":1461109673,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461818721,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461882154,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882267,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882298,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882690,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882832,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461882881,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461883332,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461883566,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461883568,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461885826,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461887194,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460482203,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460482528,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460495947,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460496869,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460517967,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1460608470,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461101191,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106233,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106428,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461106538,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461109904,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461110836,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115060,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115156,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461115382,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461123212,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461127141,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461132965,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461134296,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461188023,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461253841,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461275430,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461282388,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461291029,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461299970,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461307230,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461338321,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461341524,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461361910,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461376273,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461378319,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461384392,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461388841,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461422894,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461437636,\"source\":\"googledrive\"},{\"actor\":\"Jorge Herrera\",\"timestamp\":1461448456,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461474362,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461480100,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461482202,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461505503,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461524155,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461534168,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461537084,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461539241,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461539665,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461540182,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461544687,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461550993,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461559744,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461563898,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461708868,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461819989,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461861185,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461874701,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461881867,\"source\":\"googledrive\"},{\"actor\":\"Eric Gonzalez\",\"timestamp\":1461893239,\"source\":\"googledrive\"},{\"actor\":\"Cullen Brown\",\"timestamp\":1461894417,\"source\":\"googledrive\"}]');\n\t\treturn $activityJSON;\n\t}", "public function getPhotofeedInfoAction()\n {\n\t $params = $this->getRequest()->getParams();\n\t \n \t \t$result = \\Extended\\wall_post::getWallpostInfo( $params['wallpost_id'] );\n \t \n\t\techo Zend_Json::encode( $result );\n\t die;\n }", "function set_business_activity($submit_activities, $activities){\n\t\tif( isset($_POST[$submit_activities]) ){\n\t\t\t$business_activity = $_POST[$activities];\n\t\t\tuser::update_business_activity($business_activity);\n\n\t\t\t\theader(\"location: ../../basic_info.php\");\n\t\t} \t\n\t}", "function pushjsonaction($params){\n $this->view = new helper_viewhelper();\n $this->view->print_r($params);\n\n\t\t$this->config = new model_core_config();\n $this->modeljson = new model_ext_json();\n $this->requestobj = new model_ext_request($this->modeljson->toobj($params));\n $this->view->print_r($this->requestobj);\n\t\t$this->modelmysql = new model_ext_mysql($this->config);\n\t\t$this->requestobj->pushdata($this->modeljson->toobj($this->requestobj->pullrequestparam()));\n\t\t// $this->view->print_r($this->requestobj);\n\t\t$this->result = $this->modelmysql->processrequest($this->requestobj);\n\t\t// $this->view->print_r($this->result);\n\t}", "function facebook_user_check_post() \n\t{ \n\t\t$fb_id=$this->post('fb_id');\n\t\t$fullname=$this->post('fullname');\n\t\t$email=$this->post('email');\n\t\t$data=$this->users_model->get_by_fb_id($fb_id);\n\t\tif($data==null){\n\t\t\t$this->response(array('ok'=>'0'));\n\t\t}else{\n\t\t\t$this->response($this->users_model->get_by_fb_id($fb_id));\n\t\t}\n\t}", "function wall()\n\t\t{\n\t\t\n\t\t// Parameters\n \t$limit = (! $this->EE->TMPL->fetch_param('limit')) ? 5 : $this->EE->TMPL->fetch_param('limit');\n \t$pageId = $this->EE->TMPL->fetch_param('page');\n\t\t\t\n\t\t// Page feed data and display\n\t\t$pageUrl = 'https://graph.facebook.com/'.$pageId.'/feed?limit='.$limit;\n\t\t$page = file_get_contents($pageUrl);\n\t\t$obj = json_decode($page);\n\t\t\n\t\t$output = '';\n\t\t\t\n\t\tforeach ($obj->data as $data) {\n\t\t\t// Display outpu if the type of Facebook entry is a status update\n\t\t\tif (($data->type) == 'status' && isset($data->from->id) && isset($data->from->name)) {\n\t\t\t\t$HTMLpattern = \"/http:\\/\\/([a-z0-9\\-]*)(\\.)+(com|net|org)/\";\n\t\t\t\t\n\t\t\t\t// This checks for apps that post and include HTML links. It will format the link and display. Else statement posts message as is.\n\t\t\t\tif (isset($data->application->id) && preg_match($HTMLpattern, ($data->message))) {\n\t\t\t\t\t$words = explode(' ', ($data->message));\n\t\t\t\t\tforeach ($words as &$text) {\n\t\t\t\t\t\tif (preg_match('/^http:\\/\\//', $text)) {\n\t\t\t\t\t\t\t$text = '<a href=\"'.$text.'\">'.$text.'</a>';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$message = implode(' ', $words);\n\t\t\t\t\t$output .= '<br /><div class=\"fb_status\"><span class=\"fb_profile_link\"><a href=\"http://www.facebook.com/profile.php?id='.\"{$data->from->id}\".'\">'.\"{$data->from->name}\".'</a></span> '.\"<div class='fb_message'>$message</div>\".'<br /></div>';\n\t\t\t\t} else {\n\t\t\t\t\t$output .= '<br /><div class=\"fb_status\"><span class=\"fb_profile_link\"><a href=\"http://www.facebook.com/profile.php?id='.\"{$data->from->id}\".'\">'.\"{$data->from->name}\".'</a></span> '.\"<div class='fb_message'>{$data->message}</div>\".'<br /></div>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Display output if the type of Facebook entry is a photo or video\n\t\t\tif (($data->type) == 'photo' || ($data->type) == 'video' && isset($data->from->id) && isset($data->from->name)) {\n\t\t\t\t$output .= '<br /><div class=\"fb_status\"><span class=\"fb_profile_link\"><a href=\"http://www.facebook.com/profile.php?id='.\"{$data->from->id}\".'\">'.\"{$data->from->name}\".'</a></span> ';\n\t\t\t\tif (isset($data->message)) {\n\t\t\t\t\t$output .= \"<div class='fb_message'>{$data->message}</div>\\n\".'<br />';\n\t\t\t\t\t$output .= '<div class=\"fb_photo\"><a href=\"'.\"{$data->link}\".'\"><img src=\"'.\"{$data->picture}\".'\" /></a></div></div>';\n\t\t\t\t} else {\n\t\t\t\t\t$output .= '<div class=\"fb_photo\"><a href=\"'.\"{$data->link}\".'\"><img src=\"'.\"{$data->picture}\".'\" /></a></div></div>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Display output if the type of Facebook entry is a link\n\t\t\tif (($data->type) == 'link' && isset($data->from->id) && isset($data->from->name)) {\n\t\t\t\t$output .= '<br /><div class=\"fb_status\"><span class=\"fb_profile_link\"><a href=\"http://www.facebook.com/profile.php?id='.\"{$data->from->id}\".'\">'.\"{$data->from->name}\".'</a></span> ';\n\t\t\t\tif (isset($data->message)) {\n\t\t\t\t\t$output .= \"<div class='fb_message'>{$data->message}</div>\\n\".'<br />';\n\t\t\t\t\t$output .= '<div class=\"fb_link\"><a href=\"'.\"{$data->link}\".'\">'.\"{$data->name}\\n\".'</a></div></div>';\n\n\t\t\t\t} else {\n\t\t\t\t\t$output .= '<div class=\"fb_link\"><a href=\"'.\"{$data->link}\".'\">'.\"{$data->name}\\n\".'</a></div></div>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Display date information for posts\t\t\t\t\n\t\t\t$postTime = date('M d, Y',strtotime($data->created_time));\n\t\t\t$output .= '<div class=\"fb_time\">'.$postTime.'</div>';\n\t\t}\n\t\t\t\n\t\treturn $output;\n\t\t}", "function addUserRecognizedActivity(){\n\n\t\tglobal $dclserver;\n\t\t$url=\"$dclserver/MMDataCurationRestfulService/webresources/InformationCuration/AddUserRecognizedActivity\";\n\t\t\n\t\t$data = array(\"userRecognizedActivityId\"=>NULL,\n\t\t\"userId\"=>39,\n\t\t\"activityId\"=>2,\n\t\t\"startTime\"=>\"2015 05 05 16:58:56\",\n\t\t\"endTime\"=>\"2015 05 05 16:58:59\",\n\t\t\"duration\"=>3\n\t\t\n\t\t);\n\t\t\n\t\n\t$json = json_encode($data,true);\n\t\n\t$result =postJsonRest($url,$json);\n\t\n\treturn $result;\n\n\t\t\n}", "function extractActionData($data) {\n $fields = array(\n 'surfer_handle',\n 'surfer_givenname',\n 'surfer_surname',\n 'surfer_email',\n 'surfer_valid',\n 'surfergroup_id',\n 'surfer_gender',\n 'surfer_avatar'\n );\n $result = array();\n foreach ($fields as $field) {\n if (isset($data[$field])) {\n $result[$field] = $data[$field];\n }\n }\n return $result;\n }", "public function handleFacebookCallback()\n {\n \n $user = Socialite::driver('facebook')->user();\n\n \n }", "function before() {\n\t\tparent::before();\n\t\t$this->_activity_result[] = $this->request->param(\"id\");\n\t}", "public function executeGetinfo(sfWebRequest $request)\n {\n\terror_reporting(E_ERROR | E_WARNING | E_PARSE);\n \t$this->facebook = new Facebook(array(\n \t \t\t\t 'appId' => '172395622846837',\n \t\t\t\t\t 'secret' => 'ea4ead91f041779802a15f2c5cf9e63d',\n\t\t\t\t\t));\n\t$info = $this->facebook->api('/'.$request->getParameter('uid').'');\n\tforeach ($info as $key => $val) {\n \techo \"$key = $val -\";\n\t}\n\t//echo json_encode($sorted);\n\texit;\n }", "public function fbauthAction()\n {\n $request = $this->getRequest()->getQuery()->toArray();\n\n $auth = array(\n \"signup\" => $this->params()->fromRoute('url', false) == \"signup\",\n \"login\" => $this->params()->fromRoute('url', false) == \"login\",\n \"connect\" => $this->params()->fromRoute('url', false) == \"connect\",\n \"state_key\" => \"fb_ipoints_auth\"\n );\n\n $auth['url'] = $this->getConfig()->site['domain'] .\"/\". $this->getLang() . \"/user/fbauth/\";\n if ($auth['login'])\n $auth['url'] .= \"login\";\n else if ($auth['connect'])\n $auth['url'] .= \"connect\";\n else if ($auth['signup'])\n $auth['url'] .= \"signup\";\n else {\n return $this->redirect()->toRoute(\"home\", array(\"language\" => $this->getLang()));\n }\n $fbconfig = array(\n 'appId' => $this->getConfig()->FB['api_key'],\n 'secret' => $this->getConfig()->FB['app_secret'],\n );\n\n if(array_key_exists('state', $request) && $request['state']) {\n $state = json_decode(stripslashes(urldecode($request[\"state\"])));\n if (array_key_exists('code', $request) && $request['code']) {\n // User accepted app authorization, retrieve access_token\n $url = \"https://graph.facebook.com/oauth/access_token?client_id=\" . $fbconfig['appId'] .\n \"&redirect_uri=\" . $auth['url'] . \"&client_secret=\" . $fbconfig['secret'] .\n \"&code=\" . $request[\"code\"];\n\n $config = array(\n 'adapter' => 'Zend\\Http\\Client\\Adapter\\Socket',\n 'ssltransport' => 'tls',\n 'sslverifypeer' => false\n );\n\n $client = new Client($url, $config);\n $response = $client->send();\n\n if (!$response->isSuccess()) {\n die($response->getBody());\n } else {\n try {\n parse_str($response->getContent(), $facebook_response);\n $access_token = $facebook_response['access_token'];\n\n $config = array(\n 'adapter' => 'Zend\\Http\\Client\\Adapter\\Socket',\n 'ssltransport' => 'tls',\n 'sslverifypeer' => false\n );\n\n $client1 = new Client(\"https://graph.facebook.com/me?access_token=\" . $access_token, $config);\n $response1 = $client1->send();\n\n $facebook_user = json_decode($response1->getBody(), true);\n if ($auth['login']) {\n $redirect = $this->facebookLogin($state, $facebook_user['id'], $access_token, $facebook_user);\n } else if ($auth['signup']) {\n $redirect = $this->facebookSignup($state, $facebook_user['id'], $access_token, $facebook_user);\n } else if ($auth['connect']) {\n // @TODO implement\n $redirect = $this->facebookConnect($state, $facebook_user['id'], $access_token, $facebook_user);\n }\n } catch (Exception $e) {\n //$redirect = $this->getRedirect($state->redirect, $e->getMessage());\n die(\"bbbbbbbbbbbbbbbbbbb\");\n }\n }\n } else {\n // User declined the applications Auth Dialog\n return $this->redirect()->toUrl($state->redirect);\n }\n } else {\n // the user is calling /fbauth/___/ without any parameters, redirect them to the Facebook login page\n $state = array(\"state_key\" => $auth['state_key']);\n $state[\"redirect\"] = array_key_exists(\"redirect\", $request) ? $request[\"redirect\"] : $this->getConfig()->site['domain'].\"/\".$this->getLang().\"/user/fbauth/\";\n $redirect = \"https://www.facebook.com/dialog/oauth?client_id=\" . $fbconfig['appId'] .\n \"&redirect_uri=\" . urlencode($auth['url']) .\n \"&scope=email,user_birthday,user_location,publish_actions&state=\" . urlencode(json_encode($state));\n }\n// if (substr($redirect, 0, 1) == '/')\n// $redirect = substr($redirect, 1);\n if($redirect == \"/?action=registration\") {\n header(\"Location: \" . $redirect);\n exit;\n }\n\n if (strpos($redirect, \"http\") === 0) {\n header(\"Location: \" . $redirect);\n } else {\n if (!array_key_exists(\"iframe\", $request)){\n return $this->redirect()->toUrl($this->getRequest()->getServer('HTTP_REFERER'));\n } else if($redirect) {\n return $this->redirect()->toUrl($redirect);\n } else {\n return $this->redirect()->toUrl($this->getRequest()->getServer('HTTP_REFERER'));\n }\n }\n exit;\n }", "public function _fetch_incidents_set_params()\n\t{\n\t\t$params = Event::$data;\n\n\t\t// ---------- BEGIN HACKY IMPLEMENTATION (used on homepage map)\n\t\tif(!isset($_GET['plugin_actionable_filter']) OR !is_array($_GET['plugin_actionable_filter'])) {\n\t\t\t// If we're doing the hacky fake media trick, run this.\n\t\t\t// Look for fake media type\n\t\t\tif ($filters = $this->_check_media_type())\n\t\t\t{\n\t\t\t\t// Remove media type filter based on fake actionable media type\n\t\t\t\t// @todo make this work with normal media filters too\n\t\t\t\t$sql = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'media WHERE media_type IN ('.implode(',',$this->_check_media_type()).'))';\n\t\t\t\t$key = array_search($sql, $params);\n\n\t\t\t\tif ($key !== FALSE)\n\t\t\t\t{\n\t\t\t\t\tunset($params[$key]);\n\t\t\t\t}\n\n\t\t\t\t$actionable_sql = array();\n\t\t\t\tforeach ($filters as $filter)\n\t\t\t\t{\n\t\t\t\t\t// Cast the $filter to int just in case\n\t\t\t\t\t$filter = intval($filter);\n\n\t\t\t\t\t// Add filter based on actionable status.\n\t\t\t\t\tswitch ($filter)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase '102':\n\t\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\t\tWHERE actionable = 1 AND action_taken = 0)';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '103':\n\t\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\t\tWHERE actionable = 2 AND action_taken = 0)';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase '104':\n\t\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\t\tWHERE actionable = 1 AND action_taken = 1)';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (count($actionable_sql) > 0)\n\t\t\t\t{\n\t\t\t\t\t$actionable_sql = '('.implode(' OR ',$actionable_sql).')';\n\t\t\t\t\t$params[] = $actionable_sql;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tEvent::$data = $params;\n\t\t\treturn;\n\t\t}\n\t\t// ---------- END HACKY IMPLEMENTATION (used on homepage map)\n\n\t\t// This is the Non-hacky way of filtering reports\n\n\t\t$actionable_ids = $_GET['plugin_actionable_filter'];\n\t\t$actionable_sql = array();\n\t\tforeach($actionable_ids AS $id) {\n\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\tWHERE actionable = '.intval($id).' AND action_taken = 0)';\n\t\t}\n\n\t\tif (count($actionable_sql) > 0)\n\t\t{\n\t\t\t$actionable_sql = '('.implode(' OR ',$actionable_sql).')';\n\t\t\t$params[] = $actionable_sql;\n\t\t}\n\n\t\tEvent::$data = $params;\n\t}", "public function log_activity() {\n\t\t$data = array();\n\t\t$data['page'] = current_url();\n\t\t$data['ip_address'] = $this->_ci->input->ip_address();\n\t\t$data['user_agent'] = $this->_ci->agent->agent_string(); \n\t\t$data['request_method'] = $this->_ci->input->server('REQUEST_METHOD');\n\t\t$data['request_params'] = serialize($this->_ci->input->get_post(NULL, TRUE)); \n\t\t$data['uri_string'] = $this->_ci->uri->uri_string();\n\t\t$data['created_at'] = date('Y-m-d h:i:s');\n\n\t\tif($this->verify_activity()) {\n\t\t\t// And write it to the database\n\t\t\t$this->_ci->db->insert('hooks', $data);\n\t\t}\n\t}", "public function getCustomEventParams();", "function _tincan_lrs_activities_get_handler($activityId, $params) {\n switch($activityId) {\n case 'profile':\n $result = _tincan_lrs_activity_profiles_get_processor($params);\n break;\n case 'state':\n $result = _tincan_lrs_activity_state_get_processor($params);\n break;\n default:\n $result = _tincan_lrs_activity_get_processor($params, $activityId);\n \n }\n return $result;\n\n}", "public function GetInfo($id1) {\n\n $appID = '1811806812250197';\n $appSecret = '51aa7241711eecf5d9f4da5010b553ab';\n//Create an access token using the APP ID and APP Secret.\n $accessToken = $appID . '|' . $appSecret;\n//The ID of the Facebook page in question.\n//Tie it all together to construct the URL\n \n $url = \"https://graph.facebook.com/$id1?fields=id,name,from,link,created_time,images,reactions.summary(true)&access_token=$accessToken\";\n\n//Make the API call\n $result = file_get_contents($url);\n\n//echo $result;\n//Decode the JSON result.\n $decoded = json_decode($result, true);\n\n//echo $de ;\n $id = $decoded['id'];\n $date = $decoded['created_time'];\n $net = 'Facebook';\n $medio = $decoded['from']['name'];\n $resume = $decoded['name'];\n $pos = 0;\n $negs = 0;\n $neut = 0;\n $link = $decoded['link'];\n $asunto = 0;\n $actores = 0;\n $reacts = $decoded['reactions']['summary']['total_count'];\n $shares = 0;\n $img = $decoded[\"images\"][0]['source'];\n\n $fpost = new fbpost($id, $date, $net, $medio, $resume, $pos, $negs, $neut, $link, $asunto, $actores, $reacts, $shares, $img);\n\n\n// \n// echo\"<br>\". $fpost->id;\n// echo\"<br>\". $fpost->date;\n// echo\"<br>\". $fpost->net;\n// echo\"<br>\". $fpost->medio;\n// echo\"<br>\". $fpost->resume;\n// echo\"<br>\". $fpost->pos;\n// echo\"<br>\". $fpost->negs;\n// echo\"<br>\". $fpost->neut;\n// echo\"<br>\". $fpost->link;\n// echo\"<br>\". $fpost->asunto;\n// echo\"<br>\". $fpost->actores;\n// echo\"<br>\". $fpost->reacts;\n// echo\"<br>\". $fpost->shares;\n// \n \n return $fpost;\n }", "function culturefeed_ui_page_top_events_json() {\n\n $sort = variable_get('culturefeed_ui_block_top_events_sort', CultureFeed::TOP_EVENTS_SORT_ACTIVE);\n\n try {\n $events = DrupalCultureFeed::getTopEvents($sort, CULTUREFEED_UI_BLOCK_TOP_EVENTS_COUNT);\n }\n catch (Exception $e) {\n watchdog_exception('culturefeed_ui', $e);\n return;\n }\n\n $items = array();\n\n $events_info = culturefeed_get_nodes_for_cdbids('event', $events);\n\n // Search what top events are liked.\n $user_likes = array();\n $user_goes = array();\n if (DrupalCultureFeed::isCultureFeedUser()) {\n try {\n\n $query = new CultureFeed_SearchActivitiesQuery();\n $query->type = array(CultureFeed_Activity::TYPE_LIKE, CultureFeed_Activity::TYPE_IK_GA,);\n $query->nodeId = $events;\n $query->contentType = CultureFeed_Activity::CONTENT_TYPE_EVENT;\n $query->userId = DrupalCultureFeed::getLoggedInUserId();\n $query->private = TRUE;\n\n $activities = DrupalCultureFeed::searchActivities($query);\n\n foreach ($activities->objects as $activity) {\n if ($activity->type == CultureFeed_Activity::TYPE_LIKE) {\n $user_likes[$activity->nodeId] = TRUE;\n }\n else {\n $user_goes[$activity->nodeId] = TRUE;\n }\n }\n\n }\n catch (Exception $e) {\n watchdog_exception('culturefeed_ui', $e);\n }\n }\n\n $items = array();\n\n foreach ($events as $cdbid) {\n\n if (!isset($events_info[$cdbid])) {\n continue;\n }\n\n $event = $events_info[$cdbid];\n\n $anonymous = '';\n $disable = array();\n if (user_is_anonymous()) {\n $url = 'culturefeed/do/' . CultureFeed_Activity::TYPE_LIKE . '/' . CultureFeed_Activity::CONTENT_TYPE_EVENT . '/' . $cdbid;\n $anonymous = theme('culturefeed_ui_connect_hover', array('url' => $url));\n $disable = array('disable');\n }\n\n if (!isset($user_likes[$cdbid])) {\n\n $positive = array(\n '#type' => 'link',\n '#id' => 'top-like-'. $cdbid,\n '#title' => 'Vind ik leuk',\n '#href' => 'culturefeed/do/' . CultureFeed_Activity::TYPE_LIKE . '/' . CultureFeed_Activity::CONTENT_TYPE_EVENT . '/' . $cdbid . '/noredirect',\n '#attributes' => array('class' => array_merge(array('like-link'), $disable)),\n '#options' => array('query' => drupal_get_destination()),\n '#ajax' => array(\n 'wrapper' => 'rate-' . $cdbid,\n ),\n );\n\n $link = render($positive) . $anonymous;\n }\n else {\n\n $negative = array(\n '#type' => 'link',\n '#id' => 'top-like-'. $cdbid,\n '#title' => 'Niet meer',\n '#href' => 'culturefeed/undo/' . CultureFeed_Activity::TYPE_LIKE . '/' . CultureFeed_Activity::CONTENT_TYPE_EVENT . '/' . $cdbid . '/noredirect',\n '#attributes' => array('class' => array('unlike-link'), 'title' => 'Vind ik niet meer leuk'),\n '#ajax' => array(\n 'wrapper' => 'rate-' . $cdbid,\n ),\n );\n\n $link = render($negative);\n }\n\n $items[] = theme('culturefeed_ui_top_event', array('event' => $event, 'rate_link' => $link));\n\n }\n\n $content = array();\n if (!empty($items)) {\n $content = array(\n '#theme' => 'item_list',\n '#items' => $items,\n '#type' => 'ol',\n '#attributes' => array('class' => 'event-teaser-list'),\n );\n }\n\n $commands = array();\n\n $data = drupal_render($content);\n $commands[] = ajax_command_html('#top-events', $data);\n\n ajax_deliver(array('#type' => 'ajax', '#commands' => $commands));\n\n}", "function getUserActivity( $stream )\n\t{\n\t\tif( $stream == \"me\" ){\n\t\t\t$response = $this->api->get( 'newsfeed/list_events.json?events_category=own' );\n\t\t}\n\t\telse{\n\t\t\t$response = $this->api->get( 'newsfeed/list_events.json?events_category=friends' );\n\t\t}\n\n\t\t// check the last HTTP status code returned\n\t\tif ( $this->api->http_code != 200 ){\n\t\t\tthrow new Exception( \"User activity stream request failed! {$this->providerId} returned an error. \" . $this->errorMessageByStatus( $this->api->http_code ) );\n\t\t}\n\n\t\tif( ! $response ){\n\t\t\treturn ARRAY();\n\t\t}\n\n\t\t$activities = ARRAY();\n\n\t\tforeach( $response as $item ){\n\t\t\t$ua = new Hybrid_User_Activity();\n\n\t\t\t$ua->id = (property_exists($item,'id_event'))?$item->id_event:\"\";\n\t\t\t$ua->date = (property_exists($item,'timestamp'))?$item->timestamp:\"\";\n\t\t\t$ua->text = (property_exists($item,'content'))?$item->content:\"\";\n\t\t\t$ua->text = ($ua->text)?trim(strip_tags($ua->text)):\"\";\n\n\t\t\t$ua->user->identifier = (property_exists($item->from,'id_user'))?$item->from->id_user:\"\";\n\t\t\t$ua->user->displayName = (property_exists($item->from,'username'))?$item->from->username:\"\";\n\t\t\t$ua->user->profileURL = (property_exists($item->from,'user_url'))?$item->from->user_url:\"\";\n\t\t\t$ua->user->photoURL = (property_exists($item->from,'avatar_url'))?$item->from->avatar_url:\"\";\n\n\t\t\t$activities[] = $ua;\n\t\t}\n\n\t\treturn $activities;\n\t}", "function socialActivityGet($opt){\n\n\tif($opt['debug']) $this->pre(\"OPTION\", $opt);\n\n\t$dbMode = 'dbMulti';\n\n\t// GET notification\n\tif($opt['notification']){\n\t\t$join[] = \"INNER JOIN k_socialnotification ON k_socialactivity.id_socialactivity = k_socialnotification.id_socialactivity\";\n\t\t$cond[] = \"k_socialnotification.id_user=\".$opt['id_user'];\n\t}\n\n\t// GET id_user\n\tif(array_key_exists('id_user', $opt)){\n\n\t\tif(is_array($opt['id_user'])){\n\t\t\t$cond[] = \"id_user IN(\".implode(',', $opt['id_user']).\")\";\n\t\t}else\n\t\tif($opt['id_user'] > 0){\n\t\t\t$cond[] = \"id_user=\".$opt['id_user'];\n\t\t}else{\n\t\t\tif($opt['debug']) $this->pre(\"ERROR: ID_USER (ARRAY,NUMERIC)\", \"GIVEN\", var_export($opt['user'], true));\n\t\t\treturn array();\n\t\t}\t\t\n\n\t}\n\n\n\tif($dbMode == 'dbMulti'){\n\n\t\t$group = \"\\nGROUP BY \".(($opt['groupby'] != NULL)\n\t\t\t? $opt['groupby']\n\t\t\t: \"k_socialpost.id_socialpost\");\n\t\t\n\t\t$order = \"\\nORDER BY \".(($opt['order'] != '' && $opt['direction'] != '')\n\t\t\t? $opt['order'].\" \".$opt['direction']\n\t\t\t: \"socialActivityDate DESC\");\n\n\t\t$limit = \"\\nLIMIT \".(($opt['offset'] != '' && $opt['limit'] != '')\n\t\t\t? $opt['offset'].\",\".$opt['limit']\n\t\t\t: \"0,50\");\n\n\t\tif($opt['noLimit'] == true) unset($limit);\n\t}\n\n\t$field\t\t= \"k_socialactivity.*\";\n\t$where\t\t= is_array($cond) ? \"\\nWHERE\\n\".implode(\" AND \", $cond) : NULL;\n\t$inner\t\t= is_array($join) ? \"\\n\".implode(\"\\n\", $join).\"\\n\" : NULL;\n\n\t$activity\t= $this->dbMulti(\"SELECT \".$field.\" FROM k_socialactivity \".$inner. $where . $__group__ . $order . $limit);\n\tif($opt['debug']) $this->pre($this->db_query, $this->db_error, $activity);\n\n\treturn $activity;\n}", "public function get_default_event_params() {\n return array(\n 'objectid' => $this->id,\n 'context' => $this->df->context,\n 'other' => array(\n 'dataid' => $this->dataid,\n 'viewid' => $this->id,\n )\n );\n }", "public function onGetFeedDataFilter($buffer) {\nglobal $_LW;\nstatic $event_types;\nif (!empty($_LW->REGISTERED_APPS['ems']['custom']['event_types_map'])) { // if there is an event type map\n\tif (!empty($buffer) && @$buffer['type']=='ical' && strpos(@$buffer['url'], $_LW->CONFIG['LIVE_URL'].'/ems/')!==false && !empty($buffer['items']['default'])) { // if the feed is an EMS ICAL feed with items\n\t\tif ($this->initEMS()) { // if EMS loaded\n\t\t\tif (!isset($this->client->event_types)) { // get the EMS event types\n\t\t\t\t$this->client->getEventTypes($_LW->REGISTERED_APPS['ems']['custom']['username'], $_LW->REGISTERED_APPS['ems']['custom']['password']);\n\t\t\t};\n\t\t\tif (!isset($event_types)) { // get the LiveWhale event types\n\t\t\t\t$event_types=[];\n\t\t\t\tforeach($_LW->dbo->query('select', 'id, title', 'livewhale_events_categories', false, 'title ASC')->run() as $event_type) {\n\t\t\t\t\t$event_types[$event_type['id']]=$_LW->setFormatClean($event_type['title']);\n\t\t\t\t};\n\t\t\t};\n\t\t\tforeach($buffer['items']['default'] as $key=>$val) { // for each feed item\n\t\t\t\tif (!empty($val['categories']) || !empty($val['unknown_categories'])) { // if there are categories or unknown categories\n\t\t\t\t\tif (!empty($val['categories'])) { // if there are categories\n\t\t\t\t\t\tforeach($val['categories'] as $key2=>$val2) { // for each category\n\t\t\t\t\t\t\t$val2=$_LW->setFormatClean($val2);\n\t\t\t\t\t\t\t$val2_id='';\n\t\t\t\t\t\t\tforeach($this->client->event_types as $key3=>$val3) { // convert the category to the EMS event type ID\n\t\t\t\t\t\t\t\tif (strtolower($val3['title'])==strtolower($val2)) {\n\t\t\t\t\t\t\t\t\t$val2_id=$val3['id'];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (!empty($val2_id) && isset($_LW->REGISTERED_APPS['ems']['custom']['event_types_map'][$val2_id])) { // if the EMS event type was found in map\n\t\t\t\t\t\t\t\t$new_categories=$_LW->REGISTERED_APPS['ems']['custom']['event_types_map'][$val2_id];\n\t\t\t\t\t\t\t\tif (!is_array($new_categories)) {\n\t\t\t\t\t\t\t\t\t$new_categories=[$new_categories];\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tforeach($new_categories as $val3) { // format the translated categories\n\t\t\t\t\t\t\t\t\t$val3=$_LW->setFormatClean($val3);\n\t\t\t\t\t\t\t\t\tif ($val3==='Open to the Public') {\n\t\t\t\t\t\t\t\t\t\t$val3=' Open to the Public';\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tif (in_array($val3, $event_types)) { // if the translated category is a known LiveWhale event type\n\t\t\t\t\t\t\t\t\t\t$val4=array_search($val3, $event_types); // translate the EMS event type to the corresponding LiveWhale event type ID\n\t\t\t\t\t\t\t\t\t\tif (!in_array($val4, $buffer['items']['default'][$key]['categories'])) {\n\t\t\t\t\t\t\t\t\t\t\t$buffer['items']['default'][$key]['categories'][]=$val4;\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t};\n\t\t\t\t\t};\n\t\t\t\t\tif (!empty($val['unknown_categories'])) { // if there are unknown categories\n\t\t\t\t\t\tforeach($val['unknown_categories'] as $key2=>$val2) { // for each unknown category\n\t\t\t\t\t\t\t$val2=$_LW->setFormatClean($val2);\n\t\t\t\t\t\t\t$val2_id='';\n\t\t\t\t\t\t\tforeach($this->client->event_types as $key3=>$val3) { // convert the unknown category to the EMS event type ID\n\t\t\t\t\t\t\t\tif (strtolower($val3['title'])==strtolower($val2)) {\n\t\t\t\t\t\t\t\t\t$val2_id=$val3['id'];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tif (!empty($val2_id) && isset($_LW->REGISTERED_APPS['ems']['custom']['event_types_map'][$val2_id])) { // if the EMS event type was found in map\n\t\t\t\t\t\t\t\tif (!is_array($buffer['items']['default'][$key]['categories'])) { // ensure that there is an array of known categories\n\t\t\t\t\t\t\t\t\t$buffer['items']['default'][$key]['categories']=[];\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t$new_categories=$_LW->REGISTERED_APPS['ems']['custom']['event_types_map'][$val2_id];\n\t\t\t\t\t\t\t\tif (!is_array($new_categories)) {\n\t\t\t\t\t\t\t\t\t$new_categories=[$new_categories];\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tforeach($new_categories as $val3) { // format the translated categories\n\t\t\t\t\t\t\t\t\t$val3=$_LW->setFormatClean($val3);\n\t\t\t\t\t\t\t\t\tif ($val3==='Open to the Public') {\n\t\t\t\t\t\t\t\t\t\t$val3=' Open to the Public';\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tif (in_array($val3, $event_types)) { // if the translated category is a known LiveWhale event type\n\t\t\t\t\t\t\t\t\t\t$val4=array_search($val3, $event_types); // translate the EMS event type to the corresponding LiveWhale event type ID\n\t\t\t\t\t\t\t\t\t\tif (!in_array($val4, $buffer['items']['default'][$key]['categories'])) {\n\t\t\t\t\t\t\t\t\t\t\t$buffer['items']['default'][$key]['categories'][]=$val4;\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tunset($buffer['items']['default'][$key]['unknown_categories'][$key2]); // remove the unknown category\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};\n\t\t};\n\t};\n};\nreturn $buffer;\n}", "public function _fetch_incidents_set_params()\n\t{\n\t\t$params = Event::$data;\n\t\t\n\t\t// Look for fake media type\n\t\tif ($filters = $this->_check_media_type())\n\t\t{\n\t\t\t\n\t\t\t$actionable_sql = array();\n\t\t\tforeach ($filters as $filter)\n\t\t\t{\n\t\t\t\t// Cast the $filter to int just in case\n\t\t\t\t$filter = intval($filter);\n\t\t\t\t\n\t\t\t\t// Add filter based on actionable status.\n\t\t\t\tswitch ($filter)\n\t\t\t\t{\n\t\t\t\t\tcase '101':\n\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\tWHERE (actionable = 1 OR actionable = 2 OR actionable = 0) AND (action_taken = 0 OR action_taken = 1))';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '102':\n\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\tWHERE (actionable = 1 OR actionable =2) AND action_taken = 0)';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '103':\n\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\tWHERE actionable = 2 AND action_taken = 0)';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '104':\n\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\tWHERE action_taken = 1)';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '105':\n\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\tWHERE action_taken = 2)';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '106':\n\t\t\t\t\t\t$actionable_sql[] = 'i.id IN (SELECT DISTINCT incident_id FROM '.Kohana::config('database.default.table_prefix').'actionable\n\t\t\t\t\t\t\tWHERE actionable = 0)';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (count($actionable_sql) > 0)\n\t\t\t{\n\t\t\t\t$actionable_sql = '('.implode(' OR ',$actionable_sql).')';\n\t\t\t\t$params[] = $actionable_sql;\n\t\t\t}\n\t\t}\n\n\t\tEvent::$data = $params;\n/*\n\t\techo \"<LEIF>\";\n\t\tvar_dump(Event::$data);\n\t\techo \"</LEIF>\";\n*/\n\t}", "public function facebookSignInAction()\n {\n // specify required fields\n $requirements = array(\n 'access_token',\n 'client_id',\n 'client_secret',\n 'grant_type'\n );\n\n // fech post json data\n $params = $this->fetchRequestData($requirements);\n $client = $params['client'];\n $client_id = $params['client_id'];\n $client_secret = $params['client_secret'];\n $grant_type = $params['grant_type'];\n\n switch ($client) {\n case \"ANDROID\":\n $params['clientType'] = 2;\n break;\n case \"IOS\":\n $params['clientType'] = 1;\n break;\n case \"WINDOWS\":\n $params['clientType'] = 3;\n break;\n case \"BLACKBERRY\":\n $params['clientType'] = 5;\n break;\n case \"NOKIA\":\n $params['clientType'] = 4;\n break;\n }\n\n if (isset($params['client_type'])) {\n $client_type = $params['client_type'];\n } else {\n $client_type = 'ANDROID';\n }\n $access_token = $params['access_token'];\n\n $Result = array();\n\n\n $config_use = array(\n 'app_id' => $this->container->getParameter('facebook_app_id'),\n 'appId' => $this->container->getParameter('facebook_app_id'),\n 'app_secret' => $this->container->getParameter('facebook_app_secret'),\n 'secret' => $this->container->getParameter('facebook_app_secret'),\n 'default_graph_version' => $this->container->getParameter('facebook_default_graph_version')\n );\n\n\n try {\n $uricurserver = $this->get('TTRouteUtils')->currentServerURL();\n $fb = new \\Facebook\\Facebook($config_use);\n $response = $fb->get('/me?fields=id,name,email,birthday,first_name,last_name', $access_token);\n } catch (Facebook\\Exceptions\\FacebookResponseException $e) {\n // When Graph returns an error\n\n $Result['status'] = 'error';\n $Result['msg'] = 'Graph returned an error: ' . $e->getMessage();\n\n } catch (Facebook\\Exceptions\\FacebookSDKException $e) {\n\n $Result['status'] = 'error';\n $Result['msg'] = 'Facebook SDK returned an error: ' . $e->getMessage();\n\n }\n\n $user_profile = $response->getGraphUser();\n if (!isset($user_profile['email']) || is_null($user_profile['email']) || $user_profile['email'] == '') {\n\n $Result['status'] = 'error';\n $Result['msg'] = 'Facebook SDK returned an error: Invalid Facebook account';\n\n }\n\n $user_email = $user_profile['email'];\n $check_email = $this->get('UserServices')->getUserDetails(array('yourEmail' => $user_email));\n\n if (isset($user_profile['birthday'])) {\n $birthday = $user_profile['birthday'];\n $birthday_str = $birthday->format('Y-m-d');\n } else {\n $birthday_str = null;\n }\n\n if ($check_email && isset($check_email[0])) {\n $res = $this->get('UserServices')->userUpdateFbUser($check_email[0]['cu_id'], $user_profile['id'], $user_profile['id']);\n } else {\n $post['fullName'] = $user_profile['name'];\n $post['yourEmail'] = $user_profile['email'];\n $post['fname'] = $user_profile['first_name'];\n $post['lname'] = $user_profile['last_name'];\n $post['yourBday'] = $birthday_str;\n $post['fb_token'] = $access_token;\n $post['fb_user'] = $user_profile['id'];\n $post['password'] = $user_profile['id'];\n $post['yourPassword'] = $user_profile['id'];\n $post['gender'] = 'O';\n $post['yourUserName'] = $user_profile['email'];\n $post['defaultPublished'] = 1;\n $post['cmsUserGroupId'] = $this->container->getParameter('ROLE_USER');\n\n $res = $this->get('UserServices')->generateUser($post);\n }\n\n $userDetails = $this->get('UserServices')->userLoginFacebook($user_profile['id']);\n $secretKey = \"fakesecretkey\";\n if ($userDetails) {\n $Result['status'] = 'success';\n $Result['username'] = $user_profile['first_name'] . ' ' . $user_profile['last_name'];\n $Result['countryCode'] = ( isset($userDetails[0]['YourCountry']) && $userDetails[0]['YourCountry'] != NULL )?$userDetails[0]['YourCountry']:'';\n $Result['fname'] = $user_profile['first_name'];\n $Result['lname'] = $user_profile['last_name'];\n $Result['fullname'] = $userDetails[0]['FullName'];\n $Result['email'] = $user_profile['email'];\n $Result['userid'] = (int)$userDetails[0]['id'];\n $data = time() . \"_\" .$Result['userid'];\n $token = hash('sha512', $secretKey . $data);\n $Result['ssid'] = $token;\n $directory = '/' . $this->container->getParameter('USER_AVATAR_RELATIVE_PATH');\n $profilePic = $userDetails[0]['profile_Pic'];\n if ($profilePic == '') {\n $profilePic = 'he.jpg';\n if ($userDetails[0]['gender'] == 'F') {\n $profilePic = 'she.jpg';\n }\n }\n\n $avatar = $directory . $profilePic;\n $Result['avatar'] = $avatar;\n\n $request = Request::createFromGlobals();\n $request->request->set('client_id', $client_id);\n $request->request->set('client_secret', $client_secret);\n $request->request->set('grant_type', $grant_type);\n $request->request->set('username', $user_profile['first_name'] . ' ' . $user_profile['last_name']);\n $request->request->set('password', $user_profile['id']);\n\n $params['username'] = $user_profile['email'];\n $params['password'] = $user_profile['id'];\n\n $userRec = $this->get('UserServices')->userLogin($params);\n\n\n $req=new \\Symfony\\Component\\HttpFoundation\\Request($params);\n $tokenDetails = $this->get('OauthHelperServices')->getTokenInfo($req);\n $tokenDetailsEncoded = $tokenDetails->getContent();\n $tokenDetailsDeco = json_decode($tokenDetailsEncoded, TRUE);\n\n if (isset($tokenDetailsDeco['error']) && $tokenDetailsDeco['error']) {\n throw new HttpException(400, $tokenDetailsDeco['error_description']);\n }\n\n $Result['token'] = $tokenDetailsDeco;\n\n //updating cms_mobile_token table\n $val['tokenId'] = (isset($params['registration_id']) && $params['registration_id']) ? $params['registration_id'] : '';\n $val['platform'] = $params['clientType'];\n $val['aptType'] = $client;\n $this->get('UserServices')->userToMobileToken($val);\n\n //updating oauth token table\n if (isset($params['device_information']) && $params['device_information']) {\n\n $val['accessToken'] = $Result['token']['access_token'];\n $val['deviceInformation'] = json_encode($params['device_information']);\n $this->get('UserServices')->updateOauthAccessToken($val);\n\n }\n\n } else {\n $Result['status'] = 'error';\n $Result['msg'] = 'not able to register user';\n }\n\n $response = new Response(json_encode($Result));\n $response->setStatusCode(200);\n return $response;\n }", "protected function process_events_params()\n\t{\n\t\t// -------------------------------------\n\t\t// Convert calendar_name to calendar_id\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('calendar_id') == '' AND $this->P->value('calendar_name') != '')\n\t\t{\n\t\t\t$ids = $this->data->get_calendar_id_from_name($this->P->value('calendar_name'));\n\t\t\tif (! empty($ids))\n\t\t\t{\n\t\t\t\t$this->P->set('calendar_id', implode('|', $ids));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->P->set('calendar_id', NULL);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Convert event_name to event_id\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('event_id') == '' AND $this->P->value('event_name') != '')\n\t\t{\n\t\t\t$ids = $this->data->get_event_id_from_name($this->P->value('event_name'));\n\t\t\t$this->P->set('event_id', implode('|', $ids));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Determine which calendars this user has permission to view\n\t\t// and modify the parameters accordingly.\n\t\t// -------------------------------------\n\n\t\t// TODO\n\n\t\t// -------------------------------------\n\t\t// Set the first day of the week\n\t\t// -------------------------------------\n\n\t\t$this->first_day_of_week = ($this->P->value('first_day_of_week') !== FALSE) ? $this->P->value('first_day_of_week') : $this->first_day_of_week;\n\n\t\t// -------------------------------------\n\t\t// Set the date range based on the show_x parameters\n\t\t// -------------------------------------\n\n\t\t$adjust = ($this->P->value('date_range_start') === FALSE AND $this->P->value('date_range_end') === FALSE) ? FALSE : TRUE;\n\n\t\t$this->set_date_range_parameters($adjust);\n\n\t\t// -------------------------------------\n\t\t// Prepare pad_short_weeks\n\t\t// -------------------------------------\n\n\t\t$this->P->set( 'pad_short_weeks', $this->check_yes( $this->P->value('pad_short_weeks') ) );\n\n\t}", "public function ct_fb_mapping(){\n if (!defined('WPB_VC_VERSION')) {\n return;\n }\n\n // Map the block with vc_map()\n vc_map(\n array(\n 'name' => __('CT Facebook Feeds', 'text-domain'),\n 'base' => 'ct_facebook',\n 'description' => __('Displaying facebook feeds', 'text-domain'),\n 'category' => __('CT Test Plugins', 'text-domain'),\n 'params' => array(\n array(\n 'type' => 'dropdown',\n 'heading' => 'Style',\n 'description'=> 'Select widget coloristic style',\n 'param_name' => 'style',\n 'value' => array( '', 'dark', 'light' )\n ),\n\n array(\n 'type' => 'textfield',\n 'heading' => 'Page ID',\n 'description' => 'Your Facebook Fan Paged ID',\n 'param_name' => 'id',\n 'value' => ''\n ),\n\n array(\n 'type' => 'textfield',\n 'heading' => 'Access Token',\n 'description' => 'Access Token is needed to conect with Facebook API and so on to take page posts content',\n 'param_name' => 'access_token',\n 'value' => ''\n ),\n\n array(\n 'type' => 'checkbox',\n 'heading' => 'Embed Images',\n 'description' => 'Check for embeding images to feeds',\n 'param_name' => 'embed_images',\n 'value' => 'false'\n ),\n\n array(\n 'type' => 'textfield',\n 'heading' => 'Posts Limit',\n 'description' => 'Limit of displaying posts',\n 'param_name' => 'limit',\n 'value' => 3\n ),\n\n array(\n 'type' => 'textfield',\n 'heading' => 'Char Limit',\n 'description' => 'Limit of displaying chars per post',\n 'param_name' => 'length_limit',\n 'value' => 100\n ),\n\n array(\n 'type' => 'textfield',\n 'heading' => 'Cache',\n 'description' => 'How often widget has got to refresh (in seconds)? Default it is 300 seconds',\n 'param_name' => 'cache',\n 'value' => 300\n )\n ),\n )\n );\n }", "public function sendFacebookAppEvent()\n {\n $this->initializeFacebookEvent();\n $eventFields = array(\n 'event' => urlencode('CUSTOM_APP_EVENTS'),\n 'access_token' => urlencode($this->fbAccessToken),\n 'application_tracking_enabled' => 1,\n 'advertiser_tracking_enabled' => 1,\n //\"advertiser_id=1383-6676-5853-8751\", \n 'custom_events' => '['.json_encode($this->customEventsFields).']'\n );\n $this->attemptToSendFacebookAppEvent($eventFields);\n }", "function __construct($input) {\n \n $this->textMessage = $input['entry'][0]['messaging'][0]['message']['text'];\n $this->buttonMessage = $input['entry'][0]['messaging'][0]['postback']['payload'];\n $this->quickReplyMessage = $input['entry'][0]['messaging'][0]['message']['quick_reply']['payload'];\n $this->attachmentMessage = $input['entry'][0]['messaging'][0]['message']['attachments'][0]['type'];\n\n\n }", "public function getRequestData();", "function pushActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access,$integration_option,$params='')\n\t{\n\t\t$activityintegrationstream= new activityintegrationstream();\n\t\tif($integration_option=='joomla')\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse if($integration_option=='Community Builder')\n\t\t{\n\t\t\t$installed=$activityintegrationstream->Checkifinstalled('com_comprofiler');\n\t\t\tif($installed){\n\t\t\t\t$result=$activityintegrationstream->pushToCBActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access);\n\t\t\t\tif(!$result){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if($integration_option=='JomSocial' )\n\t\t{\n\t\t\t$installed=$activityintegrationstream->Checkifinstalled('com_community');\n\t\t\tif($installed){\n\t\t\t\t$result=$activityintegrationstream->pushToJomsocialActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access);\n\t\t\t\tif(!$result){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if($integration_option=='Jomwall')\n\t\t{\n\t\t\t$installed=$activityintegrationstream->Checkifinstalled('com_awdwall');\n\t\t\tif($installed){\n\t\t\t\t$result=$activityintegrationstream->pushToJomwallActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access,$params);\n\t\t\t\tif(!$result){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse if($integration_option=='EasySocial')\n\t\t{\n\t\t\t$installed=$activityintegrationstream->Checkifinstalled('com_easysocial');\n\t\t\tif($installed){\n\t\t\t\t$result=$activityintegrationstream->pushToEasySocialActivity($actor_id,$act_type,$act_subtype,$act_description,$act_link,$act_title,$act_access);\n\t\t\t\tif(!$result){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function SendUserData(){\n echo json_encode(array(\n 'email' => $_SESSION['email'],\n 'surname' => $_SESSION['surname'],\n 'firstname' => $_SESSION['firstname'],\n 'userId' => $_SESSION['userId'],\n 'lastLogin' => $_SESSION['date']\n ));\n}", "public function __invoke(Request $request)\n {\n $event = $request->get('type');\n $fired_at = $request->get('fired_at'); // UTC timestamp string eg: \"2009-03-26 21:35:57\",\n $data = $request->get('data');\n\n switch ($event) {\n case 'subscribe':\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"api@mailchimp.com\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"api@mailchimp.com\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\",\n //$data['ip_signup'] = \"10.20.10.30\"\n break;\n\n case 'unsub':\n case 'delete':\n //An unsubscribe event's action is either unsub or delete. The reason will be manual unless caused by a spam complaint, then it will be abuse.\n //$data['reason'] = \"manual\", // \"abuse\"\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"api+unsub@mailchimp.com\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"api+unsub@mailchimp.com\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\",\n //$data['campaign_id'] = \"cb398d21d2\",\n break;\n\n\n case 'profile':\n //Note that you will always receive a profile update at the same time as an email update.\n //$data['id'] = \"8a25ff1d98\",\n //$data['list_id'] = \"a6b5da1054\",\n //$data['email'] = \"api@mailchimp.com\",\n //$data['email_type'] = \"html\",\n //$data['merges']['EMAIL]\": \"api@mailchimp.com\",\n //$data['merges']['FNAME]\": \"Mailchimp\",\n //$data['merges']['LNAME]\": \"API\",\n //$data['merges']['INTERESTS]\": \"Group1,Group2\",\n //$data['ip_opt'] = \"10.20.10.30\"\n break;\n\n case 'upemail':\n //Note that you will always receive a profile update at the same time as an email update.\n //$data['list_id'] = \"a6b5da1054\",\n //$data['new_id'] = \"51da8c3259\",\n //$data['new_email'] = \"api+new@mailchimp.com\",\n //$data['old_email'] = \"api+old@mailchimp.com\"\n break;\n\n case 'cleaned':\n //For cleaned emails, the reason will be hard (for hard bounces) or abuse.\n //$data['list_id'] = \"a6b5da1054\",\n //$data['campaign_id'] = \"4fjk2ma9xd\",\n //$data['reason'] = \"hard\", // \"abuse\"\n //$data['email'] = \"api+cleaned@mailchimp.com\"\n break;\n\n case 'campaign':\n // Campaign-Sent Emails\n //$data['id'] = \"5aa2102003\",\n //$data['subject'] = \"Test Campaign Subject\",\n //$data['status'] = \"sent\",\n //$data['reason'] = \"\",\n //$data['list_id'] = \"a6b5da1054\"\n break;\n }\n\n\n // Send a response, to acknowledge receipt, so it doesn't keep re-sending.\n return response('Success', 200);\n }", "public function viewAction() {\n if (!Engine_Api::_()->core()->hasSubject('siteevent_organizer'))\n $this->respondWithError('unauthorized');\n\n $showEvents = $this->_getParam('showEvents', 1);\n $profileTabs = $this->_getParam('profileTabs', 1);\n $getInfo = $this->_getParam('getInfo', null);\n\n\n $viewtype = $this->_getParam('viewType', 'upcoming');\n\n //GET EVENT SUBJECT\n $organizer = Engine_Api::_()->core()->getSubject();\n if (empty($organizer)) {\n return $this->respondWithError('no_record');\n }\n $response = $organizer->toArray();\n\n $suffix = '';\n if (strpos($response['web_url'], \"http\") === false)\n $suffix = \"http://\";\n if (isset($response['facebook_url']) && !empty($response['facebook_url']))\n $response['facebook_url'] = 'https://facebook.com/' . $response['facebook_url'];\n if (isset($response['twitter_url']) && !empty($response['twitter_url']))\n $response['twitter_url'] = 'https://twitter.com/' . $response['twitter_url'];\n if (isset($response['web_url']) && !empty($response['web_url']))\n $response['web_url'] = $suffix . $response['web_url'];\n\n $contentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($organizer);\n $response = array_merge($response, $contentImages);\n $response['countOrganizedEvent'] = $organizer->countOrganizedEvent();\n $response['addedBy'] = $organizer->getOwner()->displayname;\n\n if (isset($getInfo) && !empty($getInfo)) {\n $getInfoArray['Added By'] = $response['addedBy'];\n $getInfoArray['Events Hosted '] = $organizer->countOrganizedEvent();\n\n $allowedInfo = Engine_Api::_()->getApi('settings', 'core')->getSetting('siteevent.hostinfo', array('body', 'sociallinks'));\n\n if (in_array('body', $allowedInfo)) {\n if (isset($response['description']) && !empty($response['description']))\n $getInfoArray['Description'] = strip_tags($response['description']);\n }\n\n if (in_array('sociallinks', $allowedInfo)) {\n if (isset($response['facebook_url']) && !empty($response['facebook_url']))\n $getInfoArray['Facebook URL'] = $response['facebook_url'];\n if (isset($response['twitter_url']) && !empty($response['twitter_url']))\n $getInfoArray['Twitter URL'] = $response['twitter_url'];\n if (isset($response['web_url']) && !empty($response['web_url']))\n $getInfoArray['Web URL'] = $response['web_url'];\n }\n\n $ratingEnable = Engine_Api::_()->getApi('settings', 'core')->getSetting('siteevent.reviews', 2);\n if ($ratingEnable) {\n $tempRating = Engine_Api::_()->getDbtable('events', 'siteevent')->avgTotalRating(\n array('host_type' => $organizer->getType(), 'host_id' => $organizer->getIdentity(), 'more_than' => 0));\n\n // Added variable for rating to show rating bar\n if (_CLIENT_TYPE && ((_CLIENT_TYPE == 'ios') && _IOS_VERSION && _IOS_VERSION >= '1.5.3') || (_CLIENT_TYPE == 'android') && _ANDROID_VERSION && _ANDROID_VERSION >= '1.7') {\n if (isset($tempRating) && !empty($tempRating))\n $getInfoArray['total_rating'] = $tempRating;\n } else {\n if (isset($tempRating) && !empty($tempRating))\n $getInfoArray['Total Rating'] = $tempRating;\n }\n }\n\n // Added variable for description to show full description\n if (_CLIENT_TYPE && ((_CLIENT_TYPE == 'ios') && _IOS_VERSION && _IOS_VERSION >= '1.5.3') || (_CLIENT_TYPE == 'android') && _ANDROID_VERSION && _ANDROID_VERSION >= '1.7') {\n if (in_array('body', $allowedInfo)) {\n if (isset($response['description']) && !empty($response['description'])) {\n $getInfoArray['description'] = strip_tags($response['description']);\n if (isset($getInfoArray['Description']) && !empty($getInfoArray['Description']))\n unset($getInfoArray['Description']);\n }\n }\n }\n\n if (isset($getInfoArray) && !empty($getInfoArray))\n $this->respondWithSuccess($getInfoArray, true);\n }\n\n// //GET EVENTS PAGINATOR\n// $paginator = Engine_Api::_()->getDbTable('events', 'siteevent')->getSiteeventsPaginator($values, $customProfileFields);\n// $paginator->setItemCountPerPage($this->getRequestParam(\"limit\", 20));\n// $paginator->setCurrentPageNumber($this->getRequestParam(\"page\", 1));\n//\n// //SET VIEW\n// Engine_Api::_()->getApi('Core', 'siteapi')->setView();\n// $response['canCreate'] = Engine_Api::_()->authorization()->isAllowed('siteevent_event', $viewer, 'create');\n// $response[\"getTotalItemCount\"] = $getTotalItemCount = $paginator->getTotalItemCount();\n//\n//\n// if (isset($showEvents) && !empty($showEvents) && empty($getInfo)) {\n// try {\n// $values['viewType'] = $viewtype;\n// $values['host_type'] = 'siteevent_organizer';\n// $values['host_id'] = $organizer->getIdentity();\n//\n//\n// if (!empty($getTotalItemCount)) {\n// foreach ($paginator as $eventObj) {\n// $event = $eventObj->toArray();\n//\n// // ADD OWNER IMAGES\n// $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($eventObj, true);\n// $event = array_merge($event, $getContentImages);\n// $event[\"owner_title\"] = $eventObj->getOwner()->getTitle();\n//\n// // ADD EVENT IMAGES\n// $getContentImages = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($eventObj);\n// $event = array_merge($event, $getContentImages);\n// $tempResponse[] = $event;\n// }\n// $response['events'] = $tempResponse;\n// }\n// } catch (Exception $e) {\n// \n// }\n// }\n\n\n if (isset($profileTabs) && !empty($profileTabs) && empty($getInfo)) {\n $profileTabsArray[] = array(\n 'name' => 'organizer_info',\n 'label' => $this->translate('Info'),\n 'url' => 'advancedevents/organizer/' . $organizer->getIdentity(),\n 'urlParams' => array(\n 'getInfo' => 1\n )\n );\n\n if ($organizer->countOrganizedEvent() > 0) {\n $profileTabsArray[] = array(\n 'name' => 'organizer_events',\n 'label' => $this->translate('Events'),\n 'url' => 'advancedevents/',\n 'totalItemCount' => $organizer->countOrganizedEvent(),\n 'urlParams' => array(\n 'host_type' => 'siteevent_organizer',\n 'host_id' => $organizer->getIdentity()\n )\n );\n }\n\n $response['profileTabs'] = $profileTabsArray;\n }\n $this->respondWithSuccess($response, true);\n }", "function notifica_post_facebook() {\n\n global $baseUrl, $mysql;\n\n $uname = $_SESSION['username'];\n $facebook = get_fb_instance();\n\n $utenti = mysql_query(\"SELECT fb_uid FROM utenti WHERE fb_uid IS NOT NULL\", $mysql);\n if($utenti)\n while($row = mysql_fetch_assoc($utenti))\n $uids[] = $row['fb_uid'];\n //$uid_string = implode(',', $uids);\n\n $attachment = array(\n 'access_token' => $facebook->getAccessToken(),\n 'name' => 'NewFantaTorneo',\n 'link' => \"$baseUrl\",\n 'caption' => \"Nuovo post di \" . $uname . \" sul wall\",\n 'description' => 'Corri a leggerlo!',\n 'picture' => $baseUrl . 'images/facebook_post_image_message.png',\n 'message' => 'Hai un nuovo messaggio in bacheca!'\n );\n\n foreach($uids as $uid)\n if($uid != $_SESSION['fb_uid'])\n @$facebook->api(\"/\" . $uid . \"/feed\", 'POST', $attachment);\n}", "private function liveevets($postDataArr){\n $access_token = isset($postDataArr['access_token']) ? filter_var($postDataArr['access_token'], FILTER_SANITIZE_STRING) : '';\n $device_type = isset($postDataArr['device_type']) ? filter_var($postDataArr['device_type'], FILTER_SANITIZE_NUMBER_INT) : '';\n if(!empty($access_token)){\n if(!empty($device_type) && $device_type!= 1 && $device_type!= 2){ //1 = ANDROID 2 = IOS\n //INVALID DEVICE TYPE ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('INVALID_ACCESS');\n $this->response($errorMsgArr);\n }\n //VALIDATE ACCESS\n $valid = $this->Api_model->validateAccess($access_token);\n if(isset($valid['STATUS']) && !$valid['STATUS']){\n //ACCESS TOKEN INVALID\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $valid['MESSAGE'];\n $this->response($errorMsgArr);\n }\n //FETCH LISTING\n $liveEvents = $this->Api_model->eventslisting($valid['VALUE']['user_id']);\n //SUCCESS\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = SUCCESS_CODE;\n $errorMsgArr['STATUS'] = TRUE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['VALUE'] = $liveEvents;\n $this->response($errorMsgArr);\n }else{\n //ACCESS TOKEN MISSING ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('ACCESSTOKEN_MISSING');\n $this->response($errorMsgArr);\n }\n \t}", "public function fb()\n\t\t{\n\t\t$facebook = new Facebook(array(\n\t\t 'appId' => $this->config->item('App_ID'),\n\t\t 'secret' => $this->config->item('App_Secret'),\n\t\t 'cookie' => true\n\t\t));\n\t\t\n\t\tif(isset($_GET['logout'])) \n\t\t{\n\t\t\t$url = 'https://www.facebook.com/logout.php?next=' . urlencode('http://demo.phpgang.com/facebook_login_graph_api/') .\n\t\t\t '&access_token='.$_GET['tocken'];\n\t\t\tsession_destroy();\n\t\t\theader('Location: '.$url);\n\t\t}\n\t\tif(isset($_GET['fbTrue']))\n\t\t{\n\t\t\t$token_url = \"https://graph.facebook.com/oauth/access_token?\"\n\t\t\t . \"client_id=\".$this->config->item('App_ID').\"&redirect_uri=\" . urlencode($this->config->item('callback_url'))\n\t\t\t . \"&client_secret=\".$this->config->item('App_Secret').\"&code=\" . $_GET['code']; \n\t\t\n\t\t\t $response = file_get_contents($token_url);\n\t\t\t $params = null;\n\t\t\t parse_str($response, $params);\n\t\t\n\t\t\t $graph_url = \"https://graph.facebook.com/me?access_token=\" \n\t\t\t . $params['access_token'];\n\t\t\n\t\t\t $user = json_decode(file_get_contents($graph_url));\n\t\t\t $extra = \"<a href='index.php?logout=1&tocken=\".$params['access_token'].\"'>Logout</a><br>\"; \n\t\t\t \n\t\t\t// $content = $user;\n\t\t\t $content=array();\n\t\t\t $content['id'] = $user->id;\n\t\t\t $content['email'] = $user->email;\n\t\t\t $content['first_name'] = $user->first_name;\n\t\t\t $content['gender'] = $user->gender;\n\t\t\t $content['last_name'] = $user->last_name;\n\t\t\t $content['locale'] = $user->locale;\n\t\t\t $content['name'] = $user->name;\n\t\t\t $content = $this->session->set_userdata(\"fb_data\",$content);\n\t\t\t \n\t\t}\n\t\telse\n\t\t{\n\t\t\t$content = '<a href=\"https://www.facebook.com/dialog/oauth?client_id='.$this->config->item('App_ID').'&redirect_uri='.$this->config->item('callback_url').'&scope=email,user_likes,publish_stream\"><img src=\"'.base_url().'images/login_facebook.jpg\" alt=\"Sign in with Facebook\"/></a>';\n\t\t}\n\t \n\t\t $data[\"facebook_data\"] = $content;\n\t\t $data[\"item\"] = \"Fb login\";\n\t\t $data[\"master_title\"] = \"Fb login | \".$this->config->item('sitename');\n\t\t $data[\"master_body\"] = \"register\";\n\t\t debug($data);die;\n\t\t $this->load->theme('home_layout',$data);\n\t\t}", "public function actionShowusersactivities()\n\t{\t\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->limit=6;\t\n\t\t$uid = Yii::app()->user->id; //logged in userId\n\t\t$activityArray = array(); //contains, all activities, Like,Dislikes,Become friends etc\n\t\t$str='';\n\t\t$limit = 10;\n\t\t$flag = (isset($_GET['flag']))?$_GET['flag']:'';\n\t\tif(!empty($uid))\n\t\t{\n\t\t\t// ** User Logged IN ***\n\t\t\t//Show Photo Likes activities of Me & friends of Me\t\t\t\n\t\t\t$photolikes=LogPhotosHearts::model()->getActivityWhoLikes($limit,$uid);\t\n\t\t\tif(count($photolikes)>0)\n\t\t\t{\n\t\t\t\tforeach($photolikes as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$uname = ($uid==$v['userid'])?'You':$v['username'];\n\t\t\t\t\t$owner_name = $v['ownername'];\t\t\t\t\t\n\t\t\t\t\t$msg = ' Likes '.$owner_name.'&#39;s photo:';\n\t\t\t\t\t$src=Yii::app()->baseUrl.'/files/'.$v['owner_id'].'/thumbnail/'.$v['photos_name'];\t\t\t\t\n\t\t\t\t\t$file_path = Yii::getPathOfAlias('webroot').'/files/'.$v['owner_id'].'/'.$v['photos_name'];\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tif(!file_exists($file_path)){\n\t\t\t\t\t\t$src=Yii::app()->theme->baseUrl.'/img/noimage.jpg';\n\t\t\t\t\t}\n\t\t\t\t\t$img='<img class=\"img-responsive thumbimg\" alt=\"\" src=\"'.$src.'\" />';\n\t\t\t\t\t$activityArray[$v['hdate']] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\n\t\t\t\t\t\n\t\t\t\t\t//Duplicate Testing\tDUMMY Data .......\n\t\t\t\t\t$img='<img class=\"img-responsive thumbimg\" alt=\"\" src=\"'.Yii::app()->theme->baseUrl.'/img/avatar2.jpg\" />';\n\t\t\t\t\t$activityArray['1410354280'] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\n\t\t\t\t\t$activityArray['1410354380'] = array('avatar'=>$v['useravatar'],'name'=>$uname,'message'=>$msg,'image'=>$img);\t\t\t\t\t\n\t\t\t\t\t//Duplicate Ends\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($photolikes);\n\t\t\t//Now get List of Friends..ie who had recently become your friend\t\t\n\t\t\t$criteria->condition = \"t.user_id='\".$uid.\"' AND t.status=1\";\t\t\t\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' and '.$v['friend']['user_details_firstname'].' '.$v['friend']['user_details_lastname'].' are now friends';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['friend']['user_details_avatar'],'name'=>'you','message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Now get List of Users..ie who had recently Send You Friends Request\t\t\n\t\t\t$criteria->condition = \"t.friend_id='\".$uid.\"' AND t.status=0\";\t\t\t\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' Had Sent You a Friend Request';\n\t\t\t\t\t$avatar = $v['user']['user_details_avatar'];\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$avatar,'name'=>$v['user']['user_details_firstname'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Now get List of Friend's friends..ie your friend who had add another friend\t\t\t\n\t\t\t$friends=UsersFriends::model()->getActivityFriends($limit,$uid);\t\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t//where $[name] is your(loggedIn User) frnd , who also become frnd with $v['ffname']\n\t\t\t\t\t$date1 = $v['date']; \n\t\t\t\t\t$msg = ' and '.$v['ffname'].' are now friends';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['avatar'],'name'=>$v['name'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t\t//Get List of users who started to follow you..\n\t\t\t$followers=UsersFollow::model()->getActivityFollow($limit,$uid);\n\t\t\tif(count($followers)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($followers as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$date1 = $v['date']; \n\t\t\t\t\t$msg = ' is now your follower';\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$v['avatar'],'name'=>$v['name'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\n\t\t\tunset($followers);\n\t\t\t\n\t\t\t//Now get List of Extra Notification of Posly, only for Top-Header DUMMY Data .......\n\t\t\tif($flag==\"header\"){\n\t\t\t\t$msg = 'There is an event to be organised at bangalore, at 1-oct-14, for Fashion ..an fasion event';\n\t\t\t\t$activityArray['1410835502'] = array('avatar'=>'avatar1_small.jpg','name'=>'Posly','message'=>$msg,'image'=>''); \n\t\t\t\t//*Duplicate Testing Data\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// ** User NOT Logged IN ***\n\t\t\t//Show general user Photo Likes activities , as no body has loggedIn\t\t\t\t\t\n\t\t\t$photolikes=LogPhotosHearts::model()->getActivityWhoLikes($limit); \t\t\t\t\t\t\t\n\t\t\tif(count($photolikes)>0)\n\t\t\t{\n\t\t\t\tforeach($photolikes as $k=>$v){\t\t\t\t\t\n\t\t\t\t\t$msg = ' Likes '.$v['ownername'].'&#39;s photo:';\n\t\t\t\t\t$activityArray[$v['hdate']] = array('avatar'=>$v['useravatar'],'name'=>$v['username'],'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($photolikes);\n\t\t\t//Now get List of any user who had recently become friends\n\t\t\t$criteria->condition = \"status=1\";\n\t\t\t$friends=UsersFriends::model()->with('friend','user')->findAll($criteria);\n\t\t\tif(count($friends)>0)\n\t\t\t{\t\t\n\t\t\t\tforeach($friends as $k=>$v)\n\t\t\t\t{\t\n\t\t\t\t\t$user = $v['user']['user_details_firstname'].' '.$v['user']['user_details_lastname'];\n\t\t\t\t\t$date1 = $v['user_friend_created_date'];\n\t\t\t\t\t$msg = ' and '.$v['friend']['user_details_firstname'].' '.$v['friend']['user_details_lastname'].' are now friends';\n\t\t\t\t\t$avatar = $v['user']['user_details_avatar'];\n\t\t\t\t\t$activityArray[$date1] = array('avatar'=>$avatar,'name'=>$user,'message'=>$msg,'image'=>'');\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tunset($friends);\n\t\t}\n\t\t\n\t\t//Now Create the display Activity HTML\t\t\n\t\tif(count($activityArray)>0)\n\t\t{\n\t\t\tkrsort($activityArray); \n\t\t\t//Sort activity Array By Keys -- SORT\t\n\t\t\t$unread_notifycount=0;\n\t\t\t$user_notifyReaddate = (!empty($uid))?Yii::app()->user->getState(\"notify_readdate\"):'0';\t\t\t\n\t\t\tforeach($activityArray as $keys=>$values)\n\t\t\t{\t\t\t\n\t\t\t\t$fromurl=strstr($values['avatar'], '://', true);\n\t\t\t\tif($fromurl=='http' || $fromurl=='https')\n\t\t\t\t\t$avatar = $values['avatar']; \n\t\t\t\telse\n\t\t\t\t$avatar = Yii::app()->baseUrl.'/profiles/'.$values['avatar'];\n\t\t\t\tif($flag==\"header\")\n\t\t\t\t{\n\t\t\t\t\t//This is for Top-Header Notification Display\n\t\t\t\t\t$str.='\n\t\t\t\t\t<li> \n\t\t\t\t\t<a href=\"#\">\n\t\t\t\t\t<div class=\"main\">\n\t\t\t\t\t<span class=\"photo\">\n\t\t\t\t\t<img class=\"avatar-user-l img-responsive\" src=\"'.$avatar.'\" alt=\"\"/>\n\t\t\t\t\t</span>\t\t\t\t\t\n\t\t\t\t\t<div class=\"message\"> \n\t\t\t\t\t\t<span class=\"name\">'.$values['name'].'</span> '.$values['message'].' \n\t\t\t\t\t\t<div class=\"newtime\">'.$this->get_msgtime($keys).'</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</a> \n\t\t\t\t\t</li>\t\t\t\t\n\t\t\t\t\t';\n\t\t\t\t} else{\n\t\t\t\t\t//This for Side-Bar UserActivity/Notification Display\n\t\t\t\t\t$str.='\n\t\t\t\t\t<li class=\"noti-area\"><img class=\"avatar img-responsive\" alt=\"\" src=\"'.$avatar.'\" />\n\t\t\t\t\t<div class=\"message\">\n\t\t\t\t\t<span class=\"notimsg\"><span class=\"name\">'.$values['name'].'</span> '.$values['message'].'</span>'.$values['image'].'\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t</li>\t\t\t\t\t\n\t\t\t\t\t';\n\t\t\t\t}\n\t\t\t\t//Now check For notify Cnt for LoggedIn user\t\t\t\t\n\t\t\t\tif(!empty($uid))\n\t\t\t\t{ //Condition if notify Date in DB is Less then Keys(notifyTimedate), then its an Unread\t\t\n\t\t\t\t\tif($user_notifyReaddate < $keys){\n\t\t\t\t\t\t$unread_notifycount++; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!empty($uid)){\n\t\t\t\t$unread_notifycount = ($unread_notifycount==0)?'':$unread_notifycount;\n\t\t\t\tYii::app()->user->setState('notify_count', $unread_notifycount);\n\t\t\t}\n\t\t}\n\t\tunset($activityArray);\n\t\tif(empty($str)){\n\t\t\t//a Default Dummy status.\n\t\t\t$str='<li class=\"noti-area\"><img class=\"avatar img-responsive\" alt=\"\" src=\"'.Yii::app()->theme->baseUrl.'/img/avatar2.jpg\" />\n\t\t\t<div class=\"message\"> <span class=\"name\">Chanh Ny</span> likes Chi Minh Anh photo. </div>\n\t\t\t</li>';\n\t\t}\t\t\n\t\techo $str;\t\t\n\t\tYii::app()->end();\t\n\t}", "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 }", "function getActivityEvents($userId,$activityId){\n\n $activityData = array();\n $activityImg = base_url().ACTIVITY_IMAGE;\n $defaultActivityImg = base_url().DEFAULT_ACTIVITY_IMAGE;\n $data['offset'] = 0; $data['limit']= 10; \n $where1 = array('ae.status'=>'1','a.status'=>'1','ae.activity_id'=>$activityId);\n $this->db->select('ae.activityEventId,ae.event_title,ae.event_date,ae.event_time,ae.description,ae.location,ae.latitude,ae.longitude,a.fee,a.fee_type,a.max_users,count(DISTINCT aj.activityJoinId) as total_users,count(DISTINCT ac.activityConfirmId) as joined_users,if(ac_me.activityConfirmId IS NULL,0,1) as is_confirm,if(aj1.activityJoinId IS NULL,0,1) as hasJoined,if(aj2.activityJoinId IS NULL,0,1) as hasAffiliatesJoined');\n $this->db->from(ACTIVITY_EVENTS.' as ae');\n $this->db->join(ACTIVITIES.' as a','ae.activity_id = a.activityId'); \n $this->db->join(ACTIVITY_JOIN.' as aj','a.activityId = aj.activity_id','left');\n $this->db->join(ACTIVITY_CONFIRM.' as ac','ae.activityEventId = ac.activity_event_id','left');\n $this->db->join(ACTIVITY_CONFIRM.' as ac_me','ae.activityEventId = ac_me.activity_event_id AND ac_me.user_id = \"'.$userId.'\"','left');\n $this->db->join(ACTIVITY_JOIN.' as aj1','a.activityId = aj1.activity_id AND aj1.user_id = \"'.$userId.'\"','left');\n $this->db->join(ACTIVITY_JOIN.' as aj2','a.activityId = aj2.activity_id AND aj2.user_id = \"'.$userId.'\" AND aj2.affiliate_id != 0','left');\n $this->db->where($where1);\n $this->db->group_by('ae.activityEventId');\n $this->db->order_by(\"ae.event_date asc,ae.event_time asc\");\n $this->db->limit($data['limit'],$data['offset']);\n $query = $this->db->get();\n if($query->num_rows() >0){\n $activityData = $query->result();\n }\n return $activityData;\n\n }", "function send($accessToken, $jsonData){\n // https://graph.facebook.com/v2.6/me/messages?access_token=<PAGE_ACCESS_TOKEN>\n $url = \"https://graph.facebook.com/v2.6/me/messages?access_token=\".$accessToken;\n $ch =curl_init($url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);\n curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, True);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, False);\n// if(!empty($input[\"entry\"][0][\"messaging\"][0][\"message\"])) {\n curl_exec($ch);\n\n $errors = curl_error($ch);\n $dataCourseponse = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\n var_dump($errors);\n var_dump($dataCourseponse);\n\n curl_close($ch);\n// }\n\n }", "public function addActivity($data);", "function grab_video_facebook($fb_user_id, $access_token_offline_access) {\n\n require_once(getcwd() . \"/core/Facebook/facebook.php\");\n\n $facebook = new Facebook(array(\n 'appId' => fb_application_id,\n 'secret' => fb_secret_key,\n 'cookie' => true,\n ));\n\n\n //$access_token_offline_access = 'CAADMmgmTET8BAEc3DVi7NBMx0x2tn1jZAX7KGZB4UxEqEZCo0ExgMPLQZA1NOzGha7le2ZALZAekZADQKKXaZAxjRrCA57AjytL11DLolRJQB8ayDVm96yhWwccLgUAaK8pWMHlPwuMo9zfAoHH3PzTyKQ4U5ZASbDoVywzZBcCqMv35bPMNaQuRUH'; //works\n $response = $facebook->api(\n\t\t\t\t'/' . $fb_user_id . '/videos/uploaded/?fields=id,name,embed_html,created_time', 'GET', array(\n\t\t\t\t'access_token' => $access_token_offline_access,\n )\n );\n\n\n \n\t\t$data = array();\n\t\t$i = 0;\n\t\t$start = 1;\n\n\n\t\tforeach ($response['data'] as $value) {\n\t\t\t$data[$i]['index'] = 1;\n\t\t\t$data[$i]['video_id'] = $value['id'];\n\n\t\t\tif (isset($value['name'])) {\n\t\t\t\t$data[$i]['title'] = $value['name'];\n\t\t\t}else{\n\t\t\t\t$data[$i]['title'] = 'Not title';\n\t\t\t}\n\t\t \n\t\t\t$data[$i]['duration'] = 'Unknown';\n\t\t\t$data[$i]['video_source'] = 'Facebook';\n\t\t\t$i++;\n\t\t\t$start++;\n\t\t}\n\n return $data;\n\t\n}", "function getChatUpdate(){\r\n\t\t$state = $_POST['state'];\r\n\t\t$file = $_POST['file'];\r\n\r\n\t\t//get the json encoded data from this function\r\n\t\t$dataChatUpdate = sendChatUpdate($state, $file);\r\n\r\n\t\t//echo back to the calling domain with jsone encoded data\r\n\t\techo $dataChatUpdate;\r\n\r\n\t}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $data_source;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($data_source)) {\n $this->data_source=$data_source;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n}", "public function handleFacebookCallback()\n {\n $user = Socialite::driver('facebook')->user();\n\n // $user->token;\n }", "public function handleDashletData($args = array()) {\n $activity_type = isset($args['activity_type']) ? $args['activity_type'] : '';\n if($activity_type == 'subscriber') {\n //Return subscriber activities in Leads, Contacts or Prospect dashlets\n $list_id = $args['list_id'];\n $subscriber_hash = $args['subscriber_hash'];\n $result = $this->list->memberActivity($list_id, $subscriber_hash);\n if($result) {\n $count = $result['total_items'];\n if($count > 0) {\n $activities = $result['activity'];\n foreach($activities as $key => $value) {\n $camaign_id = $value['campaign_id'];\n $response = $this->campaign->getEepURL($camaign_id);\n if($response) {\n $activities[$key]['eepurl'] = $response['eepurl'];\n }\n }\n return $activities;\n }\n }\n } else if($activity_type == 'campaign') {\n //Return mailchimp campaign report on Home dashlet\n $campaign_id = $args['campaign_id'];\n $result = $this->campaign->campaignReport($campaign_id);\n if($result) {\n $count = 0;\n $res = $this->list->getList($result['list_id'], array(\"stats.member_count\"));\n if($res) {\n $count = $res['stats']['member_count'];\n }\n $result['recipient_count'] = $count;\n return $result;\n }\n } else if($activity_type == 'campaign-list') {\n //Return mailchimp campaign list on Home dashlet\n return $this->getMailChimpCampaigns();\n } else if($activity_type == 'targetlist') {\n $list_id = $args['list_id'];\n $result = $this->list->getList($list_id, $this->default['list_fields']);\n if($result) {\n return $result;\n }\n } else if($activity_type == 'mailchimp-lists') {\n //Return mailchimp list in Leads, Contacts or Prospect dashlets\n $response_data = array();\n $list_ids = $args['list_ids'];\n if(!empty($list_ids) && is_array($list_ids) && count($list_ids) > 0) {\n foreach($list_ids as $list_id) {\n $listConfig = !is_array($this->settings['mailchimp_'.$list_id]) ? json_decode($this->settings['mailchimp_'.$list_id]) : (object) $this->settings['mailchimp_'.$list_id];\n if(!empty($listConfig)) {\n $response_data[$list_id] = $listConfig->mailchimp_list_name;\n }\n }\n }\n return $response_data;\n }\n return false;\n }", "private function followCallback($event)\n {\n $res = $this->bot->getProfile($event['source']['userId']);\n if ($res->isSucceeded())\n {\n $profile = $res->getJSONDecodedBody();\n // create welcome message\n $message = \"Assalamualaikum Wr.Wb, \" . $profile['displayName'] . \"!\\n\";\n $message .= \"Jobot merupakan chatbot line yang membantu anda mempersiapkan diri menghadapi Ujian Nasional Biologi \";\n $message .= \"Silakan kirim pesan \\\"ayok\\\" untuk memulai latihan.\";\n $textMessageBuilder = new TextMessageBuilder($message);\n // create sticker message\n $stickerMessageBuilder = new StickerMessageBuilder(1, 2);\n // merge all message\n $multiMessageBuilder = new MultiMessageBuilder();\n $multiMessageBuilder->add($textMessageBuilder);\n $multiMessageBuilder->add($stickerMessageBuilder);\n // send reply message\n $this->bot->replyMessage($event['replyToken'], $multiMessageBuilder);\n // save user data\n $this->latihan_un->saveUser($profile);\n }\n }", "function getParams() {\r\n global $id;\r\n global $mode;\r\n global $view_mode;\r\n global $edit_mode;\r\n global $data_source;\r\n global $tab;\r\n if (isset($id)) {\r\n $this->id=$id;\r\n }\r\n if (isset($mode)) {\r\n $this->mode=$mode;\r\n }\r\n if (isset($view_mode)) {\r\n $this->view_mode=$view_mode;\r\n }\r\n if (isset($edit_mode)) {\r\n $this->edit_mode=$edit_mode;\r\n }\r\n if (isset($data_source)) {\r\n $this->data_source=$data_source;\r\n }\r\n if (isset($tab)) {\r\n $this->tab=$tab;\r\n }\r\n}", "function myActivityList($userId,$data){\n\n $activityData = array();\n $activityImg = base_url().ACTIVITY_IMAGE;\n $defaultActivityImg = base_url().DEFAULT_ACTIVITY_IMAGE;\n if(empty($data['limit']) && empty($data['offset'])){\n $data['offset'] = 0; $data['limit']= 5; \n }\n $where = array('c.status'=>'1','cc.status'=>'1','a.status'=>'1','a.creator_id'=>$userId);\n \n $this->db->select('IF(a.image IS NULL or a.image = \"\",\"'.$defaultActivityImg.'\",concat(\"'.$activityImg.'\",a.image)) as image,a.name as activityName,a.is_hide,a.activityId,c.club_name');\n $this->db->from(ACTIVITIES.' as a'); \n $this->db->join(CLUBS.' as c','a.club_id = c.clubId');\n $this->db->join(CLUB_CATEGORY.' as cc','c.club_category_id = cc.clubCategoryId'); \n $this->db->join(ACTIVITY_EVENTS.' as ae','a.activityId = ae.activity_id AND ae.status = \"1\"','left');\n \n $this->db->where($where);\n $this->db->group_by('a.activityId');\n $this->db->order_by(\"a.activityId desc\");\n $this->db->limit($data['limit'],$data['offset']);\n $query = $this->db->get();\n if($query->num_rows() >0){\n $activityData = $query->result();\n foreach ($activityData as $key => $value) {\n $activityId = $value->activityId;\n $activityData[$key]->events = $this->getActivityEvents($userId,$activityId);\n }\n }\n return $activityData;\n }", "function handle_fb_login() {\n\t\t$this->load->library('facebook');\n\n\t\tif(!$this->facebook->is_authenticated()){\n\t\t\tredirect('user/login');\n\t\t}\n\n\t\t$oFbUserData = (object) $this->facebook->request('get', '/me?fields=id,email,first_name,middle_name,last_name,gender,birthday,age_range');\n\n\t\tif(!isset($oFbUserData->email) || (isset($oFbUserData->email) && '' != $oFbUserData->email)){\n\t\t\tsf('error_message', \"You hav'nt allowed email permission on facebook.\");\n\t\t}\n\n\n//\t\t$user_profile = $this->facebook->api('/me');\n\n\t\t//p('AFTER');\n\n\t\t//$oFbUserData = (object)$user_profile;\n\n\t\tif($oSystemUserData = $this->user_model->getUserBy('facebook_id', $oFbUserData->id)){\n\n\t\t\tif($oSystemUserData->status == $this->aUserStatus['closed']){\n\n\t\t\t\t//reactivate the account\n\t\t\t\t$this->account_model->activateAccount($oSystemUserData->id);\n\t\t\t\tsf('success_message', 'Good To have you back!!');\n\n\t\t\t} elseif($oSystemUserData->status == $this->aUserStatus['blocked']){\n\n\t\t\t\t\tsf('error_message', \"Your account is blocked. \\nPlease use the Contact Us page to contact the Administrator\");\n\t\t\t\t\tredirect('home');\n\n\t\t\t}\n\n\t\t\t//proceed with login\n\t\t\tif($this->authentication->makeLogin($oSystemUserData->facebook_id, 'facebook_id')){\n\t\t\t\tredirect('home');\n\t\t\t} else {\n\t\t\t\tsf('error_message', 'There was some problem. Could not log you in.');\n\t\t\t\tredirect('home');\n\t\t\t}\n\n\t\t} else {\n\t\t\t\t//consider this as a first time login\n\t\t\t\t//proceed with registration, mail sending, and login\n\t\t\t\tif(!$oSystemUserData = $this->user_model->getUserBy('email_id', $oFbUserData->email)) {\n\n\t\t\t\t\t$this->load->helper('custom_upload');\n\t\t\t \t$sUrl = getFbImage((object)array('facebook_id' => $oFbUserData->id), array('type'=>'large'), false);\n\t\t\t \t$aImageData = urlUpload('image', 'profile_pic', $sUrl);\n\n\t\t\t\t\t//registration\n\t\t\t\t\t$aUserData['facebook_id'] \t= $oFbUserData->id;\n\t\t\t\t\t$aUserData['email_id'] \t\t= $oFbUserData->email;\n\t\t\t\t\t$aUserData['account_no'] \t= $this->authentication->generateAccountNumber();\n\t\t\t\t\t$aUserData['type'] \t\t\t= $this->aUserTypes['user'];\n\t\t\t\t\t$aUserData['status'] \t\t= $this->aUserStatus['active'];\n\t\t\t\t\t$aUserData['joined_on'] \t= date('Y-m-d');\n\t\t\t\t\t$aUserData['first_name'] \t= isset($oFbUserData->first_name) ? $oFbUserData->first_name : '';\n\t\t\t\t\t$aUserData['middle_name'] \t= isset($oFbUserData->middle_name) ? $oFbUserData->middle_name : '';\n\t\t\t\t\t$aUserData['last_name'] \t= isset($oFbUserData->last_name) ? $oFbUserData->last_name : '';\n\t\t\t\t\t$aUserData['gender'] \t\t= $this->aGenders[$oFbUserData->gender];\n\t\t\t\t\t$aUserData['profile_image'] = $aImageData['file_name'];\n\n\t\t\t\t\tif(isset($oFbUserData->birthday) && '' != $oFbUserData->birthday){\n\t\t\t\t\t\t$aBirthday \t= explode('/', $oFbUserData->birthday); // mm/dd/yyyy\n\t\t\t\t\t\t$aUserData['birthday'] \t\t= $aBirthday[2].'-'.$aBirthday[0].'-'.$aBirthday[1];\n\t\t\t\t\t}\n\t\t\t\t\t$this->db->set ($aUserData);\n\t\t\t \t$this->db->insert ('users');\n\n\t\t\t \t$iUserId = $this->db->insert_id();\n\n\n\t\t\t \t//Login\n\t\t\t \t$this->authentication->makeLogin($oFbUserData->id, 'facebook_id');\n\n\t\t\t \t$this->account_model->activateAccount($iUserId);\n\n//\t\t\t \tupdate the profile pictures page\n//\t\t\t \t$aUploadType = c('profile_pic_upload_type');\n//\t\t\t \t$aProfilePicData = array(\n//\t\t\t \t\t'user_id' => $iUserId,\n//\t\t\t \t\t'current_pic' => $aUploadType['facebook'],\n//\t\t\t \t\t'facebook' => $aImageData['file_name'],\n//\t\t\t \t);\n\n\n\t\t\t\t\t/*$this->load->model('maintenance_model');\n\t\t\t\t\t$this->maintenance_model->getSingleSetting('db_welcome_msg');\n\t\t\t \t$aWelcomeEmail['receiver_name'] = $aUserData['first_name'];\n\t\t\t \t$aWelcomeEmail['welcome_text'] \t= $this->maintenance_model->getSingleSetting('db_signup_welcome_msg');\n\t\t\t\t\t*/\n\t\t\t\t\t$aSettings = array(\n\t\t\t\t\t\t'to' \t\t\t\t=> array($oFbUserData->email=>$aUserData['first_name']), // email_id => name pairs\n\t\t\t\t\t\t'from_email' \t\t=> c('accounts_email_id'),\n\t\t\t\t\t\t'from_name'\t\t\t=> c('accounts_email_from'),\n\t\t\t\t\t\t'reply_to' \t\t\t=> array(c('accounts_email_id') => c('accounts_email_from')), // email_id => name pairs\n\t\t\t\t\t\t'email_contents' \t=> $aWelcomeEmail, // placeholder keywords to be replaced with this data\n\t\t\t\t\t\t'template_name' \t=> 'welcome', //name of template to be used\n\t\t\t\t\t\t//'preview'\t\t\t=> true\n\t\t\t\t\t);\n\n\t\t\t\t\t//p(sendMail_PHPMailer($aSettings));exit;\n\t\t\t\t\t$this->load->helper('custom_mail');\n\t\t\t\t\tsendMail_PHPMailer($aSettings);\n\n\t\t\t\t\t$this->session->set_flashdata ('success_message', 'Welcome to '.$this->mcontents['c_website_title']);\n\n\t\t\t \tredirect('home');\n\n\t\t\t\t} else {\n\t\t\t\t\techo '3';exit;\n\t\t\t\t\tsf('error_message', 'We already have an account associated with the email id '.$oFbUserData->email);\n\t\t\t\t\tredirect('home');\n\t\t\t\t}\n\t\t\t\t//$aFBUserData['facebook_id'] =\n\t\t}\n\n\t}", "public function __construct() {\n\t\t\t\n\t\t\tif ( isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'GET' ) {\n\t\t\t\t$this->Params = $_GET;\n\t\t\t\t$this->Method = 'get';\n\t\t\t}\n\t\t\telseif ( isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST' ) {\n\t\t\t\t$this->Params = $_POST + $_GET;\n\t\t\t\tif ( @count($_POST) > 0 ) {\n\t\t\t\t\t$this->Method = 'post';\n\t\t\t\t\t// Support for you know what.\n\t\t\t\t\tif ( $this->Params['signed_request'] && $_SERVER['HTTP_ORIGIN'] ) {\n\t\t\t\t\t\t$this->Facebook = TRUE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->Params = array();\n\t\t\t}\n\t\t\t\n\t\t\tif ( isset($this->Params['num']) ) {\n\t\t\t\tif ( $this->Params['num'] > 0 && $this->Params['num'] <= 100 ) {\n\t\t\t\t\t$this->Params['num'] = $this->fetchParam('num',validnum);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->Params['num'] = 10;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->Params['num'] = 10;\n\t\t\t}\n\t\t\t\n\t\t\tif ( isset($this->Params['start']) ) {\n\t\t\t\t// This is a pagination protection step\n\t\t\t\tif ( $this->Params['start'] > 0 && ($this->Params['start'] + $this->Params['num'] ) <= 1000 ) {\n\t\t\t\t\t$this->Params['start'] = $this->fetchParam('start',validstart);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->Params['start'] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->Params['start'] = 0;\n\t\t\t}\n\t\t\t\n\t\t\tdefine ('validint','int');\n\t\t\tdefine ('validstring','string');\n\t\t\tdefine ('validlongtext','string');\n\t\t\tdefine ('validgeo','point');\n\t\t\tdefine ('validdouble','double');\n\t\t\t\n\t\t\t// Detect the auth password\n\t\t\tif ( isset($_SERVER['PHP_AUTH_USER']) ) {\n\t\t\t\t$this->_Service['authn']['http']['username'] = $_SERVER['PHP_AUTH_USER'];\n\t\t\t\tif ( isset($_SERVER['PHP_AUTH_PW']) ) {\n\t\t\t\t\t$this->_Service['authn']['http']['password'] = $_SERVER['PHP_AUTH_PW'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Dropping this down to capture at the end of all runs\n\t\t\tif ( is_array($this->Params) && @count($Params) > 0 ) {\n\t\t\t\tforeach(array_keys($this->Params) as $theParam) {\n\t\t\t\t\tif ( is_numeric($this->Params[$theParam]) ) {\n\t\t\t\t\t\t$this->intParams[] = $this->Params[$theParam];\n\t\t\t\t\t}\n\t\t\t\t\telseif ( is_string($this->Params[$theParam]) ) {\n\t\t\t\t\t\t$this->strParams[] = $this->Params[$theParam];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}", "public function process()\n {\n // get parameters\n $sM = $this->request()->get('m');\n $sModule = $this->request()->get('module');\n $sName = $this->request()->get('name');\n $sMatchType = $this->request()->get('match_type');\n $sMatchID = trim($this->request()->get('match_id'), '/');\n $sMatchName = $this->request()->get('match_name');\n\n // init\n $oUser = Phpfox::getService('user');\n $oProfilePopup = Phpfox::getService('profilepopup');\n $iNumberOfMutualFriend = intval(Phpfox::getParam('profilepopup.number_of_mutual_friend'));\n $iNumberOfMutualFriend = $iNumberOfMutualFriend < 0 ? 0 : $iNumberOfMutualFriend;\n\n $aUser = $oProfilePopup->getByUserName($sMatchName);\n\n $iIsUser = 1;\n if (isset($aUser['user_id']) === false)\n {\n $this->template()->assign(array(\n 'iIsUser' => $iIsUser\n )\n );\n\n return;\n }\n\n $bIsPage = ($aUser['profile_page_id'] > 0 ? true : false);\n if ($bIsPage)\n {\n $aUser['page'] = Phpfox::getService('pages')->getPage($aUser['profile_page_id']);\n }\n\n // check view profile permission\n $aFriend = $oProfilePopup->getFriendByUserIDAndFriendID(intval(Phpfox::getUserId()), intval($aUser['user_id']));\n if (\n (Phpfox::getService('user.block')->isBlocked($aUser['user_id'], Phpfox::getUserId()) && !Phpfox::getUserParam('user.can_override_user_privacy'))\n || (\n ((Phpfox::isModule('friend') && Phpfox::getParam('friend.friends_only_profile')) )\n && empty($aUser['is_friend'])\n && !Phpfox::getUserParam('user.can_override_user_privacy')\n && $aUser['user_id'] != Phpfox::getUserId()\n )\n || (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'profile.view_profile'))\n )\n {\n $this->template()->assign(array(\n 'iIsCanViewProfile' => 0,\n 'bIsPage' => $bIsPage,\n 'iIsUser' => $iIsUser,\n 'aFriend' => $aFriend,\n 'aUser' => $aUser\n )\n );\n\n return;\n }\n\n // check basic information viewing permission\n $iIsCanViewBasicInfo = 1;\n if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'profile.basic_info'))\n {\n $iIsCanViewBasicInfo = 0;\n }\n $iIsCanViewProfileInfo = 1;\n if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'profile.profile_info'))\n {\n $iIsCanViewProfileInfo = 0;\n }\n $iIsCanViewMutualFriends = 1;\n if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'profile.view_friend'))\n {\n $iIsCanViewMutualFriends = 0;\n }\n $iIsCanViewLocation = 1;\n if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'friend.view_location'))\n {\n $iIsCanViewLocation = 0;\n }\n\n $aUser['birthday_time_stamp'] = $aUser['birthday'];\n $aUser['birthday'] = $oUser->age($aUser['birthday']);\n $aUser['gender_name'] = $oUser->gender($aUser['gender']);\n $aUser['birthdate_display'] = $oUser->getProfileBirthDate($aUser);\n $aUser['location'] = Phpfox::getPhraseT(Phpfox::getService('core.country')->getCountry($aUser['country_iso']), 'country');\n if (isset($aUser['country_child_id']) && $aUser['country_child_id'] > 0)\n {\n $aUser['location_child'] = Phpfox::getService('core.country')->getChild($aUser['country_child_id']);\n }\n\n $aUser['is_friend'] = false;\n $iTotal = 0;\n $aMutual = array();\n if ($aUser['user_id'] != Phpfox::getUserId() && !$bIsPage)\n {\n if (Phpfox::isUser())\n {\n $aUser['is_friend'] = Phpfox::getService('friend')->isFriend(Phpfox::getUserId(), $aUser['user_id']);\n if (!$aUser['is_friend'])\n {\n $aUser['is_friend'] = (Phpfox::getService('friend.request')->isRequested(Phpfox::getUserId(), $aUser['user_id']) ? 2 : false);\n }\n }\n\n list($iTotal, $aMutual) = Phpfox::getService('friend')->getMutualFriends($aUser['user_id'], $iNumberOfMutualFriend);\n }\n\n $bShowBDayInput = false;\n if (!empty($aUser['birthday']))\n {\n $iDays = Phpfox::getLib('date')->daysToDate($aUser['birthday'], null, false);\n } else\n {\n $iDays = 999;\n }\n\n if ($iDays < 1 && $iDays > 0)\n {\n $bShowBDayInput = true;\n }\n (($sPlugin = Phpfox_Plugin::get('profilepopup.component_block_popup_1')) ? eval($sPlugin) : false);\n\n // get latest status\n $aAllItems = $oProfilePopup->getAllItems();\n $aDataUserCustomField = $oProfilePopup->getDataUserCustomFieldByUserID(intval($aUser['user_id']));\n $aDataUserCutomFieldMutipleValue = $oProfilePopup->getDataUserCutomFieldMutipleValueByUserID(intval($aUser['user_id']));\n $iLen = count($aAllItems);\n\t\t\t\t$showCoverPhoto = false;\n\n for ($idx = 0; $idx < $iLen; $idx++)\n {\n \t// check show cover photo\n \tif($aAllItems[$idx]['name'] == 'cover_photo' && $aAllItems[$idx]['is_display'] == 1){\n \t\t$showCoverPhoto = true;\n \t}\n // language name\n $aAllItems[$idx]['lang_name'] = '';\n if (intval($aAllItems[$idx]['is_custom_field']) == 1)\n {\n if(Phpfox::getLib('locale')->isPhrase($aAllItems[$idx]['phrase_var_name'])){\n $aAllItems[$idx]['lang_name'] = Phpfox::getPhrase($aAllItems[$idx]['phrase_var_name']);\n } else {\n $aAllItems[$idx]['is_display'] = 0;\n } \n } else\n {\n $aAllItems[$idx]['lang_name'] = Phpfox::getPhrase('profilepopup.' . $aAllItems[$idx]['phrase_var_name']);\n }\n\n // custom field with content\n $aAllItems[$idx]['cf_content'] = '';\n if (isset($aDataUserCustomField['cf_' . $aAllItems[$idx]['name']]) === true)\n {\n $aAllItems[$idx]['cf_content'] = $aDataUserCustomField['cf_' . $aAllItems[$idx]['name']];\n }\n\n // custom field with mutiple value\n foreach ($aDataUserCutomFieldMutipleValue as $iKey => $sVal)\n {\n if ($aAllItems[$idx]['name'] == $sVal['field_name'])\n {\n $aAllItems[$idx]['cf_content'] .= Phpfox::getPhrase($sVal['phrase_var_name']) . ', ';\n //break;\n }\n }\n\t\t\t\t\t\t$aAllItems[$idx]['cf_content'] = rtrim($aAllItems[$idx]['cf_content'], \", \");\n }\n\n $aStatus = $oProfilePopup->getLatestStatusByUserID(intval($aUser['user_id']));\n\n $aRelationshipStatus = $oProfilePopup->getRelationshipStatusByUserID(intval($aUser['user_id']));\n if (isset($aRelationshipStatus) && is_array($aRelationshipStatus) === true && count($aRelationshipStatus) > 0)\n {\n $aRelationshipStatus['lang_name'] = Phpfox::getPhrase($aRelationshipStatus['phrase_var_name']);\n } else\n {\n $aRelationshipStatus = array();\n }\n\n $iShorten = intval(Phpfox::getParam('profilepopup.profilepopup_length_in_index'));\n $sShowMutualFriend = Phpfox::getParam('profilepopup.show_mutual_friend') ? '1' : '0';\n\n // update firstname and lastname\n if (Phpfox::getParam('user.split_full_name') && empty($aUser['first_name']) && empty($aUser['last_name']))\n {\n preg_match('/(.*) (.*)/', $aUser['full_name'], $aNameMatches);\n if (isset($aNameMatches[1]) && isset($aNameMatches[2]))\n {\n $aUser['first_name'] = $aNameMatches[1];\n $aUser['last_name'] = $aNameMatches[2];\n } else\n {\n $aUser['first_name'] = $aUser['full_name'];\n }\n }\n\n // integrate with Fox Favorite\n if (Phpfox::isModule('foxfavorite') && Phpfox::isUser())\n {\n $sFFModule = 'profile';\n $iFFItemId = $aUser['user_name'];\n $iFFUserId = $aUser['user_id'];\n\n $bFFPass = true;\n if (!Phpfox::getService('foxfavorite')->isAvailModule($sFFModule)\n || $iFFUserId == Phpfox::getUserId()\n || empty($iFFUserId)\n || (Phpfox::getUserBy('view_id') != 0))\n {\n $bFFPass = false;\n }\n\n if ($bFFPass === true)\n {\n $bFFIsAlreadyFavorite = Phpfox::getService('foxfavorite')->isAlreadyFavorite($sFFModule, $iFFItemId);\n $this->template()->assign(array(\n 'bFFIsAlreadyFavorite' => $bFFIsAlreadyFavorite,\n 'sFFModule' => $sFFModule,\n 'iFFItemId' => $iFFItemId\n )\n );\n }\n }\n\n\t\t\t\t// Resume Module\n\t\t\t\tif($oProfilePopup->canViewResumeByUserID(intval(Phpfox::getUserId()), $aUser['user_id']) == true){\n\t\t\t\t\t$aResumeItems = $oProfilePopup->getItemsByModule(1, 'user', 'resume');\n\t\t\t\t\t$iResumeLen = count($aResumeItems);\n\t\t\t\t\t$oneItemResumeIsDisplay = '0';\n\t\t\t\t\t$aResume = $oProfilePopup->getPublishedResumeByUserID($aUser['user_id']);\n\t\t\t\t\t$iResumeId = $aResume['resume_id'];\n\t\t\t\t\t$aResume = Phpfox::getService(\"resume.basic\")->getBasicInfo($iResumeId);\n\t\t\t\t\t\n\t\t\t\t\tfor ($idx = 0; $idx < $iResumeLen; $idx++){\n\t\t\t\t\t\tif($aResumeItems[$idx]['is_display'] == 1){\n\t\t\t\t\t\t\t$oneItemResumeIsDisplay = '1';\n\t\t\t\t\t\t}\n // language name\n $aResumeItems[$idx]['lang_name'] = '';\n if (intval($aResumeItems[$idx]['is_custom_field']) == 1)\n {\n if(Phpfox::getLib('locale')->isPhrase($aResumeItems[$idx]['phrase_var_name'])){\n $aResumeItems[$idx]['lang_name'] = Phpfox::getPhrase($aResumeItems[$idx]['phrase_var_name']);\n } else {\n $aResumeItems[$idx]['is_display'] = 0;\n } \n \n } else\n {\n $aResumeItems[$idx]['lang_name'] = Phpfox::getPhrase('profilepopup.' . $aResumeItems[$idx]['phrase_var_name']);\n }\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$aCurrentWork = Phpfox::getService('resume.experience')->getCurrentWork($iResumeId);\n\t\t\t\t\t$aResume['level_name'] = Phpfox::getService('resume.level')->getLevelById($aResume['level_id']);\n\t\t\t\t\t$aLatestEducation = Phpfox::getService('resume.education')->getLatestEducation($iResumeId);\n\t\t\t\t\t$aCats = Phpfox::getService('resume.category')->getCatNameList($iResumeId);\n\t\t\t\t\t$catPlainText = '';\n\t\t\t\t\tforeach($aCats as $k => $v){\n\t\t\t\t\t\tif($k == 0){\n\t\t\t\t\t\t\t$catPlainText .= $v['name']; \t\t\t\t\t\t\t\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$catPlainText .= ' | ' . $v['name'];\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t $this->template()->assign(array(\n\t 'canViewResume' => '1',\n\t 'aResumeItems' => $aResumeItems,\n\t 'oneItemResumeIsDisplay' => $oneItemResumeIsDisplay,\n\t 'aResume' => $aResume,\n\t 'aCurrentWork' => $aCurrentWork,\n\t 'aLatestEducation' => $aLatestEducation,\n\t 'aCats' => $aCats,\n\t 'catPlainText' => $catPlainText,\n\t )\n\t );\n\t\t\t\t} else {\n\t $this->template()->assign(array(\n\t 'canViewResume' => '0'\n\t )\n\t );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//\tget cover photo\n\t\t\t\tif(Phpfox::isModule('photo') && isset($aUser['cover_photo']) && $showCoverPhoto == true)\n\t\t\t\t{\n\t\t\t\t\t$aCoverPhoto = Phpfox::getService('photo')->getCoverPhoto($aUser['cover_photo']);\n\t\t\t\t\tif (!isset($aCoverPhoto['photo_id']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$aCoverPhoto = null;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'profile.view_profile'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$aCoverPhoto = null;\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(null != $aCoverPhoto)\n\t\t\t\t\t{\n\t\t $this->template()->assign(array(\n\t\t 'aCoverPhoto' => $aCoverPhoto\n\t\t )\n\t \t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//\tcheck online\n\t\t\t\t$foCnt = 0;\n\t\t\t\t$foFriends = array();\n\t\t\t\t$iTotalFriendsOnline = 1;\n\t\t\t\tlist($foCnt, $foFriends) = Phpfox::getService('friend')->get('friend.friend_user_id = ' . $aUser['user_id'] . ' AND friend.is_page = 0 AND friend.user_id = ' . Phpfox::getUserId(), 'ls.last_activity DESC', 0, $iTotalFriendsOnline, true, false, true);\n\t\t\t\tif($foCnt > 0){\n\t\t\t\t\t$aUser['is_online'] = 1;\n\t\t\t\t}\n\t\t\t\t\n $this->template()->assign(array(\n 'bIsPage' => $bIsPage,\n 'iIsUser' => $iIsUser,\n 'iIsCanViewProfile' => 1,\n 'iIsCanViewBasicInfo' => $iIsCanViewBasicInfo,\n 'iIsCanViewProfileInfo' => $iIsCanViewProfileInfo,\n 'iIsCanViewMutualFriends' => $iIsCanViewMutualFriends,\n 'iIsCanViewLocation' => $iIsCanViewLocation,\n 'iIsUser' => 1,\n 'aUser' => $aUser,\n 'aAllItems' => $aAllItems,\n 'aStatus' => $aStatus,\n 'aRelationshipStatus' => $aRelationshipStatus,\n 'aFriend' => $aFriend,\n 'iShorten' => $iShorten,\n 'sShowMutualFriend' => $sShowMutualFriend,\n 'iNumberOfMutualFriend' => $iNumberOfMutualFriend,\n 'iMutualTotal' => $iTotal,\n 'aMutualFriends' => $aMutual,\n 'bEnableCachePopup' => Phpfox::getParam('profilepopup.enable_cache_popup'),\n 'bShowBDay' => $bShowBDayInput\n )\n );\n }", "function get_activity_meta( $activity_id, $activity_type ) {\r\n\r\n\t\t// Init Data.\r\n\t\t$data = array();\r\n\r\n\t\tswitch ( $activity_type ) {\r\n\r\n\t\t\tcase 'activity_quote':\r\n\t\t\t\t// Get Quote Data.\r\n\t\t\t\t$data['quote_text'] = bp_activity_get_meta( $activity_id, 'yz-quote-text' );\r\n\t\t\t\t$data['quote_owner'] = bp_activity_get_meta( $activity_id, 'yz-quote-owner' );\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t\t// Get Link Data.\r\n\t\t\tcase 'activity_link':\r\n\t\t\t\t$data['link_url'] = bp_activity_get_meta( $activity_id, 'yz-link-url' );\r\n\t\t\t\t$data['link_title'] = bp_activity_get_meta( $activity_id, 'yz-link-title' );\r\n\t\t\t\t$data['link_desc'] = bp_activity_get_meta( $activity_id, 'yz-link-desc' );\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\t\t// Get Giphy Data.\r\n\t\t\tcase 'activity_giphy':\r\n\t\t\t\t$data['giphy_image'] = bp_activity_get_meta( $activity_id, 'giphy_image' );\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\treturn apply_filters( 'yz_get_edit_activity_content_by_type', $data, $activity_type, $activity_id );\r\n\t}", "public function facebook_settings_on_save_post(){\n global $wpdb;\n if ( \n ! isset($_POST['aios_facebook_publish']) \n || ! wp_verify_nonce( $_POST['aios_facebook_publish'], 'aios_facebook_publish_action' ) \n ) return false;\n\n if(isset($_POST['fb_custom_title']) && !empty($_POST['fb_custom_title'])){\n CsQuery::Cs_Update_Postmeta($_POST['post_ID'], 'aios_fb_custom_title', sanitize_text_field($_POST['fb_custom_title']));\n }\n \n if(isset($_POST['fb_custom_content']) && !empty($_POST['fb_custom_content'])){\n CsQuery::Cs_Update_Postmeta($_POST['post_ID'], 'aios_fb_custom_content', sanitize_text_field($_POST['fb_custom_content']));\n }\n \n \n if( isset( $_POST['aios_fb_instant_post']) && ! empty( $_POST['aios_fb_instant_post'])){\n $ret = $this->publish_to_facebook( $_POST['post_ID'] );\n if( $ret ){\n foreach( $ret as $item ){\n if( $item['response_code'] === 200 ){\n CsQuery::Cs_Insert(array(\n 'table' => 'aios_facebook_statistics',\n 'insert_data'=> array(\n 'post_id' => $_POST['post_ID'],\n 'fb_post_id' => $item['response_text'],\n 'created_on' => date('Y-m-d H:i:s')\n )\n ));\n }\n }\n }\n }\n \n if( isset( $_POST['aios_fb_post_schedule_val'] ) && !empty( $_POST['aios_fb_post_schedule_val'])){\n $aios_fb_post_schedule_val = $_POST['aios_fb_post_schedule_val'];\n if( $aios_fb_post_schedule_val > 0 ){\n \n date_default_timezone_set(get_option('timezone_string'));\n $schedule = strtotime($aios_fb_post_schedule_val);\n \n CsQuery::Cs_Insert(array(\n 'table' => 'aios_social_publish_schedule',\n 'insert_data' => array(\n 'type' => 1, // facebook type 1\n 'post_id' => $_POST['post_ID'],\n 'publish_on' => $schedule,\n 'created_on' => date('Y-m-d H:i:s')\n )\n ));\n \n \n //insert new schedule\n CsFlusher::Cs_Single_Cron_Schedule_Flush( array( 'schedule' => $schedule, 'hook' => \"aiosFbAutoPubCron\", 'args' => array( 'publish_on' => $schedule )));\n }\n }\n }", "public function vailidatefb($params) {\n \n \t$fbId = @$params['facebookId'];\n \t$email = @$params['email'];\n \t \n \t/* $data = Doctrine_Query::create()->select(\"u.*\")\n \t->from('User u')\n \t->where('u.facebookId='.\"'$fbId'\")\n \t->fetchArray(); */\n \t\n \t$data = Doctrine_Query::create()->select(\"u.*\")\n \t->from('User u')\n \t->where('u.email='.\"'$email'\")\n \t->fetchArray();\n \n \treturn @$data;\n }", "protected function ProcessHookData()\n {\n if ($_IPS['SENDER'] == 'Execute') {\n echo 'This script cannot be used this way.';\n return;\n }\n\n if ((IPS_GetProperty($this->InstanceID, 'Username') != '') || (IPS_GetProperty($this->InstanceID, 'Password') != '')) {\n if (!isset($_SERVER['PHP_AUTH_USER'])) {\n $_SERVER['PHP_AUTH_USER'] = '';\n }\n if (!isset($_SERVER['PHP_AUTH_PW'])) {\n $_SERVER['PHP_AUTH_PW'] = '';\n }\n\n if (($_SERVER['PHP_AUTH_USER'] != IPS_GetProperty($this->InstanceID, 'Username')) || ($_SERVER['PHP_AUTH_PW'] != IPS_GetProperty($this->InstanceID, 'Password'))) {\n header('WWW-Authenticate: Basic Realm=\"Geofency WebHook\"');\n header('HTTP/1.0 401 Unauthorized');\n echo 'Authorization required';\n return;\n }\n }\n\n if (!isset($_GET['id'])) {\n die('Missing parameter: id');\n }\n\n $id = intval($_GET['id']);\n\n if (!$this->IsAllowedObject($id)) {\n echo 'This id is not allowed';\n return;\n }\n\n if (!IPS_VariableExists($id) && !IPS_MediaExists($id)) {\n echo 'Invalid VariableID/MediaID';\n return;\n }\n\n $startTime = time();\n if (isset($_GET['startTime']) && $_GET['startTime'] != '') {\n $startTime = intval($_GET['startTime']);\n }\n\n /*\n * 0 = Hour\n * 1 = Day\n * 2 = Week\n * 3 = Month\n * 4 = Year\n * 5 = Decade\n *\n */\n $timeSpan = 4;\n if (isset($_GET['timeSpan'])) {\n $timeSpan = intval($_GET['timeSpan']);\n }\n\n if (isset($_GET['isRawDensity']) && intval($_GET['isRawDensity'])) {\n $density = 2;\n } elseif (isset($_GET['isHighDensity']) && intval($_GET['isHighDensity'])) {\n $density = 1;\n } else {\n $density = 0;\n }\n\n $isExtrema = false;\n if (isset($_GET['isExtrema'])) {\n $isExtrema = intval($_GET['isExtrema']);\n }\n\n $isDynamic = false;\n if (isset($_GET['isDynamic'])) {\n $isDynamic = intval($_GET['isDynamic']);\n }\n\n $isContinuous = false;\n if (isset($_GET['isContinuous'])) {\n $isContinuous = intval($_GET['isContinuous']);\n }\n\n $width = 800;\n if (isset($_GET['width']) && intval($_GET['width']) > 0) {\n $width = intval($_GET['width']);\n }\n\n $height = 600;\n if (isset($_GET['height']) && intval($_GET['height']) > 0) {\n $height = intval($_GET['height']);\n }\n\n $showTitle = true;\n if (isset($_GET['showTitle'])) {\n $showTitle = intval($_GET['showTitle']);\n }\n\n $showLegend = true;\n if (isset($_GET['showLegend'])) {\n $showLegend = intval($_GET['showLegend']);\n }\n\n //Calculate proper startTime\n if ($isContinuous) {\n switch ($timeSpan) {\n case 0: //Hour\n $startTime = mktime(intval(date('H', $startTime)) - 1, intval(floor(intval(date('i', $startTime)) / 5) * 5 + 5), 0, intval(date('m', $startTime)), intval(date('d', $startTime)), intval(date('Y', $startTime)));\n break;\n case 1: //Day\n $startTime = mktime(intval(date('H', $startTime)) + 1, 0, 0, intval(date('m', $startTime)), intval(date('d', $startTime)) - 1, intval(date('Y', $startTime)));\n break;\n case 2: //Week\n $startTime = mktime(0, 0, 0, intval(date('m', $startTime)), intval(date('d', $startTime)) - 7 + 1, intval(date('Y', $startTime)));\n break;\n case 3: //Month\n $startTime = mktime(0, 0, 0, intval(date('m', $startTime)) - 1, intval(date('d', $startTime)) + 1, intval(date('Y', $startTime)));\n break;\n case 4: //Year\n $startTime = mktime(0, 0, 0, intval(date('m', $startTime)) + 1, 1, intval(date('Y', $startTime)) - 1);\n break;\n case 5: //Decade\n $startTime = mktime(0, 0, 0, 1, 1, intval(date('Y', $startTime)) - 9);\n break;\n default:\n echo 'Invalid timespan';\n\n return;\n }\n } else {\n switch ($timeSpan) {\n case 0: //Hour\n $startTime = mktime(intval(date('H', $startTime)), 0, 0, intval(date('m', $startTime)), intval(date('d', $startTime)), intval(date('Y', $startTime)));\n break;\n case 1: //Day\n $startTime = mktime(0, 0, 0, intval(date('m', $startTime)), intval(date('d', $startTime)), intval(date('Y', $startTime)));\n break;\n case 2: //Week\n $startTime = mktime(0, 0, 0, intval(date('m', $startTime)), intval(date('d', $startTime)) - intval(date('N', $startTime)) + 1, intval(date('Y', $startTime)));\n break;\n case 3: //Month\n $startTime = mktime(0, 0, 0, intval(date('m', $startTime)), 1, intval(date('Y', $startTime)));\n break;\n case 4: //Year\n $startTime = mktime(0, 0, 0, 1, 1, intval(date('Y', $startTime)));\n break;\n case 5: //Decade\n $startTime = mktime(0, 0, 0, 1, 1, floor(intval(date('Y', $startTime)) / 10) * 10);\n break;\n default:\n echo 'Invalid timespan';\n\n return;\n }\n }\n\n $css = file_get_contents(__DIR__ . '/style.css');\n\n //Add CSS for multi charts\n if (IPS_MediaExists($id)) {\n $css .= PHP_EOL . PHP_EOL;\n $css .= $this->BuildCSSForMultiChart($id);\n }\n\n $legend = '';\n if ($showLegend) {\n if (IPS_MediaExists($id)) {\n $legend = $this->BuildLegendForMultiChart($id) . '<br/>';\n } else {\n $legend = 'Name: ' . IPS_GetName($id) . '<br/>';\n }\n }\n\n $acID = IPS_GetInstanceListByModuleID('{43192F0B-135B-4CE7-A0A7-1475603F3060}')[0];\n $chart = AC_RenderChart($acID, $id, $startTime, $timeSpan, $density, $isExtrema, $isDynamic, $width, $height);\n\n //Translate strings\n $chart = $this->TranslateChart($chart);\n\n //Bail out on error\n if ($chart === false) {\n return;\n }\n\n $title = '';\n if ($showTitle) {\n $title = $this->Translate('Start time') . ': ' . date('d.m.Y H:i', $startTime) . '<br/>';\n }\n\n echo <<<EOT\n<html>\n<head><style>body { background: black; color: white; font-family: Verdana } $css</style></head>\n<body>\n<div class=\"ipsChart\">\n$title\n$legend\n$chart\n</div>\n</body>\nEOT;\n }", "public function showRequestPost();", "static function event($unique_user_id, $title, $params = array())\n {\n\n if (!$params || !is_array($params)) {\n $params = array();\n }\n\n $params['title'] = $title;\n \n $message = array(\n 'unique_id' => $unique_user_id,\n 'event' => 'custom',\n 'created_at' => self::get_time(),\n 'params' => $params,\n );\n\n self::store_or_send('event', 'POST', $message);\n }", "function setVars($action){\n $id = trim(filter_input($action, 'id'));\n $text = trim(filter_input($action, 'text'));\n $author = trim(filter_input($action, 'author'));\n $authorId = trim(filter_input($action, 'authorId'));\n $category = trim(filter_input($action, 'category'));\n $categoryId = trim(filter_input($action, 'categoryId'));\n $limit = trim(filter_input($action, 'limit'));\n $random = trim(filter_input($action, 'random'));\n $data = array(\"id\"=>$id, \"text\"=>$text,\n \"author\"=>$author, \"authorId\"=>$authorId,\n \"category\"=>$category, \"categoryId\"=>$categoryId,\n \"limit\"=>$limit, \"random\"=>$random);\n return $data;\n }", "function test(...$params){\n // pass event to callback function\n\n print_r($params[0]);\n print_r(\"EVENT TYPE: \" . $params[1] . PHP_EOL . PHP_EOL);\n\n}", "public function activityObject();", "function getUserFbInfo($token){\n\n\n\t\trequire(realpath(dirname(__FILE__) . \"/../config.php\"));\t\t\n\t\t\t$servername = $config[\"db\"][\"fanbot\"][\"host\"];\n\t\t\t$username = $config[\"db\"][\"fanbot\"][\"username\"];\n\t\t\t$password = $config[\"db\"][\"fanbot\"][\"password\"];\n\t\t\t$dbname = $config[\"db\"][\"fanbot\"][\"dbname\"];\n\n\n\t\t$fb = new Facebook\\Facebook([\n\t\t 'app_id' => $config[\"fbApp\"][\"appId\"],\n\t\t 'app_secret' => $config[\"fbApp\"][\"appSecret\"],\n\t\t 'default_graph_version' => 'v2.6',\n\t\t //'default_access_token' => '{access-token}', // optional\n\t\t]);\n\t\t\n\t\t$fb->setDefaultAccessToken( $token );\n\t\t// Use one of the helper classes to get a Facebook\\Authentication\\AccessToken entity.\n\t\t// $helper = $fb->getRedirectLoginHelper();\n\t\t// $helper = $fb->getJavaScriptHelper();\n\t\t// $helper = $fb->getCanvasHelper();\n\t\t// $helper = $fb->getPageTabHelper();\n\t\t\n\t\ttry {\n\t\t // Get the Facebook\\GraphNodes\\GraphUser object for the current user.\n\t\t // If you provided a 'default_access_token', the '{access-token}' is optional.\n\t\t $response = $fb->get('/me?fields=id,name,last_name,first_name,friends,email,gender,birthday');\n\t\t} catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n\t\t // When Graph returns an error\n\t\t echo 'Graph returned an error: ' . $e->getMessage();\n\t\t exit;\n\t\t} catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n\t\t // When validation fails or other local issues\n\t\t echo 'Facebook SDK returned an error: ' . $e->getMessage();\n\t\t exit;\n\t\t}\n\t\t\n\t\t$me = $response->getGraphUser();\n\n\t\t$_SESSION['fbUser']['id'] = $me->getId();\n\t\t$_SESSION['fbUser']['link'] = $me->getLink();\n\t\t$_SESSION['fbUser']['name'] = $me->getName();\n\t\t$_SESSION['fbUser']['email'] = $me->getEmail();\n\t\t$_SESSION['fbUser']['firstName'] = $me->getFirstName();\n\t\t$_SESSION['fbUser']['lastName'] = $me->getLastName();\n\t\t$_SESSION['fbUser']['gender'] = $me->getGender();\n\t\t$_SESSION['fbUser']['friends'] = $me->getField('friends');\n\n\t}", "public function getCalendarEvents($uid, $appName, $facebook_page_id = '') {\n $user = \\Drupal::currentUser();\n if ($appName) {\n $terms_obj = \\Drupal::entityTypeManager()->getStorage('taxonomy_term')->load($appName);\n $socialname = $terms_obj->getName();\n $events = array();\n $query = \\Drupal::database()->select('social_media', 'sm');\n if ($facebook_page_id) {\n $result = $query->fields('sm', array('id', 'scheduled_timestamp'))->condition('sm.uid', $uid, '=')->condition('sm.social_media_name', $socialname, '=')->condition('sm.page_id', $facebook_page_id, '=')->orderBy('created', 'DESC')->execute()->fetchAll();\n } else {\n $result = $query->fields('sm', array('id', 'scheduled_timestamp'))->condition('sm.uid', $uid, '=')->condition('sm.social_media_name', $socialname, '=')->orderBy('created', 'DESC')->execute()->fetchAll();\n }\n if (!empty($result)) {\n foreach ($result as $row_object) {\n $date = new DrupalDateTime(date('Y-m-d H:i:s', $row_object->scheduled_timestamp), new \\DateTimeZone('utc'));\n $date->setTimezone(new \\DateTimeZone($user->getTimeZone()));\n $manual_datetime = strtotime($date->format('Y-m-d H:i:s'));\n //$manual_datetime = $scheduled_data->manual_datetime;\n $published_date = date('Y-m-d H:i:s', $manual_datetime);\n $Onlytime = explode(\" \", $published_date);\n $formatedTime = date(\"g:i a\", strtotime($Onlytime[1]));\n $unformatedTime = date('Y-m-d H:00', $manual_datetime);\n $events[] = array('start' => $unformatedTime);\n }\n }\n }\n return $events;\n }", "public function getWhoLikePhotoAction()\n {\n// \t$photo_id = $this->getRequest()->getParam( 'photo_id' ) ;\n// \t$photo_posted_by_user_id = $this->getRequest()->getParam( 'photo_posted_by_user_id' ) ;\n// \t$is_wallpost_exist = \\Extended\\wall_post::checkWallpostByPhotoNUser($photo_id , $photo_posted_by_user_id);\n// \tif($is_wallpost_exist){\n// \t\techo Zend_Json::encode( \\Extended\\likes::getUsersForWallpost($is_wallpost_exist ) );\n// \t}\n// \telse\n// \t{\n// \t\treturn ;\n// \t}\n// \tdie;\n \t$user_info = array();\n \tif($this->getRequest()->getParam( 'photo_id' ))\n \t{\n \t\tif( \\Extended\\wall_post::getRowObject( $this->getRequest()->getParam( 'photo_id' ) ))\n \t\t{\n \t\t\t$ppl_who_liked = \\Extended\\likes::getUserslikedWallpostOrAlbumOrPhoto(\tnull, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\tnull, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t$this->getRequest()->getParam('photo_id'),\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->getRequest()->getParam('limit'),\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->getRequest()->getParam('offset'));\n \t\t\tif($ppl_who_liked)\n \t\t\t{\n \t\t\t\tforeach( $ppl_who_liked['data'] as $key=>$user_who_liked )\n \t\t\t\t{\n \t\t\t\t\t$mutual_arr=\\Extended\\ilook_user::getMutualLinks(\\Auth_UserAdapter::getIdentity()->getId(), $user_who_liked->getLikesLiked_by()->getId());\n \t\t\t\t\t$mutualFrdsCount = count($mutual_arr);\n \t\t\t\t\tif(\\Auth_UserAdapter::getIdentity()->getId() == $user_who_liked->getLikesLiked_by()->getId()){\n \t\t\t\t\t\t$user_info[$key][\"mutual_count\"] = \"Me\";\n \t\t\t\t\t}\n \t\t\t\t\telse{\n \t\t\t\t\t\t$user_info[$key][\"mutual_count\"] = $mutualFrdsCount;\n \t\t\t\t\t\t\t\n \t\t\t\t\t}\n \t\t\t\t\t$user_info[$key][\"user_id\"] = $user_who_liked->getLikesLiked_by()->getId();\n \t\t\t\t\t$user_info[$key][\"user_image\"] = \\Helper_common::getUserProfessionalPhoto($user_who_liked->getLikesLiked_by()->getId(), 3);\n \t\t\t\t\t$user_info[$key][\"user_full_names\"] = $user_who_liked->getLikesLiked_by()->getFirstname().\" \".$user_who_liked->getLikesLiked_by()->getLastname();\n \t\t\t\t\t$user_info[$key][\"link_info\"] = \\Extended\\link_requests::getFriendRequestState( $user_who_liked->getLikesLiked_by()->getId() );\n \t\t\t\t}\n \t\t\t\t//For pagination which is not yet implemented.\n \t\t\t\t//$user_info['more_records'] = $ppl_who_liked['is_more_records'];\n \t\t\t\techo Zend_Json::encode( $user_info );\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\techo Zend_Json::encode( 0 );\n \t\t\t}\n \t\t}\n \t\telse\n \t\t{\n \t\t\techo Zend_Json::encode( 0 );\n \t\t}\n \t}\n \telse\n \t{\n \t\techo Zend_Json::encode( 0 );\n \t}\n \t \n \t \n \tdie;\n }", "function getFBResponse($arr_post = []) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,'https://graph.facebook.com/v2.10/oauth/access_token');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($arr_post));\n $response = curl_exec($ch);\n return json_decode($response);\n}", "public function getAlbumInfoAction()\n {\n \t$params = $this->getRequest()->getParams();\n\n \t$result = \\Extended\\socialise_album::getSocialiseAlbumInfo( $params['album_id'] );\n \n \tif( $result ):\n \techo Zend_Json::encode( $result );\n \telse:\n \t//Wallpost doesnot exist anymore.\n \techo Zend_Json::encode( 2 );\n \tendif;\n \tdie;\n }", "public function getAuthParams() {\n\t\t$settings = array_filter($this->settings['facebook'], function($k){\n\t\t\treturn !is_null($k) OR $k == true;\n\t\t});\n\n\t\tif(isset($settings['scope']) && is_array($settings['scope'])){\n\t\t\t$settings['scope'] = implode(',', $settings['scope']);\n\t\t}\n\n\t\treturn $settings;\n\t}", "function gatherMovieInfoFromPost( $params ) \n\t{\n\t\tif (!empty($params['localdbid']))\n\t\t\t$movieinfo['localdbid'] = $params['localdbid'];\n\t\t$movieinfo['filepath'] = $params['filepath'];\n\t\t$movieinfo['duration'] = $params['duration'];\n\t\t$movieinfo['title'] = $params['title'];\n\t\t$movieinfo['imdbid'] = $params['imdbid'];\n\t\t$movieinfo['original_title'] = $params['original_title'];\n\t\t$movieinfo['year'] = $params['year'];\n\t\t$movieinfo['mpaa'] = $params['mpaa'];\n\t\t$movieinfo['director'] = $params['director'];\n\t\t$movieinfo['writers'] = $params['writers'];\n\t\t$movieinfo['tagline'] = $params['tagline'];\n\t\t$movieinfo['genres'] = $params['genres'];\n\t\t$movieinfo['overview'] = $params['overview'];\n\t\t$movieinfo['plot'] = $params['overview'];\n\t\t$movieinfo['actors'] = $params['actors'];\n\t\t$movieinfo['thumb'] = isset($params['thumb']) ? urldecode($params['thumb']) : '';\n\t\t$movieinfo['allthumbs'] = urldecode($params['allthumbs']);\n\n\t\treturn $movieinfo;\n\t}", "function loadActivity(){\n\t\t\t$this->articleEvents->add( $this->db->getUserActivity($this->getName()) ,true );\t\t\t\n\t\t}", "function getParams()\n {\n global $id;\n global $mode;\n global $data_source;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id = $id;\n }\n if (isset($mode)) {\n $this->mode = $mode;\n }\n if (isset($data_source)) {\n $this->data_source = $data_source;\n }\n if (isset($view_mode)) {\n $this->view_mode = $view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode = $edit_mode;\n }\n if (isset($tab)) {\n $this->tab = $tab;\n }\n }", "public function __construct()\n\t{\n\t\t//get data from Webhook call\n\t\t$this->raw_data = file_get_contents(\"php://input\");\n\t\t//decode data\n\t\t$this->decoded_data = json_decode($this->raw_data, true);\n\t\t//Set attributes and Default actions\n\t\t$this->method = \"sendMessage\";\n\t\t$this->action = \"typing\";\n\t\t//Get data\n\t\tif (isset($this->decoded_data[\"message\"][\"text\"]))\n\t\t{\t//Get data and type (photo , text or other)\n\t\t\t$this->text = $this->decoded_data[\"message\"][\"text\"];\n\t\t\t$this->type = \"text\";\n\t\t}else if(isset($this->decoded_data[\"message\"][\"photo\"]))\n\t\t{\n\t\t\t$this->type = \"photo\";\n\t\t}else if(isset($this->decoded_data[\"message\"][\"location\"]))\n\t\t{\n\t\t\t$this->type = \"location\";\t\n\t\t}else if(isset($this->decoded_data[\"message\"][\"video\"]))\n\t\t{\n\t\t\t$this->type = \"video\";\n\t\t}else{\n\t\t\t$this->type = \"unknown\";\n\t\t}\n\t\t//Inline query or regular query ?\n\t\tif (isset($this->decoded_data[\"inline_query\"])) \n\t\t{\t//inline_query is present instead of message field in case of an inline request\n\t\t\t$this->isInlineQuery = isset($this->decoded_data[\"inline_query\"]) ? true : false;\n\t\t\t$this->inlineQuery = $this->decoded_data[\"inline_query\"];\t//Contains id,from,query and offset\n\t\t}\n\t}", "function getParams() {\n global $id;\n global $mode;\n global $view_mode;\n global $edit_mode;\n global $tab;\n if (isset($id)) {\n $this->id=$id;\n }\n if (isset($mode)) {\n $this->mode=$mode;\n }\n if (isset($view_mode)) {\n $this->view_mode=$view_mode;\n }\n if (isset($edit_mode)) {\n $this->edit_mode=$edit_mode;\n }\n if (isset($tab)) {\n $this->tab=$tab;\n }\n\n\n\n}", "public function getCallBackUrl()\r\n {\r\n \r\n }", "public function eventfeedAction()\n {\n $this->disableView();\n $this->setCustomHeader('json');\n //get params\n $startTime = $this->_getParam('start');\n $endTime = $this->_getParam('end');\n $idJabatan = $this->_getParam('id_jabatan');\n $idSkenario = $this->_getParam('id_skenario');\n //get list of events\n $listEvent = $this->getEventFeed($startTime, $endTime, $idJabatan, $idJabatan);\n //initialize empty array\n $arrayEvent = array();\n //loop through the list of the events\n if(count($listEvent))\n {\n foreach($listEvent as $event)\n {\n //converting date time format\n $asumsiDayStart = date('d', strtotime($event['asumsi_start']));\n $asumsiDayEnd = date('d', strtotime($event['asumsi_end']));\n $asumsiDateStart = date('d/F/Y', strtotime($event['asumsi_start']));\n $asumsiDateEnd = date('d/F/Y', strtotime($event['asumsi_end']));\n $asumsiTimeStart = date('H:i:s', strtotime($event['asumsi_start']));\n $asumsiTimeEnd = date('H:i:s', strtotime($event['asumsi_end']));\n //if a one day events only\n if( $asumsiDayStart == $asumsiDayEnd )\n {\n //print the date only once\n $title = $event['nama_kegiatan'] . ' waktu asumsi ' . $asumsiDateStart . ', ';\n }else{\n //print only the start and end date\n $title = $event['nama_kegiatan'] . ' waktu asumsi ' . $asumsiDateStart . ' - ' . $asumsiDateEnd . ', ';\n }\n //print the timeline\n $title .= $asumsiTimeStart . ' - ' . $asumsiTimeEnd;\n //print assumption time\n $title .= ' Perbandingan Sebenarnya : Asumsi = ' . $event['asumsi_perbandingan'];\n //add edit links only if user can access the edit forms: latihan-rol-edit\n if (Zend_Auth::getInstance()->hasIdentity()) {\n $identity = Zend_Auth::getInstance()->getStorage()->read();\n $tablePrivileges = new Latihan_Model_DbTable_Privileges();\n if($tablePrivileges->checkRolesPrivileges('latihan', 'rol', 'edit', $identity->role_id) >= 1)\n {\n $tempArray = array(\n 'id' => $event['id_rol'],\n 'start' => $event['realtime_start'],\n 'end' => $event['realtime_end'],\n 'url' => $this->view->baseUrl('latihan/rol/edit/id/') . $event['id_rol'] ,\n 'title' => $title,\n 'allDay' => false\n );\n }else{\n $tempArray = array(\n 'id' => $event['id_rol'],\n 'start' => $event['realtime_start'],\n 'end' => $event['realtime_end'],\n 'title' => $title,\n 'allDay' => false\n );\n }\n }\n //form into fullcalendar json object format\n array_push($arrayEvent, $tempArray);\n }\n echo json_encode($arrayEvent);\n }\n }", "public function user_social(){\n\t\tcheck_ajax_referer('mp_seg', 'nonce');\n\t\t\n\t\tif( isset($_POST['action'] ) ) {\n\t\t\t$user_id = $_POST['userid'];\n\t\t\t\n\t\t\tif( $_POST['tipo'] == 'cargando' ){\n\t\t\t\t$social = get_user_meta( $user_id, 'mp_social', true );\n \n\t\t\t\tif( isset($social) && is_array($social) ) {\n\n\t\t\t\t\textract( $social, EXTR_OVERWRITE );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$facebook = '';\n\t\t\t\t\t$twitter = '';\n\t\t\t\t\t$instagram = '';\n\n\t\t\t\t}\n\t\t\t\t$json = [\n\t\t\t\t\t'facebook' \t=> $facebook,\n\t\t\t\t\t'twitter' \t=> $twitter,\n\t\t\t\t\t'instagram' => $instagram\n\t\t\t\t];\n\t\t\t}elseif($_POST['tipo'] == 'guardando'){\n \n \n\t\t\t\t$facebook = sanitize_text_field( $_POST['facebook'] );\n\t\t\t\t$twitter = sanitize_text_field( $_POST['twitter'] );\n\t\t\t\t$instagram = sanitize_text_field( $_POST['instagram'] );\n\t\t\t\t$mp_social = [\n\t\t\t\t\t'facebook' \t=> $facebook,\n\t\t\t\t\t'twitter' \t=> $twitter,\n\t\t\t\t\t'instagram' => $instagram\t\n\t\t\t\t];\n \n \t$resultado =update_user_meta( $user_id, 'mp_social', $mp_social );\n\t\t\t\t$usuario = new WP_User($user_id);\n \tif($resultado != false){\n\t\t\t\t\t$json = [\n\t\t\t\t\t\t'resultado' => 'exitoso',\n\t\t\t\t\t\t'usuario' => $usuario->display_name\n\t\t\t\t\t];\n\t\t\t\t}else{\n\t\t\t\t\t$json = [\n\t\t\t\t\t\t'resultado' => 'error'\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t}\n\t\t\techo json_encode($json);\n\t\t\twp_die();\n\t\t}\n\t}", "public function activityAction() {\n\tif($this->_getParam('id',false)){\n\t$activities = new PrimaryActivities();\n\t$this->view->activities = $activities->getActivityDetails($this->_getParam('id'));\n\t} else {\n\t\tthrow new Pas_Exception_Param($this->_missingParameter);\n\t}\n\t}", "public function getPhotoInfoAction()\n {\n \t$params = $this->getRequest()->getParams();\n \t//Zend_Debug::dump($params); die();\n \n \t$result = \\Extended\\socialise_photo::getPhotoInfo( $params['photo_id'] );\n \t \n \tif( $result ):\n \techo Zend_Json::encode( $result );\n \telse:\n \t//Wallpost doesnot exist anymore.\n \techo Zend_Json::encode( 2 );\n \tendif;\n \tdie;\n }" ]
[ "0.60599965", "0.5757755", "0.55691695", "0.5533957", "0.5504438", "0.5462942", "0.54532325", "0.5416127", "0.5404493", "0.5373595", "0.5363646", "0.5363174", "0.5360115", "0.5357556", "0.53428733", "0.52425456", "0.5230426", "0.5222235", "0.5203201", "0.5192375", "0.51791835", "0.5169486", "0.5156608", "0.5136518", "0.51263493", "0.51134735", "0.51094884", "0.5109024", "0.51028985", "0.5101537", "0.5096346", "0.509607", "0.5093338", "0.5090763", "0.50839484", "0.5059803", "0.5055064", "0.5043739", "0.50430554", "0.50380105", "0.5037171", "0.5033967", "0.502204", "0.5018964", "0.50171024", "0.4991382", "0.4988728", "0.49853295", "0.49769077", "0.49745375", "0.49736714", "0.4959561", "0.4941361", "0.4936094", "0.49303895", "0.4928912", "0.49259514", "0.49215946", "0.4919356", "0.49176043", "0.49147892", "0.49129754", "0.49105042", "0.49100184", "0.49100184", "0.49100184", "0.49100184", "0.49080303", "0.49038124", "0.49007955", "0.48969573", "0.48954317", "0.4894831", "0.4887629", "0.4886187", "0.4871666", "0.4870309", "0.48625308", "0.4859967", "0.48526615", "0.48481703", "0.48477727", "0.4846659", "0.48461604", "0.48450673", "0.48410556", "0.48410535", "0.48315132", "0.48272312", "0.4826479", "0.48215812", "0.48174748", "0.48138523", "0.48135987", "0.48022476", "0.47989005", "0.4798547", "0.47966334", "0.47952536", "0.47925252" ]
0.6309429
0
check response error from facebook graph api
private function facebookResponseCheck($result) { if(!empty($result->error)) { $type = isset($result->error->type) ? $result->error->type : ''; $code = isset($result->error->code) ? $result->error->code : ''; $message = isset($result->error->message) ? $result->error->message : ''; $msg = sprintf('type: %s, $code: %s, message: %s', $type, $code, $message); throw new Exception($msg); } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function is_error() \n\t\t{\n\t\t\t\t$json = json_decode( $this->response );\n\t\t\t\tif( $json->faultstring )\n\t\t\t\t{\n\t\t\t\t\t\t$this->error = $json->faultstring;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\treturn false;\n\n\t\t}", "public function has_http_error($response) {\n if(!$response || !isset($response['response']['code']) || !preg_match('/20*/', $response['response']['code']) || !isset($response['body'])) {\n return true;\n }\n return false;\n }", "private function is_api_error( $response ) {\n\t\tif ( false === $response ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( ! is_object( $response ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( isset( $response->error ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function checkResponse($r){\n if (!is_array($r) || !array_key_exists('code', $r)){\n $this->log(\"No Response found\",'Warning');\n return false;\n }\n if ($r['code'] == 200){\n return true;\n } else {\n $xml = simplexml_load_string($r['body'])->Error;\n $this->log(\"Bad Response! \".$r['code'].\" \".$r['error'].\": \".$xml->Code.\" - \".$xml->Message,'Urgent');\n return false;\n }\n }", "private function error($response) {\n\t\tif(property_exists($response, \"error\") AND $response->code != 200) {\n\t\t\tthrow new MystoreAPI_exception(\"Error \".$response->code.\"<br />\".$response->error->message);\n\t\t}\n\t}", "private function checkTokenWithFacebook($accessToken){\r\n\r\n $url = Laracurl::buildUrl('https://graph.facebook.com/app', ['access_token'=>$accessToken]);\r\n $response = Laracurl::get($url);\r\n if(!empty($response) && !empty($response->body)){\r\n $fbResult = json_decode($response->body, true);\r\n if(!empty($fbResult['id']) && $fbResult['id'] == env('FB_APP_KEY')){//this user come from our facebook app\r\n $url = Laracurl::buildUrl('https://graph.facebook.com/me', ['fields'=> 'id,name,gender,email,age_range', 'access_token'=>$accessToken]);\r\n $response = Laracurl::get($url);\r\n if(!empty($response) && !empty($response->body)) {\r\n $fbResult = json_decode($response->body, true);\r\n if (!empty($fbResult['id'])) {\r\n return $fbResult;\r\n }\r\n }\r\n }\r\n }\r\n return null;\r\n }", "public static function create(FacebookResponse $response)\n {\n $data = $response->getDecodedBody();\n\n if (!isset($data['error']['code']) && isset($data['code'])) {\n $data = ['error' => $data];\n }\n\n $code = isset($data['error']['code']) ? $data['error']['code'] : null;\n $message = isset($data['error']['message']) ? $data['error']['message'] : 'Unknown error from Graph.';\n\n if (isset($data['error']['error_subcode'])) {\n switch ($data['error']['error_subcode']) {\n // Other authentication issues\n case 458:\n case 459:\n case 460:\n case 463:\n case 464:\n case 467:\n return new static($response, new FacebookAuthenticationException($message, $code));\n // Video upload resumable error\n case 1363030:\n case 1363019:\n case 1363037:\n case 1363033:\n case 1363021:\n case 1363041:\n return new static($response, new FacebookResumableUploadException($message, $code));\n }\n }\n\n switch ($code) {\n // Login status or token expired, revoked, or invalid\n case 100:\n case 102:\n case 190:\n return new static($response, new FacebookAuthenticationException($message, $code));\n\n // Server issue, possible downtime\n case 1:\n case 2:\n return new static($response, new FacebookServerException($message, $code));\n\n // API Throttling\n case 4:\n case 17:\n case 32:\n case 341:\n case 613:\n return new static($response, new FacebookThrottleException($message, $code));\n\n // Duplicate Post\n case 506:\n return new static($response, new FacebookClientException($message, $code));\n }\n\n // Missing Permissions\n if ($code == 10 || ($code >= 200 && $code <= 299)) {\n return new static($response, new FacebookAuthorizationException($message, $code));\n }\n\n // OAuth authentication error\n if (isset($data['error']['type']) && $data['error']['type'] === 'OAuthException') {\n return new static($response, new FacebookAuthenticationException($message, $code));\n }\n\n // All others\n return new static($response, new FacebookOtherException($message, $code));\n }", "public function hasError()\n {\n return $this->info['http_code'] != '200';\n }", "public function Access_error ()\n\t\t{\n\t\t\t$errMsg[0]['error'] = \"Invalid URL!\";\n\t\t\treturn json_encode ($errMsg);\n\t\t}", "public static function checkError($resp) {\n\t}", "public static function checkError($resp) {\n\t}", "public function testError()\n {\n $error = $this->response->error(404, 'File Not Found');\n json_decode($error);\n $checkJson = (json_last_error() == JSON_ERROR_NONE);\n\n $this->assertTrue($checkJson);\n }", "function is_error ( $res ) {\n if ( is_numeric( $res ) && $res < 0 ) return $res;\n else if ( is_array( $res ) && isset( $res['code'] ) && $res['code'] < 0 ) return $res['code'];\n else if ( $res === FALSE ) return TRUE;\n else return false;\n}", "public function checkUser_post(){\n\t\textract($_POST);\n\t\t//print_r($_POST);die();\n\t\t$oauth_provider='facebook';\n\t\t// ------if facebook oauth provider not found-------------\n\t\tif ($oauth_provider=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'OAuth provider field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook oauth uid not found-------------\n\t\tif ($oauth_uid=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'OAuth UID field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook First Name not found-------------\n\t\tif ($first_name=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'Facebook First Name field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook Last Name not found-------------\n\t\tif ($last_name=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'Facebook Last Name field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // ------if facebook email not found-------------\n\t\tif ($email=='') {\n\t\t\t$this->response([\n\t\t\t\t'status' => 500,\n\t\t\t\t'status_message' => 'Facebook email field is empty. All parameters are required!'\n\t\t\t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t\tdie();\n\t\t}\n\n // // ------if facebook picture not found-------------\n\t\t// if ($picture=='') {\n\t\t// \t$this->response([\n\t\t// \t\t'status' => 500,\n\t\t// \t\t'status_message' => 'Facebook picture field is empty. All parameters are required!'\n\t\t// \t], REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t// \tdie();\n\t\t// }\n\t\t$userData = $_POST;\n\t\t$result = $this->User->checkUser($userData);\n\n\t\tif($result['status']==200){\n\t\t\t$this->response($result, REST_Controller::HTTP_OK);\n\t\t}\n\t\telse{\n\t\t\t$this->response($result, REST_Controller::HTTP_PRECONDITION_FAILED);\n\t\t}\n\t}", "function is_json_error( $json ) {\n\treturn isset_not_empty( $json, 'code' ) && isset_not_empty( $json, 'message' ) && get_array_var( $json, 'code' ) !== 'success';\n}", "private function checkResponseStatus($response, $format)\n {\n $status = $this->curlLib->getStatus();\n if ( $status >= 400 ){\n switch($format){\n case 'json':\n default:\n $data = json_decode($response);\n if ( $status >= 500 ){\n if ( $data === null ){\n throw new PipeStackServerException('A server error has occurred. Please try again soon.');\n }\n throw new PipeStackServerException($this->jsonException($data));\n }\n switch($status){\n case 400:\n case 405:\n if ( $data === null ){\n throw new PipeStackRequestException('Invalid request. Please double check parameters and request method.');\n }\n throw new PipeStackRequestException($this->jsonException($data));\n case 401:\n case 403:\n if ( $data === null ){\n throw new PipeStackPermissionException('Invalid permissions and/or authorization. Please check your access token verify endpoint permission requirements.');\n }\n throw new PipeStackPermissionException($this->jsonException($data));\n\n case 404:\n if ( $data === null ){\n throw new PipeStackRequestException('You have requested an endpoint which does not exist. Please double check the endpoint parameter and try again.');\n }\n throw new PipeStackRequestException($this->jsonException($data));\n break;\n default:\n if ( $data === null ){\n throw new PipeStackException('An unknown PipeStack API error has occurred. Please contact PipeStack customer service.');\n }\n throw new PipeStackException($this->jsonException($data));\n break;\n }\n break;\n }\n }\n }", "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 }", "protected static function isErrorApiResponse($response): bool\n {\n return property_exists($response, 'status_code') &&\n property_exists($response, 'status') &&\n $response->status === 'failed';\n }", "public function check_social() {\n\n $facebook_client_id = envfile('FB_CLIENT_ID');\n $facebook_client_secret = envfile('FB_CLIENT_SECRET');\n $facebook_call_back = envfile('FB_CALL_BACK');\n\n $google_client_id = envfile('GOOGLE_CLIENT_ID');\n $google_client_secret = envfile('GOOGLE_CLIENT_SECRET');\n $google_call_back = envfile('GOOGLE_CALL_BACK');\n\n $fb_status = false;\n\n if (!empty($facebook_client_id) && !empty($facebook_client_secret) && !empty($facebook_call_back)) {\n\n $fb_status = true;\n\n }\n\n $google_status = false;\n\n if (!empty($google_client_id) && !empty($google_client_secret) && !empty($google_call_back)) {\n\n $google_status = true;\n\n }\n\n return response()->json(['fb_status'=>$fb_status, 'google_status'=>$google_status]);\n \n }", "public function test_token_invalid() {\n\t\t$this->uri->rsegments[3] = 'b';\n\t\tset_valid_authorization();\n\t\t$out = run_action($this->c, 'token');\n\n\t\t$json = json_decode($out, true);\n\n\t\t$this->assertTrue($json['error']);\n\t\t$this->assertFalse(array_key_exists('opportunity', $json));\n\t\t$this->assertFalse(array_key_exists('opportunities', $json));\n\t}", "public function validateResponseApi($response)\n {\n //Get response\n $data = json_decode($response->content());\n\n //If there is errors, throw error\n if (isset($data->errors))\n throw new Exception($data->errors, $response->getStatusCode());\n else {//if response is successful, return response\n return $data->data;\n }\n }", "public function validateResponse($response): bool\n {\n if (null === $response) {\n return false;\n }\n\n if (200 === ($statusCode = $response->getStatusCode())) {\n return true;\n }\n\n $responseContents = $response->getBody()->getContents();\n if (400 === $statusCode) {\n \\Yii::error(ErrorsHelper::getStatusCodeErrorMessage($statusCode, $responseContents, $this), ErrorsHelper::GUZZLE_HTTP_CLIENT_ERROR);\n \\Yii::error('Something in the request data was wrong: check if all data{...}values are converted to strings.', ErrorsHelper::GUZZLE_HTTP_CLIENT_ERROR);\n $this->setErrorStatusDescription(ErrorsHelper::STATUS_CODE_400, $responseContents);\n\n return false;\n }\n\n if (401 === $statusCode) {\n \\Yii::error(ErrorsHelper::getStatusCodeErrorMessage($statusCode, self::UNAUTHORIZED_REQUEST_EXCEPTION_MESSAGE, $this), ErrorsHelper::GUZZLE_HTTP_CLIENT_ERROR);\n \\Yii::error('To use the new FCM HTTP Legacy API, you need to enable FCM API on your Google API dashboard first - https://console.developers.google.com/apis/library/fcm.googleapis.com/.', ErrorsHelper::GUZZLE_HTTP_CLIENT_ERROR);\n $this->setErrorStatusDescription(ErrorsHelper::STATUS_CODE_403, $responseContents);\n return false;\n }\n\n \\Yii::error(ErrorsHelper::getStatusCodeErrorMessage($statusCode, $responseContents, $this), ErrorsHelper::GUZZLE_HTTP_CLIENT_OTHER_ERRORS);\n $this->setErrorStatusDescription(ErrorsHelper::OTHER_STATUS_CODES, $responseContents);\n $this->setRetryAfter($response);\n\n return false;\n }", "function facebook_user_check_post() \n\t{ \n\t\t$fb_id=$this->post('fb_id');\n\t\t$fullname=$this->post('fullname');\n\t\t$email=$this->post('email');\n\t\t$data=$this->users_model->get_by_fb_id($fb_id);\n\t\tif($data==null){\n\t\t\t$this->response(array('ok'=>'0'));\n\t\t}else{\n\t\t\t$this->response($this->users_model->get_by_fb_id($fb_id));\n\t\t}\n\t}", "private function validateAccessToken() {\n $this->userID = $this->facebook->getUser();\n }", "private function tokenNotFoundError() {\n return response()->json([\n 'error' => 'Either your email or token is wrong.'\n ], Response::HTTP_UNPROCESSABLE_ENTITY);\n }", "function media_theplatform_mpx_check_json_response($response, $service) {\n // No response\n if(!strlen($response))\n return array('status' => 'error', 'response' => t('No response from @service', array('@service' => $service)));\n // Decode JSON\n $responseObject = json_decode($response);\n // Make sure the response decodes, if not, return it's text\n if(!is_object($responseObject))\n return array('status' => 'error', 'response' => t('Error response from @service: @response', array('@service' => $service, '@response' => $response)));\n // Check for an exception on the response, return it's description if set\n if(property_exists($responseObject, 'isException'))\n return array('status' => 'error', 'response' => t('Exception from @service: @response', array('@service' => $service, '@response' => $responseObject->description)));\n // Looking good, return the response object\n else\n return array('status' => 'success', 'response' => $responseObject);\n}", "public function error(BaseResponse $response);", "public function isError(): bool\n {\n return $this->get('json', 'error') === true;\n }", "protected function handleJsonRpcErrors($response) {\n if (isset($response->error)) {\n $error = $response->error;\n switch($error->code) {\n case -32601:\n throw new JsonRpcException($error->message, $error->code);\n case -32602:\n throw new JsonRpcException(\n $error->message, $error->code);\n default:\n throw new JsonRpcException(\n $error->message.\"\\nStacktrace : \" . $error->data->stacktrace,\n $error->code);\n }\n }\n }", "protected function handleFacebookException($exception)\n {\n return false;\n }", "public function fbCallback()\n\t{\n try {\n // $code = Input::get('code');\n // if (strlen($code) == 0) return Redirect::to('/noauth')->with('message', 'Se ha producido un error al comunicarse con Facebook.');\n\n FacebookSession::setDefaultApplication(Config::get('facebook')['appId'],Config::get('facebook')['secret']);\n //$pageHelper = new FacebookPageTabHelper(Config::get('facebook')['appId'],Config::get('facebook')['secret']);\n //$helper = new FacebookRedirectLoginHelper( Config::get('app')['url'] . '/login/fb/callback' );\n\n $pageHelper = new FacebookJavaScriptLoginHelper(Config::get('facebook')['appId'],Config::get('facebook')['secret']);\n $session = $pageHelper->getSession();\n // $session = $helper->getSessionFromRedirect();\n //\t $uid = $session->getSignedRequestProperty('user_id'); \n $uid = $pageHelper->getUserId();\n //$facebook = new Facebook(Config::get('facebook'));\n //$uid = $facebook->getUser();\n\n if ($uid == 0) return Redirect::to('/noauth')->with('message', 'Hubo un error');\n\n $request = new FacebookRequest( $session, 'GET', '/me' , null, 'v1.0');\n $response = $request->execute();\n // Responce\n $me = $response->getGraphObject()->asArray();//GraphUser::className()\n //getBirthday;\n //$me = $facebook->api('/me');\n\n $profile = Profile::whereUid($uid)->first();\n if (empty($profile)) {\n $user = new User;\n $user->name = $me['first_name'] . ' '. $me['last_name'];\n $user->email = $me['email'];\n $user->photo = '';\n $user->gender = $me['gender'];\n $user->inscrito = false;\n $user->save();\n\n $profile = new Profile();\n $profile->uid = $uid;\n $profile->username = $me['email'];\n $profile = $user->profiles()->save($profile);\n }\n\n $profile->access_token = $session->getAccessToken();\n $profile->autorizado = true;\n $profile->save();\n $user = $profile->user;\n\n if ($user->inscrito) {\n return Redirect::to('/categorias')->with('message', 'Logged in with Facebook');\n } else {\n // return View::make('inscripcion');\n return Redirect::route('inscripcion', array('id' => $user->id));\n }\n\n // Auth::login($user);\n\n //return Redirect::to('/')->with('message', 'Logged in with Facebook');\n } catch (FacebookAuthorizationException $e) {\n return Redirect::to('/sesionexpirada')->with('message', 'Su sesión ha expirado. Por favor haga click en reiniciar.');\n } catch (\\Exception $e) {\n return Redirect::to('/error')->with('message', 'Ha ocurrido un error.');\n }\n\t}", "public function testErrorMessage()\n {\n $holiday = new MalaysiaHoliday;\n $response = $holiday->fromState(['Selangor', 'Malaccaa'])->get();\n\n $this->assertTrue($response['status']);\n $this->assertTrue($response['data'][0]['regional'] == 'Selangor');\n\n\n $this->assertFalse($response['data'][1]['regional'] == 'Malacca');\n $this->assertTrue($response['data'][1]['collection'] == []);\n\n $this->assertCount(1, $response['error_messages']);\n $this->assertTrue($response['error_messages'][0] == 'Malaccaa is not include in the regional state');\n }", "protected static function checkJsonError() {\n if (json_last_error()) {\n throw new Exception('Invalid JSON data: ' . json_last_error_msg());\n }\n }", "public function errorCode() {}", "protected function searchForError()\n\t{\n\t\t$code = $this->findNode('/response/code');\n\t\t$msg = $this->findNode('/response/message');\n\n\t\tif ($code !== NULL || $msg !== NULL)\n\t\t{\n\t\t\t$this->error = $msg;\n\t\t\t$this->error_code = $code;\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "final public static function unableToParseApgResponse()\n {\n return self::get(2061);\n }", "public function errorCode();", "public function errorCode();", "private function checkResponseFormat(){\n\n }", "function http_get_response_code_error($code)\n\t{\n\t\t$errors = array(\n\t\t200 => 'Success - The request was successful',\n\t\t201 => 'Created (Success) - The request was successful. The requested object/resource was created.',\n\t\t400 => 'Invalid Request - There are many possible causes for this error, but most commonly there is a problem with the structure or content of XML your application provided. Carefully review your XML. One simple test approach is to perform a GET on a URI and use the GET response as an input to a PUT for the same resource. With minor modifications, the input can be used for a POST as well.',\n\t\t401 => 'Unauthorized - This is an authentication problem. Primary reason is that the API call has either not provided a valid API Key, Account Owner Name and Associated Password or the API call attempted to access a resource (URI) which does not match the same as the Account Owner provided in the login credientials.',\n\t\t404 => 'URL Not Found - The URI which was provided was incorrect. Compare the URI you provided with the documented URIs. Start here.',\n\t\t409 => 'Conflict - There is a problem with the action you are trying to perform. Commonly, you are trying to \"Create\" (POST) a resource which already exists such as a Contact List or Email Address that already exists. In general, if a resource already exists, an application can \"Update\" the resource with a \"PUT\" request for that resource.',\n\t\t415 => 'Unsupported Media Type - The Media Type (Content Type) of the data you are sending does not match the expected Content Type for the specific action you are performing on the specific Resource you are acting on. Often this is due to an error in the content-type you define for your HTTP invocation (GET, PUT, POST). You will also get this error message if you are invoking a method (PUT, POST, DELETE) which is not supported for the Resource (URI) you are referencing.\n\t\tTo understand which methods are supported for each resource, and which content-type is expected, see the documentation for that Resource.',\n\t\t500 => 'Server Error',\n\t\t);\n\n\t\tif(array_key_exists($code, $errors)):\n\t\t\treturn $errors[$code];\n\t\tendif;\n\n\t\treturn '';\n\t}", "public function actionError() {\n if ($error = Yii::app()->errorHandler->error) {\n\t\t\t$this->sendRestResponse(500,array(\n\t\t\t\t'status' => false,\n\t\t\t\t'message' => $error['message'],\n\t\t\t\t'data' => $error,\n\t\t\t));\t\t\t\n }\n\t}", "protected function verifyResponse(Klarna_Checkout_HTTP_Response $result)\n {\n // Error Status Code recieved. Throw an exception.\n if ($result->getStatus() >= 400 && $result->getStatus() <= 599) {\n throw new Klarna_Checkout_ConnectorException(\n $result->getData(), $result->getStatus()\n );\n }\n }", "function APIerror() {\n\t\t$session = JFactory::getSession();\n\n\t\t$order_id = $session->get('wbtypayments.order_id', 0);\n\n\t\t// Initialize database\n\t\t$db = JFactory::getDBO();\n\n\t\tsession_start();\n\t\t$resArray=$_SESSION['reshash'];\n\n\t\t// Get any URL errors\n\t\tif(isset($_SESSION['curl_error_no'])) {\n\t\t\t$errorCode= $_SESSION['curl_error_no'] ;\n\t\t\t$errorMessage=$_SESSION['curl_error_msg'] ;\n\t\t\tsession_unset();\n\t\t} else {\n\t\t\t// Create a new row in the errors table with this order ID\n\t\t\t$query = \"INSERT INTO #__wbty_payments_errors (`number`,`message`,`order_id`) VALUES ('\".$resArray['L_ERRORCODE0'].\"','\".$resArray['L_LONGMESSAGE0'].\"','$order_id')\";\n\t\t\t$db->setQuery($query);\n\t\t\t$db->query();\n\t\t\t$error_id = $db->insertid();\n\n\t\t\tforeach($resArray as $key => $value) {\n\t\t\t\tswitch ($key) {\n\t\t\t\t\tcase 'L_ERRORCODE0':\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'L_LONGMESSAGE0':\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$query = \"INSERT INTO #__wbty_payments_error_extra_items (`error_id`,`name`,`value`) VALUES ('\".$error_id.\"','\".$key.\"','\".$value.\"')\";\n\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t$db->query();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}", "private function _check_valid_response($http_body_json = '')\n {\n if(!in_array($this->status_code, $this->valid_response_codes))\n {\n //@todo log bad response info\n $body_string = '';\n $body_array = array();\n $body_array = json_decode($http_body_json, true);\n if(!empty($body_array))\n {\n foreach($body_array as $k => $v)\n {\n $body_string .= \"$k: $v \";\n }\n }\n\n $x_message_data = 'X-Chirpify-Message: ' . $body_string;\n header($x_message_data);\n $header_data = 'HTTP/1.1 ' . $this->status_code;\n header($header_data);\n\n exit();\n }\n }", "public function testFacebookPagesRequest()\n {\n $stream = $this->getStream('FacebookPages', '27469195051');\n $response = $stream->getResponse();\n\n $this->checkResponseIntegrity('FacebookPages', $response);\n\n $errors = $stream->getErrors();\n $this->assertTrue(empty($errors));\n }", "public function parseErrors(Response $response);", "function isAppsApproved($response) \n {\n $fbErrorMessage = 'must be reviewed and approved by Facebook';\n if ($response['error'] == 500 && isset($response['message']->message, $fbErrorMessage) && strpos($response['message']->message, $fbErrorMessage) !== false) {\n return false;\n }\n\n return true;\n }", "public function isServerError();", "public function testInvalidToken()\n {\n $this->sessionInfo['logged_in'] = true;\n $this->sessionInfo['token'] = 'foo';\n\n $this->session($this->sessionInfo);\n\n $response = $this->call('GET', '/api/user');\n\n $this->assertEquals(200, $response->getStatusCode());\n\n $decoded = json_decode($response->getContent());\n\n $this->assertEquals('error', $decoded->status);\n }", "public function handleFailure($response) {\n }", "protected function get_json_last_error()\n {\n }", "public function theResponseIsGraphQLErrorWith(string $message)\n {\n $this->assertResponseStatus(Response::HTTP_OK);\n\n //success GraphQL response should not contains errors\n if ($this->client->getGraphQL()) {\n if ($this->isValidGraphQLResponse() && $errors = $this->getGraphQLResponseError()) {\n $errorsStack = '';\n foreach ($errors as $error) {\n $errorsStack .= $error->message.\"\\n\";\n }\n\n Assert::assertContains($message, $errorsStack);\n } else {\n $this->graphQLContext->debugLastQuery();\n throw new AssertionFailedError('The response is not the expected error response.');\n }\n }\n }", "public function get_error();", "public function get_error();", "public function getErrorResponses();", "public function validate_response($abkashresponse) {\n\t\tif(is_null($abkashresponse))\n\t\t{\n\t\t\treturn \"Config Error . Please Contact with Support\";;\n\t\t}\n\t\tswitch ($abkashresponse->trxStatus) {\n\t\tcase '0010':\n\t\tcase '0011':\n\t\t\tthrow new Exception('Transaction is pending, please try again later.');\n\t\t\tbreak;\n\t\tcase '0100':\n\t\t\tthrow new Exception('Transaction ID is valid but transaction has been reversed.');\n\t\t\tbreak;\n\t\tcase '0111':\n\t\t\tthrow new Exception('Transaction is failed.');\n\t\t\tbreak;\n\t\tcase '1001':\n\t\t\tthrow new Exception('Invalid MSISDN input. Try with correct mobile no.');\n\t\t\tbreak;\n\t\tcase '1002':\n\t\t\tthrow new Exception('Invalid transaction ID.');\n\t\t\tbreak;\n\t\tcase '1003':\n\t\t\tthrow new Exception('Authorization Error, please contact site admin.');\n\t\t\tbreak;\n\t\tcase '1004':\n\t\t\tthrow new Exception('Transaction ID not found.');\n\t\t\tbreak;\n\t\tcase '9999':\n\t\t\tthrow new Exception('System error, could not process request. Please contact site admin.');\n\t\t\tbreak;\n\t\tcase '0000':\n\t\t\treturn $response;\n\t\t}\n\t}", "function handle_validate_purchase_code_response($response) {\r\n\r\n global $internal_err;\r\n\r\n if($response[\"status\"] !== 200) {\r\n\r\n // If error exist\r\n if($response[\"status\"] === 404) {\r\n set_field_error(\"purchase_code\", \"Invalid Purchase Code!\");\r\n }else {\r\n set_field_error(\"purchase_code\", json_decode(json_encode($response[\"result\"]), true)[\"error\"]);\r\n show_err($internal_err);\r\n }\r\n\r\n redirect_to_home();\r\n }\r\n return $response[\"result\"]->item;\r\n}", "function errorCode()\n {\n }", "public function invalid(BaseResponse $response);", "public function test_receive_throwsBadResponseStatus_ifBadStatus()\n\t{\n\t\t$this->setExpectedException('Jstewmc\\\\Api\\\\Exception\\\\BadResponseStatus');\n\t\t\n\t\t$this->url->getQuery()->setParameter('code', 301);\n\t\t\n\t\t(new Client())\n\t\t\t->send(new Request\\Get((string) $this->url))\n\t\t\t->receive(new Response\\Json());\n\t\t\n\t\treturn;\n\t}", "public function testQueryWithError(): void\n {\n $result = $this->httpGraphql($this->queries['examplesWithError'], [\n 'expectErrors' => true,\n ]);\n\n self::assertArrayHasKey('errors', $result);\n self::assertCount(1, $result['errors']);\n self::assertArrayHasKey('message', $result['errors'][0]);\n self::assertArrayHasKey('locations', $result['errors'][0]);\n }", "public function isError()\n {\n return isset($this->decodedBody['error']) || isset($this->decodedBody['errors']);\n }", "function getResponseErrors( $response ) {\n\t\tif ( is_array( $response ) && array_key_exists( 'RESULT', $response ) ) {\n\t\t\t$resultCode = $response['RESULT'];\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\t$errors = array( );\n\n\t\tswitch ( $resultCode ) {\n\t\t\tcase '0':\n\t\t\t\t$errors['1'] = WmfFramework::formatMessage( 'payflowpro_gateway-response-0' );\n\t\t\t\t$this->finalizeInternalStatus( 'complete' );\n\t\t\t\tbreak;\n\t\t\tcase '126':\n\t\t\t\t$errors['5'] = WmfFramework::formatMessage( 'payflowpro_gateway-response-126-2' );\n\t\t\t\t$this->finalizeInternalStatus( 'pending' );\n\t\t\t\tbreak;\n\t\t\tcase '12':\n\t\t\t\t$errors['2'] = WmfFramework::formatMessage( 'payflowpro_gateway-response-12' );\n\t\t\t\t$this->finalizeInternalStatus( 'failed' );\n\t\t\t\tbreak;\n\t\t\tcase '13':\n\t\t\t\t$errors['2'] = WmfFramework::formatMessage( 'payflowpro_gateway-response-13' );\n\t\t\t\t$this->finalizeInternalStatus( 'failed' );\n\t\t\t\tbreak;\n\t\t\tcase '114':\n\t\t\t\t$errors['2'] = WmfFramework::formatMessage( 'payflowpro_gateway-response-114' );\n\t\t\t\t$this->finalizeInternalStatus( 'failed' );\n\t\t\t\tbreak;\n\t\t\tcase '4':\n\t\t\t\t$errors['3'] = WmfFramework::formatMessage( 'payflowpro_gateway-response-4' );\n\t\t\t\t$this->finalizeInternalStatus( 'failed' );\n\t\t\t\tbreak;\n\t\t\tcase '23':\n\t\t\t\t$errors['3'] = WmfFramework::formatMessage( 'payflowpro_gateway-response-23' );\n\t\t\t\t$this->finalizeInternalStatus( 'failed' );\n\t\t\t\tbreak;\n\t\t\tcase '24':\n\t\t\t\t$errors['3'] = WmfFramework::formatMessage( 'payflowpro_gateway-response-24' );\n\t\t\t\t$this->finalizeInternalStatus( 'failed' );\n\t\t\t\tbreak;\n\t\t\tcase '112':\n\t\t\t\t$errors['3'] = WmfFramework::formatMessage( 'payflowpro_gateway-response-112' );\n\t\t\t\t$this->finalizeInternalStatus( 'failed' );\n\t\t\t\tbreak;\n\t\t\tcase '125':\n\t\t\t\t$errors['3'] = WmfFramework::formatMessage( 'payflowpro_gateway-response-125-2' );\n\t\t\t\t$this->finalizeInternalStatus( 'failed' );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$errors['4'] = WmfFramework::formatMessage( 'payflowpro_gateway-response-default' );\n\t\t\t\t$this->finalizeInternalStatus( 'failed' );\n\t\t}\n\n\t\treturn $errors;\n\t}", "function media_theplatform_mpx_check_empty_response($response, $service) {\n // No response (this is what we want in this case)\n if(!strlen($response))\n return array('status' => 'success');\n\n // If there is a response, look for an exception\n $responseObject = json_decode($response);\n // Make sure the response decodes, if not, return it's text\n if(!is_object($responseObject))\n return array('status' => 'error', 'response' => t('Error response from @service: @response', array('@service' => $service, '@response' => $response)));\n // Check for an exception on the response, return it's description if set\n if(property_exists($responseObject, 'isException'))\n return array('status' => 'error', 'response' => t('Exception from @service: @response', array('@service' => $service, '@response' => $responseObject->description)));\n}", "public function testDeniedProtectedMethodWithInvalidAccessToken()\n {\n $this->post('/user-info', [], [\n 'authorization' => 'asdeasdasdasdasdasd',\n ])\n ->seeJsonStructure(['error', 'message', 'hint'])\n ->seeStatusCode(401);\n }", "public function validateLowProfileCodeResponse($response) {\n\n\t\tif (\n\t\t\t$response['ResponseCode'] == 0 &&\n\t\t\t$response['DealResponse'] == 0 &&\n\t\t\t$response['OperationResponse'] == 0\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function testShortenThrowsExceptionIfApiResponseHasInvalidStatusCode()\n {\n $provider = new BitlyProvider($this->getMockClientFactory($this->getMockResponseWithInvalidStatusCode()), $this->getMockAuthentication());\n $provider->shorten($this->getBaseMockLink());\n }", "public function facebook_count_callback($response) {\n if($this->has_http_error($response)) {\n return false;\n }\n $body = json_decode($response['body'], true);\n return isset($body['share']['share_count']) ? intval($body['share']['share_count']) : false;\n }", "public function theResponseIsGraphQLErrorWithCode(string $code)\n {\n $this->assertResponseStatus(Response::HTTP_OK);\n\n //success GraphQL response should not contains errors\n if ($this->client->getGraphQL()) {\n if ($this->isValidGraphQLResponse() && $errors = $this->getGraphQLResponseError()) {\n $errorsStack = '';\n foreach ($errors as $error) {\n $errorsStack .= $error->code.\"\\n\";\n }\n\n Assert::assertContains($code, $errorsStack);\n } else {\n $this->graphQLContext->debugLastQuery();\n throw new AssertionFailedError('The response is not the expected error response.');\n }\n }\n }", "private function assertError($response)\n {\n $response->assertStatus(500)\n ->assertJson([\n 'status' => 'error'\n ]);\n }", "private function getSocialUserInfo($access_token, $social_app)\n {\n $user = NULL;\n $user_exist = NULL;\n $reference_where = [];\n $email_where = [];\n $user_data_array = [];\n if ($social_app === 'facebook') {\n $client = new HTTPClient('https://graph.facebook.com/me?fields=id,name,email,gender,age_range,picture&access_token=' . $access_token);\n $response = $client->setOptions(['ssl-verify-peer' => null])->send();\n $response = $response->getBody();\n $response = json_decode($response, true);\n if (!empty($response) and is_array($response) and empty($response['error'])) {\n if (!empty($response['id'])) {\n $reference_where['facebook_reference'] = Str::substr($response['id'], 0, 50);\n $user_data_array['facebook_reference'] = Str::substr($response['id'], 0, 50);\n $user = User::where('facebook_reference', '=', $reference_where['facebook_reference'])\n ->first();\n }\n if (!empty($response['email'])) {\n $email_where['email'] = Str::substr($response['email'], 0, 254);\n $user_data_array['email'] = Str::substr($response['email'], 0, 254);\n $user_exist = User::where('email', '=', $user_data_array['email'])\n ->first();\n }\n if (!empty($response['name']))\n $user_data_array['full_name'] = Str::substr($response['name'], 0, 254);\n if (!empty($response['gender']))\n $user_data_array['gender'] = Str::substr($response['gender'], 0, 6);\n if (!empty($response['age_range'])) {\n $age = null;\n if (!empty($response['age_range']['min']) and !empty($response['age_range']['max'])) {\n $age = ceil(((int)$response['age_range']['min'] + (int)$response['age_range']['max']) / 2);\n } else if (!empty($response['age_range']['min'])) {\n $age = (int)$response['age_range']['min'];\n } else if (!empty($response['age_range']['max'])) {\n $age = (int)$response['age_range']['max'];\n }\n $user_data_array['age'] = $age;\n unset($age);\n }\n }\n } else {\n $client = new HTTPClient('https://www.googleapis.com/oauth2/v3/tokeninfo?fields=sub,gender,ageRange,email,name,picture,given_name,family_name,locale&id_token=' . $access_token);\n $response = $client->setOptions(['ssl-verify-peer' => null])->send();\n $response = $response->getBody();\n $response = json_decode($response, true);\n\n if (!empty($response) and is_array($response) and empty($response['error_description'])) {\n if (!empty($response['sub'])) {\n $reference_where['gplus_reference'] = Str::substr($response['sub'], 0, 50);\n $user_data_array['gplus_reference'] = Str::substr($response['sub'], 0, 50);\n $user = User::where('gplus_reference', '=', $reference_where['gplus_reference'])\n ->first();\n }\n if (!empty($response['email'])) {\n $email_where['email'] = Str::substr($response['email'], 0, 254);\n $user_data_array['email'] = Str::substr($response['email'], 0, 254);\n $user_exist = User::where('email', '=', $user_data_array['email'])\n ->first();\n }\n if (!empty($response['name']))\n $user_data_array['full_name'] = Str::substr($response['name'], 0, 254);\n if (!empty($response['gender']))\n $user_data_array['gender'] = Str::substr($response['gender'], 0, 6);\n if (!empty($response['picture']))\n $user_data_array['picture_path'] = Str::substr($response['picture'], 0, 254);\n if (!empty($response['ageRange'])) {\n $age = null;\n if (!empty($response['ageRange']['min']) and !empty($response['ageRange']['max'])) {\n $age = ceil(((int)$response['ageRange']['min'] + (int)$response['ageRange']['max']) / 2);\n } else if (!empty($response['ageRange']['min'])) {\n $age = (int)$response['ageRange']['min'];\n } else if (!empty($response['ageRange']['max'])) {\n $age = (int)$response['ageRange']['max'];\n }\n $user_data_array['age'] = $age;\n unset($age);\n }\n }\n }\n\n if(!empty($user))\n return [\n 'user' => $user,\n 'user_data_array' => $user_data_array,\n 'user_with_email_already_exist' => false\n ];\n\n if(!empty($user_exist))\n return [\n 'user' => $user_exist,\n 'user_data_array' => $user_data_array,\n 'user_with_email_already_exist' => true\n ];\n\n return [\n 'user' => NULL,\n 'user_data_array' => $user_data_array,\n 'user_with_email_already_exist' => false\n ];\n }", "private function assertError($response, $code = 500) {\n $response->assertStatus($code)\n ->assertJson([\n 'status' => 'error',\n 'http_status_code' => $code\n ]);\n }", "function check_auth_response_code($status) {\n\n if ($status != 'S000') {\n $message = get_ticket_error_message($status);\n return result_error($status,$message);\n }\n return result_success();\n}", "protected function fetchResponseError($response) {\n\t\tif (isset($response['error'])) {\n\t\t\treturn array(\n\t\t\t\t'code' => $response['error']['code'],\n\t\t\t\t'message' => $response['error']['message'],\n\t\t\t);\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}", "public function validateToken() \n {\n return API::response()->array(['status' => 'success'])->statusCode(200);\n }", "function getErrorResponse($error){\n\t\t//Create skeleton for all responses as json.\n\t\t$response = array(\n\t\t\t'conv' => array(\n\t\t\t\t'error' => $error['code'],\n\t\t\t\t'msg' => $error['msg']\n\t\t\t)\n\t\t);\n\t\t\n\t\t//If format is set, validate it otherwise default to xml or if not set, set to xml\n\t\tif (isset($_GET['format'])){\n\t\t\t$format = checkFormatValueValid($_GET['format']) ? $_GET['format'] : \"xml\";\n\t\t} else {\n\t\t\t$format = \"xml\";\n\t\t}\n\t\treturn sendResponse($response, $format);\n\t}", "private function verifyResponse()\n {\n $errorMessages = [];\n \n if (!isset($this->endpoint)) {\n $errorMessages[] = \"$endpoint must be set.\";\n }\n \n if (!isset($this->statusCode)) {\n $errorMessages[] = \"$statusCode must be set.\";\n }\n \n if (!is_array($this->data)) {\n $errorMessages[] = \"$data must be formatted as an array.\";\n }\n \n if (!is_array($this->errors)) {\n $errorMessages[] = \"$errors must be formatted as an array.\";\n }\n\n if (!empty($errorMessages)) {\n return $errorMessages;\n }\n \n return true;\n }", "public function SignInFacebook(){\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n $email = $_POST['email'];\n $pic1 = $_POST['pic1'];\n $first_name = $_POST['first_name']; \n $last_name = $_POST['last_name'];\n $user_name = $_POST['user_name'];\n $gender = $_POST['gender'];\n $birth_date = $_POST['birth_date'];\n $login_type = $_POST['login_type'];\n $latitude = $_POST['latitude'];\n $longitude = $_POST['longitude'];\n $source_id = $_POST['source_id'];\n $format = $_POST['format'];\n \n $dobarr = explode(\"/\",$birth_date);\n $month = $dobarr[0];\n $day = $dobarr[1];\n $year = $dobarr[2];\n $dob=$year.'-'.$month.'-'.$day;\n \n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n $result = $res->check_user($email,$conn);\n if($result == 0){\n $response = $res->sign_up_facebook($email,$pic1,$first_name,$last_name,$user_name,$gender,$dob,$login_type,$latitude,$longitude,$source_id,$conn);\n }\n elseif($result > 0){\n $response = $res->sign_in_facebook($email,$pic1,$first_name,$last_name,$user_name,$gender,$dob,$latitude,$longitude,$source_id,$conn);\n $this->dbClose();\n // $error = array('status' => \"0\",\"msg\" => \"Email Already Exists \");\n // ($_REQUEST['format'] == 'xml') ? $this->response($this->xml($error), 400) : $this->response($this->json($error), 400);\n }\n }", "public function authenticate($access_token_val='')\r\n { \r\n /**********make the access token Extended by extend_access_token() and get extended token********/\r\n $extended_access_token_val = $this->extend_access_token($access_token_val);\r\n if($extended_access_token_val==''){\r\n $access_token_val = $extended_access_token_val;\r\n } \r\n\r\n \r\n /***running FQL to fetch data from facebook ****/\r\n // $fql = urlencode(\"SELECT post_id,viewer_id,source_id,updated_time,created_time,actor_id,message,attachment,permalink ,type FROM stream WHERE source_id = me() AND actor_id = me() order by created_time desc LIMIT 5\");\r\n $fql = urlencode(\"SELECT uid,about_me, birthday, current_location, first_name, has_added_app, hometown_location, last_name, locale, birthday_date, pic, pic_with_logo, pic_big, pic_big_with_logo, pic_small, pic_small_with_logo, pic_square, pic_square_with_logo, profile_url, proxied_email, email, contact_email, sex, meeting_sex, status, timezone, website, education_history, work_history, work, education, hs_info, religion, relationship_status, political, activities, interests, family, music, tv, movies, books, username, quotes, sports, favorite_teams, favorite_athletes, inspirational_people, languages FROM user WHERE uid = me()\");\r\n $content = $this->process_fql($fql,$access_token_val);\r\n \r\n //pr($content['data'][0],1);\r\n \r\n $user_meta = $this->session->userdata('current_user_session'); // get current user data loggedin\r\n\t\t\r\n\t\t/*pr($content['data'][0]);\r\n\t\tpr($content,1);\r\n\t\texit;*/\r\n \r\n if(isset($content->error))\r\n echo 'A user of access token '.$access_token_val. ' got following error while fetching user details'.$temp_ret_graph;\r\n else\r\n { \r\n\t\t\t\tif(empty($user_meta)) { \r\n\t\t\t\t\t\r\n\t\t\t\t if($this->login_by_facebook($content['data'][0],$access_token_val)){\r\n\t\t\t\t\t\tredirect(base_url().'user/profile'); \r\n\t\t\t\t\t\t\r\n\t\t\t\t } else {\r\n\t\t\t\t\t\tif($this->register_by_facebook($content['data'][0],$access_token_val)){\r\n\t\t\t\t\t\t\tif($this->login_by_facebook($content['data'][0],$access_token_val)){\r\n\t\t\t\t\t\t\t\t\tredirect(base_url().'user/profile');\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\techo 'login failed!';\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//echo 'registration failed!';\r\n\t\t\t\t\t set_error_msg(message_line('fb_reg_fail')); // either user email is not verified in fb \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// or kept private, so goto signup page\r\n\t\t\t\t\t redirect(base_url('user/signup'));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} \r\n\t\t\t\telse {\r\n\t\t\t\t\tif($user_meta[0]['s_email'] == $content['data'][0]['email'] ){\r\n\t\t\t\t\t\t$content['data'][0]['access_token'] = $access_token_val;\r\n\t\t\t\t\t\t$this->user_model->update_data(array(\"s_facebook_credential\"=>serialize($content['data'][0])),\r\n\t\t\t\t\t\t\t\tarray(\"i_id\"=> $user_meta[0]['i_id'])\r\n\t\t\t\t\t ); \r\n\t\t\t\t\t\tset_success_msg('facebook account add success');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tset_error_msg('facebook account email not match');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tredirect(base_url().\"user/profile\");\r\n\t\t\t\t}\r\n } \r\n\r\n\t\t}", "public function _facebook_verify($code) {\n if (!isset($_REQUEST['code']) || empty($_REQUEST['code'])) {\n return false;\n }\n\n $verify = fb::access($_REQUEST['code'], G_URL.'user/facebook?redirect='.urlencode($_REQUEST['redirect']));\n\n if (!isset($verify['access_token'])) {\n return false;\n }\n\n $fb = new fb($verify['access_token']);\n $me = $fb->api('/me');\n $me['access_token'] = $verify['access_token'];\n\n return $me;\n\n }", "public function getErrorResponse()\n {\n $result['responseCode'] = self::RESPONSE_LOGIN_ERROR;\n return $result;\n }", "function fetchErrorCode($error)\n{\n if (method_exists($error, 'getStatusCode')) {\n return $error->getStatusCode();\n }\n\n if (method_exists($error, 'getCode')) {\n return $error->getCode();\n }\n\n return 0;\n}", "public function test_get_errors_if_category_not_exist()\n {\n $data = [\n 'category_id' => 10,\n 'name' => 'Test_item',\n 'value' => 50,\n 'quality' => -10,\n ];\n\n $response = $this->json('POST', '/api/items/', $data);\n\n $response->assertStatus(404);\n\n $response->assertSee('errors');\n }", "function validateResponse($page) {\n\treturn array_key_exists('headers', $page) && array_key_exists('headersRaw', $page) && array_key_exists('body', $page) && array_key_exists('error', $page)\n\t\t&& is_array($page['headers']) && is_array($page['headersRaw']) && is_string($page['body']);\n}", "public function check_authorization_response(){\n if(!isset($_SESSION))\n session_start();\n\n // no LINE_CRSF is set in session\n if(!isset($_SESSION['LINE_CRSF']))\n throw new Exception('Fail to check CRSF token');\n\n // CRSF token not match\n $state = isset($_GET['state']) ? $_GET['state'] : null;\n // equalty check can be rewrite with hash_equals()\n if($_SESSION['LINE_CRSF'] !== $state)\n throw new Exception('CRSF token not match');\n\n unset($_SESSION['LINE_CRSF']);\n\n // user denies the premissions requested\n // NOTICE:\n // LINE server redirect user who does not have\n // developer role with following error (in GET data)\n // error=access_denied\n // error_description=The+authorization+server+denied+the+request.+This+channel+is+now+developing+status.+User+need+to+have+developer+role\n // To solve this, go to your LINE Login channel then\n // click the Developing label on the top right to proceed\n // publish your channel\n if(isset($_GET['error'])){\n throw new Exception(json_encode(array(\n 'error' => $_GET['error'],\n 'error_description' => $_GET['error_description'],\n )));\n }\n\n $this->authorization_code = $_GET['code'];\n return $this->authorization_code;\n }", "protected function invalidResponse(){\n return response()->json([\n 'ResultCode' => 1,\n 'ResultDesc' => 'Failed to complete the transaction',\n 'ThirdPartyTransID' => 0\n ]);\n\n }", "public function error()\n {\n return curl_error($this->curl);\n }", "public function error()\n {\n return curl_error($this->curl);\n }", "public function hasError();", "public function hasError();", "public function hasError();", "public function hasError();", "protected function error()\n {\n $this->response = $this->response->withStatus(500);\n $this->jsonBody([\n 'input' => $this->payload->getInput(),\n 'error' => $this->payload->getOutput(),\n ]);\n }", "public function testErrorMessageBadFormat()\n {\n $errorResponse = json_decode('{\n \"error\": {\n \"code\": \"UNPROCESSABLE_ENTITY\",\n \"message\": {\n \"errors\": [\n \"Bad format\",\n \"Bad format 2\"\n ],\n \"bad_data\": [\n {\n \"first_message\": \"Bad format 3\",\n \"second_message\": \"Bad format 4\",\n \"thrid_message\": \"Bad format 5\"\n }\n ]\n },\n \"errors\": []\n }\n }', true);\n\n\n try {\n Requestor::handleApiError(null, 404, $errorResponse);\n } catch (EasyPostException $error) {\n $this->assertEquals(\n 'Bad format, Bad format 2, Bad format 3, Bad format 4, Bad format 5',\n $error->getMessage()\n );\n }\n }", "public function fbcallback() {\n\t\t$this->autoRender = false;\n\n\n\t\t$fb = new Facebook\\Facebook([\n\t\t\t'app_id' => '1038913562917167',\n\t\t\t'app_secret' => 'c0df3e628a09c24f972985ad47dee466',\n\t\t\t'default_graph_version' => 'v2.10',\n\t\t]);\n\n\t\t$helper = $fb->getRedirectLoginHelper();\n\t\t$accessToken = $helper->getAccessToken();\n\n\t\tdebug($accessToken);\n\n\t\tif (isset($_GET['state'])) {\n\t\t\tdebug($_GET['state']);\n\t\t}\n\n\t\ttry {\n\t\t\t$accessToken = $helper->getAccessToken();\n\t\t} catch(Facebook\\Exceptions\\FacebookResponseException $e) {\n\t\t\t// When Graph returns an error\n\t\t\techo 'Graph returned an error: ' . $e->getMessage();\n\t\t\texit;\n\t\t} catch(Facebook\\Exceptions\\FacebookSDKException $e) {\n\t\t\t// When validation fails or other local issues\n\t\t\techo 'Facebook SDK returned an error: ' . $e->getMessage();\n\t\t\texit;\n\t\t}\n\n\t\tif (! isset($accessToken)) {\n\t\t\tif ($helper->getError()) {\n\t\t\t\theader('HTTP/1.0 401 Unauthorized');\n\t\t\t\techo \"Error: \" . $helper->getError() . \"\\n\";\n\t\t\t\techo \"Error Code: \" . $helper->getErrorCode() . \"\\n\";\n\t\t\t\techo \"Error Reason: \" . $helper->getErrorReason() . \"\\n\";\n\t\t\t\techo \"Error Description: \" . $helper->getErrorDescription() . \"\\n\";\n\t\t\t\tvar_dump($helper->getError());\n\t\t\t} else {\n\t\t\t\theader('HTTP/1.0 400 Bad Request');\n\t\t\t\techo 'Bad request';\n\t\t\t}\n\t\t\texit;\n\t\t}\n\n\t\t// Logged in\n\t\techo '<h3>Access Token</h3>';\n\t\tvar_dump($accessToken->getValue());\n\n\t\t// The OAuth 2.0 client handler helps us manage access tokens\n\t\t$oAuth2Client = $fb->getOAuth2Client();\n\n\t\t// Get the access token metadata from /debug_token\n\t\t$tokenMetadata = $oAuth2Client->debugToken($accessToken);\n\t\techo '<h3>Metadata</h3>';\n\t\tvar_dump($tokenMetadata);\n\n\t\t// Validation (these will throw FacebookSDKException's when they fail)\n\t\t$tokenMetadata->validateAppId('1038913562917167'); // Replace {app-id} with your app id\n\t\t\n\t\t// If you know the user ID this access token belongs to, you can validate it here\n\t\t//$tokenMetadata->validateUserId('123');\n\t\t$tokenMetadata->validateExpiration();\n\n\t\tif (! $accessToken->isLongLived()) {\n\t\t\t// Exchanges a short-lived access token for a long-lived one\n\t\t\ttry {\n\t\t\t\t$accessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);\n\t\t\t} catch (Facebook\\Exceptions\\FacebookSDKException $e) {\n\t\t\t\techo \"<p>Error getting long-lived access token: \" . $helper->getMessage() . \"</p>\\n\\n\";\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tvar_dump($accessToken->getValue());\n\t\t}\n\n\t\t$_SESSION['fb_access_token'] = (string) $accessToken;\n\t\tdebug($_SESSION['fb_access_token'] );\n\t\t$this->log($_SESSION['fb_access_token'] );\n\n\t\t// User is logged in with a long-lived access token.\n\t\t// You can redirect them to a members-only page.\n\t\t//header('Location: https://example.com/members.php');\n\t}", "public function parse_response($resp)\n {\n if ($resp['data']==null)\n {\n return ['error'=>404, 'message'=>'Data from youtube not found'];\n }\n else\n {\n return ['error'=>0, 'data'=>$resp['data']];\n }\n }", "private function assertErrorValidation($response)\n {\n $response->assertStatus(422)\n ->assertJson([\n 'status' => 'error'\n ]);\n }", "protected function unknown()\n {\n $this->response = $this->response->withStatus(500);\n $this->jsonBody([\n 'error' => 'Unknown domain payload status',\n 'status' => $this->payload->getStatus(),\n ]);\n }", "public function testShowUserFail()\n {\n $this->withoutMiddleware();\n $response = $this->get('/api/users/2');\n $response->assertJsonStructure([\n \"meta\" => [\n \"message\",\n \"code\"\n ],\n ]);\n $response->assertJson([\n \"meta\" => [\n \"code\" => Response::HTTP_NOT_FOUND\n ]\n ]);\n }", "protected function checkResponse($response)\n {\n if ($response == 'Not found') {\n $result = $response;\n } else {\n\n try {\n if ($response === false)\n throw new EServiceUnavailable('Empty search');\n\n $result = $this->decodeResponse($response);\n\n if (!is_object($result)) {\n throw new EResponseFail('The rpc response is empty, or have invalid format');\n }\n\n //if ('failure' == $result->type) {\n // throw new EDepositApiCall($result->errormsg, $result->errorcode);\n //}\n }\n catch (EResponseFail $e){\n $result = $e->errorMessage();\n //return false;\n }\n catch (EServiceUnavailable $e){\n $result = $e->errorMessage();\n //return false;\n }\n }\n \n return $result;\n }" ]
[ "0.6256429", "0.6234275", "0.62125367", "0.6202816", "0.619115", "0.6112488", "0.59841853", "0.59429115", "0.59417385", "0.5915669", "0.5915669", "0.5914272", "0.5861633", "0.5848695", "0.5822073", "0.57939005", "0.5764143", "0.574654", "0.5718953", "0.5672794", "0.56537724", "0.5609037", "0.5580286", "0.55712223", "0.5567401", "0.55638593", "0.55472225", "0.5546991", "0.55399513", "0.5535256", "0.54895204", "0.5449957", "0.542615", "0.5423341", "0.5421245", "0.542044", "0.54163617", "0.54163617", "0.5415077", "0.54104", "0.5408542", "0.5406591", "0.54052275", "0.54006577", "0.53853893", "0.53841996", "0.5373201", "0.5358109", "0.535653", "0.53421587", "0.5339827", "0.5338473", "0.53350884", "0.53350884", "0.5332535", "0.53294075", "0.5319534", "0.5316016", "0.5314138", "0.5314104", "0.53111744", "0.5302046", "0.5297219", "0.5295476", "0.5291735", "0.5282779", "0.5280079", "0.5278571", "0.52703524", "0.5259374", "0.525597", "0.52455634", "0.5237078", "0.5233786", "0.5233431", "0.52330726", "0.5227832", "0.5222959", "0.5222631", "0.5220261", "0.5216296", "0.52080023", "0.52015346", "0.5201178", "0.51984197", "0.5196793", "0.51953566", "0.51953566", "0.51908326", "0.51908326", "0.51908326", "0.51908326", "0.51881963", "0.51786584", "0.51777935", "0.51762146", "0.51745063", "0.5167166", "0.51671296", "0.51670396" ]
0.73957115
0
Returns the entire path in a single string
public function __toString() { return $this->toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPath() {\n if (empty($this->uriParts['path'])) {\n return '';\n }\n return implode('/', array_map(\"rawurlencode\", explode('/', $this->uriParts['path'])));\n }", "public static function getPath() {\n\t\tif ($args = func_get_args()) {\n\t\t\t$path = self::_getPath($args);\n\t\t} else {\n\t\t\t$path = '';\n\t\t}\n\t\treturn self::fixSlash($path);\n\t}", "public function GetPath()\n\t{\n\t\tif (!empty($this->path))\n\t\t\treturn $this->path;\n\n\t\treturn '';\n\t}", "public function getPath()\n {\n\n if (empty($this->_path))\n return '';\n\n return $this->_path;\n }", "function getPath() {\n $ruta = realpath(dirname(__FILE__));\n if ( strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' )\n $separator = '\\\\';\n else\n $separator = '/';\n $aRuta = explode($separator,$ruta);\n $ruta = '';\n foreach($aRuta as $index => $value)\n if ( $index < count($aRuta) - 1 ) $ruta .= $value.$separator;\n return $ruta;\n}", "public function toString() {\n\t\treturn $this->path();\n\t}", "public function path(): string\n {\n return $this->path ??= trim(\n $this->api->stripBasePath($this->request->getUri()->getPath()),\n '/',\n );\n }", "function getPath(): string;", "public function path(): string\n {\n $path = $this->uri()->getPath();\n\n return match (true) {\n empty($path) => '/',\n $path[0] !== '/' => '/' . $path,\n default => $path\n };\n }", "public function path($path = '')\n\t{\n\t\treturn $this['path'].ltrim($path, '/');\n\t}", "public function path()\n\t{\n\t\treturn $this->CLI->stringQuery($this->SqueezePlyrID.\" path ?\");\n\t}", "public function get_path() : string\n {\n return $this->path;\n }", "public function path(): string\n {\n return components_path($this->name);\n }", "public function path(){\n if(!empty($this->segments)){\n return implode(\"/\", $this->segments);\n }\n return '';\n }", "public function toString()\n {\n $path = '';\n if (!empty($this->dirs)) {\n foreach ($this->dirs as $dir) {\n $path .= $dir . DIRECTORY_SEPARATOR;\n }\n }\n $path .= $this->file;\n return $path;\n }", "public function getFullPath(): string;", "public function get_path(): string\n {\n return $this->path;\n }", "public function getFullPath();", "public function getFullPath()\n\t{\n\t\treturn Generic::getCompletePath($this->getPath(), $this->getBasename());\n\t}", "public function path()\n {\n $prefix = (isset($this->attributes[self::PREFIX]) ? $this->attributes[self::PREFIX] : '');\n\n return $prefix . $this->path;\n }", "public function getFullPath(): string\n {\n return $this->getRoot() . $this->getPathExt();\n }", "public function getPath(): string\n {\n $path = $this->getPathPattern();\n $path = $this->replaceVariablesWithValues($path);\n $path = $this->removeNonSelectedVariables($path);\n\n return $path;\n }", "public function path(): string\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;", "public function\n\tGetPath():\n\t?String {\n\t/*//\n\treturn(string)\n\tfetch the requested path as a string.\n\t//*/\n\n\t\treturn $this->Path;\n\t}", "public function getPath() : string\n {\n return $this->path;\n }", "public function getPath() : string\n {\n return $this->path;\n }", "public function getPath()\n {\n \treturn implode(' / ', array_map(create_function('$a', 'return trim($a->getName());'), $this->getParents()));\n }", "public function path(): string;", "public function path(): string;", "public function get_path( $path = '' ) {\n\t\treturn $this->directory . ltrim( $path, '/' );\n\t}", "public function getPath(): string {\n\t\treturn $this->path;\n\t}", "public function getPath(): string\n {\n return $this->path;\n }", "public function getPath(): string\n {\n return $this->path;\n }", "public function getPath(): string\n {\n return $this->path;\n }", "public function getPath(): string\n {\n return $this->path;\n }", "public function getPath(): string\n {\n return $this->path;\n }", "public function getPath(): string\r\n {\r\n return $this->path;\r\n }", "public function getPath(): string\r\n {\r\n return $this->path;\r\n }", "function completePath(){\n \treturn $this->path . $this->name;\n }", "public function asset(): string\n {\n if (is_null($this->rootPath)) {\n\n $partials = explode('/', $this->fullPath);\n\n return array_pop($partials);\n\n }\n\n return substr($this->fullPath, strlen(rtrim($this->rootPath, '/')) + 1);\n }", "public function getPathnamePlain() : string\n {\n return $this->getPathname(true);\n }", "public function getFullpath()\n\t{\n\t\treturn $this->filesystem->getAdapter()->root . $this->path;\n\t}", "private function _getFullPath($path)\n {\n return $this->_directory . DIRECTORY_SEPARATOR . $path;\n }", "public function __toString()\n {\n return (string)$this->_sPath;\n }", "public function path(): string\n {\n return realpath($this->file);\n }", "public function getPath()\n {\n return str_replace(\n ['/', '\\\\'],\n Storage::GetSeparator(),\n Storage::GetPath() . '/' . $this->dirname . '/' . $this->basename\n );\n }", "public function path();", "public function getPath() : string\n {\n return $this->path;\n }", "public function toString() {\n return url::buildPath($this->toArray());\n }", "public function getPath() : string\n {\n return $this->path;\n }", "public function path() {\n\t\t/* Note that it is necessary to pass the full URL to\n\t\t * `parse_url`, because `parse_url` can be tricked into\n\t\t * thinking that part of the path is a domain name. */\n\t\treturn parse_url($this->fullUrl(), PHP_URL_PATH);\n\t}", "public function getPath()\n {\n return rtrim($this->partials['path'], '/').'/';\n }", "public function getPath() : string;", "public function resourcePath($path = '')\n\t{\n\t\treturn $this['path.resource'].ltrim($path, '/');\n\t}", "public function getPath(): string\n {\n return $this->directory->getPath();\n }", "public function __toString() {\r\n return $this->getPath();\r\n }", "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 absPath(string $path): string;", "public function path() {\n\t\t$args = func_get_args();\n\t\tif (count($args)) {\n\t\t\t$this->path = $this->verify($args[0]);\n\t\t}\n\t\treturn $this->path;\n\t}", "protected function path($path)\n\t{\n\t\treturn $this->root . $path;\n\t}", "public function __toString() {\n\t\treturn $this->getPath();\n\t}", "public function absolutePath() : string {\n return empty($this->path) ? '' : $this->path;\n }", "public function path(): string\n {\n return str_replace('?', '', \"/{$this->route->uri()}\");\n }", "public function getPathLocation(): string;", "public function __toString()\n {\n return $this->path;\n }", "public function getPathEncoded();", "public function __toString()\n {\n return $this->getPath();\n }", "public function get_path() {\n\t\treturn $this->path;\n\t}", "public function get_path() {\n\t\treturn $this->path;\n\t}", "public function __toString()\n\t{\n\t\treturn $this->getPath();\n\t}", "public function getPath()\n {\n $components = [];\n foreach ($this->components as $component => $rdns) {\n array_map(function ($value) use ($component, &$components) {\n $components[] = $component . '=' . ldap_escape($value, '', LDAP_ESCAPE_FILTER);\n }, $rdns);\n }\n\n return implode(',', $components);\n }", "function path($path='') {\n return $this->base_dir . $path;\n }", "private function _getPath():string {\n\n # Declare result\n $result = self::PATH;\n\n # check constant\n if(Env::has(\"phpunit_test\") && Env::get(\"phpunit_test\"))\n\n # Set result\n $result = self::PATH_TEST;\n\n # Strange reaction... Allow to debug next command... ¯\\_(ツ)_/¯\n Env::get(\"crazyphp_root\");\n\n # Process result\n $result = File::path($result);\n\n # Return result\n return $result;\n\n }", "public function standardizePath()\n {\n $arrPath = func_get_args();\n\n if (count($arrPath) == 0 || $arrPath == null || $arrPath == \"\")\n {\n return \"\";\n }\n\n $strVar = \"\";\n\n foreach ($arrPath as $itPath)\n {\n $itPath = str_replace(array(TL_ROOT, \"\\\\\"), array(\"\", \"/\"), $itPath);\n $itPath = explode(\"/\", $itPath);\n\n foreach ($itPath as $itFolder)\n {\n if ($itFolder == \"\" || $itFolder == \".\" || $itFolder == \"..\")\n {\n continue;\n }\n\n $strVar .= \"/\" . $itFolder;\n }\n }\n\n return preg_replace(\"/^\\//i\", \"\", $strVar);\n }", "public function getPathName()\n {\n return $this->getFullPath();\n }", "public function getPath()\n {\n return $this->__get(\"path\");\n }", "function getAbsolutePath() ;", "public function getAbsolutePath();", "private function slashPath(string $path) : string\n {\n return trim($path, '/');\n }", "public function getPath()\r\n\t{\r\n\t\treturn $this->path;\r\n\t}", "private function getPath()\n {\n $path = $this->getDirName().$this->getFilename();\n if (strlen($this->getMime()->getExt())>0) {\n $path .= '.'.$this->getMime()->getExt();\n }\n return $path;\n }", "private function getPath()\n {\n return $this->path;\n }", "public function getPath() {\n\t\treturn $this->path;\n\t}", "public function getPath() {\n\t\treturn $this->path;\n\t}", "private function _path($path = '') {\n\t\tif (!$path) $path = g($this->conf, 'path');\n\t\treturn $this->_sanitize(g($this->conf, 'rootPath').'/'.$path);\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();" ]
[ "0.7560482", "0.7498773", "0.7427926", "0.73637944", "0.7265767", "0.7262139", "0.7243546", "0.72140753", "0.71746916", "0.7170932", "0.7156773", "0.71464914", "0.7140199", "0.71345633", "0.7121323", "0.7096821", "0.70520943", "0.7025706", "0.70080173", "0.7002442", "0.69817954", "0.69804317", "0.6963163", "0.6958866", "0.6958866", "0.6958866", "0.6958866", "0.6958866", "0.6958866", "0.6958866", "0.6958866", "0.695701", "0.69285464", "0.69285464", "0.6914515", "0.6904027", "0.6904027", "0.68995917", "0.687205", "0.6866867", "0.6866867", "0.6866867", "0.6866867", "0.6866867", "0.6856477", "0.6856477", "0.6855226", "0.6849445", "0.68478996", "0.6843549", "0.6842637", "0.67975783", "0.6793974", "0.6781556", "0.67476964", "0.67446727", "0.6730576", "0.67027503", "0.669125", "0.6649051", "0.66336167", "0.66310894", "0.6620886", "0.66038823", "0.65992224", "0.6597504", "0.65883255", "0.65765727", "0.65627736", "0.6552785", "0.6552749", "0.6533699", "0.65303916", "0.6520283", "0.6508958", "0.65033096", "0.65033096", "0.6493224", "0.64879006", "0.6486069", "0.6479326", "0.6472534", "0.64649236", "0.64597064", "0.6447173", "0.6444828", "0.64370364", "0.6426615", "0.64210874", "0.64204067", "0.64180213", "0.64180213", "0.6411169", "0.64034504", "0.64034504", "0.64034504", "0.64034504", "0.64034504", "0.64034504", "0.64034504", "0.64034504" ]
0.0
-1
Converts the object to a string
public function toString() { return url::buildPath($this->toArray()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function objectToString($obj);", "abstract function objectAsString($object);", "function objectToString( &$object ) {\n\n\t}", "public function to_string() { return $this->__toString(); }", "function dataToString($object=null) {\r\n\t\treturn $object->__toString();\r\n\t}", "public function __toString() { return $this->as_string(); }", "public function __toString(){\n return $this->convert();\n }", "public function toString()\n {\n return json_encode($this->obj);\n }", "public function __tostring() {\r\n return (string) $this->object->getId();\r\n }", "public function toString()\n {\n return $this->cast('string');\n }", "public function __toString() {\n return $this->as_string();\n }", "function toString ($object)\n{\n\treturn get_class($object);\n}", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "public function __toString();", "private static function objToStr($obj)\n {\n return method_exists($obj, '__toString') ? (string)$obj : get_class($obj) . '@' . spl_object_hash($obj);\n }", "public function __toString()\n {\n return (string) $this->exportTo(SanitasiPeer::DEFAULT_STRING_FORMAT);\n }", "public function __tostring();", "public function __toString()\n {\n return (string) $this->exportTo(JadwalPeer::DEFAULT_STRING_FORMAT);\n }", "public function __toString()\n {\n notice('Object: \"'.get_class($this).'\" is used as string');\n\n return 'Object('.get_class($this).')';\n }", "public function __toString()\n {\n return (string) $this->exportTo(SekolahPaudPeer::DEFAULT_STRING_FORMAT);\n }", "public function __toString(): string\n {\n return $this->to_string();\n }", "public function getToString()\n {\n return $this->toString();\n }", "public function __toString(): string\n {\n return $this->toJson();\n }", "public function __toString()\n {\n return (string) $this->exportTo(BangunanPeer::DEFAULT_STRING_FORMAT);\n }", "public function toString()\n {\n $data = $this->origin->data();\n $out = '';\n if (is_scalar($data) || is_null($data)) {\n $out = (string) $data;\n } elseif (is_object($data) && method_exists($data, '__toString')) {\n $out = (string) $data;\n }\n return $out;\n }", "public function toString() {}", "public function toString() {}", "public function __toString(): string\n {\n return (string) $this->call('__toString');\n }", "public function toString() {}", "public function toString() {}", "public function toString() {}", "public function __toString()\n {\n return strval($this->_data);\n }", "public function toString() {}", "public function __toString()\n {\n return (string) $this->getValue();\n }", "public function __toString()\n {\n return (string) $this->getValue();\n }", "public function __toString()\n {\n return (string) $this->getValue();\n }", "function __toString() {\n return $this->string();\n }", "public function __toString() : string\n {\n return \\json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }", "public function __toString() : string\n {\n return \\json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }", "public function __toString() : string\n {\n return \\json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }", "public function __toString() : string\n {\n return \\json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }", "public function __toString() : string\n {\n return \\json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }", "public function __toString() : string\n {\n return \\json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }", "public function __toString()\n {\n return (string)$this->value;\n }", "public function __toString() : string\n {\n return json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }", "public function __toString() : string\n {\n return json_encode(\n ObjectSerializer::sanitizeForSerialization($this),\n JSON_PRETTY_PRINT\n );\n }", "public function __toString(): string\n {\n return (string) $this->getValue();\n }", "public function __toString()\n {\n return $this->make()->toString();\n }", "public function __toString()\n {\n try {\n return $this->toString();\n } catch (\\Exception $e) {\n return '';\n }\n }", "public function __toString() {\n //(string)var_export($this);\n }", "function __toString() \n {\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) {\n if ($obj != NULL) {\n $obj->name = $name; #nombre de la variable que hace de nombre de objecto\n $str .= $obj->label();\n $str .= $obj;\n $str .= \"<br />\\n\";\n }\n }\n return $str;\n }", "public function __toString() {\n\t\t\treturn Core\\Convert::toString($this->value);\n\t\t}", "public function __toString(): string\n {\n return (string)$this->value;\n }", "public function __toString() {\n\t\treturn get_class($this) . '-object ' . \"\\n\";\n\t}", "public function __toString(): string\n {\n return (string) $this->format();\n }", "public function __toString()\n\t{\n\t\treturn $this->serialize();\n\t}", "public function __toString()\n {\n return $this->formatAsString();\n }", "public function __toString(): string\n {\n return serialize($this->toArray());\n }", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}", "public function __toString() {}" ]
[ "0.8290331", "0.80152243", "0.77929914", "0.77623343", "0.7743808", "0.7649999", "0.7633557", "0.7581554", "0.7564965", "0.75404686", "0.7526985", "0.7518531", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.75075585", "0.7501129", "0.74871", "0.7484361", "0.7480744", "0.7463726", "0.7446459", "0.74458265", "0.74091333", "0.7398321", "0.7390975", "0.7385613", "0.7367521", "0.7367521", "0.73672014", "0.73667777", "0.73667777", "0.73667777", "0.7365952", "0.73650694", "0.7342921", "0.7342921", "0.7342921", "0.7326602", "0.73190594", "0.73190594", "0.73190594", "0.73190594", "0.73190594", "0.73190594", "0.73154694", "0.7305916", "0.7305916", "0.73029864", "0.7291839", "0.72851574", "0.7279109", "0.7278516", "0.7267265", "0.7262708", "0.72591126", "0.7257686", "0.7256608", "0.72533774", "0.72465277", "0.7243825", "0.7243825", "0.7243825", "0.7243825", "0.7243825", "0.7243825", "0.7243825", "0.7243825" ]
0.0
-1
Returns an IntersectionIterator containing elements in $this that are also in $iterable
public function intersection($iterable, $strategy = null);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function of(iterable $iterable): self {\n\t\t$generator = function () use ($iterable) {\n\t\t\tforeach ($iterable as $item) {\n\t\t\t\tyield $item;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator());\n\t}", "public function intersect(iterable $items): self\n {\n $items = Factory::getArrayForItems($items);\n\n return Factory::create(array_intersect($this->items, $items));\n }", "private function wrapIterable(iterable $iterable): Generator\n {\n foreach ($iterable as $key => $value) {\n yield $key => $value;\n\n $this->iteratorAdvanced = true;\n }\n\n $this->iterator = null;\n }", "public function getIterable() : Iterable {\n\n\t\treturn $this->innerIterable;\n\t}", "abstract protected function _normalizeIterable($iterable);", "public function appendedAll(iterable $that): Set;", "public function getIterator()\n {\n foreach ($this->iterable as $item) {\n yield $item;\n }\n }", "public function iterable(): iterable\n {\n return $this->array;\n }", "public function iterator()\n {\n $i = new CollectionIterator($this);\n return $i;\n }", "public function getIterator(): \\ArrayIterator\n {\n return $this->iterable ?? $this->iterable = new \\ArrayIterator($this->doMerge('', new static()));\n }", "public function attach(Traversable $iterable)\n {\n $this->iterable = $iterable;\n }", "public function getIterator()\n {\n return new ArrayIterator($this->elements);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->elements);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->elements);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->_elements);\n }", "public abstract function toIterable(): iterable;", "public function getIterator()\n {\n return $this->multi()->load();\n }", "function getInnerIterator()\n\t{\n\t\treturn $this->iterator;\n\t}", "public function getIterator()\n {\n return new \\ArrayIterator($this->elements(true));\n }", "public function merge(iterable $items, bool $inPlace = false): self\n {\n $collection = $inPlace ? $this : clone $this;\n foreach ($items as $key => $value) {\n $collection->set($key, $value);\n }\n\n return $collection;\n }", "public function intersect(PageCollectionInterface $collection)\n {\n $array1 = $this->items;\n $array2 = $collection->toArray();\n\n $this->items = array_uintersect($array1, $array2, function ($val1, $val2) {\n return strcmp($val1['slug'], $val2['slug']);\n });\n\n return $this;\n }", "public function getIterator()\n {\n return new ArrayIterator($this->entities);\n }", "public static function is_iterable($input)\n {\n }", "public function getIterator()\n {\n return new ArrayIterator($this->toArray());\n }", "public function intersectKeys(iterable $items): self\n {\n $items = Factory::getArrayForItems($items);\n\n return Factory::create(array_intersect_key($this->items, $items));\n }", "public function zip(iterable ...$iterables): Collection;", "public function getIterator()\n {\n return new \\ArrayIterator($this);\n }", "public function getIterator() {\n return new ArrayIterator($this->getAll());\n }", "function getiterator() {\n\t\treturn new \\ArrayIterator($this->cast());\n\t}", "public function concat(iterable $stream): Stream {\n\t\t$generator = function (iterable $stream) {\n\t\t\tforeach ($this as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t\tforeach ($stream as $element) {\n\t\t\t\tyield $element;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator($stream));\n\t}", "public function getIterator()\n {\n return new Iterator($this->entities);\n }", "public function iterateAllElements()\n {\n return $this->getIterator();\n }", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->fetch());\n\t}", "public function getIterator() : ArrayIterator\n {\n return new ArrayIterator($this->all());\n }", "public function getIterator()\n {\n return new \\ArrayIterator(array_values($this->collection->getAll()));\n }", "public function intersectByItems(array $arr): CollectionInterface;", "protected function initList(Closure|iterable $iterable): Generator\n {\n if ($iterable instanceof CollectionInterface) {\n $iterable = $iterable->getIterator();\n }\n\n if (!$iterable instanceof Generator) {\n if (is_iterable($iterable)) {\n $iterable = fn(): Generator => yield from $iterable;\n }\n }\n\n if ($iterable instanceof Closure) {\n $iterable = $iterable();\n }\n\n if (!$iterable instanceof Generator) {\n throw new InvalidArgumentException('Argument must be iterable');\n }\n\n return $iterable;\n }", "public function getIterator()\n {\n return new ArrayIterator($this->items);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->items);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->items);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->items);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->items);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->items);\n }", "public function merge(iterable $items) {\n foreach ($items as $key => $value) {\n $this->items[$key] = $value;\n }\n return $this;\n }", "public function getIterator(): ArrayIterator\n {\n return new ArrayIterator($this->all());\n }", "public function getInnerIterator(): Iterator\n {\n if (isset($this->innerIterator)) {\n return $this->innerIterator;\n }\n\n if (! $this->wrappedIterator instanceof FilesystemIterator) {\n return $this->innerIterator = $this->wrappedIterator;\n }\n\n $files = $folders = [];\n foreach ($this->wrappedIterator as $file) {\n if ($file->isDir()) {\n $folders[$file->getPathname()] = $file;\n } else {\n $files[$file->getPathname()] = $file;\n }\n }\n ksort($folders);\n ksort($files);\n\n // Make sure folders are handled after files\n $contents = Arrays::attach($files, $folders);\n\n // Inherit the info class\n $children = new self(new ArrayIterator($contents));\n $children->setInfoClass($this->infoClass);\n\n return $this->innerIterator = $children;\n }", "public function getIterator(): \\Traversable;", "public function getIterator(): \\Traversable;", "public function getIterator()\n {\n return new ArrayIterator($this->_array);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->getResultList());\n }", "public function isIn($enumerable) {\n return $this->is(new ContainedIn($enumerable));\n }", "public function all(): \\Iterator;", "public function getIterator()\n {\n return new ArrayIterator($this->items->all());\n }", "public function getIterator()\n {\n return new \\ArrayObject($this->toArray());\n }", "public function getIterator()\n\t{\n\t\treturn new ArrayIterator($this->items);\n\t}", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "public function getIterator();", "abstract public function getIterator();", "public function iterator() {\n return new SimpleIterator(array_keys($this->elements));\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->_items);\n }", "public function getIterator()\n\t{\n\t\treturn new \\ArrayIterator($this->array);\n\t}", "public function getIterator()\n {\n return new \\ArrayIterator(\\Resursi\\PodaciSlikeArrayConverter::toArray($this));\n }", "public function getIterator()\n {\n return new \\ArrayIterator($this->items->all());\n }", "public function getIterator()\n {\n return new ArrayIterator(static::$origin);\n }", "public function getIterator() {\n return new \\ArrayIterator($this->getValues());\n }", "public function getIterator()\n {\n return new ArrayIterator($this->export());\n }", "public function getIterator() {\n return new \\ArrayIterator($this->cast);\n }", "public function intersect(): self;", "public function getIterator()\n {\n return $this->iterator();\n }", "public function getIterator()\n\t{\n\t\treturn new ArrayIterator($this->getListByKey());\n\t}", "public function getIterator()\n {\n return new ArrayIterator($this->pages);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->data);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->data);\n }", "public function getIterator()\r\n {\r\n return new ArrayIterator($this->attributes);\r\n }", "public function getIterator()\n {\n return new ArrayIterator($this->result);\n }", "public function getIterator()\n\t{\n\t\treturn new ArrayIterator($this->_structures);\n\t}", "public function getIterator()\n {\n return new ArrayIterator((array)$this->data);\n }", "public function getIterator() : Traversable\n {\n return new ArrayIterator($this->entries);\n }", "public function getIterator() {\r\n return new ArrayIterator($this->data);\r\n }", "public function getIterator()\n {\n return new ArrayIterator($this->attributes);\n }", "public function getIterator()\n {\n return new GroupedCollectionIterator($this->groups);\n }", "public function getIterator()\n {\n return new Itr($this);\n }", "public function containsIterator($iterator)\n {\n }", "public function getIterator()\n\t{\n return new ArrayIterator($this->_tbody->getElements());\n\t}", "public function getFillIterable(): iterable;", "public function getIterator()\n {\n // Ensure immutable.\n return new IteratorProxy($this->iterator);\n }", "public function getIterator()\n {\n return new ArrayIterator($this->_data);\n }", "public function getIterator()\r\n {\r\n return new \\ArrayIterator($this->data);\r\n }", "public function getIterator()\n {\n return new ArrayIterator($this->valueOf());\n }", "public function union(iterable $items, bool $inPlace = false): self\n {\n $collection = $inPlace ? $this : clone $this;\n foreach ($items as $key => $value) {\n if (!$collection->containsKey($key)) {\n $collection->set($key, $value);\n }\n }\n\n return $collection;\n }", "public function getIterator()\r\n {\r\n return $this->all();\r\n }", "public function getIterator()\n {\n return new ArrayObject($this->items);\n }", "public static function ofKeyValueMap(iterable $iterable): self {\n\t\t$generator = function () use ($iterable) {\n\t\t\tforeach ($iterable as $key => $item) {\n\t\t\t\tyield [$key, $item];\n\t\t\t}\n\t\t};\n\t\treturn new self($generator());\n\t}", "public function getIterator() {}", "public function getIterator() {}", "public function getIterator(): \\Traversable\n {\n if ($this->object && method_exists($this->object, 'getIterator')) {\n return $this->object->getIterator();\n }\n\n if (is_object($this->array) && method_exists($this->array, 'getIterator')) {\n return $this->array->getIterator();\n }\n\n return new \\ArrayIterator($this->array);\n }" ]
[ "0.6072463", "0.60437727", "0.6029325", "0.5887875", "0.579804", "0.55278397", "0.54709667", "0.546725", "0.5455278", "0.54440105", "0.5418173", "0.5389925", "0.5389925", "0.5389925", "0.538118", "0.53732204", "0.5365471", "0.53622234", "0.536218", "0.5348531", "0.5331685", "0.53064966", "0.5303901", "0.5301225", "0.52770185", "0.52636224", "0.52221316", "0.5212484", "0.51880693", "0.51844674", "0.5183621", "0.51302326", "0.51123077", "0.5108457", "0.510379", "0.5097617", "0.50917923", "0.5087238", "0.5087238", "0.5087238", "0.5087238", "0.5087238", "0.5087238", "0.5070152", "0.50687826", "0.50620854", "0.5058412", "0.5058412", "0.5056958", "0.50521976", "0.5051159", "0.5048862", "0.50478756", "0.5029869", "0.50222033", "0.5020575", "0.5020575", "0.5020575", "0.5020575", "0.5020575", "0.5020575", "0.5016077", "0.5010154", "0.49940416", "0.49726745", "0.49455833", "0.4931861", "0.49285722", "0.4913892", "0.4911817", "0.4910863", "0.48990008", "0.4893786", "0.48839417", "0.48830706", "0.48823664", "0.48823664", "0.4879716", "0.4877185", "0.48753363", "0.4875254", "0.48724502", "0.48723876", "0.48648083", "0.4862077", "0.4857935", "0.4851152", "0.4846978", "0.48440456", "0.48421493", "0.4840643", "0.48350054", "0.48341763", "0.48313826", "0.48194286", "0.4817439", "0.48159924", "0.48102084", "0.48102084", "0.4803163" ]
0.64896554
0
Returns the setting value instead of property value if is set.
public function getPropertyValue($propertyName, $settingsKey) { // Load settings. if (self::$typoScriptCache === NULL) { $typoScriptCache = Tx_AdGoogleMaps_Utility_BackEnd::getTypoScriptSetup($this->getPid(), 'tx_adgooglemaps'); } $settings = $typoScriptCache[$settingsKey]; $currentValue = NULL; if (array_key_exists($propertyName, get_object_vars($this))) { $currentValue = $this->$propertyName; } // Get settings value only if set and current value is "false", "0" or empty. if (array_key_exists($propertyName, $settings) === TRUE && !$currentValue) { $currentValue = $settings[$propertyName]; } return $currentValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSettingValue()\n {\n if (array_key_exists(\"settingValue\", $this->_propDict)) {\n return $this->_propDict[\"settingValue\"];\n } else {\n return null;\n }\n }", "public function getValueToSet()\n {\n return $this->newValue;\n }", "public function getValue()\n {\n if (!$this->isExplicitlySet) {\n return $this->defaultValue;\n } else {\n return $this->value;\n }\n }", "function getValue($setting)\n\t\t{\n\t\t\t// lookup the value in the array \n\t\t\tif (isset($this->options[$setting]))\n\t\t\t{\n\t\t\t\t// return its value, if set\n\t\t\t\treturn $this->options[$setting];\n\t\t\t}\n\t\t\t\n\t\t\t// default to NULL\n\t\t\treturn NULL;\n\t\t}", "public function getSetting() : bool\n {\n return $this->setting;\n }", "public function getPropertyValue() {\n\t\t$propertyValue = parent::getPropertyValue();\n\t\tif ($propertyValue === NULL)\n\t\t\treturn FALSE;\n\t\treturn $propertyValue;\n\t}", "public function getSetting() {}", "public function getSetting() {}", "public function getSettingDisplayValue()\n {\n if (array_key_exists(\"settingDisplayValue\", $this->_propDict)) {\n return $this->_propDict[\"settingDisplayValue\"];\n } else {\n return null;\n }\n }", "function get_setting() {\n return get_config(NULL, $this->name);\n }", "abstract protected function getSetting() ;", "private function getPropertyValue($property)\n {\n $value = null;\n $getter = 'get' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase($property);\n\n if (method_exists($this, $getter)) {\n $value = $this->{$getter}();\n } elseif ($this->returnAdditionalSetting($property)) {\n $value = $this->returnAdditionalSetting($property);\n }\n\n return $value;\n }", "public function get_setting($setting) {\n\t\treturn $this->settings[$setting] ?? null;\n\t}", "public final function value($setting_key = 'default')\n {\n }", "protected function getPropertyValue() {}", "function get_setting() {\n // has to be overridden\n return NULL;\n }", "public function getPropertyValue()\n\t{\n\t\t$property = $this->property;\n\t\treturn (isset($this->object) && ($property instanceof Reflection\\Reflection_Property))\n\t\t\t? $property->getValue($this->object)\n\t\t\t: null;\n\t}", "public function getValue()\n {\n if (array_key_exists(\"value\", $this->_propDict)) {\n return $this->_propDict[\"value\"];\n } else {\n return null;\n }\n }", "public function getValue()\n {\n if (array_key_exists(\"value\", $this->_propDict)) {\n return $this->_propDict[\"value\"];\n } else {\n return null;\n }\n }", "function value($setting, $main='site')\n {\n $value = $this->out->trimmed($setting);\n if (empty($value)) {\n $value = common_config($main, $setting);\n }\n return $value;\n }", "function __get($property)\n {\n return $this->value;\n }", "public function GetSettingValue($name)\r\n\t\t{\r\n\t\t\treturn $this->DB->GetOne(\"SELECT value FROM client_settings WHERE clientid=? AND `key`=?\",\r\n\t\t\t\tarray($this->ID, $name)\r\n\t\t\t);\r\n\t\t}", "function getifSet(&$value, $default = null)\n{\n //if it is set return the value, or else, return the default value\n return isset($value) ? $value : $default;\n}", "public function getValue()\n {\n return isset($this->value) ? $this->value : null;\n }", "public function getSetting( $key ) {\n $query = $this->db->query( \"SELECT value FROM \" . DB_PREFIX . \"setting WHERE `code` = 'foks' AND `key` = '{$key}' LIMIT 1\" );\n $setting_data = $query->row;\n return isset($setting_data['value']) && !empty($setting_data['value']) ? $setting_data['value'] : '';\n }", "public function get()\n\t{\n\t\treturn $this->_value;\n\t}", "public function __get($property) {\n\n if(!isset($this->settings[$property])) {\n $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);\n trigger_error('Undefined configuration constant \"'.$property.'\" ('.$backtrace[0]['file'].':'.$backtrace[0]['line'].')', E_USER_ERROR);\n }\n\n return $this->settings[$property];\n\n }", "public function getValue()\n {\n return isset($this->value) ? $this->value : '';\n }", "public function getValue()\n {\n return isset($this->value) ? $this->value : '';\n }", "public function getSetting($sProperty = null)\n {\n if (property_exists($this->oSettings, $sProperty)) {\n return $this->oSettings->{$sProperty};\n } elseif (is_null($sProperty)) {\n return $this->oSettings;\n } else {\n return null;\n }\n }", "function sloodle_get_value($settings, $name, $default = null)\n {\n if (is_array($settings) && isset($settings[$name])) return $settings[$name];\n return $default;\n }", "public function get($key = NULL)\n {\n if (!$key) return;\n $val = $this->_settings[$key];\n\n return isset($val) ? $val : NULL;\n }", "function _get_setting($setting_name, $default = null)\n {\n $value = $this->getDb()->get_value('select value from mwg_setting where name=?', $setting_name); \n if ($value) return $value;\n\n $value = $this->getDb()->get_value('select value from settings where name=?', $setting_name); \n if ($value) {\n return stripslashes($value); \n } \n if ($default) {\n return $default;\n } \n return $value;\n }", "public function __get($key)\n {\n // First, check if its in the properties index.\n // This is so we can override the global setting.\n if ($meta = $this->getMeta($key)) {\n return $meta->value;\n }\n $meta = $this->getGlobal($key);\n return $meta ? $meta->value : null;\n\n }", "public function getValue()\n {\n if (!$this->isActive()) {\n //value cannot be retrieved as it cannot be set if it is not active\n return false;\n }\n return $this->value;\n }", "public function getSetting($key) {\n\t\tif (!$this -> exists($key)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this -> settings[$key];\n\t}", "public function getSetting($key) {\n\t\treturn $this->settings[$key];\n\t}", "public function getSettingValue($setting_key)\n {\n $sql = \"SELECT setting_value FROM settings WHERE setting_key = :key\";\n\n $this->db->query($sql);\n\n $this->db->bind(\":key\", $setting_key);\n\n if ($this->db->execute()) {\n $setting_value = $this->db->single()->setting_value;\n }\n\n return $setting_value;\n }", "public function get_value() {\n\t\treturn $this->_value;\n\t}", "protected function getValue() {\r\n return $this->_value;\r\n }", "public function getSetting(){\n\t\treturn $this->findById(1);\n\t}", "public function get()\n {\n $this->set();\n \n return $this->value;\n }", "public function get($key)\n {\n if ($this->_shouldBeCached()) {\n if ($this->_isCached($key)) {\n return Cache::get($key);\n }\n $item = $this->repo->get($key);\n if (!$item) {\n Log::channel('runtime')->warning(\n '[SettingsManager:89] Failed to fetch setting.',\n ['key' => $key]\n );\n return \"\";\n }\n Cache::forever($key, $item->value);\n return $item->value;\n }\n $item = $this->repo->get($key);\n if (!$item) {\n Log::channel('runtime')->warning(\n '[SettingsManager:100] Failed to fetch setting.',\n ['key' => $key]\n );\n return \"\";\n }\n return $item->value;\n }", "public function get_value()\n\t{\n\t\treturn $this->value;\n\t}", "public function get_value()\n {\n return $this->value;\n }", "public function get_value() {\n return $this->value;\n }", "public function get()\n {\n return $this->value;\n }", "public function get()\n {\n return $this->value;\n }", "public function get()\n {\n return $this->value;\n }", "public function get()\n {\n return $this->value;\n }", "public function getSetting($key)\n\t{\n\t\treturn $this->settings[$key];\n\t}", "public function textPropertyVal()\n {\n return $this->textPropertyVal;\n }", "public function getValue(): mixed\n {\n return $this->field?->getValue();\n }", "public function getValue($field)\n {\n $adminSettings = DB::table('settings')->where('field_name', $field)->first();\n if ($adminSettings) {\n return $adminSettings->value;\n }\n \n }", "function get_setting($setting_id, $default_value = '') {\n //it doesn't requiers the tds_ prefix\n if (td_util::get_option('tds_' . $setting_id) == $this->get_default($setting_id)) {\n return $default_value;\n } else {\n return td_util::get_option('tds_' . $setting_id);\n }\n }", "function get_defaultsetting() {\n return $this->defaultsetting;\n }", "public function stone_setting() {\r\n return $this->stone_setting;\r\n }", "public function getValue(): mixed\n {\n return $this->value;\n }", "protected function get_setting( $key ) {\n\t\t$location = $this->setting_loc[$key];\n\t\t$type = $this->setting_type[$key];\n\t\t$value = is_array( $location ) ? $this->settings[$location[0]][$location[1]] : $this->settings[$location];\n\t\tif ( 'b' == $type ) {\n\t\t\t$value = ( $value ) ? true : false;\n\t\t} elseif ( 's' == $type ) {\n\t\t\t$value = wp_kses( trim( $value ), array(), array() );\n\t\t} elseif ( 'u' == $type ) {\n\t\t\t$value = esc_url_raw( trim( $value ), array( 'http', 'https' ) );\n\t\t} elseif ( 't' == $type ) {\n\t\t\t$value = trim( $value );\n\t\t}\n\t\treturn ( $value );\n\t}", "public function handleSettingValue(array $setting)\n\t{\n\t\treturn $setting;\n\t}", "public function getValue($field)\n {\n $adminSettings = DB::table('settings')->where('field_name', $field)->first();\n if ($adminSettings) {\n return $adminSettings->value;\n }\n }", "function get_setting($setting)\n{\n $row = Setting::where('name', $setting)->first();\n\n return $row ? $row->value : null;\n}", "private function getSetting()\n {\n $r = Session::get('setting');\n Session::forget('setting');\n\n return $r;\n }", "public function getSettingValueType()\n {\n if (array_key_exists(\"settingValueType\", $this->_propDict)) {\n return $this->_propDict[\"settingValueType\"];\n } else {\n return null;\n }\n }", "function get_prop_value($prop_name)\n{\n\treturn (empty($prop_name)) ? DEFAULT_MISSING_PROP : $prop_name;\n}", "public function get_setting( string $key ) : string {\n\t\tif ( defined( $key ) && empty( $value ) ) {\n\t\t\treturn constant( $key );\n\t\t}\n\n\t\treturn isset( $this->settings[ $key ] ) ? $this->settings[ $key ] : '';\n\t}", "public function get(string $setting)\n {\n if (!$this->validate($setting)) {\n return false;\n }\n\n return $this->configuration->getConfigurationSetting($setting);\n }", "function getDefaultValue() {\n return $this->getProperty('default_value');\n }", "public function getValue(string $settingName)\n {\n return $this->getValueInstance($settingName)->getValue();\n }", "public function getValue() {\n \n $_aParams = func_get_args(); \n return AdminPageFramework_WPUtility::getOption( \n $this->oProp->sOptionKey, \n $_aParams, \n null, // default\n $this->getSavedOptions() + $this->oProp->getDefaultOptions( $this->oForm->aFields ) // additional array to merge with the options\n );\n \n }", "function get_setting( $key, $default = '' ) {\n\t\t$this->get_settings();\n\n\t\tif ( isset( $this->settings[ $key ] ) ) {\n\t\t\treturn $this->settings[ $key ];\n\t\t}\n\n\t\treturn $default;\n\t}", "public function useSetting()\n\t{\n\t\treturn count($this->settingConfig()) ? true : false;\n\t}", "public function getSetting($name) {\n\t\t##\n\t\t##\tPARAMETERS\n\t\t##\t\t@name\t\t\t\tThe name of the settings key\n\t\t##\n\t\t##\tRETURN\n\t\t##\t\tThe value of the selected setting on success\n\t\t##\t\tFalse on failure\n\t\t$sql = <<<EOD\n\t\tSELECT\n\t\t\t{$this->wpdb->prefix}topspin_settings.value\n\t\tFROM\n\t\t\t{$this->wpdb->prefix}topspin_settings\n\t\tWHERE\n\t\t\tname = %s\nEOD;\n\t\treturn $this->wpdb->get_var($this->wpdb->prepare($sql,$name));\n\t}", "public static function getSettingValue(string $id)\n {\n return get_option($id);\n }", "static function Get($valueName)\n {\n if(isset(self::$settings[$valueName]))\n {\n return self::$settings[$valueName];\n }\n\n return false;\n }", "public function get($key) {\n if (!isset($this->settings->$key)) {\n return null;\n }\n\n return $this->settings->$key;\n }", "public function value() { return $this->_m_value; }", "public function getFieldValue(): ?string\n {\n return $this->getOption('fieldvalue');\n }", "public function __get($value);", "public function get()\n {\n \n return $this->value;\n \n }", "public function getValue()\n {\n return $this->get(self::_VALUE);\n }", "public function getValue()\n {\n return $this->get(self::_VALUE);\n }", "protected function getSettingValue($name, $default = null)\n {\n \treturn Settings::get(strtolower($this->getKey()) . '_' . $name , $default);\n }", "public function get_setting( $name ){\n $setting = '';\n if( isset($this->settings[$name]) )\n $setting = $this->settings[$name];\n return $setting;\n }", "public function get_setting( $name ){\n $setting = '';\n if( isset($this->settings[$name]) )\n $setting = $this->settings[$name];\n return $setting;\n }", "public function get_setting( $name ){\n $setting = '';\n if( isset($this->settings[$name]) )\n $setting = $this->settings[$name];\n return $setting;\n }", "public function get($key){\n return $this->getSetting($key);\n }", "public function GetValue() {\n\t\treturn $this->_value;\n\t}", "public static function get(string $key)\n {\n self::getInstance();\n\n if (!empty(self::$settings)) {\n foreach (self::$settings as $settingKey => $setting) {\n if ($key === $setting['settings_name']) {\n if (isset($setting['settings_value']) && !empty($setting['settings_value'])) {\n if (is_scalar($setting['settings_value'])) {\n return sanitize_data($setting['settings_value'], gettype($setting['settings_value']));\n }\n\n return $setting['settings_value'];\n }\n }\n }\n }\n\n return '';\n }", "public function getValue()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'value'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'value'];\n\t\t}\n\n\t\treturn '';\n\t}", "public static function settingsVal($key = null, $all = false) {\n if ($all == true) {\n $settings = Settings::first();\n if (count($settings) != 1) {\n return false;\n } else {\n return $settings;\n }\n }\n\n //***//\n $settings = Settings::first();\n if (count($settings) != 1) {\n return false;\n } else {\n if (isset($settings->$key)) {\n return $settings->$key;\n } else {\n return false;\n }\n }\n }", "function getSettingValue($field_name=null){\r\n\t\tif($field_name==null) return array();\r\n\t\t$this->db->select(\"*\");\r\n\t\t$this->db->where(array('is_active'=>true));\r\n\t\t$recordSet = $this->db->get(TBL_MST_SETTINGS);\r\n\t\t$data=$recordSet->result() ;\r\n \t\tif(count($data)>0){\r\n\t\t\treturn $data[0]->$field_name;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function setting($name, $default = null) {\n $settings = get_option(sprintf('%s_settings', __CLASS__), array());\n return isset($settings[$name]) ? $settings[$name] : $default;\n }", "public function getSettingValueBySettingName($settingName)\n {\n $setting = Vip_Setting::getByNameAndCustomer($settingName, $this);\n if (!$setting) {\n return null;\n }\n return $setting->value;\n }", "function hybrid_get_setting( $option = '' ) {\n\tglobal $hybrid;\n\n\t/* If no specific option was requested, return false. */\n\tif ( !$option )\n\t\treturn false;\n\n\t/* If the settings array hasn't been set, call get_option() to get an array of theme settings. */\n\tif ( !isset( $hybrid->settings ) )\n\t\t$hybrid->settings = get_option( hybrid_get_prefix() . '_theme_settings', hybrid_get_default_theme_settings() );\n\n\t/* If the settings isn't an array or the specific option isn't in the array, return false. */\n\tif ( !is_array( $hybrid->settings ) || empty( $hybrid->settings[ $option ] ) )\n\t\treturn false;\n\n\t/* If the specific option is an array, return it. */\n\tif ( is_array( $hybrid->settings[ $option ] ) )\n\t\treturn $hybrid->settings[ $option ];\n\n\t/* Strip slashes from the setting and return. */\n\telse\n\t\treturn wp_kses_stripslashes( $hybrid->settings[ $option ] );\n}", "function GetSetting ($cDb, $id, $value) {\n\t$id = MakeSafeString($id);\n\t$sQuery = \"SELECT `VALUE` FROM `setting` WHERE `ID`='$id'\";\n\t$cResult = mysql_query($sQuery, $cDb);\n\tif ($cResult != null) {\n\t\tif ($aRow = mysql_fetch_row($cResult)) $value = $aRow[0];\n\t\tmysql_free_result($cResult);\n\t}\n\treturn $value;\n}", "protected function getSetting($key, $default_value = NULL) {\n $config = $this->config(static::SETTINGS);\n $setting = $config->get($key);\n\n if ($setting === NULL) {\n return $default_value;\n }\n return $setting;\n }", "function getValue()\n\t{\n\t\treturn $this->value;\n\t}", "function getValue()\n\t{\n\t\treturn $this->value;\n\t}", "public function get($key)\n {\n return $this->settings[$key];\n }" ]
[ "0.81224203", "0.7113134", "0.6982079", "0.69097865", "0.68257624", "0.68190336", "0.67986673", "0.67986673", "0.6662591", "0.66525847", "0.6534799", "0.65239966", "0.6501718", "0.6479824", "0.64773846", "0.64314556", "0.63669723", "0.63616395", "0.63616395", "0.6231985", "0.6225266", "0.6198173", "0.619089", "0.61843157", "0.61735183", "0.61484295", "0.61349654", "0.6126066", "0.6126066", "0.6120799", "0.6100251", "0.6098805", "0.60892993", "0.60780674", "0.60765266", "0.60647994", "0.60557526", "0.60539263", "0.60492575", "0.6022713", "0.60169876", "0.6007468", "0.59952164", "0.59838134", "0.59814405", "0.598072", "0.5980436", "0.5980436", "0.5980436", "0.5980436", "0.59744436", "0.5957006", "0.5954435", "0.5951004", "0.59393203", "0.59273934", "0.59248644", "0.5917464", "0.5917045", "0.5913697", "0.59105325", "0.5900705", "0.58956516", "0.58919835", "0.58729607", "0.58711797", "0.586635", "0.586448", "0.5854727", "0.58219236", "0.58166414", "0.58121073", "0.58113056", "0.58074313", "0.58063936", "0.57966566", "0.5794125", "0.57677656", "0.5766873", "0.5766541", "0.57573736", "0.57573736", "0.5753605", "0.57485825", "0.57485825", "0.57485825", "0.57432085", "0.57367337", "0.57361495", "0.5735558", "0.5728026", "0.5714066", "0.5702104", "0.5702023", "0.5692502", "0.5688954", "0.5684794", "0.5681737", "0.5681737", "0.5680519" ]
0.59666127
51
Transpose array ($foo['baz']['bar'] > $foo['bar']['baz'])
function a_t($array) { $r=array(); foreach($array as $k1=>$ia) { foreach($ia as $k2=>$v) { $r[$k2][$k1]=$v; } } return $r; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testTranspose()\n {\n // check not array\n $this->assertFalse(Arrays::transpose('string'));\n\n // check bad arrays\n $this->assertFalse(\n Arrays::transpose(array('1', '2', '3')),\n 'Invalid two-dimensional array was accepted'\n );\n $this->assertFalse(\n Arrays::transpose(array('1' => 0, '2' => '0', '3' => array(0))),\n 'Invalid elements on a two-dimensional array were accepted'\n );\n\n // check array with numerical keys\n $array = array(\n 'key1' => array(\n 'value1'\n ),\n 'key2' => array(\n 'value1',\n 'value2'\n )\n );\n $transposed = array(\n array(\n 'key1' => 'value1',\n 'key2' => 'value1'\n ),\n array(\n 'key2' => 'value2'\n )\n );\n $this->assertEquals(\n $transposed,\n Arrays::transpose($array),\n 'Unexpected result of transpose()'\n );\n\n // check array with string keys\n $array = array(\n 'key1' => array(\n 'subkey1' => 'value1'\n ),\n 'key2' => array(\n 'subkey1' => 'value1',\n 'subkey2' => 'value2'\n )\n );\n $transposed = array(\n 'subkey1' => array(\n 'key1' => 'value1',\n 'key2' => 'value1'\n ),\n 'subkey2' => array(\n 'key2' => 'value2'\n )\n );\n $this->assertEquals(\n $transposed,\n Arrays::transpose($array),\n 'Unexpected result of transpose()'\n );\n\n // check array with no keys in common between sub arrays\n $array = array(\n 'key1' => array(\n 'subkey1' => 'value1'\n ),\n 'key2' => array(\n 'subkey2' => 'value1',\n 'subkey3' => 'value2'\n )\n );\n $transposed = array(\n 'subkey1' => array(\n 'key1' => 'value1',\n ),\n 'subkey2' => array(\n 'key2' => 'value1'\n ),\n 'subkey3' => array(\n 'key2' => 'value2'\n )\n );\n $this->assertEquals(\n $transposed,\n Arrays::transpose($array),\n 'Unexpected result of transpose()'\n );\n }", "function transpose(array $xs)\n{\n if (!$xs) {\n return array();\n }\n //special case: row matrix\n if (count($xs) == 1) {\n return array_chunk($xs[0], 1);\n }\n return call_user_func_array(\n 'array_map',\n array_merge(array(null), $xs)\n );\n}", "public static function transpose($array) {\n // array_unshift($array, null);\n // return call_user_func_array('array_map', $array);\n return array_map(null, ...$array);\n }", "public function transpose();", "static function transpose($data,$setdef=FALSE,$def=NULL){\n if(!is_array($data)) return(NULL);\n if(!array_reduce($data,create_function('$z,$x','return($z and is_array($x));'),TRUE))\n return(NULL);\n $ikeys = array_reduce($data,create_function('$z,$x','return(array_merge(array_keys($x)));'),array());\n $okeys = array_keys($data);\n $res = array();\n foreach($ikeys as $key){\n foreach($okeys as $ck){\n\tif(isset($data[$ck][$key])) \n\t $res[$key][$ck] = $data[$ck][$key];\n\telse if($setdef)\n\t $res[$key][$ck] = $def;\n }\n }\n return($res);\n }", "function transpose(&$A, &$B)\r\n {\r\n $N = 4;\r\n for ($i = 0; $i < $N; $i++)\r\n for ($j = 0; $j < $N; $j++)\r\n $B[$i][$j] = $A[$j][$i];\r\n }", "function transposeData($data) {\r\n $retData = array();\r\n foreach ($data as $row => $columns) {\r\n foreach ($columns as $row2 => $column2) {\r\n \t\t$retData[$row2][$row] = $column2;\r\n }\r\n }\r\n\treturn $retData;\r\n}", "function transposeMatrix($arr){\n $length = count($arr);\n $sublength = count($arr[0]);\n $output = [];\n for($i=0; $i<$sublength; $i++){\n $tmp_arr = [];\n for($j=0; $j<$length;$j++){\n $tmp_arr[] = $arr[$j][$i];\n }\n $output[] = $tmp_arr;\n unset($tmp_arr);\n }\n return $output;\n}", "function flipDiagonally($arr) {\n\t $out = array();\n\t foreach ($arr as $key => $subarr) {\n\t foreach ($subarr as $subkey => $subvalue) {\n\t $out[$subkey][$key] = $subvalue;\n\t }\n\t }\n\t return $out;\n\t}", "private static function flipDiagonally($arr)\n\t{\n\t\t$out = array();\n\t\tforeach ($arr as $key => $subarr) {\n\t\t\tforeach ($subarr as $subkey => $subvalue) {\n\t\t\t\t$out[$subkey][$key] = $subvalue;\n\t\t\t}\n\t\t}\n\t\treturn $out;\n\t}", "public static function crossJoin( ...$arrays )\n {\n $results = [ [] ];\n\n foreach ( $arrays as $index => $array ) {\n $append = [];\n\n foreach ( $results as $product ) {\n foreach ( $array as $item ) {\n $product[ $index ] = $item;\n\n $append[] = $product;\n }\n }\n\n $results = $append;\n }\n\n return $results;\n }", "function transpose($matrix){\n\t$trans = Array();\n\tfor($i=0; $i<count($matrix[0]); $i++){\n\t\t$row = Array();\n\t\tfor($j=0; $j<count($matrix); $j++){\n\t\t\tarray_push($row, $matrix[$j][$i]);\n\t\t}\n\t\tarray_push($trans, $row);\n\t}\n\treturn $trans;\n}", "function flat(&$ary) {\n for ($i = 0; $i < count($ary); $i++) {\n while (is_array($ary[$i])) {\n array_splice($ary, $i, 1, $ary[$i]);\n }\n }\n}", "public static function data_valuesFlipCopy(): array {\n\t\treturn [\n\t\t\t[\n\t\t\t\t[\n\t\t\t\t\t'A', 'B', 'C',\n\t\t\t\t], [\n\t\t\t\t\t'A' => 'A', 'B' => 'B', 'C' => 'C',\n\t\t\t\t],\n\t\t\t], [\n\t\t\t\t[\n\t\t\t\t\t'one', 'two', 'three',\n\t\t\t\t], [\n\t\t\t\t\t'one' => 'one', 'two' => 'two', 'three' => 'three',\n\t\t\t\t],\n\t\t\t], [\n\t\t\t\t[\n\t\t\t\t\t'1', '2', '3', 'fish', '4', '5', '1', '2',\n\t\t\t\t], [\n\t\t\t\t\t'1' => '1', '2' => '2', '3' => '3', 'fish' => 'fish', '4' => '4', '5' => '5',\n\t\t\t\t],\n\t\t\t], [\n\t\t\t\t[\n\t\t\t\t\t'a' => 'A', 'b' => 'B',\n\t\t\t\t], [\n\t\t\t\t\t'A' => 'A', 'B' => 'B',\n\t\t\t\t],\n\t\t\t], [\n\t\t\t\t[\n\t\t\t\t\t'A', 'B',\n\t\t\t\t], [\n\t\t\t\t\t'A' => 'A', 'B' => 'B',\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\t}", "public function transpose() : self\n {\n switch ($this->m) {\n case 0:\n return $this;\n\n case 1:\n $b = [];\n\n foreach (current($this->a) ?: [] as $row) {\n $b[] = [$row];\n }\n\n return self::quick($b);\n\n default:\n return self::quick(array_map(null, ...$this->a));\n }\n }", "public function transpose()\n {\n $literal = array();\n\n for ($i = 0; $i < $this->columns; $i++) {\n $literal[] = array();\n\n for ($j = 0; $j < $this->rows; $j++) {\n $literal[$i][] = $this->get($j, $i);\n }\n }\n\n return new static($literal);\n }", "function awesomeSort($a, $b)\n{\n return $a['amount'] <=> $b['amount'];\n}", "public static function sortArrayDataProvider(): array\n {\n return [\n 'flatArray' => [\n ['d' => 'lemon', 'a' => 'orange', 'b' => 'banana', 'c' => 'apple'],\n ['a' => 'orange', 'b' => 'banana', 'c' => 'apple', 'd' => 'lemon'],\n ],\n 'twoDimensionalArray' => [\n ['z' => 'zzz', 'x' => ['b' => 'bbb', 'a' => 'aaa', 'c' => 'ccc'], 'y' => ['k' => 'kkk', 'j' => 'jjj', 'i' => 'iii']],\n ['x' => ['a' => 'aaa', 'b' => 'bbb', 'c' => 'ccc'], 'y' => ['i' => 'iii', 'j' => 'jjj', 'k' => 'kkk'], 'z' => 'zzz'],\n ],\n ];\n }", "function array_multisort_2d($array,$column,$sortorder='',$base=1){\n\tglobal $array_multisort_2d;\n\tif(!$array)return $array;\n\n\tforeach($array as $n=>$v){\n\t\t//develop link based on column\n\t\t$ref[]=strtolower($v[$column]);\n\t\t$refb[]=$n;\n\t}\n\t//need to develop to arsort if called\n\tasort($ref);\n\t$base=$base-1;\n\tforeach($ref as $n=>$v){\n\t\t$base++;\n\t\t$buffer[$base]=$array[$refb[$n]];\n\t}\n\treturn $buffer;\n}", "function asort2d($records, $field, $reverse=false) {\n\t $hash = array();\n\t foreach($records as $key => $record) {\n\t\t$hash[$record[$field].$key] = $record;\n\t }\n\t ($reverse)? krsort($hash) : ksort($hash);\n\t $records = array();\n\t foreach($hash as $record) {\n\t\t$records []= $record;\n\t }\n\t return $records;\n\t}", "public static function transpose($_name,$_flag=TRUE) {\n\t\t$_rows=F3::get($_name);\n\t\tif (!is_array($_rows)) {\n\t\t\tF3::$global['CONTEXT']=$_name;\n\t\t\ttrigger_error(self::TEXT_NotArray);\n\t\t\treturn FALSE;\n\t\t}\n\t\tforeach ($_rows as $_keyx=>$_cols)\n\t\t\tforeach ($_cols as $_keyy=>$_valy)\n\t\t\t\t$_result[$_keyy][$_keyx]=$_valy;\n\t\tif (!$_flag)\n\t\t\treturn $_result;\n\t\tF3::set($_name,$_result);\n\t}", "function sortCrossings() {\n $sortedtransits = array();\n for( $aspect = 0; $aspect < count($this->m_crossing); $aspect++ ) {\n $sortedtransits[substr($this->m_crossing[$aspect],17,11)] = $this->m_crossing[$aspect];\n }\n krsort($sortedtransits);\n //print_r($sortedtransits);\n\n unset($this->m_crossing);\n $this->m_crossing = array();\n for( $aspect = 0; $aspect < count($sortedtransits); $aspect++ ) {\n array_push(\n $this->m_crossing,\n array_pop( $sortedtransits )\n );\n }\n //print_r($this->m_crossing);\n }", "function rearrangePro_orderby(){\n\t\t$args = func_get_args();\n\t\t$data = array_shift($args);\n\t\tforeach ($args as $n => $field) {\n\t\t\tif (is_string($field)) {\n\t\t\t\t$tmp = array();\n\t\t\t\tforeach ($data as $key => $row)\n\t\t\t\t\t$tmp[$key] = $row[$field];\n\t\t\t\t$args[$n] = $tmp;\n\t\t\t}\n\t\t}\n\t\t$args[] = &$data;\n\t\tcall_user_func_array('array_multisort', $args);\n\t\treturn array_pop($args);\n\t}", "function reduceDependencies( $array1, $array2 )\r\n {\r\n $result = array();\r\n foreach ($array1 as $key => $value) {\r\n if ((!isset( $array2[$key] )) || ($array2[$key]['version'] < $value['version'])) {\r\n $result[$key] = $value;\r\n }\r\n }\r\n \r\n return $result;\r\n }", "function differenceWith(array $array, ...$values): array\n{\n if (!$array) {\n return [];\n }\n\n if (!\\is_callable(\\end($values))) {\n return difference($array, ...$values);\n }\n\n /** @var callable $comparator */\n $comparator = \\array_pop($values);\n\n $values = baseFlatten($values, 1, 'is_array', true, null);\n\n $valuesLength = \\count($values);\n $result = [];\n\n foreach ($array as $value) {\n $valuesIndex = $valuesLength;\n while ($valuesIndex--) {\n if ($comparator($value, $values[$valuesIndex])) {\n continue 2;\n }\n }\n\n $result[] = $value;\n }\n\n return $result;\n}", "function flatten_and_sort(array $a): array {\n $flatten = array_merge([], ...$a);\n sort($flatten);\n return $flatten;\n }", "function array_mash($primary, $secondary) {\n\t$primary = (array)$primary;\n\t$secondary = (array)$secondary;\n\t$out = array();\n\tforeach($primary as $name => $value) {\n\t\tif ( array_key_exists($name, $secondary) && !empty($secondary[$name]) && empty($value)) {\n\t\t\t$out[$name] = $secondary[$name];\n\t\t}\n\t\telse {\n\t\t\t$out[$name] = $value;\n\t\t}\n\t}\n\treturn $out;\n}", "function sort_array_by_other_array($arr, $keys_arr, $num_field) {\n\t$new_arr = array();\n\t$left_arr = $arr;\n\t\n\tforeach($keys_arr as $key=>$value) {\n\t\tforeach($arr as $key2=>$value2) {\n\t\t\tif($value2[$num_field] == $value) {\n\t\t\t\t$new_arr[] = $value2;\n\t\t\t\tunset($left_arr[$key2]);\n\t\t\t}\t\n\t\t}\n\t}\t\n\t$new_arr = array_merge($new_arr, $left_arr);\n\treturn $new_arr;\n}", "public function test_attribute_copy_array_of_array()\n {\n $src = [\n [\n \"1\" => \"shallow\",\n \"2\" => \"shallow\",\n \"3\" => [\n \"1\" => \"notshallow\",\n \"2\" => \"notshallow\",\n ],\n \"4\" => \"shallow\",\n \"5\" => [],\n ],\n [\n \"1\" => \"shallow\",\n \"2\" => \"shallow\",\n \"3\" => [\n \"1\" => \"notshallow\",\n \"2\" => \"notshallow\",\n ],\n \"4\" => \"shallow\",\n \"5\" => [],\n ],\n ];\n $dist = shallow_copy_array_of_array($src);\n $expect = [\n [\n \"1\" => \"shallow\",\n \"2\" => \"shallow\",\n \"4\" => \"shallow\",\n ],\n [\n \"1\" => \"shallow\",\n \"2\" => \"shallow\",\n \"4\" => \"shallow\",\n ],\n ];\n $this->assertTrue($this->arrays_are_similar($dist, $expect));\n }", "function vievReverseArray($array){\n echo '<table border=\"1\"><tr>';\n for ($x = (count($array) - 1); $x >= 0; $x--){\n echo '<td>'.$array[$x].\"</td>\";\n }\n echo '</tr></table>';\n}", "function compress_array($array) {\n if (!is_array($array)) {\n return quote($array);\n }\n $strings=array();\n foreach ($array as $ind => $val) {\n $strings[]=quote($ind).\"=>\".\n (is_array($val)?compress_array($val):quote($val));\n }\n return \"array(\".implode(\",\",$strings).\")\";\n}", "public function convertTypoScriptArrayToPlainArrayTestdata()\n {\n return [\n 'simple typoscript array' => [\n 'typoScriptSettings' => [\n '10.' => [\n 'value' => 'Hello World!',\n 'foo.' => [\n 'bar' => 5\n ]\n ],\n '10' => 'TEXT'\n ],\n 'expectedSettings' => [\n '10' => [\n 'value' => 'Hello World!',\n 'foo' => [\n 'bar' => 5\n ],\n '_typoScriptNodeValue' => 'TEXT'\n ]\n ]\n ],\n 'typoscript with intermediate dots' => [\n 'typoScriptSettings' => [\n '10.' => [\n 'value' => 'Hello World!',\n 'foo.' => [\n 'bar' => 5\n ]\n ],\n '10' => 'TEXT'\n ],\n 'expectedSettings' => [\n '10' => [\n 'value' => 'Hello World!',\n 'foo' => [\n 'bar' => 5\n ],\n '_typoScriptNodeValue' => 'TEXT'\n ]\n ]\n ],\n 'typoscript array with changed order' => [\n 'typoScriptSettings' => [\n '10' => 'TEXT',\n '10.' => [\n 'value' => 'Hello World!',\n 'foo.' => [\n 'bar' => 5\n ]\n ]\n ],\n 'expectedSettings' => [\n '10' => [\n 'value' => 'Hello World!',\n 'foo' => [\n 'bar' => 5\n ],\n '_typoScriptNodeValue' => 'TEXT'\n ]\n ]\n ],\n 'nested typoscript array' => [\n 'typoScriptSettings' => [\n '10' => 'COA',\n '10.' => [\n '10' => 'TEXT',\n '10.' => [\n 'value' => 'Hello World!',\n 'foo.' => [\n 'bar' => 5\n ]\n ],\n '20' => 'COA',\n '20.' => [\n '10' => 'TEXT',\n '10.' => [\n 'value' => 'Test',\n 'wrap' => '[|]'\n ],\n '20' => 'TEXT',\n '20.' => [\n 'value' => 'Test',\n 'wrap' => '[|]'\n ]\n ],\n '30' => 'custom'\n ]\n ],\n 'expectedSettings' => [\n '10' => [\n '10' => [\n 'value' => 'Hello World!',\n 'foo' => [\n 'bar' => 5\n ],\n '_typoScriptNodeValue' => 'TEXT'\n ],\n '20' => [\n '10' => [\n 'value' => 'Test',\n 'wrap' => '[|]',\n '_typoScriptNodeValue' => 'TEXT'\n ],\n '20' => [\n 'value' => 'Test',\n 'wrap' => '[|]',\n '_typoScriptNodeValue' => 'TEXT'\n ],\n '_typoScriptNodeValue' => 'COA'\n ],\n '30' => 'custom',\n '_typoScriptNodeValue' => 'COA'\n ]\n ]\n ],\n ];\n }", "function zip(array ...$arrays): array\n{\n return baseRest('\\_\\unzip')(...$arrays);\n}", "public function testEvaluateUnorderedArray(): void\n {\n $actual = [\n 'random' => 'value',\n 'date' => new DateTime('2019-10-10T00:00:00Z'),\n 'deep' => [\n 'deeper' => [\n 'date' => new DateTime('2019-10-10T00:00:00+0000'),\n ]\n ]\n ];\n\n $expected = [\n 'date' => new DateTime('2019-10-10T00:00:00Z'),\n 'deep' => [\n 'deeper' => [\n 'date' => new DateTime('2019-10-10T00:00:00+0000'),\n ]\n ],\n 'random' => 'value',\n ];\n\n $constraint = new ArraySameWithDates($expected);\n $result = $constraint->evaluate($actual, '', true);\n\n self::assertTrue($result);\n }", "function util_array_union($array1, $array2)\n{\n\t$result = $array1;\n\tforeach ($array2 as $key => $value)\n\t{\n\t\t$result[$key] = $value ;\n\t}\n\t\n\treturn $result ;\n}", "function comp($a,$b)\r\n{\r\n\treturn ($a[0] < $b[0]);\r\n}", "protected static function array_flip_3d ($array) {\n\t\tif (!is_array($array)) {\n\t\t\treturn false;\n\t\t}\n\t\t$result = [];\n\t\t$size = 0;\n\t\tforeach ($array as $values) {\n\t\t\t$size = max($size, count((array)$values));\n\t\t}\n\t\tforeach ($array as $key => $values) {\n\t\t\tfor ($i = 0; $i < $size; ++$i) {\n\t\t\t\tif (is_array($values)) {\n\t\t\t\t\tif (isset($values[$i])) {\n\t\t\t\t\t\t$result[$i][$key] = $values[$i];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$result[$i][$key] = $values;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public static function arrayGlue($destination, $addition) {\n foreach($destination as $key => $value) {\n if(!isset($addition[$key]) || is_numeric($key)) {\n continue;\n }\n\n if(is_array($value) && !is_array($addition[$key])\n && !in_array($addition[$key], $destination[$key])) {\n $destination[$key][] = $addition[$key];\n } else if(is_array($value)) {\n $destination[$key] = self::arrayGlue($value, $addition[$key]);\n } else if ($value != $addition[$key]) {\n $destination[$key] = [$value, $addition[$key]];\n }\n }\n\n return $destination;\n }", "function insertionSort(array &$arr)\n{\n\t$r = count($arr); // number of rows since its a 2d array [ [], [], [] ]\n\t$c = count($arr[0]); //number of columns\n\tfor ($i = 0; $i < $r * $c - 1; ++$i) {\n\t\tfor ($j = 0; $j < $r * $c - 1 - $i; ++$j) {\n\n\t\t\t// $j / $c gets each row: 0,0,0,1,1,1... and $j % $c gets each column: 0,1,2,0,1,2...\n\t\t\t//basically if $arr[0][1]>$arr[0][2] and so on\n\t\t\tif ($arr[$j / $c][$j % $c] > $arr[($j + 1) / $c][($j + 1) % $c]) {\n\n\t\t\t\t//swap the values\n\t\t\t\t$temp = $arr[($j + 1) / $c][($j + 1) % $c];\n\t\t\t\t$arr[($j + 1) / $c][($j + 1) % $c] = $arr[$j / $c][$j % $c];\n\t\t\t\t$arr[$j / $c][$j % $c] = $temp;\n\t\t\t}\n\t\t}\n\t}\n}", "public function test_attribute_copy_array()\n {\n $src = [\n \"1\" => \"shallow\",\n \"2\" => \"shallow\",\n \"3\" => [\n \"1\" => \"notshallow\",\n \"2\" => \"notshallow\",\n ],\n \"4\" => \"shallow\",\n \"5\" => [],\n ];\n $dist = shallow_copy_array($src);\n $expect = [\n \"1\" => \"shallow\",\n \"2\" => \"shallow\",\n \"4\" => \"shallow\"\n ];\n $this->assertTrue($this->arrays_are_similar($dist, $expect));\n }", "function sortByKeys($arr, $rows) {\n\n $res = array();\n foreach($rows as $key=>$val) {\n if(key_exists($key, $arr))\n $res[] = $arr[$key];\n }\n return $res;\n}", "function simpleQSortExample($list): array\n{\n // if count less than 2, then no need to sort\n if(count($list) < 2){\n return $list;\n }\n\n $pivot = $list[0];\n $lessItems = [];\n $greaterItems = [];\n\n for ($i = 1; $i < count($list); $i++){\n if($list[$i] <= $pivot){\n $lessItems[] = $list[$i];\n }else {\n $greaterItems[] = $list[$i];\n }\n }\n\n return array_merge(simpleQSortExample($lessItems), [$pivot], simpleQSortExample($greaterItems));\n}", "function compareTriplets($a, $b) {\r\n $res = array(0, 0);\r\n for($i = 0; $i < 3; $i++){\r\n if($a[$i] > $b[$i]){\r\n $res[0] = $res[0] + 1;\r\n }\r\n if($a[$i] < $b[$i]){\r\n $res[1] = $res[1] + 1;\r\n }\r\n }\r\n return $res;\r\n}", "function array_dots_uncollapse(array $array): array\n {\n $result = [];\n\n foreach ($array as $key => $value) {\n Arr::set($result, $key, $value);\n }\n\n return $result;\n }", "public function burbuja($array, $cantidad)\n {\n for($i=1;$i<$cantidad;$i++)\n {\n for($j=0;$j<$cantidad-$i;$j++)\n {\n if($array[$j]>$array[$j+1])\n {$k=$array[$j+1]; $array[$j+1]=$array[$j]; $array[$j]=$k;}\n }\n }\n //retorno del resultado a la vista\n return $array;\n\n }", "function cjpopups_sortArrayByArray(Array $array, Array $orderArray) {\n $ordered = array();\n foreach($orderArray as $key) {\n if(array_key_exists($key,$array)) {\n $ordered[$key] = $array[$key];\n unset($array[$key]);\n }\n }\n return $ordered + $array;\n}", "function sortMatrix(&$asMatrix){\r\n for ($i = 0; $i < count($asMatrix); $i++) {\r\n for ($j = $i + 1; $j < count($asMatrix); $j++) {\r\n if ($asMatrix[$i]['Magnitude'] < $asMatrix[$j]['Magnitude']) {\r\n $temp = $asMatrix[$i];\r\n $asMatrix[$i] = $asMatrix[$j];\r\n $asMatrix[$j] = $temp;\r\n }\r\n }\r\n }\r\n }", "function array_sort($array, $sortby) {\n\n $size = sizeof($array);\n\n for($i=0;$i<$size;$i++) {\n for($j=$i+1;$j<$size;$j++) {\n $temp = array();\n if($array[$i]['priority']<$array[$j]['priority']) {\n $temp = $array[$i];\n $array[$i] = $array[$j];\n $array[$j] = $temp;\n }\n }\n }\n return $array;\n}", "public function toMergedArray(): array;", "static function sortasc_old($data, $fieldname)\n {\n $len1 = count($data);\n $len2 = $len1;\n for ($i = 0; $i < $len1; $i++)\n {\n for ($j = $i+1; $j < $len2-1; $j++)\n {\n if ($data[$i][$fieldname] > $data[$j][$fieldname])\n {\n $tmp = $data[$i];\n $data[$i] = $data[$j];\n $data[$j] = $tmp;\n }\n }\n }\n \n return $data;\n }", "protected function _sortByArray($array) {}", "function print_array1(array $values, $reverse = false)\n{\n // if reverse is set to true, reverse order of array elements.\n if ($reverse) {\n $print_values = array_reverse($values);\n } else {\n $print_values = $values;\n }\n\n foreach ($print_values as $value) {\n echo $value . PHP_EOL;\n }\n}", "function merge_sort($arr)\n{\n $length = count($arr);\n\n if ($length <= 1) {\n return $arr;\n }\n\n $half = ($length >> 1) + ($length & 1);\n $half_arr = array_chunk($arr, $half);\n\n $left = merge_sort($half_arr[0]);\n $right = merge_sort($half_arr[1]);\n\n while (count($left) && count($right)) {\n if ($left[0] < $right[0]) {\n $reg[] = array_shift($left);\n } else {\n $reg[] = array_shift($right);\n }\n }\n\n return array_merge($reg, $left, $right);\n}", "function atkArrayCompare($array1, $array2)\n{\n\t$difference = atkArrayDiff($array1, $array2);\n\n\treturn !is_array($difference) ? false : true;\n}", "public function transpose(): Option\n {\n return $this->mapOrElse(\n static fn (Option $option) => $option->mapOrElse(\n static fn ($value) => Option::some(Result::ok($value)),\n static fn () => Option::none(),\n ),\n fn () => Option::some($this),\n );\n }", "public function unionDataProvider()\n {\n // A, B, expected result\n return [\n [[], [], []],\n [[], ['a'], ['a']],\n [['a'], ['a'], ['a']],\n [['a'], ['b'], ['a', 'b']],\n [['a', 'b'], [], ['a', 'b']],\n ];\n }", "function cmpByOrderIndexDesc($a, $b)\n{\n if ($a['order_index'] == $b['order_index']) {\n return 0;\n }\n return($a['order_index'] > $b['order_index']) ? -1 : 1;\n}", "function md_multisort($arr, $col, $method = SORT_ASC)\n{\n\tif(!is_array($arr) || empty($arr)) return false;\n\tif($col === null) return $arr;\n\telseif($col == 'name') $tmp = array_keys($arr);\n\telse foreach($arr as $key => $row) $tmp[$key] = @$row[$col];\n\tarray_multisort($tmp, $method, $arr);\n\treturn $arr;\n}", "function multitosingle($input, $output = array()) {\n ksort($input);\n foreach ($input as $value) {\n $key = count($output);\n if (is_array($value)) {\n $output = multitosingle($value, $output);\n }\n else {\n $output[$key] = $value;\n }\n }\n return $output;\n}", "function unite_arrays($a, $b) {\n if(!$a || !is_array($a)) {\n $a = array();\n }\n\n if($b && is_array($b)) {\n $a = array_merge($a, $b);\n }\n\n return $a;\n}", "function sortArrayWithSelection( &$arr ) {\r\n\t$i = 0;\r\n\t$size = count( $arr );\r\n\r\n\twhile ( $i < $size - 1 ) {\r\n\t\t$j = $i;\r\n\t\tfor ( $k = $j + 1; $k < $size; $k++ ) {\r\n\t\t\tif ( $arr[ $k ] < $arr[ $j ] ) {\r\n\t\t\t\t$j = $k;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ( $arr[ $i ] > $arr[ $j ] ) {\r\n\t\t\tswapArrayByValues( $arr, $i, $j );\r\n\t\t}\r\n\t\t$i++;\r\n\t}\r\n}", "function array_sort_by(&$array_initial, $col, $order = SORT_ASC){\n\n $arrAux = array();\n\n foreach ($array_initial as $key=> $row){\n $arrAux[$key] = is_object($row) ? $arrAux[$key] = $row->$col : $row[$col];\n $arrAux[$key] = strtolower($arrAux[$key]);\n }\n\n array_multisort($arrAux, $order, $array_initial);\n }", "public function toArray()\n {\n if ($this->isEmpty()) {\n return array();\n }\n\n $imploded = array();\n $current = $this->bottom();\n\n while ($current) {\n $imploded[$current->getKey()] = $current->getValue();\n $current = $current->getAfter();\n }\n\n return $imploded;\n }", "function arrayDiff(array $a, array $b):array {\n \n}", "public function transpose(): Stream {\n\t\t$streams = $this->map(function (iterable $iterable) {\n\t\t\treturn Stream::of($iterable);\n\t\t})\n\t\t\t->collect();\n\t\tif (count($streams) == 0) {\n\t\t\treturn new self(new \\ArrayIterator([]));\n\t\t}\n\n\t\t$generator = function (\\Iterator ...$streams): \\Generator {\n\t\t\tforeach ($streams as $stream) {\n\t\t\t\t$stream->rewind();\n\t\t\t}\n\t\t\t$all_are_valid = function (\\Iterator ...$streams) {\n\t\t\t\tforeach ($streams as $stream) {\n\t\t\t\t\tif (!$stream->valid()) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\twhile ($all_are_valid(...$streams)) {\n\t\t\t\t$ziped_element = [];\n\t\t\t\tforeach ($streams as $stream) {\n\t\t\t\t\t$ziped_element[] = $stream->current();\n\t\t\t\t\t$stream->next();\n\t\t\t\t}\n\t\t\t\tyield $ziped_element;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator(...$streams));\n\t}", "public static function devide(array $array)\n\t{\n\t\treturn [array_keys($array), array_values($array)];\n\t}", "public static function sortInnerValues(&$arr, $sortFn = 'sort') {\n foreach ($arr as $key => $item) {\n $sortFn($arr[$key]);\n }\n }", "function sort_array_of_arrays( $array, $sort_by_key ) {\n\n usort( $array, function ( $item1, $item2 ) use ( $sort_by_key ) {\n\n if ($item1[ $sort_by_key ] == $item2[ $sort_by_key ]) return 0;\n return $item1[ $sort_by_key ] < $item2[ $sort_by_key ] ? -1 : 1;\n\n });\n\n return $array;\n\n}", "function dePlucks($array, $key_array){\n $out =[];\n foreach($array as $row){\n $temp = $row;\n foreach ($key_array as $key) {\n unset($temp[$key]);\n }\n $out[] = $temp;\n }\n return $out;\n }", "public function orderDimensions(array $dimensions)\n {\n $result = array();\n $maxZ = 0;\n $byZ = array();\n $woZ = array();\n foreach ($dimensions as $arr) {\n if (array_key_exists('zIndex', $arr) AND ( (int) $arr['zIndex'] > 0)) {\n $byZ[ (int) $arr['zIndex']] = $arr;\n if ($arr['zIndex'] > $maxZ) {\n $maxZ = $arr['zIndex'];\n }\n }\n else {\n $woZ []= $arr;\n }\n }\n for ($i = 0; $i<$maxZ; $i++) {\n if (array_key_exists($i+1, $byZ)) {\n $result[$i] = $byZ[$i+1]; \n }\n else {\n $result[$i] = NULL;\n }\n }\n if ( ! empty($woZ)) {\n $result = array_merge($result, $woZ);\n }\n return $result;\n }", "private function _compare($outputStack)\n {\n $res = array();\n $len = count($outputStack);\n \n if ($len > 1) {\n for ($i = 0; $i < $len; $i++) {\n if (is_bool($outputStack[$i])) {\n continue;\n }\n else if ($outputStack[$i] === '&&') {\n $con1 = isset($outputStack[$i - 2]) && is_bool($outputStack[$i - 2]);\n $con2 = isset($outputStack[$i - 1]) && is_bool($outputStack[$i - 1]);\n \n if ($con1 && $con2) {\n $outputStack[$i] = $outputStack[$i - 2] && $outputStack[$i - 1];\n unset($outputStack[$i - 2], $outputStack[$i - 1]);\n }\n else {\n return $this->_compare(array_values($outputStack));\n }\n }\n else if ($outputStack[$i] === '||') {\n $con1 = isset($outputStack[$i - 2]) && is_bool($outputStack[$i - 2]);\n $con2 = isset($outputStack[$i - 1]) && is_bool($outputStack[$i - 1]);\n \n if ($con1 && $con2) {\n $outputStack[$i] = $outputStack[$i - 2] || $outputStack[$i - 1];\n unset($outputStack[$i - 2], $outputStack[$i - 1]);\n }\n else {\n return $this->_compare(array_values($outputStack));\n }\n }\n }\n }\n \n return end($outputStack);\n }", "function tabla02($array01){\n\t$i = '0';\n\t$array02[$i++] = \"<table border=\\\"1\\\">\";\n\tforeach( $array01 as $key => $value){\n\t\tif ( $key == 'id' or $key == 'ID' or $key == 'Id'){\n\t\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td><td> - </td></tr>\\n\";\n\t\t} else{\n\t\t\t$array02[$i++] = \"<tr><td>\".$key.\"</td><td>\".$value.\"</td><td>\".$value.\"</td></tr>\\n\";\n\t\t}\n\t}\n\t$array02[$i++] = \"</table>\";\n\treturn $array02;\n}", "private function _reorder_array(Matrix $transpose){\n $save_for_output[0] = $transpose->matrix[0];\n $save_for_output[1] = $transpose->matrix[4];\n $save_for_output[2] = $transpose->matrix[8];\n $save_for_output[3] = $transpose->matrix[12];\n $save_for_output[4] = $transpose->matrix[1];\n $save_for_output[5] = $transpose->matrix[5];\n $save_for_output[6] = $transpose->matrix[9];\n $save_for_output[7] = $transpose->matrix[13];\n $save_for_output[8] = $transpose->matrix[2];\n $save_for_output[9] = $transpose->matrix[6];\n $save_for_output[10] = $transpose->matrix[10];\n $save_for_output[11] = $transpose->matrix[14];\n $save_for_output[12] = $transpose->matrix[3];\n $save_for_output[13] = $transpose->matrix[7];\n $save_for_output[14] = $transpose->matrix[11];\n $save_for_output[15] = $transpose->matrix[15];\n $transpose->matrix = $save_for_output;\n return ($transpose);\n }", "public function compareShardTables($shard)\n\t{\n\t\t$shards = [];\n\t\tfor ($i = 1; $i <= $shard -> tablesMax; $i++) {\r\n\t\t\t$tblName = $shard -> baseTablePrefix . $i;\n\t\t\t$shards[$tblName] = $this -> connection -> setTable($tblName) -> getRowsCount();\r\n\t\t}\n\t\tasort($shards);\n\t\t\n\t\t$getTables = $getRows = $shards;\n\t\t$result['max']['rows'] = array_pop($getTables);\r\n\t\t$result['min']['rows'] = array_shift($getTables);\n\n\t\t$getRows = array_flip($shards);\n\t\tif (count($getRows) < 2) {\n\t\t\t$getRows = array_keys($shards);\n\t\t}\n\t\t$result['max']['table'] = array_pop($getRows);\r\n\t\t$result['min']['table'] = array_shift($getRows);\n\t\t\n\t\treturn $result;\n\t}", "function array_columns($array, $columns = 2) {\n\n\t$output_array = array();\n\t$counter = 0;\n\n\tforeach ( $array as $key => $value ) {\n\n\t\t$output_array[$counter][$key] = $value;\n\n\t\tif ( $counter++ >= ($columns - 1) ) {\n\t\t\t$counter = 0;\n\t\t}\n\n\t}\n\n\treturn $output_array;\n\n}", "Private function array_sort_by_columnR(&$arr, $col, $dir = SORT_DESC) {\n $sort_col = array();\n foreach ($arr as $key=>$row) {\n $sort_col[$key] = $row[$col];\n }\narray_multisort($sort_col, $dir, $arr);\nreturn $arr;\n}", "function comp($a1, $a2) {\n if (is_null($a1) || is_null($a2)) return false;\n sort($a1);\n sort($a2);\n // There is no comparison of arrays, only values.\n // The minimum number of iterations is 1, the maximum is n.\n foreach ($a2 as $key => $value) {\n if($a1[$key] ** 2 !== $value) return false;\n }\n return true;\n}", "function arrays_exor($a1, $a2)\n{\n $r = array();\n for ($i = 0; $i < count($a1); $i++) {\n if ($a1[$i] != '' and !in_array($a1[$i], $a2)) {\n $r[] = $a1[$i];\n }\n }\n for ($j = 0; $j < count($a2); $j++) {\n if ($a2[$j] != '' and !in_array($a2[$j], $a1)) {\n $r[] = $a2[$j];\n }\n }\n return $r;\n}", "function makeSorted($array)\n{\n\t$i = 0;\n\n\t// Shouldn't happen!\n\tif (empty($array))\n\t\treturn $array;\n\n\tforeach($array as $key => $value)\n\t\t$keys[$i++] = stripslashes($key);\n\tsort($keys);\n\tfor ($i=0 ; isset($keys[$i]); $i++)\n\t\t$return[addslashes($keys[$i])] = $array[addslashes($keys[$i])];\n\treturn $return;\n}", "abstract public function combineTo(array $array);", "function sortTransits() {\n $sortedtransits = array();\n for( $aspect = 0; $aspect < count($this->m_transit); $aspect++ ) {\n $sortedtransits[substr($this->m_transit[$aspect],17,11)] = $this->m_transit[$aspect];\n }\n ksort($sortedtransits);\n\n unset($this->m_transit);\n $this->m_transit = array();\n reset($sortedtransits);\n while( list($key,$value) = each($sortedtransits) ) {\n array_push(\n $this->m_transit,\n $value\n );\n }\n }", "function compareValues($data_array, $sql_records) {\n\t$changes = array();\n\tforeach ($data_array as $key => $val) {\n\t\t$diff = array_diff_assoc($data_array[$key], $sql_records[$key]);\n\t\tif ($diff) {\n\t\t\t$changes[$key] = $diff;\n\t\t}\n\t}\n\n\treturn $changes;\n}", "function array_extend_distinct(array $arrays) {\n $merged = array();\n\n foreach (func_get_args() as $array) {\n foreach ($array as $key => $value) {\n if (is_array($value) &&\n array_has($merged, $key) &&\n is_array($merged[$key])\n ) {\n if (array_is_associative($value) && array_is_associative($merged[$key])) {\n $merged[$key] = array_extend_distinct($merged[$key], $value);\n\n continue;\n }\n }\n\n $merged[$key] = $value;\n }\n }\n\n return $merged;\n }", "public function testFlip() {\n $data = array(\n 'true' => true,\n 'false' => false,\n 'null' => null,\n 'zero' => 0,\n 'stringZero' => '0',\n 'empty' => array(),\n 'array' => array(\n 'false' => false,\n 'null' => null,\n 'empty' => array()\n )\n );\n\n $this->assertEquals(array(\n 1 => 'true',\n 0 => 'stringZero',\n 'empty' => array(),\n 'array' => array(\n 'empty' => array()\n )\n ), Hash::flip($data));\n\n $data = array(\n 'foo' => 'bar',\n 1 => 'one',\n 2 => 'two',\n true,\n false,\n null,\n 'key' => 'value',\n 'baz' => 'bar',\n );\n\n $this->assertEquals(array(\n 'bar' => 'baz',\n 'one' => '',\n 'two' => '',\n 1 => '',\n 'value' => 'key'\n ), Hash::flip($data));\n\n $this->assertEquals(array(\n 1 => 'boolean',\n 123 => 'integer',\n 'foobar' => 'strings',\n 1988 => 'numeric',\n 'empty' => array(),\n 'one' => array(\n 1 => 'depth',\n 'two' => array(\n 2 => 'depth',\n 'three' => array(\n 3 => 'depth',\n 1 => 'true',\n 0 => 'zero',\n 'four' => array(\n 'five' => array(\n 'six' => array(\n 'seven' => array(\n 'We can go deeper!' => 'key'\n )\n )\n )\n )\n )\n )\n )\n ), Hash::flip($this->expanded));\n }", "function array_merge(/* $array, ... */): array\n{\n $merged = [];\n $arrays = array_reverse(func_get_args());\n while (!empty($arrays)) {\n $current = array_shift($arrays);\n if (!is_array($current)) {\n $current = [$current];\n }\n foreach (array_reverse($current) as $key => $value) {\n if (array_key_exists($key, $merged)) {\n if (is_array($value) && is_array($merged[$key])) {\n $merged[$key] = array_merge($value, $merged[$key]);\n }\n if (is_numeric($key)) {\n $merged[] = $value;\n }\n } else {\n $merged[$key] = $value;\n }\n }\n }\n\n return array_reverse($merged);\n}", "private function get_combinations($arrays) {\n $result = array(array());\n foreach ($arrays as $property => $property_values) {\n $tmp = array();\n foreach ($result as $result_item) {\n foreach ($property_values as $property_value) {\n $tmp[] = array_merge($result_item, array($property => $property_value));\n }\n }\n $result = $tmp;\n }\n return $result;\n }", "protected function getFormatedRows(array $data) : array{\n\n foreach($data as $k => $v){\n\t\t\t$data[$k] = array_values($v);\n\t\t}\n return $data;\n }", "public function array2table($array, $table = true) {\n $out = '';\n foreach ($array as $key => $value) {\n if (is_array($value)) {\n\n /** if (!isset($tableHeader)) { \n $tableHeader =\n '<tr><th>' .\n implode('</th><th>', array_keys($value)) .\n '</th></tr>';\n } **/ \n array_keys($value);\n\n $out .= \"\\n<tr>\";\n $out .= $this->array2table($value, false);\n $out .= \"</tr>\\n\";\n } else {\n \n $out .= \"<td>$value</td>\";\n\n }\n }\n // build it up \n if ($table) { \n $sort_buttons = $this->BuildSortButtons(); \n \n return \"\\n<table>\\n\" . $sort_buttons . $out . \"\\n</table>\\n\";\n\n } else {\n \n return $out;\n } \n }", "function compare($X, $Y) {\n return ($Y['count'] - $X['count']);\n}", "private function getCombinations(array ...$arrays): array\n {\n $result = [[]];\n foreach ($arrays as $property => $property_values) {\n $tmp = [];\n foreach ($result as $result_item) {\n foreach ($property_values as $property_value) {\n $tmp[] = array_merge($result_item, [$property => $property_value]);\n }\n }\n $result = $tmp;\n }\n return $result;\n }", "function merge_presorted_arrays($left, $right, $comparer = null) {\n\t\t\tif ($comparer === null) {\n\t\t\t\t$comparer = function($a, $b) {\n\t\t\t\t\tif ($a < $b) return -1;\n\t\t\t\t\tif ($a == $b) return 0;\n\t\t\t\t\tif ($a > $b) return 1;\n\t\t\t\t};\n\t\t\t}\n\t\t\t$leftLength = count($left);\n\t\t\t$rightLength = count($right);\n\t\t\t$result = [];\n\t\t\t\n\t\t\t$i = 0;\n\t\t\t$j = 0;\n\t\t\t\n\t\t\twhile ($i < $leftLength || $j < $rightLength) {\n\t\t\t\tif ($i < $leftLength && $j < $rightLength) {\n\t\t\t\t\t$cmp = $comparer($left[$i], $right[$j]);\n\t\t\t\t}\n\t\t\t\telse if ($i < $leftLength) {\n\t\t\t\t\t$cmp = -1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$cmp = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($cmp <= 0) {\n\t\t\t\t\t$result[] = $left[$i++];\n\t\t\t\t}\n\t\t\t\tif ($cmp >= 0) {\n\t\t\t\t\t$result[] = $right[$j++];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $result;\n\t\t}", "function sortedMerge($large, $small) {\n // put small array into bigger array\n $smallIndex = -1;\n for ($i=0; $i < sizeof($large); $i++) { \n if (empty($large[$i])) {\n if ($smallIndex == -1) {\n $smallIndex = $i;\n }\n $large[$i] = array_shift($small);\n }\n }\n // merge them into 1 array with merge part of merge sort\n return merge($large, $smallIndex);\n}", "function propsort(&$array, $property) {\n uasort($array, create_function('$a,$b','return strcmp($a->'.$property.', $b->'.$property.');'));\n return $array;\n}", "function array_cartesian_product(array $arrays): array\n{\n if (empty($arrays)) {\n return [[]];\n }\n\n $subset = array_shift($arrays);\n $cartesianSubset = array_cartesian_product($arrays);\n $product = [];\n\n foreach ($subset as $value) {\n foreach ($cartesianSubset as $p) {\n array_unshift($p, $value);\n $product[] = $p;\n }\n }\n\n return $product;\n}", "function array_collapse($array)\n {\n return Arr::collapse($array);\n }", "function make_comparer() {\n // Normalize criteria up front so that the comparer finds everything tidy\n $criteria = func_get_args();\n foreach ($criteria as $index => $criterion) {\n $criteria[$index] = is_array($criterion)\n ? array_pad($criterion, 3, null)\n : array($criterion, SORT_ASC, null);\n }\n\n return function($first, $second) use (&$criteria) {\n foreach ($criteria as $criterion) {\n // How will we compare this round?\n list($column, $sortOrder, $projection) = $criterion;\n $sortOrder = $sortOrder === SORT_DESC ? -1 : 1;\n\n // If a projection was defined project the values now\n if ($projection) {\n $lhs = call_user_func($projection, $first[$column]);\n $rhs = call_user_func($projection, $second[$column]);\n }\n else {\n $lhs = $first[$column];\n $rhs = $second[$column];\n }\n\n // Do the actual comparison; do not return if equal\n if ($lhs < $rhs) {\n return -1 * $sortOrder;\n }\n else if ($lhs > $rhs) {\n return 1 * $sortOrder;\n }\n }\n\n return 0; // tiebreakers exhausted, so $first == $second\n };\n}", "function fn_sort_md_array_by_value(&$array, $key)\n{\n\t//ref. http://stackoverflow.com/questions/2699086/sort-multi-dimensional-array-by-value\n $sorter=array();\n $ret=array();\n reset($array);\n foreach ($array as $ii => $va) {\n $sorter[$ii]=$va[$key];\n }\n asort($sorter);\n foreach ($sorter as $ii => $va) {\n $ret[$ii]=$array[$ii];\n }\n $array=$ret;\n}", "public function testSort()\n {\n $array = array(\n array('col1' => 20, 'col2' => 20),\n array('col1' => 20, 'col2' => 10),\n array('col1' => 10, 'col2' => 50),\n array('col1' => 10, 'col2' => 10),\n array('col1' => 10, 'col2' => 20),\n );\n\n $expected = array(\n array('col1' => 10, 'col2' => 50),\n array('col1' => 10, 'col2' => 10),\n array('col1' => 10, 'col2' => 20),\n array('col1' => 20, 'col2' => 20),\n array('col1' => 20, 'col2' => 10),\n );\n\n Sort::mergesort($array, function ($row1, $row2) {\n return strcmp($row1['col1'], $row2['col1']);\n });\n\n $this->assertEquals($expected, $array);\n }", "function quickSort($array)\n{\n $len = count($array);\n if ($len <= 1) {\n return $array;\n }\n\n //compare data\n $base = $array[0];\n\n $left = $right = [];\n for ($i = 1; $i < $len; $i++) {\n if ($array[$i] < $base) {\n $left[] = $array[$i];\n } else {\n $right[] = $array[$i];\n }\n }\n\n $left = quickSort($left);\n $right = quickSort($right);\n\n return array_merge($left, (array)$base, $right);\n}", "abstract public function diffWith(array $array);" ]
[ "0.5695664", "0.56495565", "0.56145334", "0.5267228", "0.5258671", "0.52019745", "0.50720555", "0.5003975", "0.49917012", "0.48905623", "0.48578012", "0.48132464", "0.47079942", "0.46216288", "0.46019268", "0.459663", "0.45812762", "0.45809868", "0.45339", "0.45071772", "0.44922483", "0.4474608", "0.44666836", "0.44149587", "0.43747318", "0.43673337", "0.43604127", "0.43553686", "0.43073872", "0.4294455", "0.42836505", "0.42739046", "0.42608726", "0.4257367", "0.4254995", "0.4254424", "0.42479068", "0.423646", "0.4222666", "0.42100233", "0.42030525", "0.41994914", "0.41979843", "0.41941303", "0.41885564", "0.41879237", "0.41876096", "0.41860566", "0.4174782", "0.41695833", "0.4167893", "0.41669944", "0.4160455", "0.41583115", "0.41483882", "0.41309577", "0.41242364", "0.41127354", "0.41101307", "0.41052452", "0.41016397", "0.4099191", "0.4096312", "0.40833595", "0.4057792", "0.405766", "0.40565637", "0.40520713", "0.40396613", "0.40351185", "0.40285808", "0.40200076", "0.40197113", "0.4017372", "0.4016572", "0.40154332", "0.40053102", "0.4004917", "0.40009403", "0.39992285", "0.39987975", "0.39969102", "0.39963838", "0.39924175", "0.39908195", "0.3988633", "0.3988436", "0.39831686", "0.39698777", "0.39659765", "0.39658177", "0.39650238", "0.39624217", "0.39519778", "0.3945819", "0.39439222", "0.39428502", "0.39411867", "0.39370617", "0.39348668" ]
0.44492617
23
$response_data_126t = array( "form_format" => TRUE, "read_data" => TRUE, "data" => array() );
public function save_records($id_form_detail, $response_data) { if ($response_data["form_format"] && $response_data["read_data"]) { if (!empty($response_data["data"])) { // var_dump($response_data["data"]);exit(); foreach ($response_data["data"] as $satuan_kotama => $array_data_satuan) { $this->save_per_satuan($id_form_detail, $satuan_kotama, $array_data_satuan); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getResponseData();", "public function getRequestData();", "public function postDataArrayProvider()\n {\n\t$data_array = array(\n\t 'photo' => 'test.jpg',\n\t 'id' => 1,\n\t 'author' => 'Anonymous',\n\t 'subject' => '',\n\t 'updated' => 0,\n\t 'content' => 'Testing'\n\t);\n\treturn array(\n\t 'default' => array($data_array)\n\t);\n }", "public static function getFormData() { \n $result = lC_Products_expected_Admin::formData($_GET['peid']);\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n\n echo json_encode($result);\n }", "private function POST() {\n global $_POST;\n $postData = array();\n foreach($_POST as $key => $value) {\n $postData[$key] = $value;\n }\n $this -> response[\"response\"] = $postData;\n return;\n }", "private function parsed_data()\n {\n $parsed_data = array();\r\n\r\n //post data\r\n $parsed_data['name'] = $this->input->post(\"name\", TRUE);\r\n $parsed_data['email'] = $this->input->post(\"email\", TRUE);\r\n $parsed_data['countryID'] = $this->input->post(\"country\", TRUE);\r\n $parsed_data['phone'] = $this->input->post(\"phone\", TRUE);\r\n $parsed_data['message'] = $this->input->post(\"message\", TRUE);\r\n $parsed_data['IP'] = $this->input->ip_address();\r\n $parsed_data['browser'] = $this->input->user_agent();\r\n //post data\r\n\r\n return $parsed_data;\n }", "function getResponseData( $response ) {\n\t\t\n\t\tif ( is_array( $response ) && !empty( $response ) ) {\n\t\t\treturn $response;\n\t\t}\n\t}", "public function get_validate_response_data() {\n\t\treturn [];\n\t}", "function getFormData(){\n\n}", "function setFormData($data) {\r\n\t\t$data['why_use'] = $this->load->view('common/why_use_view', $data, TRUE);\r\n\t\t\r\n\t\t// load search block\r\n\t\t$data = buildTourSearchCriteria($data);\r\n\t\t\r\n\t\t$data['inc_css'] = get_static_resources('ads.min.css');\r\n\t\t\r\n\t\treturn $data;\r\n\t}", "abstract public function parsePostData() : array;", "public function getResponse() : array;", "private static function _cookData($data) {\n\t $tmp = array();\n\t if(isset($data['request_id'])) $tmp['request_id'] = $data['request_id'];\n\t if(isset($data['unit_id'])) $tmp['unit_id'] = $data['unit_id'];\n\t if(isset($data['ad_id'])) $tmp['ad_id'] = $data['ad_id'];\n\t if(isset($data['originality_id'])) $tmp['originality_id'] = $data['originality_id'];\n\t if(isset($data['device_id'])) $tmp['device_id'] = $data['device_id'];\n\t if(isset($data['create_time'])) $tmp['create_time'] = $data['create_time'];\n\t if(isset($data['create_date'])) $tmp['create_date'] = $data['create_date'];\n\t return $tmp;\n\t}", "function prepData($responseCode,$data){\n header('Content-Type: application/json');\n echo json_encode($data);\n http_response_code($responseCode);\n }", "function prepData($data)\r\n {\r\n \t$data['data']['Question']['master'] = $data['form']['master'];\r\n\t$data['data']['Question']['type'] = $data['form']['type'];\r\n\t$data['data']['Question']['count'] = $data['form']['data']['Question']['count'];\r\n\r\n\treturn $data;\r\n }", "abstract protected function getReponseData() ;", "public function setResponseData(array $data)\n {\n $this->responseData = json_encode($data);\n }", "public static function getFormData() {\r\n $result = lC_Configuration_Admin::getFormData($_GET['cid']);\r\n if (!isset($result['rpcStatus'])) {\r\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\r\n }\r\n\r\n echo json_encode($result);\r\n }", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['id'])) $tmp['id'] = $data['id'];\n\t\tif(isset($data['title'])) $tmp['title'] = $data['title'];\n\t\tif(isset($data['guide'])) $tmp['guide'] = $data['guide'];\n\t\tif(isset($data['gtype'])) $tmp['gtype'] = $data['gtype'];\n\t\tif(isset($data['ntype'])) $tmp['ntype'] = $data['ntype'];\n\t\tif(isset($data['btype'])) $tmp['btype'] = $data['btype'];\n\t\tif(isset($data['img'])) $tmp['img'] = $data['img'];\n\t\tif(isset($data['status'])) $tmp['status'] = intval($data['status']);\n\t\tif(isset($data['start_time'])) $tmp['start_time'] = $data['start_time'];\n\t\tif(isset($data['update_time'])) $tmp['update_time'] = intval($data['update_time']);\n\t\tif(isset($data['end_time'])) $tmp['end_time'] = intval($data['end_time']);\n\t\treturn $tmp;\n\t}", "public function parsePostData()\n {\n }", "protected function loadFormData()\n\t{\n\t}", "public function getAuthDataFromResponse(): array;", "public function getResponse(): array;", "function getData() {\n return $this->body->getResponse();\n }", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "protected function getReponseData() {}", "function getData()\r\n{\r\n$data = array();\r\n$data[0]=$_POST['id'];\r\n$data[1]=$_POST['name'];\r\n$data[2]=$_POST['age'];\r\n$data[3]=$_POST['photo'];\r\n$data[4]=$_POST['nationality'];\r\n$data[5]=$_POST['potential'];\r\n$data[6]=$_POST['club'];\r\n$data[7]=$_POST['logo'];\r\n$data[8]=$_POST['wage'];\r\n$data[9]=$_POST['jersey'];\r\nreturn $data;\r\n}", "private static function _cookData($data) {\n $tmp = array();\n if (isset($data['ad_id'])) $tmp['ad_id'] = $data['ad_id'];\n if (isset($data['label_type'])) $tmp['label_type'] = $data['label_type'];\n if (isset($data['ads_name'])) $tmp['ads_name'] = $data['ads_name'];\n if (isset($data['advertiser_uid'])) $tmp['advertiser_uid'] = $data['advertiser_uid'];\n if (isset($data['create_time'])) $tmp['create_time'] = $data['create_time'];\n if (isset($data['update_time'])) $tmp['update_time'] = $data['update_time'];\n return $tmp;\n }", "protected function getInputData ()\n {\n (new HCRivilePaymentsValidator())->validateForm();\n\n $_data = request()->all();\n\n if (array_has($_data, 'id'))\n array_set($data, 'record.id', array_get($_data, 'id'));\n\n array_set($data, 'record.COUNT', array_get($_data, 'COUNT'));\n array_set($data, 'record.I04_KODAS_CH', array_get($_data, 'I04_KODAS_CH'));\n array_set($data, 'record.I04_DOK_NR', array_get($_data, 'I04_DOK_NR'));\n array_set($data, 'record.I04_OP_RUSIS', array_get($_data, 'I04_OP_RUSIS'));\n array_set($data, 'record.I04_OP_TIPAS', array_get($_data, 'I04_OP_TIPAS'));\n array_set($data, 'record.I04_OP_STORNO', array_get($_data, 'I04_OP_STORNO'));\n array_set($data, 'record.I04_OP_DATA', array_get($_data, 'I04_OP_DATA'));\n array_set($data, 'record.I04_KODAS_SS', array_get($_data, 'I04_KODAS_SS'));\n array_set($data, 'record.I04_MOKETOJAS', array_get($_data, 'I04_MOKETOJAS'));\n array_set($data, 'record.I04_KODAS_KS', array_get($_data, 'I04_KODAS_KS'));\n array_set($data, 'record.I04_PAV', array_get($_data, 'I04_PAV'));\n array_set($data, 'record.I04_ADR', array_get($_data, 'I04_ADR'));\n array_set($data, 'record.I04_ATSTOVAS', array_get($_data, 'I04_ATSTOVAS'));\n array_set($data, 'record.I04_KODAS_VS', array_get($_data, 'I04_KODAS_VS'));\n array_set($data, 'record.I04_SUMA', array_get($_data, 'I04_SUMA'));\n array_set($data, 'record.I04_SUMA_DSK', array_get($_data, 'I04_SUMA_DSK'));\n array_set($data, 'record.I04_SUMA_PLK', array_get($_data, 'I04_SUMA_PLK'));\n array_set($data, 'record.I04_PASTABOS', array_get($_data, 'I04_PASTABOS'));\n array_set($data, 'record.I04_PERKELTA', array_get($_data, 'I04_PERKELTA'));\n array_set($data, 'record.I04_IMP_EXP', array_get($_data, 'I04_IMP_EXP'));\n array_set($data, 'record.I04_KODAS_VL', array_get($_data, 'I04_KODAS_VL'));\n array_set($data, 'record.I04_SUMA_VAL', array_get($_data, 'I04_SUMA_VAL'));\n array_set($data, 'record.I04_KOEF', array_get($_data, 'I04_KOEF'));\n array_set($data, 'record.I04_USERIS', array_get($_data, 'I04_USERIS'));\n array_set($data, 'record.I04_R_DATE', array_get($_data, 'I04_R_DATE'));\n array_set($data, 'record.I04_ADDUSR', array_get($_data, 'I04_ADDUSR'));\n array_set($data, 'record.I04_KODAS_SM', array_get($_data, 'I04_KODAS_SM'));\n array_set($data, 'record.I04_APRASYMAS', array_get($_data, 'I04_APRASYMAS'));\n array_set($data, 'record.I04_SUMA_PER', array_get($_data, 'I04_SUMA_PER'));\n array_set($data, 'record.I04_SUMA_WK', array_get($_data, 'I04_SUMA_WK'));\n array_set($data, 'record.I04_KODAS_LS_1', array_get($_data, 'I04_KODAS_LS_1'));\n array_set($data, 'record.I04_KODAS_LS_2', array_get($_data, 'I04_KODAS_LS_2'));\n array_set($data, 'record.I04_KODAS_LS_3', array_get($_data, 'I04_KODAS_LS_3'));\n array_set($data, 'record.I04_KODAS_LS_4', array_get($_data, 'I04_KODAS_LS_4'));\n array_set($data, 'record.I04_KODAS_ZN', array_get($_data, 'I04_KODAS_ZN'));\n array_set($data, 'record.I04_BUSENA', array_get($_data, 'I04_BUSENA'));\n\n return makeEmptyNullable($data);\n }", "private function _data( $data=array() )\n {\n $output = array();\n\n if( is_array( $data ) )\n {\n $query = http_build_query( $data, '', '&' );\n parse_str( $query, $output );\n }\n return $output;\n }", "function getFormData($array) {\r\n $data = array();\r\n foreach($array as $key=>$dataname){\r\n $data[$dataname] = xtc_db_input($_POST[$dataname]);\r\n }\r\n return $data;\r\n }", "private function getResponseStructure(){\n $success = [];\n if($this->success == false){\n //WE have to show the error\n $success = [];\n $success[\"success\"] = $this->success;\n $success[\"error_code\"] = $this -> error_code;\n $success[\"error_msg\"] = $this -> error_message;\n }else{\n\n $success = [];\n $success[\"success\"] = $this->success;\n if($this->total_elements > 0){\n $success[\"total_elements\"] = $this->total_elements;\n }\n $success[$this->data_root] = $this->data;\n }\n return $success;\n }", "private static function _cookData($data) {\n\t\t$tmp = array();\n $fields = array(\n 'htype', 'title', 'hd_start_time', 'hd_end_time', 'status', 'hd_object',\n 'condition_type', 'condition_value', 'rule_type', 'game_version', 'game_object',\n 'denomination','deadline','rule_content','rule_content_percent','create_time','subject_id',\n 'hd_object_addition_info', 'game_object_addition_info'\n );\n foreach ($fields as $field) {\n if(isset($data[$field])) {\n $tmp[$field] = $data[$field];\n }\n }\n\t\treturn $tmp;\n\t}", "private function formatData() {\n\t\t// Initialise arr variable\n\t\t$str = array();\n\n\t\t// Step through the fields\n\t\tforeach($this->data as $key => $value){\n\t\t\t// Stick them together as key=value pairs (url encoded)\n\t\t\t$str[] = $key . '=' . urlencode($value);\n\t\t}\n\n\t\t// Implode the arry using & as the glue and store the data\n\t\t$this->curl_str = implode('&', $str);\n\t}", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif (isset($data['name'])) $tmp['name'] = $data['name'];\n\t\tif (isset($data['link'])) $tmp['link'] = $data['link'];\n\t\tif (isset($data['img'])) $tmp['img'] = $data['img'];\n\t\tif (isset($data['sort'])) $tmp['sort'] = intval($data['sort']);\n\t\tif (isset($data['hits'])) $tmp['hits'] = intval($data['hits']);\n\t\tif (isset($data['status'])) $tmp['status'] = $data['status'];\n\t\tif (isset($data['type_id'])) $tmp['type_id'] = $data['type_id'];\n\t\tif (isset($data['descrip'])) $tmp['descrip'] = $data['descrip'];\n\t\tif (isset($data['is_recommend'])) $tmp['is_recommend'] = $data['is_recommend'];\n\t\tif (isset($data['star'])) $tmp['star'] = $data['star'];\n\t\treturn $tmp;\n\t}", "public function requestData() {\n\t\t// Set up cURL \n\t\t$curl = curl_init($this->query); \n\t\tcurl_setopt($curl, CURLOPT_POST, false); \n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t$response = curl_exec($curl);\n\t\tcurl_close($curl);\n\t\t\t\n\t\treturn $this->parseAPIResponse($response);\n\t}", "protected function getFormData() {\n\t\treturn $this->stripNonPrintables(json_decode($this->request->postVar('Details'), true));\n\t}", "private function _JsonData() \n {\n $raw = file_get_contents('php://input', true);\n $body = json_decode($raw);\n \n $this->__new((array) $body);\n }", "public function data() {\n $request = $this->requestReader->getContents();\n\t\tif ($request) {\n if ($json_post = CJSON::decode($request)){\n\t\t\t\treturn $json_post;\n\t\t\t}else{\n\t\t\t\tparse_str($request,$variables);\n\t\t\t\treturn $variables;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['out_id'])) $tmp['out_id'] = $data['out_id'];\n\t\tif(isset($data['file_id'])) $tmp['file_id'] = $data['file_id'];\n\t\tif(isset($data['label_id'])) $tmp['label_id'] = $data['label_id'];\n\t\tif(isset($data['create_time'])) $tmp['create_time'] = intval($data['create_time']);\n\t\tif(isset($data['update_time'])) $tmp['update_time'] = intval($data['update_time']);\n\t\treturn $tmp;\n\t}", "public function setFormData($data)\n {}", "public function getRequestData(){\n\t\treturn array( \n \t\t\t'cmd' => $this->getRequestCommand(), \n \t\t\t'params' => $this->getParams() \n\t\t); \n\t}", "public function index()\n {\n $client = new \\GuzzleHttp\\Client();\n $res = $client->request('POST', 'http://192.168.1.112:8000/polls/result/', [\n 'form_params' => [\n 'data' => \"1027.00,1027.00,1027.00,1027.00,1027.00,1027.00,1027.00,1027.00,1027.00,1032.00,1037.00,1038.00,1039.00,1040.00,1045.00,1051.00,1056.00,1056.00,1057.00,1058.00,1065.00,1066.00,1069.00,1068.00,1066.00,1061.00,1062.00,1063.00,1063.00,1060.00,1053.00,1049.00,1047.00,1050.00,1049.00,1044.00,1039.00,1035.00,1036.00,1036.00,1036.00,1034.00,1028.00,1029.00,1028.00,1029.00,1032.00,1028.00,1027.00,1023.00,1024.00,1027.00,1029.00,1028.00,1027.00,1023.00,1024.00,1025.00,1027.00,1025.00,1024.00,1023.00,1024.00,1026.00,1028.00,1022.00,1020.00,1020.00,1018.00,1024.00,1026.00,1022.00,1020.00,1017.00,1019.00,1019.00,1023.00,1022.00,1019.00,1016.00,1018.00,1021.00,1019.00,1020.00,1016.00,1016.00,1017.00,1019.00,1021.00,1018.00,1016.00,1015.00,1019.00,1020.00,1023.00,1022.00,1019.00,1017.00,1020.00,1023.00,1023.00,1022.00,1021.00,1020.00,1021.00,1024.00,1025.00,1023.00,1021.00,1021.00,1021.00,1026.00,1025.00,1024.00,1019.00,1020.00,1021.00,1024.00,1025.00,1024.00,1021.00,1020.00,1018.00,1024.00,1026.00,1024.00,1021.00,1020.00,1019.00,1022.00,1025.00,1024.00,1021.00,1020.00,1020.00,1023.00,1023.00,1021.00,1019.00,1017.00,1021.00,1021.00,1022.00,1021.00,1020.00,1018.00,1016.00,1018.00,1020.00,1020.00,1018.00,1016.00,1018.00,1019.00,1020.00,1018.00,1017.00,1017.00,1017.00,1018.00,1021.00,1019.00,1016.00,1013.00,1018.00,1018.00,1021.00,1018.00,1015.00,1015.00,1016.00,1016.00,1021.00,1018.00,1016.00,1015.00,1018.00,1020.00,1021.00,1018.00,1015.00,1015.00,1018.00,1017.00,1019.00,1017.00,1018.00,1013.00,1016.00,1019.00,1021.00,1021.00,1018.00,1015.00,1016.00,1018.00,1019.00,1018.00,1017.00,1014.00,1013.00,1016.00,1020.00,1019.00,1016.00,1014.00,1018.00,1020.00,1021.00,1021.00,1014.00,1014.00,1019.00,1021.00,1022.00,1020.00,1018.00,1018.00,1018.00,1020.00,1024.00,1022.00,1019.00,1016.00,1021.00,1022.00,1025.00,1026.00,1025.00,1024.00,1026.00,1031.00,1031.00,1028.00,1029.00,1026.00,1031.00,1033.00,1035.00,1034.00,1029.00,1028.00,1028.00,1027.00,1029.00,1027.00,1025.00,1023.00,1027.00,1030.00,1030.00,1031.00,1030.00,1029.00,1031.00,1035.00,1036.00,1030.00,1025.00,1023.00,1023.00,1025.00,1028.00,1025.00,1023.00,1023.00,1021.00,1023.00,1025.00,1023.00,1020.00,1020.00,1021.00,1023.00,1024.00,1021.00,1019.00,1018.00,1021.00,1023.00,1025.00,1023.00,1019.00,1018.00,1021.00,1022.00,1025.00,1024.00,1023.00,1020.00,1023.00,1027.00,1029.00,1029.00,1028.00,1030.00,1037.00,1046.00,1052.00,1062.00,1071.00,1081.00,1095.00,1121.00,1151.00,1184.00,1217.00,1249.00,1289.00,1331.00,1376.00,1420.00,1434.00,1400.00,1304.00,1178.00,1080.00,1026.00,1010.00,1013.00,1019.00,1023.00,1024.00,1023.00,1016.00,1011.00,1009.00,1012.00,1010.00,1010.00,1006.00,1002.00,1005.00,1006.00,1009.00,1008.00,1005.00,1003.00,1008.00,1006.00,1007.00,1006.00,1003.00,1003.00,1003.00,1006.00,1007.00,1004.00,999.00,997.00,1001.00,1002.00,1005.00,1000.00,995.00,999.00,1000.00,999.00,1003.00,1001.00,997.00,995.00,999.00,999.00,1001.00,1001.00,998.00,998.00,1000.00,999.00,1002.00,1001.00,999.00,999.00,1003.00,1003.00,1005.00,1003.00,999.00,1001.00,1002.00,1005.00,1007.00,1007.00,1003.00,1004.00,1005.00,1012.00,1012.00,1013.00,1012.00,1010.00,1016.00,1019.00,1023.00,1024.00,1023.00,1025.00,1030.00,1035.00,1043.00,1042.00,1043.00,1044.00,1050.00,1056.00,1062.00,1062.00,1060.00,1061.00,1065.00,1070.00,1072.00,1071.00,1068.00,1067.00,1067.00,1067.00,1069.00,1066.00,1060.00,1055.00,1056.00,1056.00,1055.00,1051.00,1046.00,1043.00,1042.00,1044.00,1042.00,1039.00,1037.00,1032.00,1035.00,1036.00,1038.00,1034.00,1031.00,1029.00,1032.00,1033.00,1033.00,1031.00,1028.00,1027.00,1027.00,1030.00,1034.00,1030.00,1028.00,1026.00,1029.00,1031.00,1029.00,1027.00,1027.00,1024.00,1027.00,1027.00,1028.00,1026.00,1023.00,1023.00,1023.00,1026.00,1030.00,1025.00,1022.00,1023.00,1021.00,1024.00,1025.00,1024.00,1020.00,1020.00,1022.00,1027.00,1027.00,1023.00,1023.00,1022.00,1022.00,1026.00,1028.00,1026.00,1024.00,1022.00,1024.00,1027.00,1027.00,1025.00,1024.00,1024.00,1027.00,1029.00,1028.00,1026.00,1023.00,1024.00,1026.00,1030.00,1030.00,1028.00,1027.00,1026.00,1026.00,1031.00,1031.00,1030.00,1028.00,1025.00,1027.00,1029.00,1030.00,1028.00,1025.00,1023.00,1025.00,1026.00,1028.00,1027.00,1024.00,1022.00,1023.00,1026.00,1030.00,1024.00,1025.00,1021.00,1023.00,1027.00,1030.00,1026.00,1023.00,1020.00,1023.00,1024.00,1027.00,1025.00,1022.00,1021.00,1022.00,1024.00,1027.00,1023.00,1020.00,1018.00,1023.00,1024.00,1023.00,1024.00,1023.00,1021.00,1022.00,1022.00,1025.00,1023.00,1022.00,1022.00,1023.00,1023.00,1023.00,1022.00,1019.00,1020.00,1020.00,1022.00,1023.00,1023.00,1020.00,1018.00,1021.00,1022.00,1025.00,1024.00,1020.00,1022.00,1020.00,1024.00,1024.00,1023.00,1020.00,1018.00,1021.00,1024.00,1024.00,1023.00,1022.00,1019.00,1019.00,1021.00,1023.00,1023.00,1019.00,1018.00,1022.00,1025.00,1023.00,1022.00,1019.00,1017.00,1022.00,1024.00,1024.00,1023.00,1019.00,1018.00,1019.00,1022.00,1024.00,1023.00,1020.00,1020.00,1020.00,1024.00,1024.00,1023.00,1019.00,1018.00,1020.00,1023.00,1026.00,1023.00,1021.00,1018.00,1023.00,1022.00,1024.00,1024.00,1021.00,1020.00,1025.00,1025.00,1024.00,1024.00,1022.00,1022.00,1029.00,1029.00,1032.00,1032.00,1028.00,1027.00,1030.00,1033.00,1034.00,1036.00,1033.00,1030.00,1034.00,1035.00,1038.00,1033.00,1027.00,1024.00,1029.00,1029.00,1029.00,1032.00,1030.00,1028.00,1030.00,1034.00,1035.00,1035.00,1030.00,1029.00,1032.00,1033.00,1031.00,1026.00,1021.00,1022.00,1023.00,1026.00,1026.00,1024.00,1023.00,1022.00,1025.00,1026.00,1024.00,1024.00,1021.00,1019.00,1021.00,1024.00,1024.00,1021.00,1022.00,1022.00,1023.00,1024.00,1026.00,1022.00,1019.00,1020.00,1022.00,1026.00,1025.00,1024.00,1024.00,1021.00,1021.00,1027.00,1029.00,1028.00,1027.00,1031.00,1040.00,1049.00,1055.00,1066.00,1072.00,1084.00,1101.00,1122.00,1149.00,1177.00,1203.00,1231.00,1264.00,1294.00,1327.00,1361.00,1397.00,1427.00,1430.00,1407.00,1349.00,1254.00,1163.00,1091.00,1046.00,1025.00,1015.00,1011.00,1010.00,1015.00,1018.00,1021.00,1021.00,1018.00,1011.00,1008.00,1007.00,1006.00,1006.00,1006.00,1002.00,1000.00,1004.00,1002.00,1004.00,1001.00,1001.00,1000.00,1002.00,1005.00,1003.00,1001.00,997.00,997.00,999.00,1002.00,1001.00,1000.00,999.00,997.00,996.00,1000.00,999.00,996.00,994.00,992.00,995.00,998.00,997.00,996.00,990.00,991.00,992.00,994.00,996.00,994.00,991.00,991.00,992.00,994.00,994.00,993.00,991.00,992.00,994.00,996.00,996.00,994.00,991.00,990.00,993.00,998.00,1000.00,997.00,995.00,993.00,996.00,1000.00,998.00,997.00,996.00,997.00,998.00,1003.00,1003.00,1003.00,1002.00,1002.00,1003.00,1010.00,1012.00,1012.00,1011.00,1014.00,1018.00,1024.00,1026.00,1027.00,1026.00,1028.00,1034.00,1037.00,1041.00,1044.00,1044.00,1047.00,1051.00,1057.00,1058.00,1061.00,1060.00,1059.00,1064.00,1064.00,1068.00,1066.00,1063.00,1060.00,1060.00,1061.00,1057.00,1054.00,1051.00,1045.00,1046.00,1047.00,1043.00,1041.00,1036.00,1034.00,1032.00,1035.00,1035.00,1033.00,1030.00,1027.00,1030.00,1031.00,1030.00,1029.00,1025.00,1026.00,1027.00,1029.00,1027.00,1025.00,1023.00,1023.00,1024.00,1027.00,1027.00,1027.00,1022.00,1021.00,1022.00,1021.00,1024.00,1022.00,1020.00,1021.00,1020.00,1025.00,1023.00,1021.00,1016.00,1018.00,1019.00,1022.00,1022.00,1019.00,1017.00,1018.00,1017.00,1020.00,1020.00,1019.00,1016.00,1013.00,1017.00,1021.00,1018.00,1017.00,1013.00,1016.00,1018.00,1020.00,1022.00,1021.00,1018.00,1017.00,1018.00,1020.00,1023.00,1020.00,1016.00,1018.00,1019.00,1024.00,1022.00,1021.00,1019.00,1019.00,1022.00,1023.00,1024.00,1023.00,1019.00,1020.00,1022.00,1022.00,1023.00,1024.00,1021.00,1019.00,1021.00,1024.00,1022.00,1021.00,1020.00,1019.00,1021.00,1024.00,1024.00,1020.00,1018.00,1017.00,1020.00,1022.00,1023.00,1022.00,1016.00,1016.00,1016.00,1019.00,1021.00,1019.00,1016.00,1017.00,1019.00,1021.00,1019.00,1018.00,1014.00,1015.00,1017.00,1019.00,1018.00,1020.00,1013.00,1013.00,1016.00,1018.00,1017.00,1014.00,1016.00,1014.00,1017.00,1021.00,1019.00,1017.00,1014.00,1015.00,1016.00,1021.00,1020.00,1019.00,1016.00,1013.00,1016.00,1016.00,1016.00,1015.00,1014.00,1016.00,1019.00,1018.00,1019.00,1016.00,1016.00,1016.00,1022.00,1021.00,1018.00,1015.00,1016.00,1018.00,1020.00,1019.00,1018.00,1017.00,1015.00,1019.00,1023.00,1022.00,1019.00,1017.00,1018.00,1018.00,1020.00,1021.00,1017.00,1016.00,1016.00,1019.00,1023.00,1021.00,1020.00,1016.00,1014.00,1016.00,1021.00,1022.00,1020.00,1019.00,1015.00,1018.00,1022.00,1024.00,1021.00,1018.00,1020.00,1021.00,1023.00,1023.00,1024.00,1022.00,1023.00,1027.00,1028.00,1029.00,1030.00,1026.00,1025.00,1030.00,1032.00,1033.00,1032.00,1031.00,1030.00,1031.00,1033.00,1031.00,1027.00,1027.00,1025.00,1028.00,1031.00,1032.00,1027.00,1028.00,1027.00,1032.00,1034.00,1032.00,1032.00,1029.00,1025.00,1024.00,1025.00,1025.00,1020.00,1020.00,1020.00,1021.00,1024.00,1023.00,1023.00,1021.00,1018.00,1021.00,1024.00,1024.00,1022.00,1019.00,1018.00,1021.00,1023.00,1023.00,1023.00,1020.00,1021.00,1021.00,1022.00,1025.00,1019.00,1019.00,1018.00,1021.00,1024.00,1023.00,1023.00,1019.00,1020.00,1021.00,1029.00,1030.00,1032.00,1034.00,1039.00,1048.00,1062.00,1070.00,1079.00,1086.00,1100.00,1127.00,1159.00,1187.00,1214.00,1239.00,1265.00,1297.00,1336.00,1379.00,1409.00,1412.00,1389.00,1333.00,1255.00,1170.00,1099.00,1050.00,1024.00,1014.00,1012.00,1014.00,1017.00,1015.00,1014.00,1015.00,1015.00,1019.00,1013.00,1009.00,1006.00,1003.00,1007.00,1006.00,1002.00,1002.00,1001.00,1002.00,1007.00,1007.00,1000.00,1000.00,998.00,1002.00,1002.00,1004.00,1002.00,999.00,999.00,1000.00,1000.00,1000.00,1002.00,998.00,995.00,998.00,1000.00,1001.00,997.00,995.00,994.00,998.00,1000.00,999.00,996.00,995.00,995.00,995.00,1000.00,997.00,998.00,994.00,995.00,997.00,1000.00,998.00,997.00,994.00,993.00,995.00,997.00,1001.00,999.00,995.00,994.00,995.00,998.00,1000.00,1000.00,997.00,998.00,1001.00,1004.00,1003.00,1001.00,1000.00,1000.00,1004.00,1006.00,1008.00,1007.00,1008.00,1008.00,1010.00,1013.00,1014.00,1014.00,1015.00,1018.00,1020.00,1025.00,1027.00,1028.00,1030.00,1031.00,1036.00,1042.00,1045.00,1044.00,1048.00,1048.00,1054.00,1060.00,1063.00,1061.00,1062.00,1063.00,1066.00,1068.00,1066.00,1067.00,1063.00,1060.00,1064.00,1060.00,1059.00,1056.00,1051.00,1048.00,1050.00,1049.00,1049.00,1044.00,1039.00,1037.00,1038.00,1040.00,1040.00,1037.00,1032.00,1033.00,1034.00,1035.00,1035.00,1032.00,1028.00,1031.00,1034.00,1034.00,1035.00,1030.00,1027.00,1027.00,1029.00,1034.00,1032.00,1031.00,1027.00,1027.00,1027.00,1029.00,1029.00,1027.00,1026.00,1024.00,1024.00,1029.00,1027.00,1025.00,1021.00,1019.00,1025.00,1026.00,1028.00,1024.00,1022.00,1018.00,1020.00,1023.00,1024.00,1021.00,1019.00,1022.00,1022.00,1025.00,1023.00,1020.00,1021.00,1020.00,1022.00,1026.00,1028.00,1026.00,1023.00,1023.00,1024.00,1026.00,1028.00,1027.00,1024.00,1023.00,1025.00,1029.00,1028.00,1026.00,1023.00,1023.00,1026.00,1030.00,1028.00,1026.00,1022.00,1025.00,1023.00,1026.00,1027.00,1024.00,1022.00,1023.00,1024.00,1026.00,1025.00,1023.00,1020.00,1021.00,1021.00,1024.00,1025.00,1022.00,1019.00,1020.00,1023.00,1025.00,1022.00,1022.00,1017.00,1018.00,1017.00,1021.00,1021.00,1020.00,1015.00,1016.00,1018.00,1021.00,1021.00,1016.00,1016.00,1016.00,1019.00,1020.00,1021.00,1019.00,1017.00,1016.00,1018.00,1020.00,1019.00,1019.00,1016.00,1017.00,1019.00,1020.00,1021.00,1020.00,1015.00,1014.00,1018.00,1021.00,1022.00,1018.00,1013.00,1017.00,1017.00,1020.00,1019.00,1020.00,1017.00,1014.00,1018.00,1020.00,1019.00,1020.00,1017.00,1017.00,1019.00,1021.00,1021.00,1019.00,1016.00,1015.00,1018.00,1021.00,1022.00,1020.00,1017.00,1015.00,1017.00,1021.00,1022.00,1022.00,1018.00,1017.00,1019.00,1020.00,1021.00,1020.00,1014.00,1017.00,1019.00,1019.00,1021.00,1017.00,1016.00,1015.00,1019.00,1022.00,1022.00,1019.00,1016.00,1017.00,1020.00,1021.00,1023.00,1020.00,1020.00,1019.00,1022.00,1022.00,1025.00,1023.00,1023.00,1026.00,1027.00,1031.00,1029.00,1026.00,1029.00,1028.00,1028.00,1031.00,1031.00,1031.00,1027.00,1024.00,1026.00,1026.00,1027.00,1026.00,1022.00,1024.00,1025.00,1031.00,1031.00,1029.00,1027.00,1024.00,1023.00,1023.00,1018.00,1019.00,1016.00,1018.00,1019.00,1020.00,1018.00,1016.00,1015.00,1016.00,1017.00,1021.00,1020.00,1019.00,1014.00,1015.00,1017.00,1020.00,1019.00,1019.00,1015.00,1014.00,1018.00,1020.00,1019.00,1018.00,1017.00,1015.00,1018.00,1021.00,1022.00,1023.00,1020.00,1023.00,1031.00,1037.00,1046.00,1053.00,1064.00,1077.00,1091.00,1115.00,1146.00,1177.00,1205.00,1240.00,1273.00,1307.00,1339.00,1380.00,1413.00,1431.00,1421.00,1371.00,1284.00,1180.00,1101.00,1050.00,1026.00,1016.00,1015.00,1013.00,1013.00,1016.00,1015.00,1017.00,1014.00,1012.00,1002.00,1000.00,999.00,1002.00,1002.00,998.00,997.00,996.00,998.00,1000.00,998.00,995.00,992.00,995.00,995.00,998.00,998.00,996.00,994.00,994.00,995.00,998.00,996.00,995.00,992.00,989.00,992.00,993.00,994.00,989.00,989.00,989.00,991.00,993.00,994.00,990.00,986.00,987.00,989.00,990.00,992.00,991.00,989.00,986.00,990.00,993.00,993.00,994.00,988.00,988.00,990.00,993.00,992.00,991.00,989.00,992.00,993.00,995.00,997.00,995.00,992.00,992.00,996.00,998.00,1000.00,1000.00,994.00,998.00,1001.00,1003.00,1003.00,1002.00,1002.00,1007.00,1008.00,1015.00,1015.00,1015.00,1014.00,1019.00,1024.00,1031.00,1033.00,1033.00,1034.00,1037.00,1043.00,1050.00,1052.00,1053.00,1052.00,1057.00,1061.00,1065.00,1066.00,1066.00,1060.00,1062.00,1063.00,1063.00,1062.00,1060.00,1054.00,1052.00,1051.00,1051.00,1049.00,1046.00,1041.00,1038.00,1040.00,1038.00,1038.00,1032.00,1030.00,1030.00,1028.00,1032.00,1031.00,1026.00,1027.00,1024.00,1026.00,1030.00,1029.00,1026.00,1023.00,1024.00,1026.00,1027.00,1027.00,1024.00,1021.00,1023.00,1026.00,1029.00,1027.00,1025.00,1021.00,1021.00,1024.00,1023.00,1023.00,1022.00,1019.00,1019.00,1019.00,1020.00,1021.00,1018.00,1018.00,1017.00,1017.00,1022.00,1020.00,1017.00,1016.00,1016.00,1017.00,1019.00,1018.00,1017.00,1016.00,1016.00,1018.00,1020.00,1018.00,1017.00,1016.00,1015.00,1020.00,1021.00,1019.00,1018.00,1016.00,1017.00,1019.00,1023.00,1023.00,1021.00,1018.00,1019.00,1020.00,1024.00,1026.00,1023.00,1020.00,1021.00,1022.00,1026.00,1025.00,1023.00,1020.00,1020.00,1023.00,1026.00,1026.00,1026.00,1022.00,1021.00,1022.00,1024.00,1024.00,1025.00,1021.00,1020.00,1022.00,1023.00,1023.00,1023.00,1022.00,1019.00,1021.00,1024.00,1023.00,1022.00,1019.00,1022.00,1020.00,1025.00,1022.00,1022.00,1019.00,1018.00,1020.00,1022.00,1022.00,1021.00,1019.00,1015.00,1022.00,1021.00,1020.00,1020.00,1018.00,1016.00,1023.00,1024.00,1024.00,1022.00,1017.00,1019.00,1020.00,1025.00,1023.00,1023.00,1020.00,1018.00,1023.00,1024.00,1024.00,1023.00,1018.00,1019.00,1022.00,1024.00,1025.00,1021.00,1020.00,1018.00,1022.00,1025.00,1024.00,1025.00,1020.00,1020.00,1021.00,1025.00,1024.00,1023.00,1020.00,1018.00,1023.00,1026.00,1022.00,1020.00,1021.00,1020.00,1024.00,1025.00,1025.00,1022.00,1019.00,1021.00,1020.00,1025.00,1025.00,1023.00,1020.00,1020.00,1024.00,1024.00,1024.00,1023.00,1018.00,1020.00,1023.00,1023.00,1022.00,1019.00,1018.00,1019.00,1023.00,1027.00,1027.00,1026.00,1026.00,1026.00,1028.00,1032.00,1034.00,1030.00,1030.00,1032.00,1032.00,1036.00,1036.00,1033.00,1031.00,1030.00,1034.00,1035.00,1033.00,1028.00,1023.00,1024.00,1027.00,1027.00,1029.00,1029.00,1026.00,1028.00,1030.00,1037.00,1033.00,1032.00,1029.00,1031.00,1028.00,1027.00,1025.00,1021.00,1021.00,1021.00,1023.00,1027.00,1028.00,1026.00,1022.00,1021.00,1022.00,1025.00,1026.00,1024.00,1021.00,1020.00,1020.00,1023.00,1024.00,1022.00,1019.00,1020.00,1021.00,1022.00,1024.00,1023.00,1018.00,1020.00,1024.00,1026.00,1025.00,1025.00,1024.00,1023.00,1025.00,1031.00,1034.00,1037.00,1040.00,1046.00,1057.00,1071.00,1082.00,1087.00,1099.00,1123.00,1154.00,1187.00,1218.00,1246.00,1273.00,1300.00,1332.00,1375.00,1415.00,1437.00,1436.00,1403.00,1334.00,1244.00,1151.00,1079.00,1038.00,1018.00,1014.00,1017.00,1019.00,1017.00,1016.00,1017.00,1017.00,1017.00,1016.00,1009.00,1007.00,1004.00,1003.00,1005.00,1002.00,1001.00,999.00,1000.00,1002.00,1003.00,1001.00,1000.00,999.00,997.00,1002.00,1004.00,1003.00,1001.00,997.00,998.00,999.00,1002.00,1001.00,997.00,995.00,996.00,1000.00,1002.00,999.00,995.00,994.00,994.00,998.00,998.00,1001.00,995.00,994.00,997.00,997.00,1000.00,998.00,997.00,996.00,995.00,998.00,999.00,999.00,998.00,993.00,995.00,1000.00,1000.00,1000.00,1000.00,996.00,997.00,1000.00,1004.00,1001.00,1001.00,1000.00,1001.00,1003.00,1006.00,1005.00,1005.00,1004.00,1003.00,1007.00,1010.00,1009.00,1010.00,1010.00,1012.00,1016.00,1023.00,1025.00,1024.00,1024.00,1028.00,1033.00,1040.00,1039.00,1043.00,1043.00,1049.00,1056.00,1058.00,1061.00,1063.00,1066.00,1067.00,1071.00,1077.00,1075.00,1074.00,1071.00,1071.00,1071.00,1072.00,1070.00,1066.00,1060.00,1058.00,1057.00,1060.00,1055.00,1050.00,1045.00,1043.00,1044.00,1043.00,1041.00,1038.00,1035.00,1036.00,1037.00,1039.00,1036.00,1034.00,1031.00,1034.00,1033.00,1037.00,1035.00,1035.00,1033.00,1030.00,1034.00,1034.00,1034.00,1034.00,1029.00,1028.00,1031.00,1031.00,1031.00,1029.00,1025.00,1027.00,1030.00,1032.00,1030.00,1027.00,1023.00,1025.00,1026.00,1031.00,1030.00,1027.00,1023.00,1025.00,1026.00,1028.00,1029.00,1026.00,1022.00,1024.00,1025.00,1027.00,1028.00,1028.00,1026.00,1028.00,1029.00,1032.00,1030.00,1029.00,1025.00,1027.00,1030.00,1034.00,1030.00,1030.00,1025.00,1028.00,1030.00,1031.00,1029.00,1029.00,1027.00,1027.00,1027.00,1031.00,1030.00,1028.00,1026.00,1027.00,1029.00,1029.00,1029.00,1028.00,1027.00,1026.00,1027.00,1030.00,1031.00,1025.00,1024.00,1025.00,1027.00,1029.00,1028.00,1027.00,1025.00,1024.00,1027.00,1028.00,1026.00,1027.00,1023.00,1025.00,1026.00,1029.00,1028.00,1025.00,1022.00,1024.00,1024.00,1028.00,1027.00,1026.00,1021.00,1021.00,1025.00,1027.00,1026.00,1027.00,1022.00,1023.00,1025.00,1026.00,1024.00,1023.00,1022.00,1024.00,1024.00,1027.00,1029.00,1023.00,1022.00,1020.00,1024.00,1027.00,1026.00,1026.00,1023.00,1023.00,1024.00,1027.00,1026.00,1023.00,1021.00,1023.00,1026.00,1027.00,1029.00,1027.00,1022.00,1022.00,1025.00,1027.00,1028.00,1024.00,1023.00,1023.00,1026.00,1028.00,1026.00,1026.00,1024.00,1025.00,1025.00,1028.00,1028.00,1026.00,1022.00,1024.00,1027.00,1028.00,1029.00,1026.00,1024.00,1025.00,1028.00,1033.00,1030.00,1028.00,1026.00,1031.00,1035.00,1037.00,1037.00,1035.00,1033.00,1035.00,1038.00,1041.00,1041.00,1039.00,1038.00,1039.00,1042.00,1043.00,1040.00,1035.00,1034.00,1033.00,1034.00,1039.00,1040.00,1041.00,1034.00,1038.00,1036.00,1040.00,1039.00,1038.00,1036.00,1036.00,1035.00,1035.00,1033.00,1028.00,1025.00,1026.00,1029.00,1031.00,1029.00,1028.00,1025.00,1025.00,1027.00,1029.00,1028.00,1025.00,1023.00,1024.00,1027.00,1030.00,1027.00,1024.00,1023.00,1023.00,1029.00,1030.00,1027.00,1025.00,1023.00,1025.00,1028.00,1032.00,1030.00,1030.00,1031.00,1031.00,1034.00,1040.00,1045.00,1052.00,1060.00,1073.00,1086.00,1100.00,1116.00,1140.00,1172.00,1204.00,1242.00,1274.00,1302.00,1333.00,1372.00,1416.00,1443.00,1437.00,1388.00,1300.00,1193.00,1106.00,1055.00,1031.00,1020.00,1015.00,1016.00,1023.00,1024.00,1023.00,1022.00,1020.00,1016.00,1014.00,1013.00,1014.00,1011.00,1009.00,1004.00,1005.00,1008.00,1013.00,1011.00,1008.00,1004.00,1006.00,1007.00,1008.00,1009.00,1007.00,1006.00,1004.00,1006.00,1007.00,1007.00,1005.00,1004.00,1004.00,1004.00,1007.00,1005.00,1002.00,999.00,1001.00,1005.00,1009.00,1007.00,1003.00,1000.00,1000.00,1003.00,1006.00,1006.00,1003.00,1004.00,1005.00,1006.00,1006.00,1007.00,1004.00,1002.00,1005.00,1006.00,1011.00,1008.00,1007.00,1004.00,1007.00,1009.00,1012.00,1013.00,1011.00,1011.00,1009.00,1013.00,1019.00,1018.00,1018.00,1018.00,1020.00,1023.00,1025.00,1026.00,1027.00,1030.00,1034.00,1036.00,1043.00,1043.00,1045.00,1047.00,1052.00,1058.00,1064.00,1064.00,1067.00,1067.00,1071.00,1077.00,1082.00,1080.00,1079.00,1075.00,1073.00,1075.00,1074.00,1073.00,1068.00,1061.00,1059.00,1057.00,1054.00,1052.00,1048.00,1044.00,1044.00,1044.00,1043.00,1041.00,1039.00,1036.00,1037.00,1037.00,1038.00,1038.00,1034.00,1031.00,1032.00,1036.00,1037.00,1035.00,1032.00,1028.00,1032.00,1030.00,1032.00,1031.00,1027.00,1027.00,1028.00,1028.00,1029.00,1027.00,1024.00,1024.00,1023.00,1025.00,1029.00,1026.00,1023.00,1018.00,1019.00,1023.00,1025.00,1024.00,1024.00,1022.00,1022.00,1023.00,1025.00,1026.00,1023.00,1021.00,1023.00,1027.00,1027.00,1026.00,1023.00,1023.00,1024.00,1026.00,1027.00,1029.00,1024.00,1023.00,1022.00,1027.00,1030.00,1026.00,1023.00,1024.00,1024.00,1024.00,1025.00,1025.00,1022.00,1022.00,1020.00,1024.00,1023.00,1022.00,1021.00,1021.00,1020.00,1024.00,1024.00,1021.00,1019.00,1016.00,1018.00,1020.00,1024.00,1024.00,1021.00,1019.00,1022.00,1021.00,1024.00,1023.00,1022.00,1018.00,1022.00,1021.00,1023.00,1022.00,1019.00,1014.00,1019.00,1018.00,1024.00,1023.00,1018.00,1017.00,1018.00,1019.00,1023.00,1021.00,1021.00,1016.00,1020.00,1019.00,1020.00,1020.00,1021.00,1020.00,1019.00,1022.00,1024.00,1021.00,1017.00,1016.00,1017.00,1020.00,1021.00,1021.00,1018.00,1018.00,1018.00,1021.00,1020.00,1021.00,1019.00,1017.00,1018.00,1018.00,1023.00,1022.00,1020.00,1016.00,1019.00,1020.00,1023.00,1023.00,1019.00,1018.00,1019.00,1019.00,1022.00,1020.00,1019.00,1017.00,1019.00,1020.00,1024.00,1023.00,1018.00,1018.00,1019.00,1022.00,1024.00,1021.00,1019.00,1016.00,1019.00,1021.00,1025.00,1025.00,1025.00,1025.00,1025.00,1029.00,1030.00,1030.00,1028.00,1028.00,1029.00,1031.00,1032.00,1032.00,1029.00,1027.00,1028.00,1028.00,1029.00,1027.00,1026.00,1024.00,1025.00,1027.00,1031.00,1029.00,1028.00,1026.00,1030.00,1031.00,1032.00,1030.00,1027.00,1022.00,1020.00,1023.00,1023.00,1021.00,1019.00,1017.00,1021.00,1022.00,1023.00,1023.00,1021.00,1018.00,1020.00,1021.00,1021.00,1019.00,1020.00,1017.00,1017.00,1019.00,1023.00,1021.00,1017.00,1018.00,1017.00,1021.00,1021.00,1021.00,1019.00,1015.00,1020.00,1021.00,1026.00,1026.00,1024.00,1020.00,1021.00,1027.00,1029.00,1028.00,1029.00,1031.00,1036.00,1047.00,1053.00,1059.00,1071.00,1077.00,1082.00,1098.00,1117.00,1141.00,1164.00,1188.00,1216.00,1246.00,1276.00,1301.00,1328.00,1363.00,1399.00,1424.00,1429.00,1396.00,1328.00,1236.00,1147.00,1087.00,1051.00,1028.00,1016.00,1016.00,1018.00,1022.00,1023.00,1020.00,1018.00,1014.00,1012.00,1012.00,1011.00,1005.00,1003.00,1000.00,1000.00,1003.00,1006.00,1004.00,1000.00,996.00,999.00,1001.00,1004.00,1004.00,1000.00,996.00,997.00,1002.00,1005.00,1002.00,1001.00,999.00,999.00,1000.00,1004.00,1001.00,997.00,996.00,995.00,1000.00,1003.00,998.00,994.00,994.00,995.00,998.00,1003.00,1000.00,995.00,994.00,997.00,998.00,1000.00,997.00,998.00,995.00,996.00,997.00,1000.00,1001.00,998.00,996.00,998.00,997.00,999.00,998.00,996.00,999.00,1000.00,1001.00,1004.00,1000.00,999.00,997.00,997.00,1001.00,1005.00,1006.00,1003.00,1002.00,1002.00,1005.00,1007.00,1008.00,1006.00,1004.00,1009.00,1011.00,1017.00,1013.00,1013.00,1014.00,1016.00,1020.00,1027.00,1027.00,1028.00,1029.00,1032.00,1036.00,1044.00,1044.00,1046.00,1049.00,1051.00,1058.00,1062.00,1064.00,1063.00,1063.00,1065.00,1070.00,1074.00,1073.00,1070.00,1071.00,1071.00,1068.00,1072.00,1065.00,1063.00,1058.00,1059.00,1059.00,1058.00,1056.00,1052.00,1047.00,1046.00,1044.00,1049.00,1046.00,1042.00,1038.00,1039.00,1043.00,1044.00,1041.00,1037.00,1038.00,1035.00,1041.00,1041.00,1037.00,1036.00,1034.00,1035.00,1039.00,1038.00,1039.00,1038.00,1034.00,1035.00,1038.00,1037.00,1036.00,1035.00,1033.00,1031.00,1037.00,1039.00,1035.00,1035.00,1029.00,1031.00,1031.00,1033.00,1032.00,1029.00,1027.00,1028.00,1029.00,1030.00,1029.00,1028.00,1027.00,1029.00,1030.00,1031.00,1030.00,1028.00,1026.00,1025.00,1027.00,1032.00,1031.00,1031.00,1029.00,1029.00,1032.00,1032.00,1031.00,1028.00,1026.00,1029.00,1032.00,1034.00,1034.00,1032.00,1029.00,1029.00,1031.00,1033.00,1029.00,1028.00,1026.00,1030.00,1030.00,1031.00,1031.00,1030.00,1028.00,1030.00,1031.00,1033.00,1033.00,1030.00,1030.00,1026.00,1029.00,1033.00,1033.00,1029.00,1027.00,1027.00,1028.00,1029.00,1030.00,1029.00,1025.00,1028.00,1030.00,1032.00,1030.00,1028.00,1023.00,1023.00,1028.00,1029.00,1028.00,1027.00,1023.00,1024.00,1028.00,1030.00,1029.00,1026.00,1027.00,1026.00,1027.00,1031.00,1028.00,1024.00,1025.00,1024.00,1027.00,1030.00,1031.00,1029.00,1025.00,1025.00,1027.00,1028.00,1029.00,1026.00,1026.00,1026.00,1027.00,1030.00,1028.00,1026.00,1024.00,1027.00,1027.00,1031.00,1026.00,1028.00,1022.00,1026.00,1030.00,1030.00,1029.00,1026.00,1025.00,1025.00,1028.00,1027.00,1030.00,1029.00,1028.00,1028.00,1032.00,1031.00,1032.00,1026.00,1027.00,1029.00,1032.00,1034.00,1030.00,1026.00,1025.00,1028.00,1027.00,1031.00,1031.00,1029.00,1025.00,1029.00,1031.00,1032.00,1030.00,1028.00,1027.00,1029.00,1031.00,1036.00,1033.00,1031.00,1030.00,1030.00,1033.00,1036.00,1038.00,1035.00,1036.00,1037.00,1040.00,1041.00,1042.00,1041.00,1037.00,1040.00,1043.00,1043.00,1043.00,1040.00,1039.00,1038.00,1037.00,1040.00,1040.00,1035.00,1032.00,1035.00,1038.00,1040.00,1038.00,1037.00,1039.00,1038.00,1038.00,1043.00,1040.00,1037.00,1031.00,1033.00,1033.00,1035.00,1032.00,1032.00,1027.00,1027.00,1030.00,1032.00,1031.00,1030.00,1026.00,1028.00,1030.00,1032.00,1031.00,1028.00,1026.00,1027.00,1030.00,1032.00,1028.00,1029.00,1022.00,1027.00,1027.00,1030.00,1031.00,1029.00,1024.00,1024.00,1027.00,1030.00,1028.00,1027.00,1027.00,1028.00,1033.00,1037.00,1038.00,1039.00,1043.00,1050.00,1061.00,1075.00,1086.00,1094.00,1104.00,1128.00,1156.00,1190.00,1223.00,1252.00,1282.00,1315.00,1352.00,1391.00,1433.00,1465.00,1472.00,1459.00,1417.00,1351.00,1269.00,1184.00,1119.00,1073.00,1043.00,1029.00,1023.00,1024.00,1022.00,1024.00,1026.00,1025.00,1024.00,1016.00,1014.00,1009.00,1010.00,1011.00,1008.00,1007.00,1003.00,1005.00,1007.00,1008.00,1007.00,1004.00,1002.00,1000.00,1006.00,1007.00,1006.00,1003.00,1002.00,1000.00,1002.00,1006.00,1003.00,1002.00,999.00,999.00,999.00,1000.00,999.00,997.00,995.00,994.00,999.00,1000.00,999.00,997.00,991.00,994.00,997.00,1000.00,998.00,995.00,995.00,995.00,998.00,998.00,997.00,996.00,994.00,998.00,999.00,999.00,999.00,994.00,993.00,996.00,998.00,1001.00,1000.00,998.00,996.00,997.00,1001.00,1003.00,1005.00,1003.00,1001.00,1002.00,1007.00,1008.00,1007.00,1005.00,1005.00,1010.00,1014.00,1017.00,1019.00,1019.00,1018.00,1023.00,1030.00,1035.00,1036.00,1037.00,1039.00,1044.00,1050.00,1058.00,1058.00,1058.00,1061.00,1063.00,1071.00,1073.00,1076.00,1074.00,1071.00,1071.00,1075.00,1076.00,1075.00,1067.00,1062.00,1063.00,1062.00,1061.00,1062.00,1056.00,1051.00,1049.00,1049.00,1049.00,1046.00,1042.00,1041.00,1040.00,1041.00,1042.00,1037.00,1038.00,1034.00,1034.00,1037.00,1039.00,1038.00,1038.00,1034.00,1036.00,1036.00,1037.00,1037.00,1036.00,1031.00,1034.00,1036.00,1039.00,1036.00,1035.00,1032.00,1034.00,1037.00,1037.00,1034.00,1033.00,1030.00,1030.00,1034.00,1034.00,1032.00,1029.00,1028.00,1028.00,1032.00,1033.00,1032.00,1030.00,1027.00,1030.00,1030.00,1032.00,1029.00,1027.00,1028.00,1026.00,1031.00,1034.00,1033.00,1029.00,1027.00,1030.00,1033.00,1038.00,1037.00,1034.00,1033.00,1032.00,1033.00,1037.00,1037.00,1035.00,1033.00,1035.00,1038.00,1039.00,1035.00,1034.00,1034.00,1035.00,1038.00,1039.00,1037.00,1035.00,1033.00,1033.00,1035.00,1038.00,1037.00,1034.00,1032.00,1031.00,1035.00,1035.00,1035.00,1032.00,1031.00,1031.00,1034.00,1035.00,1032.00,1031.00,1029.00,1031.00,1030.00,1032.00,1034.00,1030.00,1028.00,1029.00,1031.00,1035.00,1031.00,1029.00,1029.00,1029.00,1032.00,1034.00,1031.00,1030.00,1027.00,1029.00,1032.00,1032.00,1032.00,1029.00,1026.00,1028.00,1031.00,1033.00,1032.00,1030.00,1026.00,1028.00,1031.00,1030.00,1030.00,1027.00,1026.00,1027.00,1031.00,1035.00,1032.00,1031.00,1029.00,1030.00,1031.00,1032.00,1031.00,1029.00,1028.00,1030.00,1033.00,1033.00,1034.00,1030.00,1029.00,1028.00,1031.00,1036.00,1034.00,1030.00,1028.00,1031.00,1033.00,1035.00,1035.00,1032.00,1031.00,1029.00,1031.00,1035.00,1034.00,1031.00,1030.00,1033.00,1033.00,1038.00,1037.00,1032.00,1029.00,1033.00,1036.00,1037.00,1037.00,1033.00,1031.00,1034.00,1035.00,1038.00,1040.00,1038.00,1037.00,1041.00,1043.00,1042.00,1042.00,1041.00,1038.00,1042.00,1048.00,1048.00,1048.00,1044.00,1039.00,1040.00,1041.00,1044.00,1040.00,1039.00,1039.00,1039.00,1042.00,1044.00,1043.00,1042.00,1038.00,1041.00,1044.00,1045.00,1044.00,1042.00,1040.00,1035.00,1038.00,1039.00,1039.00,1034.00,1032.00,1033.00,1034.00,1035.00,1032.00,1032.00,1030.00,1032.00,1034.00,1038.00,1037.00,1033.00,1031.00,1032.00,1034.00,1036.00,1034.00,1030.00,1029.00,1031.00,1032.00,1036.00,1034.00,1031.00,1029.00,1032.00,1037.00,1040.00,1038.00,1038.00,1038.00,1043.00,1050.00,1058.00,1068.00,1077.00,1088.00,1102.00,1121.00,1144.00,1172.00,1207.00,1235.00,1269.00,1303.00,1333.00,1370.00,1408.00,1446.00,1457.00,1439.00,1380.00,1283.00,1176.00,1095.00,1053.00,1034.00,1027.00,1027.00,1026.00,1029.00,1028.00,1030.00,1028.00,1025.00,1021.00,1016.00,1016.00,1016.00,1019.00,1015.00,1013.00,1013.00,1013.00,1015.00,1015.00,1014.00,1011.00,1008.00\n \"\n ]\n ]);\n\n error_log('Message');\n $final = json_decode($res->getBody(),true)['Prediction'];\n\n\n if ($final == '[1]'){\n return response()->json([\n 'positive' => 'true'\n ]);\n }else{\n return response()->json([\n 'negative' => 'true'\n ]);\n }\n\n $shares = User::all();\n\n return view('users.index', compact('shares'));\n }", "public function Hawker_type_data_post()\n {\n $response = new StdClass();\n $result = array();\n $hawker_type_code =$this->input->post('hawker_type_code');\n $datacat = $this->Deliveryboy->gethawkertypename($hawker_type_code);\n if(!empty($datacat))\n {\n foreach ($datacat as $row)\n {\n\n $data['id'] = $row['id'];\n $data['hawker__sub_type_name'] = $row['hawker__sub_type_name'];\n $data['create_date'] = $row['create_date'];\n array_push($result,$data);\n\n } \n $response->status = '1';\n $response->data = $result;\n }\n else\n {\n $response->status = '0';\n }\n \n echo json_output($response);\n }", "private function dataCreateRequest()\n\t{\n\t\treturn array(\n\t\t\t'file_date' => $this->input->post('file_date'),\n\t\t\t'type_file' => $this->input->post('type_file'),\n\t\t\t'id_user' => $this->session->id,\n\t\t);\n\t}", "public function set_response($response_data)\n\t{\n\t\t$this->response = (is_array($response_data))\n\t\t\t? json_encode($response_data)\n\t\t\t: $response_data;\n\t}", "protected function loadFormData()\n\t{\n\t\t$data = $this->getData(); \n \n return $data;\n\t}", "public function testCreateSurveyResponse0()\n {\n }", "public function testCreateSurveyResponse0()\n {\n }", "public function exchanegArray($_data)\n {\n $this->page_no = (int) gv('page_no', $_data);\n $this->category_no = (int) gv('category_no', $_data);\n $this->controller_no = (int) gv('controller_no', $_data);\n $this->page_title = (string) gv('page_title', $_data);\n $this->page_uri = (string) gv('page_uri', $_data);\n $this->page_description = (string) gv('page_description', $_data);\n $this->icon = (string) gv('icon', $_data);\n $this->order_no = (int) gv('order_no', $_data);\n $this->use_mobile = (int) gv('use_mobile', $_data);\n $this->update_time = (string) gv('update_time', $_data);\n }", "protected function loadFormData()\n {\n $data = JFactory::getApplication()->getUserState('com_labgeneagrogene.requests.data', array());\n\n if (empty($data)) {\n $id = JFactory::getApplication()->input->get('id');\n $data = $this->getData($id);\n }\n\n return $data;\n }", "function getData()\n{\n$data = array();\n$data[0]=$_POST['Name'];\n$data[1]=$_POST['DOB'];\n$data[2]=$_POST['Address'];\n$data[3]=$_POST['Postcode'];\n$data[4]=$_POST['Phone'];\n$data[5]=$_POST['email'];\n$data[6]=$_POST['MemberID'];\nreturn $data;\n}", "public function get_data()\n {\n return $this->form_data;\n }", "private function getResponseData()\n {\n $response = Shopware()->Front()->Response();\n\n return array(\n 'Class' => get_class($response),\n 'Raw header' => $response->getRawHeaders(),\n 'Response code' => $response->getHttpResponseCode(),\n 'Exception' => $response->getException()\n );\n }", "private function getTestData()\n {\n return [\n 'url' => 'http://www.mystore.com',\n 'access-token' => 'thisisaccesstoken',\n 'integration-token' => 'thisisintegrationtoken',\n 'method' => \\Magento\\Framework\\HTTP\\ZendClient::POST,\n 'body'=> ['token' => 'thisisintegrationtoken','url' => 'http://www.mystore.com'],\n ];\n }", "protected function loadFormData(){\n\t\t$app = JFactory::getApplication();\n\t\t$data = $app->getUserState('mytest.login.form.data', array());\n\t\treturn $data;\n\t}", "function getData(){ \n return json_decode($this->data); \n }", "public function postData(){\n\t\t$url = $this->host . \"/rest/asset/v1/emailTemplates.json?access_token=\" . $this->getToken();\n\t\t$ch = curl_init($url);\n\t\t$requestBody = $this->bodyBuilder();\n\t\tprint_r($requestBody);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json','Content-Type: multipart/form-data'));\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $requestBody);\n\t\tcurl_getinfo($ch);\n\t\t$response = curl_exec($ch);\n\t\treturn $response;\n\t}", "public function ParsePostData() {}", "function acf_form_data($data = array())\n{\n}", "public static function getFormData() {\n $edit = (isset($_GET['edit']) && $_GET['edit'] == 'true') ? true : false;\n $result = lC_Weight_classes_Admin::getFormData($_GET['wcid'], $edit);\n if (!isset($result['rpcStatus'])) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['id'])) $tmp['id'] = $data['id'];\n\t\tif(isset($data['uuid'])) $tmp['uuid'] = $data['uuid'];\n\t\tif(isset($data['aid'])) $tmp['aid'] = $data['aid'];\n\t\tif(isset($data['denomination'])) $tmp['denomination'] = $data['denomination'];\n\t\tif(isset($data['use_denomination'])) $tmp['use_denomination'] = $data['use_denomination'];\n\t\tif(isset($data['status'])) $tmp['status'] = $data['status'];\n\t\tif(isset($data['send_type'])) $tmp['send_type'] = $data['send_type'];\n\t\tif(isset($data['sub_send_type'])) $tmp['sub_send_type'] = $data['sub_send_type'];\n\t\tif(isset($data['consume_time'])) $tmp['consume_time'] = $data['consume_time'];\n\t\tif(isset($data['out_order_id'])) $tmp['out_order_id'] = $data['out_order_id'];\n\t\tif(isset($data['start_time'])) $tmp['start_time'] = $data['start_time'];\n\t\tif(isset($data['end_time'])) $tmp['end_time'] = $data['end_time'];\n\t\tif(isset($data['update_time'])) $tmp['update_time'] = $data['update_time'];\n\t\tif(isset($data['densection'])) $tmp['densection'] = $data['densection'];\n\t\tif(isset($data['description'])) $tmp['description'] = $data['description'];\n\t\tif(isset($data['third_type'])) $tmp['third_type'] = $data['third_type'];\n\t\treturn $tmp;\n\t}", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif (isset($data['name'])) $tmp['name'] = $data['name'];\n\t\tif (isset($data['ch'])) $tmp['ch'] = $data['ch'];\n\t\treturn $tmp;\n\t}", "public function get_data(): array;", "public function get_data(): array;", "function http_parse_response()\n\t{\n\t\tlist($headers, $body) = explode(\"\\r\\n\\r\\n\", $this->http_response, 2);\n\t\t$this->http_parse_headers($headers);\n\n\t\tif(isset($this->http_response_headers['Transfer-Encoding']) && 'chunked' == $this->http_response_headers['Transfer-Encoding']):\n \t\t$this->http_response_body = $this->http_chunked_decode($body);\n\t\telse:\n\t\t\t$this->http_response_body = $body;\n\t\tendif;\n\n\t\t$this->http_set_content_type($this->http_default_content_type);\n\t}", "public function getData()\n\t{\n\t\t$this->validate('merchantnumber', 'epayresponsecode');\n\t\t$data = array();\n\n\t\tforeach ($this->getSupportedParameters() as $key)\n\t\t{\n\t\t\t$value = $this->parameters->get($key);\n\n\t\t\tif (!is_null($value))\n\t\t\t{\n\t\t\t\t$data[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\t$data['language'] = empty($data['language']) ? 2 : $data['language'];\n\t\t$data['pbsResponse'] = -1;\n\t\t$data['epayresponse'] = -1;\n\n\t\treturn $data;\n\t}", "function getRequestInfo($data)\n{\n\t//Array data:\n\t// request -> either 'succeeded' or 'failed'\n\t// reason -> why request succeeded or failed \n\t$requestArray = array(\n\t\t\t\t\"request\" => \"\",\n\t\t\t\t\"reason\" => \"\"\n\t\t\t\t);\n\t$requestRequestArray = getData($data, \"Page/Request/Status\");\n\t$reasonRequestArray = getData($data, \"Page/Request/Status/\" . $reasonRequestArray[0]);\n\t$requestArray['request'] = $requestRequestArray[0];\n\t$requestArray['reason'] = $reasonRequestArray[0];\n\t\n\treturn $requestArray;\n\t\n\t\n}", "public function testNestedData() {\n $client = new Client();\n $client->post = array(\n 'form' => array(\n 'login' => 'bgates',\n 'password' => 'monkey'\n ),\n 'form_token' => '123123123',\n );\n $response = $client->fetch('http://' . TestCase::$settings['envHttpMirrorServer'] . '/');\n $responseParsed = ClientHelper::parseRequest($response);\n $this->assertSame('form%5Blogin%5D=bgates&form%5Bpassword%5D=monkey&form_token=123123123', $responseParsed['Body']);\n }", "public function getSubmittedData()\n\t{\n\t\t//Check we have received the Formisimo tracking data from the submission\n\t\t$data = isset($this->data['formisimo-tracking'])\n\t\t\t? $this->data['formisimo-tracking']\n\t\t\t: array(); //Default to empty array\n\n\t\treturn ! is_array($data)\n\t\t\t? (array) json_decode($data, true) //cast array in case json_decode fails\n\t\t\t: $data; //Just return the array\n\t}", "static function getBodyData(): array {\n $data = json_decode(file_get_contents('php://input'), true);\n return !is_null($data)? $data:array();\n }", "public function getPostData() :array\n {\n return empty($_POST) ? [] : $_POST;\n }", "public static function formData()\n {\n return [\n 'id',\n 'code',\n 'name',\n 'icon',\n 'position',\n 'link',\n 'parent_id' => [\n 'dropDownList' => [ 'list' => static::dataOptions('id', 'name') ]\n ],\n 'row_status' => [\n // 'radioList' => [ 'list' => [ 0 => 'Active', 1 => 'Disactive' ] ]\n 'dropDownList' => [ 'list' => [ 1 => 'Active', 0 => 'Disactive' ] ]\n ]\n ];\n }", "public function stkPushResponseData()\n {\n date_default_timezone_set('Africa/Dar_es_Salaam');\n\n $stkCallbackResponse = file_get_contents('php://input');\n\n return $stkCallbackResponse;\n\n }", "function handle_post($indata) {\n// showDebug('form_class POST:');\n// showArray($indata); \n return;\n }", "function babeliumsubmission_get_response_data($responseid){\n Logging::logBabelium(\"Getting response data\");\n $g = $this->getBabeliumRemoteService();\n $data = $g->getResponseInformation($responseid);\n $captions = null;\n if(isset($data) && isset($data['subtitleId'])){\n $subtitleId = $data['subtitleId'];\n $mediaId = '';\n $captions = $g->getCaptions($subtitleId, $mediaId);\n }\n if (!$captions){\n return;\n }\n else{\n $exerciseRoles = $this->getExerciseRoles($captions);\n $recinfo = null;\n return $this->getResponseInfo($data, $captions, $exerciseRoles, $recinfo);\n }\n }", "function get_field_list()\n\t{\n\t\t$fields = array();\n\n\n\t\t$this->xhr_output($fields);\n\t}", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['id'])) $tmp['id'] = intval($data['id']);\n\t\tif(isset($data['sort'])) $tmp['sort'] = intval($data['sort']);\n\t\tif(isset($data['game_id'])) $tmp['game_id'] = $data['game_id'];\n\t\tif(isset($data['name'])) $tmp['name'] = $data['name'];\n\t\tif(isset($data['content'])) $tmp['content'] = $data['content'];\n\t\tif(isset($data['activation_code'])) $tmp['activation_code'] = $data['activation_code'];\n\t\tif(isset($data['method'])) $tmp['method'] = $data['method'];\n\t\tif(isset($data['use_start_time'])) $tmp['use_start_time'] = $data['use_start_time'];\n\t\tif(isset($data['use_end_time'])) $tmp['use_end_time'] = $data['use_end_time'];\n\t\tif(isset($data['effect_start_time'])) $tmp['effect_start_time'] = $data['effect_start_time'];\n\t\tif(isset($data['effect_end_time'])) $tmp['effect_end_time'] = $data['effect_end_time'];\n\t\tif(isset($data['status'])) $tmp['status'] = intval($data['status']);\n\t\tif(isset($data['game_status'])) $tmp['game_status'] = $data['game_status'];\n\t\treturn $tmp;\n\t}", "public function getArrayResp()\n {\n return json_decode(Yii::$app->request->post(), false);\n }", "public function responseRequest(Request $request, array $formData)\n {\n \n\n }", "function dhvc_form_field_response_params(){\n\treturn array(\n\t\t\"name\" => __(\"Form Response\", 'dhvc-form'),\n\t\t\"base\" => \"dhvc_form_response\",\n\t\t\"category\" => __(\"Form Control\", 'dhvc-form'),\n\t\t\"icon\" => \"icon-dhvc-form-response\",\n\t\t'description' => __( 'Form message response', 'dhvc-form' ),\n\t\t\"params\" => array(\n\t\t\tarray(\n\t\t\t\t'type' => 'textfield',\n\t\t\t\t'heading' => __('Extra class name', 'dhvc-form'),\n\t\t\t\t'param_name' => 'el_class',\n\t\t\t\t'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'dhvc-form')\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'type' => 'css_editor',\n\t\t\t\t'heading' => __( 'CSS box', 'dhvc-form' ),\n\t\t\t\t'param_name' => 'input_css',\n\t\t\t\t'group' => __( 'Design Options', 'dhvc-form' ),\n\t\t\t),\n\t\t)\n\t);\n}", "#[Pure]\n public function getResponseData() {}", "public function getData(){ \n return json_decode($this->data); \n }", "function rest_post_data($url, $data)\n{\n if (is_array($data)) {\n $data = json_encode($data);\n }\n\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "public function testAllData()\n {\n Runner::truncate();\n Runner::factory()->count(15)->create();\n\n $headers['Accept'] = 'application/json';\n\n $response = $this->get('/api/v1/runner/1/form-data', $headers);\n\n $response->assertStatus(200)->assertJsonStructure(['success', 'data', 'status']);\n }", "private function compileSuccessResponseData(): array\r\n {\r\n $data = $this->getCalculatedAreaModel()->getAllData();\r\n $data['price'] = $this->fence->getPrice();\r\n $data['success'] = true;\r\n return $data;\r\n }", "public static function getFormData() {\n $result = lC_Product_variants_Admin::getFormData($_GET['pvid']);\n if (!isset($result['rpcStatus'])) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "public function set_response($response_data)\n\t{\n\t\t$this->response = (is_array($response_data))\n\t\t\t? $this->array2json($response_data)\n\t\t\t: $response_data;\n\t}", "public function processform($data)\n {\n $file_written = $this->log->ExeLog($data, var_export($data, true), 1);\n\n if ($file_written) {\n //Create a response object\n $response = json_encode(array('success' => '1', 'statuscode' => '200', 'message' => 'Request successful'));\n } else {\n $response = json_encode(array('success' => '0', 'statuscode' => '500', 'message' => 'Request failed'));\n }\n\n return $response;\n }", "public function getResponseData(): array\n {\n $responseData = [\n 'success' => $this->isSuccessful(),\n 'data' => $this->data,\n ];\n\n if ($this->error && !$this->isSuccessful()) {\n $responseData['error'] = $this->getErrorData();\n }\n\n if ($this->message) {\n $responseData['message'] = $this->message;\n }\n\n if (!empty($this->meta)) {\n $responseData['meta'] = $this->meta;\n }\n\n $responseData += ($this->fields ?: []);\n\n return $responseData;\n }", "public function jsonSerialize() {\n\t\t$ticket=$this->pe->getVar(\"DAIRY\");\n\t\treturn [\n\t\t\t\"type\" => \"form\",\n\t\t\t\"title\" => \"§aデイリーチケット交換所\",\n\t\t\t\"content\" => $this->content.\"デイリーチケット交換所です。\\n現在のチケット所有枚数\".$ticket.\"枚\",\n\t\t\t\"buttons\" => [\n\t\t\t\t[\n\t\t\t\t\t'text' => \"修復クリーム\\n(デイリーチケット:12枚)\",\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'text' => \"エメラルド原石\\n(デイリーチケット3枚)\",\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'text' => \"§d恒星の輝きを放つピッケルv2§r\\n(デイリーチケット100枚)\",\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'text'=> \"シュルカーボックス(灰色)\\n(デイリーチケット20枚)\"\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'text'=>\"ガチャチケット3枚\\n(デイリーチケット3枚)\"\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'text'=>\"赤いチケット\\n(デイリーチケット2枚)\"\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\t}", "public function getFormData()\n {\n $data = $this->getData('form_data');\n if ($data === null) {\n $formData = $this->_customerSession->getCustomerFormData(true);\n $data = new \\Magento\\Framework\\DataObject();\n if ($formData) {\n $data->addData($formData);\n $linkedinProfile = ['linkedin_profile' => $this->_customerSession->getLinkedinProfile()];\n $data->addData($linkedinProfile);\n $data->setCustomerData(1);\n }\n if (isset($data['region_id'])) {\n $data['region_id'] = (int)$data['region_id'];\n }\n $this->setData('form_data', $data);\n }\n return $data;\n }", "public function toArray() {\r\n \treturn array(\"response\"=>$this->_response);\r\n }", "public static function mapFromForm(array $data): array\n {\n\n $apiData['supportingEvidence'] = false;\n\n if (!empty($data['operatingCentres'])) {\n foreach ($data['operatingCentres'] as $operatingCentreData) {\n $apiData['operatingCentres'][$operatingCentreData['aocId']] = [\n 'adPlacedIn' => $operatingCentreData['adPlacedIn'],\n 'adPlacedDate' => $operatingCentreData['adPlacedDate'],\n 'aocId' => $operatingCentreData['aocId']\n ];\n }\n }\n\n if (!empty($data['supportingEvidence'])) {\n $apiData['supportingEvidence'] = true;\n }\n\n return $apiData;\n }", "function webform_responses($nid=NULL, $start_date=NULL, $end_date=NULL, $start_sid=NULL, $end_sid=NULL, $uid=NULL, $status=1, $limit=100) {\n $api_key = 'PUT VALID API KEY HERE'; // put your API key here\n $domain_name = 'PUT VALID DOMAIN HERE'; // put your domain name here\n \n $service = new WebformResponses($domain_name, $api_key);\n $result = $service->get(array(\n 'nid' => $nid,\n 'start_date' => $start_date,\n 'end_date' => $end_date,\n 'start_sid' => $start_sid,\n 'end_sid' => $end_sid,\n 'uid' => $uid,\n 'status' => $status,\n 'limit' => $limit,\n ));\n return $result;\n}", "public function response(): array\n {\n return [\n 'error' => $this->hasError(),\n 'exists' => $this->exists(),\n 'code' => $this->code,\n 'data' => $this->data,\n 'awb' => $this->awb,\n 'status' => $this->status,\n 'updateOn' => $this->updateOn,\n 'message' => $this->message,\n ];\n }", "private function dataInit($data) {\n\n\t\t\t//Default From\n\t\t\t$data['from']\t\t= empty($data['from']) ? $this->default['from'] : $data['from'];\n\t\t\t$data['complaint']\t= empty($data['complaint']) ? $this->default['returnPath'] : $data['complaint'];\n\t\t\t$data['reply']\t\t= empty($data['reply']) ? array($this->default['returnPath']) : $data['reply'];\n\t\t\t$data['cc']\t\t\t= empty($data['cc']) ? array() : $data['cc'];\n\t\t\t$data['bcc']\t\t= empty($data['bcc']) ? array() : $data['bcc'];\n\t\t\treturn $data;\n\t\t}", "private static function _cookData($data) {\n\t\t$tmp = array();\n\t\tif(isset($data['uid'])) $tmp['uid'] = $data['uid'];\n\t\tif(isset($data['account_type'])) $tmp['account_type'] = $data['account_type'];\n if(isset($data['balance'])) $tmp['balance'] = $data['balance'];\n\t\tif(isset($data['create_time'])) $tmp['create_time'] = json_encode ($data['create_time']);\n\t\tif(isset($data['update_time'])) $tmp['update_time'] = $data['update_time'];\n\t\treturn $tmp;\n\t}" ]
[ "0.6661469", "0.61560637", "0.6063444", "0.6038417", "0.5980344", "0.59250647", "0.5886728", "0.5877696", "0.5874399", "0.587134", "0.5832714", "0.5784602", "0.5770539", "0.57551736", "0.5740478", "0.5740442", "0.5733714", "0.57143134", "0.5668065", "0.5650723", "0.5643607", "0.5627609", "0.5623495", "0.5600157", "0.5583172", "0.5583172", "0.5583172", "0.5583172", "0.5583172", "0.5573926", "0.55720514", "0.55690837", "0.5562732", "0.5555017", "0.55549854", "0.55492806", "0.5547159", "0.5541102", "0.5535884", "0.55314946", "0.5519482", "0.55087316", "0.55063456", "0.5494954", "0.54944676", "0.54909927", "0.5490663", "0.5482445", "0.5466316", "0.5462105", "0.5460622", "0.5460622", "0.5456352", "0.54533607", "0.54521006", "0.54379076", "0.5433517", "0.54148376", "0.54143953", "0.5408122", "0.5388162", "0.5386666", "0.5386003", "0.5383308", "0.5376251", "0.5373998", "0.5368833", "0.5368833", "0.5361159", "0.5359954", "0.53573674", "0.5357336", "0.5356213", "0.5355258", "0.5353416", "0.534843", "0.5345664", "0.53325284", "0.53311926", "0.53310657", "0.53306776", "0.53232163", "0.5322853", "0.53184825", "0.5318309", "0.5306083", "0.5305657", "0.5304507", "0.53032905", "0.5303103", "0.5302923", "0.53000945", "0.529686", "0.5295758", "0.5295307", "0.52949226", "0.5290245", "0.5288893", "0.5281985", "0.5281463", "0.52784616" ]
0.0
-1
return get_theme_option(OP_ENTRY_CARD_EXCERPT_MORE, __( '...', THEME_NAME ));
function get_entry_card_excerpt_more(){ return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function themify_custom_excerpt_more($more) {\n global $post;\n return '';\n}", "function xkit_the_theme_option( $field_name, $default = '' ){\n\tprint xkit_get_theme_option( $field_name, $default );\n}", "function codium_extend_excerpt_more($more) {\n global $post;\n $readmore = __('Czytaj wiecej', 'codium_extend' );\n return '';\n}", "function codium_extend_excerpt_more($more) {\n global $post;\n $readmore = __('Czytaj wiecej', 'codium_extend' );\n return '';\n}", "function custom_excerpt_more( $more ) {\r\n\t return '...';\r\n}", "function deco_display_theme_credit(){\n\t\t$theme_credit=get_theme_option('Theme Credit');\n\t\t$credit_text=' | <a href=\"http://jeffersonsnewspaper.org/2010/deco-an-omeka-theme/\" title=\"Deco theme\">Deco theme</a> by <a href=\"http://twitter.com/ebellempire/\" title=\"@ebellempire\">E. Bell</a>';\n\t\tif ($theme_credit == 'yes')return $credit_text;\n}", "function new_excerpt_more( $more ) {\n\treturn '&hellip;';\n/*\n\tif(is_front_page()){\n\treturn '&nbsp;<span class=\"genericon genericon-next\"></span>';\t\t\n\t} else {\n\treturn '&hellip;';\n\t}\n*/\n}", "function zeen_get_theme_option( $option = '', $default = '' ) {\n\n\treturn get_theme_mod( $option, $default );\n\n}", "function inkpro_add_shop_display_options( $options ) {\r\n\r\n\tif ( class_exists( 'WooCommerce' ) ) {\r\n\t\t$options['loren'] = esc_html__( 'Loren', 'inkpro' );\r\n\t\t$options['agathe'] = esc_html__( 'Agathe', 'inkpro' );\r\n\t}\r\n\r\n\treturn $options;\r\n}", "function ppo_excerpt_more($more) {\n $link = sprintf('<a href=\"%1$s\" class=\"more-link\">%2$s</a>', esc_url(get_permalink(get_the_ID())),\n /* translators: %s: Name of current post */ \n sprintf(__('Xem thêm <span class=\"meta-nav\">&rarr;</span>', SHORT_NAME))\n );\n return ' &hellip; ' . $link;\n}", "function deco_get_about($about = null)\n{ \n if (!$about) {\n \n $about = get_theme_option('About') ? \n get_theme_option('About') : \n 'Add some text about your site in theme options. You can use HTML!';\n }\n \n return $about; \n \n}", "function wpdocs_excerpt_more( $more ) {\n return ' ...';\n}", "function et_excerpt_more($more) {\n global $post;\n return '<div class=\"view-full-post\"><a href=\"'. get_permalink($post->ID) . '\" class=\"view-full-post-btn\">Skaityti</a></div>';\n}", "function HERITAGE_general_options_callback() {\n ?>\n <p>\n <?php echo esc_html__('Setup custom logo.', 'heritage'); ?>\n </p>\n <?php\n /*print theme settings*/\n if (LC_SWP_PRINT_SETTINGS) {\n $general = get_option('heritage_theme_general_options');\n\n ?>\n <pre>heritage_theme_general_options:\n\t\t\t<?php echo (json_encode($general)); ?>\n\t\t</pre>\n <?php\n }\n}", "function new_excerpt_more($more) {\n global $post;\n // return '<a class=\"read_more\" href=\"'. get_permalink($post->ID) . '\">'.__('Read More','textdomain').'</a>';\n return '';\n}", "function custom_desktop_excerpt_more($more) {\n}", "function premise_homehero_services(){\n\t if( get_theme_mod( 'premise_homehero_services') != \"\" ) {\n\t\techo get_theme_mod( 'premise_homehero_services');\n\t }\n}", "function et_excerpt_more($more) {\n global $post;\n return '<div><a href=\"'. get_permalink($post->ID) . '\" > ... Click to View Full Post</a></div>;';\n}", "function mila_custom_excerpt_more($more) {\n global $post;\n return '&nbsp;<div class=\"more-link\"><a href=\"'. get_permalink($post->ID) . '\">'. __('<i title=\"Läs mer\" class=\"fa fa-arrow-circle-right\"></i>', 'mila') .'</a></div>';\n }", "function ajb_get_options_page_cap() {\n return 'edit_theme_options';\n}", "function premise_who_are_you(){\n\t if( get_theme_mod( 'premise_who_are_you') != \"\" ) {\n\t\techo get_theme_mod( 'premise_who_are_you');\n\t }\n}", "function excerpt_read_more_link($output) {\r\n global $post;\r\n return $output . '<a class=\"more-link\" href=\"'. get_permalink($post->ID) . '\">'.__(\"Keep Reading\",TEXTDOMAIN ).'<span class=\"icon-arrow-right5\"></span></a>';\r\n}", "function custom_excerpt_more( $more ) {\n\tif ( is_home() ) {\n\t\treturn false;\n\t}\n\treturn \"&hellip;\";\n}", "function cultiv8_option( $option, $default = false ) {\n\tif( class_exists( 'CTC_Extender' ) && ctcex_has_option( $option ) )\n\t\treturn ctcex_get_option( $option, $default );\n\t\n\treturn get_theme_mod( $option, $default );\n}", "function new_excerpt_more( $more ) {\n return '';\n}", "function custom_excerpt_more($more) {\n\t\treturn 'Read More &raquo;';\n\t}", "function new_excerpt_more($more) {\n global $post;\n\treturn ' <a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\">[ more ]</a>';\n}", "function wfs_excerpt_more( $more ) {\n return '...';\n}", "function medigroup_mikado_read_more_button($option = '', $class = '') {\n if($option != '') {\n $show_read_more_button = medigroup_mikado_options()->getOptionValue($option) == 'yes';\n } else {\n $show_read_more_button = 'yes';\n }\n if($show_read_more_button && !medigroup_mikado_post_has_read_more() && !post_password_required()) {\n echo medigroup_mikado_get_button_html(array(\n 'size' => 'small',\n 'link' => get_the_permalink(),\n 'text' => esc_html__('Read More', 'medigroup'),\n 'custom_class' => $class\n ));\n }\n }", "function techfak_get_theme_options() {\n\treturn get_option( 'techfak_theme_options', techfak_get_default_theme_options() );\n}", "function swbtheme_excerpt_more($more) {\n global $post;\n\treturn '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read the full article...</a>';\n}", "function the_option( $key ) {\n\n if ( ! $this->get_the_option( $key ) )\n return false;\n\n echo $this->get_the_option( $key );\n }", "function tsc_theme_options() {\n\tadd_theme_page( 'Theme Options', 'Theme Options', 'edit_theme_options', 'theme_options', 'tsc_theme_options_page' );\n}", "function medigroup_mikado_excerpt_more($more) {\n return '...';\n }", "function medigroup_mikado_excerpt($excerpt_length = '') {\n global $post;\n\n if(post_password_required()) {\n echo get_the_password_form();\n } //does current post has read more tag set?\n elseif(medigroup_mikado_post_has_read_more()) {\n global $more;\n\n //override global $more variable so this can be used in blog templates\n $more = 0;\n the_content(true);\n } //is word count set to something different that 0?\n elseif($excerpt_length != '0') {\n //if word count is set and different than empty take that value, else that general option from theme options\n $word_count = '45';\n if(isset($excerpt_length) && $excerpt_length != \"\") {\n $word_count = $excerpt_length;\n\n } elseif(medigroup_mikado_options()->getOptionValue('number_of_chars') != '') {\n $word_count = esc_attr(medigroup_mikado_options()->getOptionValue('number_of_chars'));\n }\n //if post excerpt field is filled take that as post excerpt, else that content of the post\n $post_excerpt = $post->post_excerpt != \"\" ? $post->post_excerpt : strip_tags($post->post_content);\n\n //remove leading dots if those exists\n $clean_excerpt = strlen($post_excerpt) && strpos($post_excerpt, '...') ? strstr($post_excerpt, '...', true) : $post_excerpt;\n\n //if clean excerpt has text left\n if($clean_excerpt !== '') {\n //explode current excerpt to words\n $excerpt_word_array = explode(' ', $clean_excerpt);\n\n //cut down that array based on the number of the words option\n $excerpt_word_array = array_slice($excerpt_word_array, 0, $word_count);\n\n //add exerpt postfix\n $excert_postfix = apply_filters('medigroup_mikado_excerpt_postfix', '...');\n\n //and finally implode words together\n $excerpt = implode(' ', $excerpt_word_array).$excert_postfix;\n\n //is excerpt different than empty string?\n if($excerpt !== '') {\n echo '<p class=\"mkd-post-excerpt\">'.wp_kses_post($excerpt).'</p>';\n }\n }\n }\n }", "function echotheme_custom_excerpt_more($output) {\n\tif (has_excerpt() && ! is_attachment()) {\n\t\t$output .= echotheme_continue_reading_link();\n\t}\n\treturn $output;\n}", "function pqurc_display_extra()\n {\n $extra_fi = get_option('pqurcode_extra');\n printf(\"<input type='text' id='%s' name='%s' value='%s' />\", 'pqurcode_extra', 'pqurcode_extra', $extra_fi);\n }", "function pu_theme_menu()\n{\n add_theme_page( 'Theme Option', 'Edycja danych motywu', 'manage_options', 'pu_theme_options.php', 'pu_theme_page'); \n}", "function new_excerpt_more($more) {\r\n global $post;\r\n return '<button class=\"btn btn-primary hvr-grow clearfix\"><a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read the full article...</a></button>';\r\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn '<div class=\"readmore\"><a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read More <i class=\"fa fa-long-arrow-right\" aria-hidden=\"true\"></i></a></div>';\n}", "function new_excerpt_more($more) {\n\n\tglobal $post;\n\n\treturn '...&nbsp; <a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"><br/>read&nbsp;more</a>';\n\n}", "function cah_news_get_dept_option() {\r\n return get_option('cah_news_display_dept2');\r\n}", "function gigx_excerpt_more($more) {\n\treturn '';\n}", "function HERITAGE_get_theme_option($option_group, $option_name)\n{\n $options = get_option($option_group);\n\n if (isset($options[$option_name])) {\n return $options[$option_name];\n }\n\n return '';\n}", "function new_excerpt_more($more) {\n\tglobal $post;\n\treturn '&hellip; </br> <a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\">Read more</a>';\n}", "function voyage_mikado_read_more_button($option = '', $class = '') {\n if($option != '') {\n $show_read_more_button = voyage_mikado_options()->getOptionValue($option) == 'yes';\n } else {\n $show_read_more_button = 'yes';\n }\n if($show_read_more_button && !voyage_mikado_post_has_read_more() && !post_password_required()) {\n echo voyage_mikado_get_button_html(array(\n 'size' => 'small',\n 'link' => get_the_permalink(),\n 'text' => esc_html__('Read More', 'voyage'),\n 'custom_class' => $class\n ));\n }\n }", "function print_excerpt($length) {\r\n\t\tglobal $post;\r\n $length = ($length =='')? '50' : $length;\r\n\t\t/*condition for supreme related theme*/\r\n\t\tif(function_exists('supreme_prefix')){\r\n\t\t\t$pref = supreme_prefix();\r\n\t\t}else{\r\n\t\t\t$pref = sanitize_key( apply_filters( 'hybrid_prefix', get_template() ) );\r\n\t\t}\r\n\t\t$tmpdata = get_option($pref.'_theme_settings');\t\r\n\t\t$morelink = @$tmpdata['templatic_excerpt_link'];\r\n\t\t\r\n\t\tif(!empty($morelink))\r\n\t\t\t$morelink =sprintf(__('<a href=\"%s\" class=\"more moretag\">%s</a>','templatic'),get_permalink(),$morelink);\r\n\t\telse\r\n\t\t\t$morelink ='<a class=\"moretag\" href=\"'.get_permalink().'\" class=\"more\">'.__('Read more').'...</a>';\r\n\t\t\r\n\t\t$text = $post->post_excerpt;\r\n\t\tif ($text =='') {\r\n\t\t\t$text = $post->post_content;\r\n\t\t\t$text = apply_filters('the_excerpt', $text);\r\n\t\t\t$text = str_replace(']]>', ']]>', $text);\r\n\t\t}\r\n\t\t$text = strip_shortcodes($text); // optional, recommended\r\n\t\t$text = strip_tags($text); // use ' $text = strip_tags($text,'<p><a>'); ' if you want to keep some tags\r\n\r\n\t\t$text = wp_trim_words($text,$length); /* shows perticular words */\r\n\t\tif(reverse_strrchr($text, '.', 1)){\r\n\t\t\t$excerpt = reverse_strrchr($text, '.', 1).\" \".sprintf(__('%s','templatic'),$morelink);\r\n\t\t}else{\r\n\t\t\t$excerpt = $text.\" \".sprintf(__('%s','templatic'),$morelink);\r\n\t\t}\r\n\t\t\r\n\t\tif( $excerpt ) {\r\n\t\t\techo apply_filters('the_excerpt',$excerpt);\r\n\t\t} else {\r\n\t\t\techo apply_filters('the_excerpt',$text);\r\n\t\t}\r\n\t}", "function new_excerpt_more($more) {\n\tglobal $post;\n\treturn '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Leia o artigo completo...</a>';\n}", "function tb_longwave_header_options_callback() {\n\techo '<p>Settings for things visible in the Head of the theme.</p>';\n}", "function barjeel_excerpt($more) {\n global $post;\n return '&nbsp; &nbsp;<a href=\"'. get_permalink($post->ID) . '\">...Continue Reading</a>';\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn ' <a href=\"'. get_permalink($post->ID) . '\"><em>(Continue Reading...)</em></a>';\n}", "function spnin_activate(){\n if(version_compare(get_bloginfo('version'),'4.2','<')){\n wp_die(__('you must have a minimum version of 4.2 use this theme'));\n }else{\n echo \"called the spnin_activate function \";\n }\n\n$theme_opts = get_option('spnin_opts');\nif(!$theme_opts){\n $opts = array(\n 'facebook' =>'',\n 'twitter' =>'',\n 'youtube' =>'',\n 'logotype' =>1,\n 'logo_img' =>'',\n 'footer' =>''\n );\n\n add_option('spnin_opts',$opts);\n\n}\n\n}", "function understrap_custom_excerpt_more( $more ) {\n\t\treturn '';\n\t}", "function voyage_mikado_excerpt_more($more) {\n return '...';\n }", "function rw_continue_reading_link( )\n{\n return ' <a href=\"'. get_permalink() . '\" class=\"more-link\">' . __( 'More', 'rotorwash' ) . '</a>';\n}", "function tac_new_excerpt_more( $more ) {\n\treturn '...';\n}", "function vdtestim_global_callback () {\n\t?>\n\t\t<p><?php esc_attr_e( 'Manage Global Options', 'vdtestim' ); ?></p>\n\t<?php\n}", "function twentyten_custom_excerpt_more( $output ) {\n\tif ( has_excerpt() && ! is_attachment() && ! is_admin() ) {\n\t\t$output .= twentyten_continue_reading_link();\n\t}\n\treturn $output;\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn '<p><a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read More</a></p>';\n}", "function emc_learn_more_link() {\r\n\r\n\t$more = sprintf( '<a href=\"%1$s\" title=\"%2$s\">%3$s</a>',\r\n\t\tget_permalink(),\r\n\t\tesc_attr__( 'View full post', 'emc' ),\r\n\t\tesc_html__( '&nbsp;&nbsp;More&nbsp;&rarr;', 'emc' )\r\n\t);\r\n\treturn $more;\r\n\r\n}", "function new_excerpt_more($more) {\n global $post, $wpak_options;\n\n\treturn '<p class=\"readmore\"><a title=\"' . $wpak_options['linkto'] . $post->post_title.'\" href=\"'. get_permalink($post->ID) . '\">' . $wpak_options['readmore'] . '</a></p>';\n}", "function custom_excerpt_length(){\n return 25;\n}", "function custom_excerpt_length(){\n return 25;\n}", "function wpdocs_excerpt_more( $more ) {\n return sprintf( '<a class=\"read-more\" href=\"%1$s\">%2$s</a>',\n get_permalink( get_the_ID() ),\n __( '...', 'textdomain' )\n );\n}", "function my_shortcode() {\n\n$options = get_option('foodrecipecptplugin_settings');\nreturn \"<p>Recipe Name:\" . $options['foodrecipecptplugin_text_field_0'] . \"</p>\".\"<p>Category: \" . $options['foodrecipecptplugin_text_field_1'].\"</p>\".\"<p>Ingredients: \". $options['foodrecipecptplugin_text_field_2'].\"</p>\".\"<p>Recipe Instructions: \" . $options['foodrecipecptplugin_text_field_3'] . \"</p>\";\n}", "function new_excerpt_more($more)\r\n{\r\n\tglobal $post;\r\n\treturn '<a class=\"moretag\" href=\"' . get_permalink($post->ID) . '\"> Read the full article...</a>';\r\n}", "function new_excerpt_more( $more ) {\n\tglobal $post;\n\treturn '... <div class=\"button small text-center\"><a href=\"'. get_permalink($post->ID) . '\">Continue Reading</a></div>';\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn '... (<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\">Read more</a>)';\n}", "function mintshow_excerpt_more( $more ) {\n return sprintf( '<a class=\"ms-read-more\" href=\"%1$s\">%2$s <i class=\"fa fa-long-arrow-right\"></i></a>',\n get_permalink( get_the_ID() ),\n __( 'Read More', 'textdomain' )\n );\n}", "function new_excerpt_more($more) {\n global $post;\n\treturn '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> read more...</a>';\n}", "function new_excerpt_more($more) {\n global $post;\n return ' [...] <a href=\"' . get_permalink($post->ID) . '\">' . __('Continue reading <span class=\"meta-nav\">&rarr;</span>', 'twentytwelve') . '</a>';\n }", "function add_theme_help()\n{\n add_menu_page('Theme Help', 'Theme Help', 'manage_options', 'theme-help', 'theme_help');\n}", "function new_excerpt_more( $more ) {\n return ' ...';\n}", "function new_excerpt_more( $more ) {\n\treturn '[...]<div class=\"read-more\"><a href=\"'. get_permalink( get_the_ID() ) . '\">Lire la suite</a></div>';\n}", "function new_excerpt_more( $more ) {\n return '&hellip; <span class=\"read-more\"><a href=\"'.get_permalink().'\" rel=\"bookmark\">continue reading</a></span>';\n}", "function extra_customizer_link() {\n\tif ( is_customize_preview() ) {\n\t\techo et_core_portability_link( 'et_extra_mods', array( 'class' => 'customize-controls-close' ) );\n\t}\n}", "function new_excerpt_more($more) {\n global $post;\n return '<a class=\"post-link\" href=\"'. get_permalink($post->ID) . '\"> ...Read the full article</a>';\n}", "function pro_copyright() {\n\t\n\t$pro = get_option ( 'up_themes_betty_commerce_wordpress_theme' );\n\t\n\tif( !empty( $pro['copyright_footer'] ) )\n\t{\n\t\treturn $pro['copyright_footer'];\n\t}\n\treturn false;\n}", "function pro_bottom_newsletter()\n{\n\t$pro = get_option('up_themes_betty_commerce_wordpress_theme');\n\t\n\tif( !empty( $pro['bottom_newsletter_optin'] ) )\n\t{\n\t\treturn $pro['bottom_newsletter_optin'];\n\t}\n\treturn false;\n}", "function clrfl_excerpt_more($more) {\n\tglobal $post;\n\treturn '<a class=\"moretag\" href=\"'. get_permalink($post->ID) . '\"> Read the full article...</a>';\n}", "function new_excerpt_more( $more ) {\n return ' <a class=\"read-more\" href=\"' . get_permalink( get_the_ID() ) . '\">' . __( 'Read More...', 'your-text-domain' ) . '</a>';\n}", "function new_excerpt_more($more) {\n global $post;\n return ' <a class=\"read_more\" href=\"' . get_permalink($post->ID) . '\">[...]</a>';\n}", "function new_excerpt_more( $more ) {\n\treturn '...';\n}", "function cpotheme_metadata_themefeature_options()\n{\n $cpotheme_data = array();\n\n $cpotheme_data[] = array(\n 'name' => 'feature_image',\n 'std' => '',\n 'label' => 'Feature Image',\n 'desc' => '',\n 'type' => 'upload'\n );\n\n $cpotheme_data[] = array(\n 'name' => 'feature_premium',\n 'std' => '',\n 'label' => 'Premium Feature',\n 'desc' => '',\n 'type' => 'checkbox'\n );\n\n return $cpotheme_data;\n}", "function lg_mac_activ_options()\n\t{\n\t\t$theme_opts =get_option('lgmac_opts');\n\t\tif(!$theme_opts) //si le theme est désactivé et réactivé plus tard il ne sera pas nécessaire de reactiver le theme\n\t\t\t{\t\t\t//afin de créer l'option\n\t\t\t\t\n\t\t\t\t//\n\t\t\t\t$opts =array(\n\t\t\t\t'image_01_url' => '',\n\t\t\t\t'slider_shortcode' =>'',\n\t\t\t\t'HeaderC' =>'',\n\t\t\t\t'FooterColor'=>'',\n\t\t\t\t'FooterCopyright'=>'',\n\t\t\t\t'lgmac_img_FirstBlock'=>'',\n\t\t\t\t'lgmac_img_firstblock133'=>'',\n\n\n\t\t\t\t);\n\t\t\t\tadd_option('lgmac_opts',$opts);\n\t\t\t}\n\t}", "function optionsframework_option_name() {\n return 'options-framework-theme-sample5';\n}", "function new_excerpt_more($more) {\n\treturn '...';\n}", "function thefirst_new_excerpt_more($more) {\n global $post;\n\treturn '...';\n}", "function bureau_theme_options() {\n echo 'Activate and Deactivate';\n}", "function rls_read_more_button($more) {\n global $post;\n return '<div class=\"center-align read-more\"><a class=\" gray view-article button\" href=\"'.get_permalink($post->ID).'\">'\n .__('Read More', 'rls')\n .'</a></div>';\n}", "function dg_excerpt() {\n global $post;\n $excerpt = '<p>' . get_the_excerpt() . ' <a class=\"more\" href=\"'. get_permalink($post->ID) . '\" title=\"'. get_the_title($post->ID) .'\">Read&nbsp;more&nbsp;»</a></p>';\n echo $excerpt;\n}", "function my_top_right_help_metabox_content() { ?>\n <p>Assicurati di cliccare sul pulsante 'Pubblica' sottostante per pubblicare la nuova voce del menù, oppure 'Aggiorna' per salvare le modifiche.</p>\n<?php }", "function twentyten_auto_excerpt_more( $more ) {\n\tif ( ! is_admin() ) {\n\t\treturn ' &hellip;' . twentyten_continue_reading_link();\n\t}\n\treturn $more;\n}", "function wpdocs_excerpt_more( $more ) {\n return ' <a href=\"' . get_the_permalink() . '\" rel=\"nofollow\">[Read More...]</a>';\n}", "function my_excerpt_more( $more ) {\n\treturn ' &hellip; <a href=\"'. get_permalink() .'\">Continue reading &ldquo;'. get_the_title() .'&rdquo; &rarr;</a>';\n}", "function pnq_get_option_name() {\n\t$theme_slug = pnq_get_theme_slug();\n\t$option_name = $theme_slug.'_options';\t\n\t\n\t// apply filter 'pnq_option_name'\n\t$option_name = pnq_option_name( $option_name );\n\t\n\treturn $option_name;\n}", "function voyage_mikado_excerpt($excerpt_length = '') {\n global $post;\n\n if(post_password_required()) {\n echo get_the_password_form();\n } //does current post has read more tag set?\n elseif(voyage_mikado_post_has_read_more()) {\n global $more;\n\n //override global $more variable so this can be used in blog templates\n $more = 0;\n the_content(true);\n } //is word count set to something different that 0?\n elseif($excerpt_length != '0') {\n //if word count is set and different than empty take that value, else that general option from theme options\n $word_count = '45';\n if(isset($excerpt_length) && $excerpt_length != \"\") {\n $word_count = $excerpt_length;\n\n } elseif(voyage_mikado_options()->getOptionValue('number_of_chars') != '') {\n $word_count = esc_attr(voyage_mikado_options()->getOptionValue('number_of_chars'));\n }\n //if post excerpt field is filled take that as post excerpt, else that content of the post\n $post_excerpt = $post->post_excerpt != \"\" ? $post->post_excerpt : strip_tags($post->post_content);\n\n //remove leading dots if those exists\n $clean_excerpt = strlen($post_excerpt) && strpos($post_excerpt, '...') ? strstr($post_excerpt, '...', true) : $post_excerpt;\n\n //if clean excerpt has text left\n if($clean_excerpt !== '') {\n //explode current excerpt to words\n $excerpt_word_array = explode(' ', $clean_excerpt);\n\n //cut down that array based on the number of the words option\n $excerpt_word_array = array_slice($excerpt_word_array, 0, $word_count);\n\n //add exerpt postfix\n $excert_postfix = apply_filters('voyage_mikado_excerpt_postfix', '...');\n\n //and finally implode words together\n $excerpt = implode(' ', $excerpt_word_array).$excert_postfix;\n\n //is excerpt different than empty string?\n if($excerpt !== '') {\n echo '<p class=\"mkdf-post-excerpt\">'.wp_kses_post($excerpt).'</p>';\n }\n }\n }\n }", "function charity_use_excerpt() {\n $display = TRUE;\n $display = apply_filters('charity_use_excerpt', $display);\n return $display;\n}", "function et_setup_theme() {\n\tglobal $themename, $shortname, $et_store_options_in_one_row;\n\t$themename = 'Extra';\n\t$shortname = 'extra';\n\t$et_store_options_in_one_row = true;\n\n\t$template_directory = get_template_directory();\n\n\t// ePanel\n\trequire_once $template_directory . '/epanel/custom_functions.php';\n\trequire_once $template_directory . '/epanel/core_functions.php';\n\trequire_once $template_directory . '/post_thumbnails_extra.php';\n\trequire_once $template_directory . '/includes/choices.php';\n\trequire_once $template_directory . '/includes/sanitization.php';\n\n\t// Core\n\trequire_once $template_directory . '/core/init.php';\n\n\tet_core_setup( get_template_directory_uri() );\n\n\tif ( '3.0.61' === ET_CORE_VERSION ) {\n\t\trequire_once $template_directory . '/core/functions.php';\n\t\trequire_once $template_directory . '/core/components/init.php';\n\t\tet_core_patch_core_3061();\n\t}\n\n\tload_theme_textdomain( 'extra', $template_directory . '/lang' );\n\n\t// deactivate page templates and custom import functions\n\tremove_action( 'init', 'et_activate_features' );\n\n\t// remove epanel theme options link in wp-admin menu\n\tremove_action( 'admin_menu', 'et_add_epanel' );\n\t// end ePanel\n\n\tregister_nav_menus( array(\n\t\t'primary-menu' => esc_html__( 'Primary Menu', 'extra' ),\n\t\t'secondary-menu' => esc_html__( 'Secondary Menu', 'extra' ),\n\t\t'footer-menu' => esc_html__( 'Footer Menu', 'extra' ),\n\t) );\n\n\tadd_theme_support( 'title-tag' );\n\n\tadd_theme_support( 'et-post-formats', array(\n\t\t'video',\n\t\t'audio',\n\t\t'quote',\n\t\t'gallery',\n\t\t'link',\n\t\t'map',\n\t\t'text',\n\t) );\n\n\tadd_theme_support( 'automatic-feed-links' );\n\tadd_theme_support( 'post-thumbnails' );\n\tadd_theme_support( 'et_widget_areas' );\n\n\tadd_theme_support( 'html5', array( 'search-form' ) );\n\n\t// Load unminified script & styles based on selected theme options field\n\tadd_filter( 'et_load_unminified_scripts', 'et_extra_load_unminified_scripts' );\n\tadd_filter( 'et_load_unminified_styles', 'et_extra_load_unminified_styles' );\n}", "function wprt_excerpt_more( $more ) {\n\treturn '&hellip;';\n}" ]
[ "0.6736971", "0.66720587", "0.6604045", "0.6604045", "0.6576243", "0.6531921", "0.6482173", "0.643697", "0.6405216", "0.6401118", "0.63861144", "0.6364165", "0.6323433", "0.6321211", "0.63200486", "0.6283958", "0.6236837", "0.6235942", "0.62268674", "0.6214131", "0.61934173", "0.6170808", "0.6159437", "0.6157571", "0.61513984", "0.61396676", "0.61298186", "0.61234206", "0.6121933", "0.6113058", "0.6111694", "0.6108207", "0.6104404", "0.6104209", "0.61040634", "0.6103649", "0.60836935", "0.6070276", "0.6059608", "0.6058155", "0.6058057", "0.6041159", "0.6038668", "0.6016532", "0.60155165", "0.60041636", "0.60016584", "0.59973675", "0.59870726", "0.59832835", "0.5969646", "0.5968802", "0.59677625", "0.5967308", "0.5956402", "0.59515435", "0.5949302", "0.59415543", "0.59365034", "0.59355277", "0.5935101", "0.59345126", "0.59345126", "0.5926791", "0.59061176", "0.5903795", "0.5902938", "0.59028167", "0.58980346", "0.5895173", "0.58944684", "0.58940387", "0.58921343", "0.5880706", "0.58803785", "0.58789617", "0.58751273", "0.5863224", "0.58599925", "0.5858841", "0.5858776", "0.5851419", "0.5840581", "0.583818", "0.58346575", "0.5832932", "0.58314306", "0.5831173", "0.5831124", "0.58287156", "0.58239377", "0.58193696", "0.5818972", "0.58189183", "0.5814659", "0.5813341", "0.58125395", "0.5812152", "0.5810917", "0.58100325" ]
0.72823095
0
Method to store valdiation filter rules
public static function filter($rules) { static::$filters[] = $rules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function getRules() {\n return [\n 'imeArtikla' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'cenaArtikla' => FILTER_VALIDATE_FLOAT,\n 'opisArtikla' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'kategorijaArtikla' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'zalogaArtikla' => FILTER_VALIDATE_FLOAT,\n \n /*'year' => [\n 'filter' => FILTER_VALIDATE_INT,\n 'options' => [\n 'min_range' => 1800,\n 'max_range' => date(\"Y\")\n ]\n ]*/\n ];\n \n }", "public function setupFilterRules()\n { }", "abstract public function filters();", "public function rules()\n\t{\n\t\treturn [\n\t\t\t'by' => [\n\t\t\t\t'required',\n\t\t\t\tRule::in(array_keys(config('filter.by'))),\n\t\t\t],\n\t\t\t'tech' => [\n\t\t\t\t'required_if:by,node',\n\t\t\t\t'required_if:by,province',\n\t\t\t\t'required_if:by,zone',\n\t\t\t\tRule::in($this->getArrayFrom('technologies'))\n\t\t\t],\n\t\t\t'vendor' => [\n\t\t\t\t'required_if:by,province',\n\t\t\t\t'required_if:by,zone',\n\t\t\t\tRule::in($this->getArrayFrom('vendor'))\n\t\t\t],\n\t\t\t'end_date' => [\n\t\t\t\t'required',\n\t\t\t\t'date_format:\"Y-m-d H:i\"',\n\t\t\t],\n\t\t\t'for' => [\n\t\t\t\t'required',\n\t\t\t\tRule::in(array_keys(config('filter.for')))\n\t\t\t],\n\t\t\t'resolution' => [\n\t\t\t\t'required',\n\t\t\t\tRule::in($this->getResolutions(request()->get('for'))),\n\t\t\t],\n\t\t\t'zone' => [\n\t\t\t\t'required_if:by,zone',\n\t\t\t\tRule::in(array_pluck(config('filter.zones'), 'value'))\n\t\t\t],\n\t\t\t'zone_aggregate' => [\n\t\t\t\t'required_if:by,zone',\n\t\t\t\tRule::in($this->getAggregates())\n\t\t\t],\n\t\t\t'values' => [\n\t\t\t\t'required_unless:by,zone',\n\t\t\t]\n\t\t];\n\t}", "abstract protected function getFilters();", "public function rules($data);", "private function filters() {\n\n\n\t}", "public static function getRules() {\n return [\n 'title' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'author' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'description' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'price' => FILTER_VALIDATE_FLOAT,\n 'year' => [\n 'filter' => FILTER_VALIDATE_INT,\n 'options' => [\n 'min_range' => 1800,\n 'max_range' => date(\"Y\")\n ]\n ]\n ];\n }", "public function rules();", "public function rules();", "public function rules();", "protected abstract function rules();", "private function defineFilters() {\n\n // init local filters variable as empty array\n $filters = [];\n\n // parse each filter to apply\n // and add the valid once to filters\n\n // filters by name\n if (isset($_GET['s'])) {\n\n $filters['name'] = $_GET['s'];\n\n }\n\n // filter by categories\n if (isset($_GET['c'])) {\n\n $categories = explode(\"_\", $_GET['c']);\n foreach ($categories as $key => $value) {\n if (is_numeric($value)) {\n $filters['categories'][] = $value;\n }\n }\n\n }\n\n // filter by areas\n if (isset($_GET['a'])) {\n\n $areas = explode(\"_\", $_GET['a']);\n foreach ($areas as $key => $value) {\n if (is_numeric($value)) {\n $filters['areas'][] = $value;\n }\n }\n\n }\n\n // Check if any filter has been set\n\n if (count($filters)>0) {\n\n $this->filters = $filters;\n return true;\n\n }\n\n\n return false;\n\n }", "public function rules() : array\n {\n return [\n 'limit' => 'integer',\n 'offset' => 'integer',\n 'order_by_dir' => 'in:DESC,ASC',\n 'filter' => 'array',\n 'filter.available' => 'boolean'\n ];\n }", "public function filters()\n {\n return array(\n 'value' => array(\n array(array($this, 'check_for_array_or_object')),\n )\n );\n }", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'amount' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t),\n\t\t\t'price' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t)\n\t\t);\n\t}", "public function rules() : array\n {\n return [\n 'limit' => 'integer',\n 'offset' => 'integer',\n 'order_by' => 'array',\n 'order_by_dir' => 'in:DESC,ASC',\n 'filter' => 'array',\n 'filter.user' => 'string|max:18',\n 'filter.custom' => 'boolean',\n 'filter.available' => 'boolean',\n ];\n }", "public function filtering();", "public function rules()\n\t{\n\t\t$defaults = array();\n\t\t$toggles = array();\n\t\t$custom = array();\n\t\t$required = array();\n\n\t\tforeach($this->searchFields as $field=>$data)\n\t\t{\n\t\t\t$type = $this->getSearchFieldType($field);\n\t\t\tif ($type == 'toggle')\n\t\t\t\t$toggles[] = $field;\n\t\t\telseif ($type == 'required')\n\t\t\t\t$required[] = $field;\n\t\t\telseif (empty($data['rule']) || !is_array($data['rule']))\n\t\t\t\t$defaults[] = $field;\n\n\t\t\tif (isset($data['rule']) && is_array($data['rule']))\n\t\t\t\t$custom[] = $data['rule'];\n\t\t}\n\n\t\treturn array_merge(array(\n\t\t\tarray(implode(', ', $required), 'required'),\n\t\t\tarray(implode(', ', $toggles), 'in', 'range' => array('Y','N','I')),\n\t\t\tarray(implode(', ', $defaults), 'length', 'max'=>200)\n\t\t), $custom);\n\t}", "public function getFilterParameters(): array;", "public function addFilters() {\n\t\t\tadd_filter( 'muut_validate_setting', array( $this, 'validateSettings' ), 10, 2 );\n\t\t}", "public function getFilterValues()\n {\n return $this->filter_values;\n }", "public function rules()\r\n {\r\n $rules= array(\r\n array(\"CONDITIONING, LATERALITY, birthdate_dd_mmm_yyyy, PATIENT_ID, SAMPLE_NUMBER, VISIT_ID, MATERIAL_TYPE_ID\",\"required\"),\r\n array(\"birthdate_dd_mm_yyyy, KIT_NUMBER_ID, blood_technical, endTaxanes, MATERIAL_ID\",\"safe\"),\r\n );\r\n\r\n $parentRules=parent::rules();\r\n $rules[]=$parentRules[0];\r\n\r\n return $rules;\r\n }", "public function rules() {\n return $this->get_from_model(__FUNCTION__);\n }", "public function rules()\n {\n return array_merge(\n parent::rules(),\n [\n ['operation', 'in', 'range' => [self::OPERATION_REDEEM, self::OPERATION_VIEWED]],\n ]\n );\n }", "public function getFilter();", "public function getFilter();", "protected function applyFiltering()\n\t{\n\t\tif (!$this->hasFilters()) return;\n\n\t\tparse_str($this->filters, $list);\n\t\tforeach ($list as $column => $value) {\n\t\t\tif ($value !== '') {\n\t\t\t\t$this[$column]->applyFilter($value);\n\t\t\t}\n\t\t}\n\t}", "public function rules()\n {\n return [\n 'limit' => ['sometimes', 'numeric', 'min:1', 'max:500'],\n 'filter' => ['sometimes', 'in:asc,desc'],\n 'sort_by' => ['sometimes', new InTableColumnsRule(with(new Product())->getTable())]\n ];\n }", "public function addFilters($values)\n {\n $attributes = $this->getAttributes();\n $allConditions = [];\n\n foreach ($attributes as $attribute) {\n /* @var $attribute Attribute */\n if (!isset($values[$attribute->getAttributeCode()])) {\n continue;\n }\n $value = $values[$attribute->getAttributeCode()];\n $preparedSearchValue = $this->getPreparedSearchCriteria($attribute, $value);\n if (false === $preparedSearchValue) {\n continue;\n }\n $this->addSearchCriteria($attribute, $preparedSearchValue);\n\n if ($attribute->getAttributeCode() == 'price') {\n $rate = 1;\n $store = $this->_storeManager->getStore();\n $currency = $store->getCurrentCurrencyCode();\n if ($currency != $store->getBaseCurrencyCode()) {\n $rate = $store->getBaseCurrency()->getRate($currency);\n }\n\n $value['from'] = (isset($value['from']) && is_numeric($value['from']))\n ? (float)$value['from'] / $rate\n : '';\n $value['to'] = (isset($value['to']) && is_numeric($value['to']))\n ? (float)$value['to'] / $rate\n : '';\n }\n\n if ($attribute->getBackendType() == 'datetime') {\n $value['from'] = (isset($value['from']) && !empty($value['from']))\n ? date('Y-m-d\\TH:i:s\\Z', strtotime($value['from']))\n : '';\n $value['to'] = (isset($value['to']) && !empty($value['to']))\n ? date('Y-m-d\\TH:i:s\\Z', strtotime($value['to']))\n : '';\n }\n $condition = $this->_getResource()->prepareCondition(\n $attribute,\n $value,\n $this->getProductCollection()\n );\n if ($condition === false) {\n continue;\n }\n\n $table = $attribute->getBackend()->getTable();\n if ($attribute->getBackendType() == 'static') {\n $attributeId = $attribute->getAttributeCode();\n } else {\n $attributeId = $attribute->getId();\n }\n $allConditions[$table][$attributeId] = $condition;\n }\n //if ($allConditions)\n if ($allConditions || (isset($values['cat']) && is_numeric($values['cat'])) ) {\n $this->_registry->register('advanced_search_conditions', $allConditions);\n $this->getProductCollection()->addFieldsToFilter($allConditions);\n } else {\n throw new LocalizedException(__('Please specify at least one search term.'));\n }\n\n return $this;\n }", "public function createFilter();", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'rights', // perform access control for CRUD operations\n\t\t);\n\t}", "public function applyRules(&$data = [])\n {\n $filters = $this->filters;\n return array_walk($data, function (&$item, $key) use (&$data, $filters) {\n $res = true;\n for($i=0; $i<count($filters); $i++){\n $operator = $filters[$i][1];\n $operands = [$data[$key][$i]];\n for($j=2;$j<count($filters[$i]);$j++){\n $operands[] = $filters[$i][$j];\n }\n $this->convertType($operands, $filters[$i][0]);\n switch($operator){\n case '=':\n $res = ($res && ($operands[0] == $operands[1]));\n break;\n case '!=':\n $res = ($data[$filters[$i]] != $operand);\n break;\n case '>':\n $res = ($data[$filters[$i]] > $operand);\n break;\n case '<':\n $res = ($data[$filters[$i]] < $operand);\n break;\n case '>=':\n $res = ($data[$filters[$i]] >= $operand);\n break;\n case '<=':\n $res = ($data[$filters[$i]] <= $operand);\n break;\n case 'between':\n $operands[] = $filters[$i][3];\n $res = (($data[$filters[$i]] >= $operand) && ($data[$filters[$i]] <= $operand2));\n break;\n case 'in':\n\n break;\n }\n if(!$res){\n break;\n }\n }\n (!$res && unset($data[$key]));\n });\n }", "public function rules()\n {\n return [\n 'filter' => 'array',\n 'filter.id' => 'numeric',\n 'filter.base_currency' => 'numeric',\n 'filter.date_from' => 'date',\n 'filter.date' => 'date',\n 'filter.date_to' => 'date',\n 'page' => 'array',\n 'page.number' => 'numeric',\n 'page.size' => 'numeric'\n ];\n }", "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}", "public function rules() {\n\t\treturn [\n\t\t\t'institute_id' => 'sometimes|institute',\n\t\t\t'plan_status' => 'sometimes|in:' . implode(',', $this->planStatus),\n\t\t];\n\t}", "public function rules()\n {\n $rules = [\n 'sort' => 'integer',\n 'required' => 'in:1,2',\n 'show' => 'in:1,2',\n ];\n\n return $rules;\n }", "function _get_filters(){\n $flt = array();\n $filters = array();\n\n if(!isset($_REQUEST['dataflt'])){\n $flt = array();\n }elseif(!is_array($_REQUEST['dataflt'])){\n $flt = (array) $_REQUEST['dataflt'];\n }else{\n $flt = $_REQUEST['dataflt'];\n }\n foreach($flt as $key => $line){\n // we also take the column and filtertype in the key:\n if(!is_numeric($key)) $line = $key.$line;\n $f = $this->_parse_filter($line);\n if(is_array($f)){\n $f['logic'] = 'AND';\n $filters[] = $f;\n }\n }\n return $filters;\n }", "abstract protected function getRules();", "public function paramsFilter(){\n\t\t\t\n\t\t\t$f = [];\n\t\t\t\n\t\t\t// Установка металла\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Металл',\n 'variabled' => 'metall',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$metallList = ['Комбинированное золото','Красное золото','Белое золото','Золочёное серебро','Чернёное серебро'];\n\t\t\t$metallListVals = ['kombinZoloto','krasnZoloto','belZoloto','zoloZoloto','chernZoloto']; \n\t\t\tforeach( $metallList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $metallListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка для кого\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Для кого',\n 'variabled' => 'sex',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$dlaKogo = ['Для женщин','Для мужчин', 'Для женщин, Для мужчин'];\n\t\t\t$dlaKogoVals = ['woman','men', 'unisex']; \n\t\t\tforeach( $dlaKogo as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $dlaKogoVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка размера\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Размер',\n 'variabled' => 'size',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$razmerList = ['2.0','12.0','13.0','13.5','14.0','14.5','15.0','15.5','16.0','16.5','17.0','17.5','18.0','18.5','19.0','19.5','20.0','20.5','21.0','21.5','22.0','22.5','23.0','23.5','24.0','24.5','25.0'];\n\t\t\t$razmerListVals = ['2_0','12_0','13_0','13_5','14_0','14_5','15_0','15_5','16_0','16_5','17_0','17_5','18_0','18_5','19_0','19_5','20_0','20_5','21_0','21_5','22_0','22_5','23_0','23_5','24_0','24_5','25_0']; \n\t\t\tforeach( $razmerList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $razmerListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add; \n\t\t\t\n\t\t\t// Установка вставки\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Вставка',\n 'variabled' => 'kamen',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t]; \n\t\t\t$kamenList = ['Бриллиант','Сапфир','Изумруд','Рубин','Жемчуг','Топаз','Аметист','Гранат','Хризолит','Цитрин','Агат','Кварц','Янтарь','Опал','Фианит'];\n\t\t\t$kamenListVals = ['brilliant','sapfir','izumrud','rubin','jemchug','topaz','ametist','granat','hrizolit','citrin','agat','kvarc','jantar','opal','fianit']; \n\t\t\tforeach( $kamenList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $kamenListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n\t\t\t\n\t\t\t// Установка формы вставки\n\t\t\t$add = [\n 'type' => \"checkbox-group\",\n 'title' => 'Форма вставки',\n 'variabled' => 'forma_vstavki',\n 'impact' => 'filter',\n 'data' => []\n\t\t\t];\t\t\t\n\t\t\t$formaList = ['Кабошон','Круг','Овал','Груша','Маркиз', 'Багет', 'Квадрат', 'Октагон', 'Триллион', 'Сердце', 'Кушон', 'Пятигранник', 'Шестигранник', 'Восьмигранник'];\n\t\t\t$formaListVals = ['Kaboshon','Krug','Oval','Grusha','Markiz', 'Baget', 'Kvadrat', 'Oktagon', 'Trillion', 'Serdtce', 'Kushon', 'Piatigranniq', 'Shestigranniq', 'Vosmigrannic']; \n\t\t\tforeach( $formaList as $k => $v ){\n\t\t\t\t$add['data'][] = [\n 'title' => $v,\n 'variabled' => $formaListVals[$k] \n\t\t\t\t];\n\t\t\t} \n\t\t\t$f[] = $add;\n \n /*\n\t\t\t\techo json_encode( $f );\n\t\t\t*/\n\t\t\techo \"<pre>\";\n\t\t\tprint_r( $f );\n\t\t\techo \"</pre>\";\t\n\t\t\t\n\t\t\t\n \n \n // металл\n \n // для кого\n \n // размер\n \n // Камень\n \n // Форма вставки\n \n \n /*{\"type\":\"checkbox-group\",\"title\":\"Размер\",\"variabled\":\"Razmer\",\"impact\":\"products\",\"data\":[{\"title\":\"2.0\",\"value\":\"\",\"variabled\":\"2_0\"},{\"title\":\"12.0\",\"value\":\"\",\"variabled\":\"12_0\"},{\"title\":\"13.0\",\"value\":\"\",\"variabled\":\"13_0\"},{\"title\":\"13.5\",\"value\":\"\",\"variabled\":\"13_5\"},{\"title\":\"14.0\",\"value\":\"\",\"variabled\":\"14_0\"},{\"title\":\"14.5\",\"value\":\"\",\"variabled\":\"14_5\"},{\"title\":\"15.0\",\"value\":\"\",\"variabled\":\"15_0\"},{\"title\":\"15.5\",\"value\":\"\",\"variabled\":\"15_5\"},{\"title\":\"16.0\",\"value\":\"\",\"variabled\":\"16_0\"}]},\n\t\t\t\t\n\t\t\t\t{\"type\":\"checkbox-group\",\"title\":\"Проба\",\"variabled\":\"Proba\",\"impact\":\"products\",\"data\":[{\"title\":\"585\",\"value\":\"\",\"variabled\":\"proba_585\"},{\"title\":\"925\",\"value\":\"\",\"variabled\":\"proba_925\"}]},\n\t\t\t\t\n\t\t\t{\"type\":\"checkbox-group\",\"title\":\"Металл\",\"variabled\":\"Metall\",\"impact\":\"products\",\"data\":[{\"title\":\"Золото\",\"value\":\"\",\"variabled\":\"met_zoloto\"},{\"title\":\"Серебро\",\"value\":\"\",\"variabled\":\"met_serebro\"}]}*/\n \n\t\t\t/*\n\t\t\t[{\"type\":\"range-values\",\"title\":\"Цена\",\"variabled\":\"Cena\",\"impact\":\"price\",\"data\":[{\"title\":\"Цена от:\",\"value\":\"0\",\"variabled\":\"_ot\"},{\"title\":\"Цена до:\",\"value\":\"900000\",\"variabled\":\"_do\"}]},{\"type\":\"checkbox-group\",\"title\":\"Размер\",\"variabled\":\"Razmer\",\"impact\":\"products\",\"data\":[{\"title\":\"2.0\",\"value\":\"\",\"variabled\":\"2_0\"},{\"title\":\"12.0\",\"value\":\"\",\"variabled\":\"12_0\"},{\"title\":\"13.0\",\"value\":\"\",\"variabled\":\"13_0\"},{\"title\":\"13.5\",\"value\":\"\",\"variabled\":\"13_5\"},{\"title\":\"14.0\",\"value\":\"\",\"variabled\":\"14_0\"},{\"title\":\"14.5\",\"value\":\"\",\"variabled\":\"14_5\"},{\"title\":\"15.0\",\"value\":\"\",\"variabled\":\"15_0\"},{\"title\":\"15.5\",\"value\":\"\",\"variabled\":\"15_5\"},{\"title\":\"16.0\",\"value\":\"\",\"variabled\":\"16_0\"}]},{\"type\":\"checkbox-group\",\"title\":\"Проба\",\"variabled\":\"Proba\",\"impact\":\"products\",\"data\":[{\"title\":\"585\",\"value\":\"\",\"variabled\":\"proba_585\"},{\"title\":\"925\",\"value\":\"\",\"variabled\":\"proba_925\"}]},{\"type\":\"checkbox-group\",\"title\":\"Металл\",\"variabled\":\"Metall\",\"impact\":\"products\",\"data\":[{\"title\":\"Золото\",\"value\":\"\",\"variabled\":\"met_zoloto\"},{\"title\":\"Серебро\",\"value\":\"\",\"variabled\":\"met_serebro\"}]}]*/\n\t\t\t\n\t\t\t\n\t\t}", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract protected function logicFilter($key, $valueK, $op, $v);", "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 readfilter()\n\t{\n\t\t$field = $this->input->post(\"namafield\");\n\t\t$value = $this->input->post(\"valfilter\");\n\n\t\treturn array(\n\t\t\t\t\"field\" => $field,\n\t\t\t\t\"value\" => $value\n\t\t\t);\n\t}", "public function filters()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t'rights', // perform access control for CRUD operations\r\n\t\t);\r\n\t}", "abstract public function prepareFilters();", "public function getFilter() :array;", "private static function _getFilter() {}", "abstract protected function getValidationRules();", "public function rules()\n {\n return [\n 'order_by' => [\n 'array',\n function ($attribute, $value, $fail) {\n if (count(array_diff_key($value, array_flip(self::ALLOWED_FIELDS))) > 0) {\n $fail($attribute . ' contains disallowed field ids.');\n }\n }\n ],\n 'order_by.*' => [\n 'in:asc,desc'\n ],\n 'filter' => [\n 'array',\n function ($attribute, $value, $fail) {\n if (count(array_diff_key($value, array_flip(self::ALLOWED_FILTER_OPERATORS))) > 0) {\n $fail($attribute . ' contains disallowed operator.');\n }\n }\n ],\n 'filter.*' => [\n function ($attribute, $value, $fail) {\n if (count(array_diff_key($value, array_flip(self::ALLOWED_FIELDS))) > 0) {\n $fail($attribute . ' contains disallowed field ids.');\n }\n }\n ],\n 'filter.*.*' => [\n function ($attribute, $value, $fail) {\n if (is_array($value) === false && is_numeric($value) === false) {\n $fail($attribute . ' must be a number or array.');\n }\n }\n ],\n 'filter.*.*.*' => [\n 'numeric'\n ]\n ];\n }", "public function getFilter(){ }", "public function filters(){\r\r\n\t\treturn CMap::mergeArray(parent::filters(),array(\r\r\n\t\t\t\r\r\n\t\t));\r\r\n\t}", "public function filters() {\n\t\treturn array(\n\t\t TRUE => array(array('trim')),\n\t\t);\n\t}", "public function global_filter_field_expr()\n {\n\n // filtering $_GET\n if (is_array(ctx()->getRequest()->get()) && ! empty(ctx()->getRequest()->get()))\n {\n foreach (ctx()->getRequest()->get() as $key => $val){\n $key=$this->_clean_input_keys($key);\n if($key){\n ctx()->getRequest()->get($key, $this->_clean_input_field_expr($val));\n }\n }\n\n }\n\n // filtering $_POST\n if (is_array(ctx()->getRequest()->post()) && ! empty(ctx()->getRequest()->post()))\n {\n foreach (ctx()->getRequest()->post() as $key => $val){\n $key=$this->_clean_input_keys($key);\n if($key){\n ctx()->getRequest()->post($key, $this->_clean_input_field_expr($val));\n }\n }\n }\n\n // filtering $_COOKIE\n if (is_array(ctx()->getRequest()->cookie()) && ! empty(ctx()->getRequest()->cookie()))\n {\n foreach (ctx()->getRequest()->cookie() as $key => $val){\n $key=$this->_clean_input_keys($key);\n if($key){\n ctx()->getRequest()->cookie($key, $this->_clean_input_field_expr($val));\n }\n\n }\n }\n\n\n // filtering $_REQUEST\n if (is_array(ctx()->getRequest()->request()) && ! empty(ctx()->getRequest()->request()))\n {\n foreach (ctx()->getRequest()->request() as $key => $val){\n $key=$this->_clean_input_keys($key);\n if($key){\n ctx()->getRequest()->request($key, $this->_clean_input_field_expr($val));\n }\n }\n }\n\n }", "public function getRules() {}", "public function getRules();", "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 }", "public function rules(): array;", "public function rules(): array;", "function calculate_data() {\n $this->data = $this->get_default_data();\n\n // Get extra icons... send list of filters but don't include exceptions - as we do need the filter list here\n $exceptions = $this->get_filter_exceptions();\n $rest_of_filters = array();\n foreach ($this->filter->_fields as $key => $value) {\n if (!in_array($key,$exceptions)) {\n $rest_of_filters[] = $key;\n }\n }\n // Pass the rest_of_filters array, but then also let the method know this is a special config filter\n $extra_icons = $this->filter->get_sql_filter('',\n $rest_of_filters,\n $this->allow_interactive_filters(),\n $this->allow_configured_filters(),\n '',\n true);\n\n foreach ($this->data as $key => $value) {\n\n //If key is in choices array and not in extra_icons\n if (array_key_exists($key,$this->checkboxes_filter->options['choices']) &&\n !strpos($extra_icons,$key)) {\n // then we need to remove it from $this->data in fact...\n unset($this->data[$key]);\n continue;\n }\n //first step - try getting the item value directly\n $data_item = $this->get_data_item($key);\n\n if ($data_item !== FALSE) {\n $this->data[$key]->value = $data_item;\n } else {\n //backup plan - use SQL query to get the item value\n\n $use_filters = true;\n $sql = $this->get_data_item_sql($key, $use_filters);\n if ($sql !== FALSE) {\n //parse SQL for a WHERE clause\n\n $has_where_clause = php_report::sql_has_where_clause($sql);\n\n $conditional_symbol = 'WHERE';\n\n if($has_where_clause) {\n $conditional_symbol = 'AND';\n }\n\n // apply filters if applicable\n if(!empty($this->filter) && !empty($use_filters)) {\n // Include filter_exceptions here so that our config type filter is not included in the filters added to the final sql\n $sql_filter = $this->filter->get_sql_filter('',\n $this->get_filter_exceptions($key),\n $this->allow_interactive_filters(),\n $this->allow_configured_filters());\n if(!empty($sql_filter)) {\n $sql .= \" {$conditional_symbol} ({$sql_filter})\";\n }\n }\n //obtain field value\n if ($field_data = get_field_sql($sql)) {\n $this->data[$key]->value = $field_data;\n }\n }\n }\n }\n\n }", "protected function getFilter() {\n\t\t$conditions = $this->getConditions();\n\t\treturn $conditions;\n\t}", "private function setFilter()\n\t{\n\t\t// get filter values\n\t\t$this->filter['language'] = ($this->getParameter('language', 'array') != '') ? $this->getParameter('language', 'array') : BL::getWorkingLanguage();\n\t\t$this->filter['application'] = $this->getParameter('application');\n\t\t$this->filter['module'] = $this->getParameter('module');\n\t\t$this->filter['type'] = $this->getParameter('type', 'array');\n\t\t$this->filter['name'] = $this->getParameter('name');\n\t\t$this->filter['value'] = $this->getParameter('value');\n\n\t\t// build query for filter\n\t\t$this->filterQuery = BackendLocaleModel::buildURLQueryByFilter($this->filter);\n\t}", "public function getFilters();", "private function filterFields() {\n\n // Initialize an associate array of our field name and value pairs.\n $values = array();\n\n // Initialize an associate array of our field name and filters pairs.\n $filters = array();\n\n // Populate the arrays.\n foreach ($this->fields as $field) {\n if ($field->getFilters()) {\n $values[$field->getName()] = $field->getValue();\n $filters[$field->getName()] = $field->getFilters();\n }\n }\n\n // Load an instance of GUMP to use to sanitize and filter our field values.\n $gump = new \\GUMP();\n\n // Sanitize the field values.\n $values = $gump->sanitize($values);\n\n // Pass the arrays to GUMP and let it do the heavy-lifting.\n $values = $gump->filter($values, $filters);\n\n // Set the values of all fields to their filtered values.\n foreach ($values as $name => $value) {\n $this->passValue($name, $value);\n }\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function get_values($rule)\n {\n }", "public function filters()\n {\n return [\n \n ];\n }", "public function getFilters(): array;", "public function rules()\n {\n return [\n 'country' => [Rule::in(['Morocco','Cameroon','Uganda','Mozambique','Ethiopia','All'])],\n 'valid' => [Rule::in(['yes','no','all'])]\n ];\n }", "public function saveItemFilters()\n {\n $variables = $this->getAllSubmittedVariablesByName();\n\n $categories = array();\n\n foreach ($variables as $key => $value) {\n if (strstr($key, 'category|') && !empty($value)) {\n $categories[] = $value;\n }\n }\n\n $filter = ItemFilterModel::model()->find('play_id = :playId', array(\n ':playId' => $this->playid\n ));\n $method = 'update';\n\n if (empty($filter)) {\n $filter = new ItemFilterModel();\n $method = 'insert';\n }\n\n $filter->play_id = $this->playid;\n $filter->price_from = $variables['price_from'];\n $filter->price_to = $variables['price_to'];\n $filter->tags = json_encode($this->sessionGet('filter_tags'));\n $filter->categories = json_encode($categories);\n $filter->$method();\n\n if (isset($variables['filter_distance'])) {\n $this->saveVariable('filter_distance', $variables['filter_distance']);\n }\n\n return $filter;\n }", "private function _setupFiltering()\n\t{\n\t\tglobal $txt;\n\n\t\t// We'll escape some strings...\n\t\t$db = database();\n\n\t\t// You can filter by any of the following columns:\n\t\t$filters = array(\n\t\t\t'id_member' => $txt['username'],\n\t\t\t'ip' => $txt['ip_address'],\n\t\t\t'session' => $txt['session'],\n\t\t\t'url' => $txt['error_url'],\n\t\t\t'message' => $txt['error_message'],\n\t\t\t'error_type' => $txt['error_type'],\n\t\t\t'file' => $txt['file'],\n\t\t\t'line' => $txt['line'],\n\t\t);\n\n\t\t$filter = $this->_req->getQuery('filter', 'trim', null);\n\t\t$value = $this->_req->getQuery('value', 'trim', null);\n\n\t\t// Set up the filtering...\n\t\tif (isset($value, $filters[$filter]))\n\t\t{\n\t\t\t$filter = array(\n\t\t\t\t'variable' => $filter,\n\t\t\t\t'value' => array(\n\t\t\t\t\t'sql' => in_array($filter, array('message', 'url', 'file'))\n\t\t\t\t\t\t? base64_decode(strtr($value, array(' ' => '+')))\n\t\t\t\t\t\t: $db->escape_wildcard_string($value),\n\t\t\t\t),\n\t\t\t\t'href' => ['filter' => $filter, 'value' => $value],\n\t\t\t\t'entity' => $filters[$filter]\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (isset($filter, $value))\n\t\t\t{\n\t\t\t\tunset($this->_req->query->filter, $this->_req->query->value);\n\t\t\t}\n\n\t\t\t$filter = [];\n\t\t}\n\n\t\treturn $filter;\n\t}", "protected function processFilters()\n {\n $this->filters = [];\n foreach ($this->params as $key => $value) {\n $this->parser->setAlias('_' . $this->contentType);\n $filter = $this->parser->getFilter($key, $value);\n if ($filter) {\n $this->addFilter($filter);\n }\n }\n }", "protected function preValidate()\n {\n $this->setFilter( preg_quote($this->getFilter()) );\n }", "public function rules(): array\n {\n return [\n 'type' => 'integer|in:' . implode(',', array_keys(Advert::availableParams('type'))),\n 'status' => 'integer|in:' . implode(',', array_keys(UserAdverts::availableParams('status')))\n ];\n }", "public function rules()\n {\n $sale_price = $this->request->get('sale_price', 0);\n \n $rules = [\n 'name' => 'required',\n 'price' => 'required|numeric|min:0',\n 'sale_price' => 'numeric|min:0',\n 'image' => ['regex:'.$this->image_regex],\n 'category_id' => 'required|exists:categories,id',\n 'supplier_id' => 'required|exists:suppliers,id',\n 'unit_id' => 'required|exists:units,id',\n 'sale_unit_id' => ($sale_price > 0 ? 'required_with:sale_price|' : '').'exists:units,id',\n \n 'additional_parameter' => 'exists:parameters,id',\n \n 'nutritional_values.*.id' => 'exists:nutritional_values,id',\n 'nutritional_values.*.value' => 'numeric',\n ];\n \n return $rules;\n }" ]
[ "0.66086787", "0.6507619", "0.6447703", "0.6369883", "0.6359987", "0.63215977", "0.63195574", "0.63150454", "0.6257946", "0.6257946", "0.6257946", "0.62349886", "0.62312895", "0.61983055", "0.6170236", "0.615807", "0.6138033", "0.6134118", "0.60906", "0.6042778", "0.6023637", "0.6018059", "0.5991779", "0.5987494", "0.5964062", "0.5942189", "0.5942189", "0.5941324", "0.5937692", "0.5934188", "0.5925714", "0.59100425", "0.5909321", "0.5905916", "0.59043145", "0.59043145", "0.589942", "0.5895137", "0.58798784", "0.58717173", "0.587054", "0.58634573", "0.58634573", "0.58634573", "0.58634573", "0.58551294", "0.585467", "0.585467", "0.584599", "0.58335155", "0.5829769", "0.5819965", "0.581739", "0.5816567", "0.58105624", "0.58101034", "0.5805131", "0.5797751", "0.57956624", "0.57956564", "0.5794319", "0.5791111", "0.5785433", "0.5785433", "0.5782929", "0.57631654", "0.5755218", "0.5736874", "0.5712308", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5706111", "0.5705503", "0.5689761", "0.5688814", "0.5686359", "0.5680897", "0.56808484", "0.56562203", "0.56555825", "0.56512856" ]
0.66950357
0
This method does the main work of the validation
public static function these($data, $type='', $message='') { $rules = array(); static::$rules = (static::$rules === FALSE) ? Config::get('validaterule') : static::$rules; if(!empty($data)) { //Lets check the type of filter validation $house_filters = array(); if( !empty($type) && is_string($type)){ $type = trim($type); $house_filters[] = $type; } $join_filters = array_merge(static::$filters, $house_filters); $rules = static::workfilter($join_filters); if(!empty($type) && is_array($type)){ if( !empty($rules) ){ $rules += $type; }else{ $rules = $type; } } //We have to reset the static rules property. VERY IMPORTANT LINE static::$rules = FALSE; return ($message == '') ? Validator::make($data, $rules) : Validator::make($data, $rules, $message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function runValidation();", "protected function _validate() {\n\t}", "public abstract function validation();", "public function validation();", "abstract public function validate();", "abstract public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public static function validate() {}", "protected function setupValidation()\n {\n }", "protected function validate()\n {\n }", "protected function performValidation()\n {\n // no required arguments\n }", "protected function localValidation()\n\t\t{\n\t\t}", "protected function prepareValidations() {}", "public function doValidate(){\n if (!is_array($this->getValidates())){\n throw new \\Exception(\"dose this function must call setValidate() function first.\");\n }\n\n foreach($this->getValidates() as $k => $v){\n //$v = (ValidateData)$v;\n if (TextUtils::isEmpty($v->getInput()) && $v->getRequire() == true){\n $v->setResult(false);\n }else{\n $v->setResult(true);\n }\n\n if ($v->getResult() && !TextUtils::isEmpty($v->getInput())){\n switch($v->getValidator()){\n case ValidateData::VALIDATOR_CUSTOM:\n $v->setResult($this->check($v->getInput(),$v->getRegexp()));\n break;\n case ValidateData::VALIDATOR_COMPARE:\n $result = false;\n if (!TextUtils::isEmpty($v->getOperator())){\n switch ($v->getOperator()){\n case ValidateData::OPERATOR_EQUIVALENT:\n $result = $v->getInput() == $v->getTo();\n break;\n case ValidateData::OPERATOR_GREATER:\n $result = $v->getInput() > $v->getTo();\n break;\n case ValidateData::OPERATOR_LESS:\n $result = $v->getInput() < $v->getTo();\n break;\n case ValidateData::OPERATOR_EQUIVALENT_GREATER:\n $result = $v->getInput() >= $v->getTo();\n break;\n case ValidateData::OPERATOR_EQUIVALENT_LESS:\n $result = $v->getInput() <= $v->getTo();\n break;\n case ValidateData::OPERATOR_NOT_EQUIVALENT:\n $result = $v->getInput() != $v->getTo();\n break;\n }\n\n }\n $v->setResult($result);\n break;\n case ValidateData::VALIDATOR_LENGTH:\n $len = mb_strlen($v->getInput(),'UTF-8');\n $v->setResult($len >= $v->getMin());\n if ($v->getMax() > $v->getMin()){\n $v->setResult($len <= $v->getMax() && $len >= $v->getMin());\n }\n\n break;\n\n case ValidateData::VALIDATOR_RANGE:\n $v->setResult((int)$v->getInput() >= $v->getMin());\n if ($v->getMax() > $v->getMin()){\n $v->setResult((int)$v->getInput() <= $v->getMax() && (int)$v->getInput() >= $v->getMin());\n }\n\n break;\n default:\n $v->setResult($this->check($v->getInput(),$this->getValidator($v->getValidator())));\n break;\n }\n }\n }\n return $this->getError();\n }", "public function validate() {\n }", "public function validate() {\n }", "public function validated();", "protected function runValidate()\n {\n Validate::run($this->request);\n }", "public function validate()\n {\n }", "public function validate()\n {\n }", "abstract public function validateData();", "function validate()\n\t{\n\t}", "public function validate()\n {\n // TODO implement this\n }", "private function proccess()\n {\n foreach ($this->validate as $name => $value) {\n $rules = $this->rules[$name];\n \n /* Let's see is this value a required, e.g not empty */\n if (preg_match('~req~', $rules)) {\n if ($this->isEmpty($value)) {\n $this->errors[] = $this->filterName($name) . ' can\\'t be empty, please enter required data.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be integer\n */\n if (preg_match('~int~', $rules)) {\n if (!$this->isInt($value)) {\n $this->errors[] = $this->filterName($name) . ' is not number, please enter number.';\n continue; // We will display only one error per input\n }\n }\n \n /**\n * Let's see is this value needs to be text\n */\n if (preg_match('~text~', $rules)) {\n if (!$this->isText($value)) {\n $this->errors[] = $this->filterName($name) . ' is not text, please enter only letters.';\n continue; // We will display only one error per input\n }\n }\n \n /* This is good input */\n $this->data[$name] = $value;\n }\n }", "protected function _runValidation() {\n\n $this->_forceFail = false;\n\n foreach ($_POST as $inputName => $inputVal) {\n $_POST[$inputName] = trim($_POST[$inputName]);\n\n if (array_key_exists($inputName, $this->_ruleSets)) {\n foreach ($this->_parseRuleString($this->_ruleSets[$inputName]) as $eachRule) {\n $this->_validateRule($inputName, $_POST[$inputName], $eachRule);\n }\n }\n }\n\n if (empty($this->_errorSet) && $this->_forceFail === false) {\n $this->_formSuccess = true;\n }\n return;\n }", "protected function preValidate() {}", "public function validate()\n {\n foreach ( $this->rules as $key => $rules ) {\n foreach ( $rules as $type => $rule ) {\n if ( $this->hasErrors( $key ) )\n break;\n $this->validateRule( $key, $type, $rule );\n }\n }\n }", "public function run() {\n \n foreach( $this->validation_rules as $var=>$opt) {\n \n /*\n $default_opt = [\n 'min' => false,\n 'max' => false,\n 'required' => false,\n ];\n $opt = array_merge($default_opt,$opt);\n */\n \n //if compulsary field is not set then no point validating further\n if(isset($opt['set']) && !$this->is_set($var)) {\n continue;\n } \n \n /* Trim whitespace from beginning and end of variable */\n if( array_key_exists('trim', $opt) ) {\n $this->source[$var] = trim( $this->source[$var] );\n }\n \n $is_required = false;\n \n //if required field is empty then no point validating further\n if( isset($opt['required']) && !$this->not_empty($var) ) {\n continue;\n }\n \n if( isset($opt['required']) ) {\n unset($opt['required']);\n $is_required = true;\n }\n \n if( isset($opt['set']) )\n unset($opt['set']);\n \n if( isset($opt['trim']) )\n unset($opt['trim']);\n \n foreach( $opt as $rule_type=>$rule_val ) {\n $raw_field_value = isset($this->source[$var]) ? $this->source[$var] : false;\n \n /*\n if(is_string($raw_field_value) && strlen($raw_field_value) == 0 && !$is_required)\n continue;\n */\n $result = true;\n if( method_exists($this, 'validate_'.$rule_type) ) {\n $t_params = is_array($rule_val) ? array_merge([$var], $rule_val) : [$var, $rule_val];\n //$result = call_user_func_array([$this, 'validate_'.$rule_type], [$var, $rule_val]);\n $result = call_user_func_array([$this, 'validate_'.$rule_type], $t_params);\n }\n elseif( method_exists($this->caller_obj, $rule_type) ) {\n $t_params = is_array($rule_val) ? array_merge([$this, $raw_field_value], $rule_val) : [$this, $raw_field_value, $rule_val];\n $result = call_user_func_array([$this->caller_obj, $rule_type], $t_params);\n }\n elseif( function_exists($rule_type) ) {\n $t_params = is_array($rule_val) ? array_merge([$this, $raw_field_value], $rule_val) : [$this, $raw_field_value, $rule_val];\n $result = call_user_func_array($rule_type, $t_params);\n }\n \n if($result === false)\n break;\n }\n }\n }", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "public function valid() {}", "private function validate() {\n\t\n\t\t\treturn false;\n\t}", "function validate()\n\t{\n\t\t//echo sizeof($this->arr_validators);\n\t\tfor($i = 0; $i < sizeof($this->arr_validators); $i++)\n\t\t{\n\t\t\t$obj_validator = $this->arr_validators[$i];\n\t\t\t$obj_validator->validate();\n\t\t}\n\t}", "public function validation()\n {\n\n }", "private static function validation()\n {\n $files = ['Validator', 'ValidationResult'];\n $folder = static::$root.'Validation'.'/';\n\n self::call($files, $folder);\n\n //Initiate the validation surface\n Validator::ini();\n }", "abstract function validator();", "abstract public function valid();", "public function valid(){ }", "protected function mainValidation()\n {\n $this->validator->add(\n 'title',\n new StringLength([\n 'max' => 50\n ])\n );\n\n $this->validator->add(\n 'description',\n new StringLength([\n 'max' => 200,\n 'allowEmpty' => true\n ])\n );\n }", "public function validation()\n\t{\n\t\t//\n\t\t\t\n\t\t\t\treturn true;\n\t\t\t\n\t}", "public function valid();", "public function valid();", "public function valid();", "public function valid();", "public function validate_fields() {\n \n\t\t//...\n \n }", "public function validate(): void\n {\n }", "public function validate(): void\n {\n }", "public function validate(): void\n {\n }", "public function validateRules();", "public function Valid();", "public function validate_fields() {\n \n\t\t\n \n\t\t}", "abstract protected function validate(): bool;", "function Validation()\n {\n $validate1 = array(\n 'FIRST_NAME' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'First name could not be blank',\n 'last' => true)\n ),\n \n 'DOB' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Date Of Birth could not be blank',\n 'last' => true)\n ),\n 'FATHER_NAME' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Father Name could not be blank',\n 'last' => true)\n ),\n 'RELIGION' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Religion could not be blank',\n 'last' => true)\n ),\n 'CAST' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Cast could not be blank',\n 'last' => true)\n ),\n 'SUB_CAST' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Sub Cast could not be blank',\n 'last' => true)\n ),\n 'CAST_CAT_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Cast Category',\n 'last' => true)\n ),\n 'CLASS_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Class',\n 'last' => true)\n ),\n 'MEDIUM_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Medium',\n 'last' => true)\n ),\n 'PASSWORD' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Please enter password',\n 'allowEmpty' => true,\n 'on' => 'create',\n 'last' => true),\n 'between' => array(\n 'rule' => array('between', 6, 25),\n 'message' => 'Password between 6 and 25 chars',\n 'required' => false,\n 'allowEmpty' => true,\n ),\n ),\n 'CONFIRM_PASSWORD' => array(\n 'mustMatch' => array(\n 'rule' => array('verifies'),\n 'message' => 'Both passwords must match',\n 'last' => true),\n ),\n 'COUNTRY_ID' => array(\n 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Country',\n 'last' => true)\n ),\n\t\t\t 'GROUP' => array(\n 'mustNotEmpty' => array(\n 'rule' => 'notEmpty',\n 'message' => 'Group could not be blank',\n 'last' => true),\n\t\t\t 'mustNotEmpty' => array(\n 'rule' => array('comparison', '!=', 0),\n 'message' => 'Please select Group',\n 'last' => true)\n \t\t ),\n \n \n \n );\n $this->validate = $validate1;\n return $this->validates();\n }", "abstract function validate(): void;", "private function validate() {\n $this->valid = (1 === count($this->marriages));\n }", "public function validation()\n {\n $this->assertFalse($this->denyValidator->validate(123));\n $this->assertFalse($this->denyValidator->validate('1234'));\n $this->assertFalse($this->denyValidator->validate(true));\n $this->assertFalse($this->denyValidator->validate(null));\n $this->assertFalse($this->denyValidator->validate(new stdClass()));\n }", "public function validate()\n\t{\n\t\t$this->vars['errors'] = $this->validation_errors();\n\t}", "public function valid()\n {\n }", "public function valid()\n {\n }", "public function valid()\n {\n }", "public function valid()\n {\n }", "public function validate()\r\n\t\t{\r\n\t\t\t\r\n\t\t\treturn true;\r\n\r\n\t\t}", "public function validate()\r\n {\r\n //clean out the errors in the errors array\r\n $this->errors = array(); //set it equal to a new empty array to clear the items in the array\r\n\r\n // need find a way to check each property\r\n // lets uses a naming convention that any function that begins with 'validate_'\r\n //will be executed in this method\r\n $methods = get_class_methods($this);\r\n $validationResults = array();\r\n foreach($methods as $func)\r\n {\r\n //see if the function begins with the text 'validate_'\r\n if(strpos($func,'validate_')===0)\r\n {\r\n //call the method with the name stored in the $func variable\r\n $validationResults[] = call_user_func([$this,$func]);\r\n }\r\n }\r\n //check to see if any of the property validation functions returned false\r\n return !in_array(false,$validationResults);\r\n\r\n }", "abstract protected function afterSuccessValidation();", "public function validate() {\r\n // Name - this is required\r\n if ($this->description == '') {\r\n $this->errors[] = 'Description is required';\r\n } \r\n \r\n // Category number - must be a number\r\n if (!is_numeric($this->category)) {\r\n $this->category = 0;\r\n } \r\n \r\n // Item number - must be a number\r\n if (!is_numeric($this->item)) {\r\n $this->item = 0;\r\n } \r\n }", "public function validate()\n\t{\n\t\t$this->errors = [];\n\n\t\t$this->validateConfig();\n\n\t\t// there is no point to continue if config is not valid against the schema\n\t\tif($this->isValid()) {\n\t\t\t$this->validateRepetitions();\n\t\t\t$this->validateMode();\n\t\t\t$this->validateClasses();\n\t\t\t$this->validateTestData();\n\t\t}\n\t}", "public function validate()\n {\n if ($this->amount <= 0) {\n $this->errors[0] = 'Wpisz poprawną kwotę!';\n }\n \n if (!isset($this->payment)) {\n $this->errors[1] = 'Wybierz sposób płatności!';\n }\n \n if (!isset($this->category)) {\n $this->errors[2] = 'Wybierz kategorię!';\n }\n }", "private function checkData(){\n $this->datavalidator->addValidation('article_title','req',$this->text('e10'));\n $this->datavalidator->addValidation('article_title','maxlen=250',$this->text('e11'));\n $this->datavalidator->addValidation('article_prologue','req',$this->text('e12'));\n $this->datavalidator->addValidation('article_prologue','maxlen=3000',$this->text('e13'));\n $this->datavalidator->addValidation('keywords','regexp=/^[^,\\s]{3,}(,? ?[^,\\s]{3,})*$/',$this->text('e32'));\n $this->datavalidator->addValidation('keywords','maxlen=500',$this->text('e33'));\n if($this->data['layout'] != 'g' && $this->data['layout'] != 'h'){ //if article is gallery dont need content\n $this->datavalidator->addValidation('article_content','req',$this->text('e14'));\n }\n $this->datavalidator->addValidation('id_menucategory','req',$this->text('e15'));\n $this->datavalidator->addValidation('id_menucategory','numeric',$this->text('e16'));\n $this->datavalidator->addValidation('layout','req',$this->text('e17'));\n $this->datavalidator->addValidation('layout','maxlen=1',$this->text('e18'));\n if($this->languager->getLangsCount() > 1){\n $this->datavalidator->addValidation('lang','req',$this->text('e19'));\n $this->datavalidator->addValidation('lang','numeric',$this->text('e20'));\n }\n //if user cannot publish articles check publish values\n if($_SESSION[PAGE_SESSIONID]['privileges']['articles'][2] == '1') {\n $this->datavalidator->addValidation('published','req',$this->text('e21'));\n $this->datavalidator->addValidation('published','numeric',$this->text('e22'));\n $this->datavalidator->addValidation('publish_date','req',$this->text('e23'));\n }\n $this->datavalidator->addValidation('topped','req',$this->text('e24'));\n $this->datavalidator->addValidation('topped','numeric',$this->text('e25'));\n $this->datavalidator->addValidation('homepage','req',$this->text('e30'));\n $this->datavalidator->addValidation('homepage','numeric',$this->text('e31'));\n $this->datavalidator->addValidation('showsocials','req',$this->text('e26'));\n $this->datavalidator->addValidation('showsocials','numeric',$this->text('e27'));\n \n $result = $this->datavalidator->ValidateData($this->data);\n if(!$result){\n $errors = $this->datavalidator->GetErrors();\n return array('state'=>'error','data'=> reset($errors));\n }else{\n return true;\n }\n }", "public function validate(): void\n {\n $errors = $this->getErrors();\n $this->throwExceptionIfErrors($errors);\n }", "public function validation()\n {\n $this->validate(new PresenceOf(\n array(\n \"field\" => \"timestamp\",\n \"message\" => \"The field timestamp is required\"\n )\n ));\n\n $this->validate(new Regex(\n array(\n \"field\" => \"ip\",\n \"pattern\" => '/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\z/',\n \"message\" => \"The email must be unique\"\n )\n ));\n\n $this->validate(new Numericality(\n array(\n \"field\" => \"load_threshold\",\n \"message\" => \"The load threshold must be numeric\"\n )\n ));\n\n return $this->validationHasFailed() != true;\n }", "abstract protected function validate($data);", "protected function validate() {\r\n if ($this->getBaseAmount() <= 0)\r\n $this->errors->add(\"The base amount of alicuota must be greater than 0.\");\r\n// \t\t\telse\r\n// \t\t\t{\r\n// \t\t\t\t$relativeError = (($this->getTaxAmount() / $this->getBaseAmount() * 100) - $this->getTaxPercent());\r\n// \t\t\t\t$relativeError = $relativeError / $this->getTaxPercent();\r\n// \t\t\t\t$relativeError = NumberDataTypeHelper::truncate($relativeError, 2);\r\n// \t\t\t\tif (abs($relativeError) > 0.01)\r\n// \t\t\t\t\t$this->errors->add(\"The base and tax amount do not match with the alicuota ({$this->getName()}). Diference: $relativeError\");\r\n// \t\t\t}\r\n }", "public function validate() { return TRUE; }", "function validate(){\n }", "public static function validate()\n\t{\n\t\tself::engine()->validate();\n\t}", "public function Validate() {return true;}", "public function validate() { return true; }", "public function Validate()\n\t{\n\t\t//\n\t\t// Traverse object.\n\t\t//\n\t\tforeach( $this as $condition => $statements )\n\t\t\t$this->_ValidateCondition( $condition, $statements, 0 );\n\t\n\t}", "function validate()\n\t\t{\n\t\t\tif(count($this->validateFields)==0 || !is_array($this->validateFields)){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\t$error\t=\t0;\n\t\t\t\t$fieldPos=1;\n\t\t\t\t//First Validate For Empty on all fields //\n\t\t\t\tforeach($this->validateFields as $key=>$val){\n\t\t\t\t\t\n\t\t\t\t\t$checkedError\t=\t0;\n\t\t\t\t\t$parts\t=\texplode(\"/\",$val);\n\t\t\t\t\t$label\t=\t$parts[0];\n\t\t\t\t\t$valids\t=\texplode(\"|\",$parts[1]);\t\n\t\t\t\t\tif(in_array(\"EMPTY\",$valids) && $checkedError==0){\n\t\t\t\t\t\tif($this->validateEmpty($key)){\n\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t$this->setError(\"Enter Mandatory Fields \");\n\t\t\t\t\t\t\t$checkedError\t=\t1;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$fieldPos++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif($error==0){\n\t\t\t\t\t$fieldPos=1;\n\t\t\t\t\tforeach($this->validateFields as $key=>$val){\n\t\t\t\t\t\n\t\t\t\t\t\t$checkedError\t=\t0;\n\t\t\t\t\t\t$parts\t=\texplode(\"/\",$val);\n\t\t\t\t\t\t$label\t=\t$parts[0];\n\t\t\t\t\t\t$valids\t=\texplode(\"|\",$parts[1]);\t\t\t\t\t\t\n\t\t\t\t\t\tif(in_array(\"EMAIL\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateEmail($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Invalid email id in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\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\tif(in_array(\"NUMBER\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateNumeric($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Enter Numeric in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(in_array(\"FILTER\",$valids)){\n\t\t\t\t\t\t\tif($this->validateSpecial($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Special chars not allowed in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\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(in_array(\"URL\",$valids)){\n\t\t\t\t\t\t\tif(!$this->validateUrl($key) && $checkedError==0 && $error==0){\n\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t$this->setError(\"Invalid website address in field -\".$label.\"-\");\n\t\t\t\t\t\t\t\t$checkedError=1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$fieldPos++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\tif($error==0){\n\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function validateInput()\r\n\t{\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->name) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in name $this->name. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(preg_match('/^[a-zA-Z ]*$/', $this->desg) != 1)\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in designation $this->desg. Only alphabets allowed.<br>\";\r\n\t\t}\r\n\r\n\t\tif(empty($this->addr))\r\n\t\t{\r\n\t\t\t$this->err = true;\r\n\t\t\t$this->errMsgBeg .= \"-> Error in address entered. Please fill correct address field as per gender: Office address for Male user, and Residential address for Female user.<br>\";\t\r\n\t\t}\r\n\r\n\t\tforeach($this->emails as $ele)\r\n\t\t{\r\n\t\t\tif(!filter_var($ele, FILTER_VALIDATE_EMAIL))\r\n\t\t\t{\r\n\t\t\t\t$this->err = true;\r\n\t\t\t\t$this->errMsgBeg .= \"-> Invalid email-id $ele. Enter correctly.<br>\";\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "protected function configureValidations()\n {\n }", "public function validate()\n {\n // query for validation information\n // set the validation flag\n // close database\n }", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}" ]
[ "0.8365654", "0.82158935", "0.8021461", "0.8012373", "0.7952171", "0.7952171", "0.79162204", "0.79162204", "0.79162204", "0.79162204", "0.79162204", "0.79162204", "0.79162204", "0.79162204", "0.79162204", "0.79162204", "0.79162204", "0.79162204", "0.79064405", "0.7774558", "0.77480435", "0.7688002", "0.76183903", "0.75276107", "0.7524985", "0.75071824", "0.75071824", "0.75069666", "0.7401291", "0.73883855", "0.73883855", "0.73836917", "0.7378228", "0.7374194", "0.7350476", "0.7334966", "0.73190385", "0.73187834", "0.7306846", "0.73017", "0.73017", "0.73017", "0.73017", "0.73017", "0.73017", "0.73017", "0.73017", "0.7285911", "0.7283471", "0.7258964", "0.7253064", "0.7243567", "0.7229783", "0.71735156", "0.7172531", "0.7114585", "0.70953786", "0.70953786", "0.70953786", "0.70953786", "0.7093062", "0.70760506", "0.70760506", "0.70760506", "0.7062684", "0.7054746", "0.7047956", "0.70474434", "0.7041752", "0.7032037", "0.7021788", "0.7018528", "0.70180583", "0.69942135", "0.69942135", "0.69942135", "0.69942135", "0.69839644", "0.6982485", "0.69814", "0.6941325", "0.6925631", "0.6920156", "0.6917905", "0.690522", "0.6900638", "0.6887983", "0.68846154", "0.68812186", "0.68811506", "0.685576", "0.6840849", "0.68320674", "0.68026453", "0.67851114", "0.6781097", "0.6780855", "0.6773798", "0.6770911", "0.6770896", "0.6770896" ]
0.0
-1
Array of validation filters from these()
private static function workfilter($break) { $rules = array(); foreach($break as $key){ $rules += static::common_filter_function(trim($key)); } return $rules; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function filters()\n {\n $filters = [];\n $filters['name'] = ['trim', 'empty_string_to_null', 'capitalize'];\n $filters['email'] = ['trim', 'empty_string_to_null', 'lowercase'];\n return $filters;\n }", "public function filters()\n {\n return array(\n 'value' => array(\n array(array($this, 'check_for_array_or_object')),\n )\n );\n }", "abstract protected function getFilters();", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'amount' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t),\n\t\t\t'price' => array(\n\t\t\t\tarray('Num::filter_number')\n\t\t\t)\n\t\t);\n\t}", "public function filters(){\r\r\n\t\treturn CMap::mergeArray(parent::filters(),array(\r\r\n\t\t\t\r\r\n\t\t));\r\r\n\t}", "public function getFilters()\n {\n return array();\n }", "public function allowedFilters()\n {\n return [];\n }", "public function rules()\n {\n return [\n 'order_by' => [\n 'array',\n function ($attribute, $value, $fail) {\n if (count(array_diff_key($value, array_flip(self::ALLOWED_FIELDS))) > 0) {\n $fail($attribute . ' contains disallowed field ids.');\n }\n }\n ],\n 'order_by.*' => [\n 'in:asc,desc'\n ],\n 'filter' => [\n 'array',\n function ($attribute, $value, $fail) {\n if (count(array_diff_key($value, array_flip(self::ALLOWED_FILTER_OPERATORS))) > 0) {\n $fail($attribute . ' contains disallowed operator.');\n }\n }\n ],\n 'filter.*' => [\n function ($attribute, $value, $fail) {\n if (count(array_diff_key($value, array_flip(self::ALLOWED_FIELDS))) > 0) {\n $fail($attribute . ' contains disallowed field ids.');\n }\n }\n ],\n 'filter.*.*' => [\n function ($attribute, $value, $fail) {\n if (is_array($value) === false && is_numeric($value) === false) {\n $fail($attribute . ' must be a number or array.');\n }\n }\n ],\n 'filter.*.*.*' => [\n 'numeric'\n ]\n ];\n }", "public function filters()\n {\n return [\n \n ];\n }", "public function getFilters(): array;", "public function & GetFilters () {\n\t\t$filters = [];\n\t\tforeach ($this->filters as $direction => $handler) \n\t\t\t$filters[$direction] = $handler[1];\n\t\treturn $filters;\n\t}", "public function rules() : array\n {\n return [\n 'limit' => 'integer',\n 'offset' => 'integer',\n 'order_by' => 'array',\n 'order_by_dir' => 'in:DESC,ASC',\n 'filter' => 'array',\n 'filter.user' => 'string|max:18',\n 'filter.custom' => 'boolean',\n 'filter.available' => 'boolean',\n ];\n }", "protected function filters(): array\n {\n return $this->filters;\n }", "public function filters() : array\n {\n return [\n 'password' => [\n [[Auth::instance(), 'hash']]\n ]\n ];\n }", "public function filters(): array\n {\n return [\n WhereIdIn::make($this),\n WhereIn::make('namespace')->delimiter(','),\n WhereIn::make('slug'),\n ];\n }", "public function getFilters();", "public static function validators() {\n return [\n 'status' => 'validateStatus',\n 'quota' => 'validateQuota'\n ];\n }", "public function filters()\n {\n $filters = array(\n 'postOnly + delete',\n );\n\n return CMap::mergeArray($filters, parent::filters());\n }", "public function filters()\n {\n $filters = array(\n 'postOnly + delete',\n );\n\n return CMap::mergeArray($filters, parent::filters());\n }", "function _get_filters(){\n $flt = array();\n $filters = array();\n\n if(!isset($_REQUEST['dataflt'])){\n $flt = array();\n }elseif(!is_array($_REQUEST['dataflt'])){\n $flt = (array) $_REQUEST['dataflt'];\n }else{\n $flt = $_REQUEST['dataflt'];\n }\n foreach($flt as $key => $line){\n // we also take the column and filtertype in the key:\n if(!is_numeric($key)) $line = $key.$line;\n $f = $this->_parse_filter($line);\n if(is_array($f)){\n $f['logic'] = 'AND';\n $filters[] = $f;\n }\n }\n return $filters;\n }", "public static function validators() {\n return [\n 'status' => 'validateStatus',\n 'time' => 'validateTime'\n ];\n }", "public function getFilters(): array\n {\n return $this->request->only($this->filters);\n }", "public function getFilters(): array;", "public function getValidators();", "public function getValidators();", "public function getValidators();", "public function rules() : array\n {\n return [\n 'limit' => 'integer',\n 'offset' => 'integer',\n 'order_by_dir' => 'in:DESC,ASC',\n 'filter' => 'array',\n 'filter.available' => 'boolean'\n ];\n }", "public function getValidationRules(): array\n {\n if ($this->validatorForEach) {\n return [\n new ParameterValidationRule(Validator::callback(function ($value) {\n $items = UnpackCSV::un($value, $this->separator);\n return Validator::each($this->validatorForEach->getValidator())->validate($items);\n }), $this->validatorForEach->getDescription())\n ];\n } else {\n return [];\n }\n }", "private static function getRules() {\n return [\n 'imeArtikla' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'cenaArtikla' => FILTER_VALIDATE_FLOAT,\n 'opisArtikla' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'kategorijaArtikla' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'zalogaArtikla' => FILTER_VALIDATE_FLOAT,\n \n /*'year' => [\n 'filter' => FILTER_VALIDATE_INT,\n 'options' => [\n 'min_range' => 1800,\n 'max_range' => date(\"Y\")\n ]\n ]*/\n ];\n \n }", "public function getValidators()\n\t{\n\t\treturn array();\n\t}", "public function getFilters(): array\n {\n return [];\n }", "abstract public function filters();", "abstract protected function getAdditionalValidators(): array;", "public function getValidators()\n {\n $validators = parent::getValidators();\n if ($this->internalValue != null) {\n if ($this->internalMultiSelect) {\n // field may contain more than one value\n $validators[] = new CsvListValidator(array('message' => $this->internalValidationMessage,\n 'domain'=>array_keys($this->internalOptionList)));\n } else {\n // single value selection\n $validators[] = new InclusionIn(array('message' => $this->internalValidationMessage,\n 'domain'=>array_keys($this->internalOptionList)));\n }\n }\n return $validators;\n }", "public static function getRules() {\n return [\n 'title' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'author' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'description' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'price' => FILTER_VALIDATE_FLOAT,\n 'year' => [\n 'filter' => FILTER_VALIDATE_INT,\n 'options' => [\n 'min_range' => 1800,\n 'max_range' => date(\"Y\")\n ]\n ]\n ];\n }", "protected function getFilteredInput(): array\n {\n return (new Filter($this->getParams(), [\n Lines::_HSRC => FILTER_SANITIZE_STRING,\n Stations::_NAME => FILTER_SANITIZE_STRING,\n self::_LIMIT => FILTER_SANITIZE_NUMBER_INT,\n self::_PAGE => FILTER_SANITIZE_NUMBER_INT,\n ]))->process()->toArray();\n }", "public function getFilters()\n {\n return array_filter($this->request->only($this->filters));\n }", "public function rules()\n\t{\n\t\t$defaults = array();\n\t\t$toggles = array();\n\t\t$custom = array();\n\t\t$required = array();\n\n\t\tforeach($this->searchFields as $field=>$data)\n\t\t{\n\t\t\t$type = $this->getSearchFieldType($field);\n\t\t\tif ($type == 'toggle')\n\t\t\t\t$toggles[] = $field;\n\t\t\telseif ($type == 'required')\n\t\t\t\t$required[] = $field;\n\t\t\telseif (empty($data['rule']) || !is_array($data['rule']))\n\t\t\t\t$defaults[] = $field;\n\n\t\t\tif (isset($data['rule']) && is_array($data['rule']))\n\t\t\t\t$custom[] = $data['rule'];\n\t\t}\n\n\t\treturn array_merge(array(\n\t\t\tarray(implode(', ', $required), 'required'),\n\t\t\tarray(implode(', ', $toggles), 'in', 'range' => array('Y','N','I')),\n\t\t\tarray(implode(', ', $defaults), 'length', 'max'=>200)\n\t\t), $custom);\n\t}", "public function getFilter() :array;", "public function rules()\n\t{\n\t\treturn [\n\t\t\t'by' => [\n\t\t\t\t'required',\n\t\t\t\tRule::in(array_keys(config('filter.by'))),\n\t\t\t],\n\t\t\t'tech' => [\n\t\t\t\t'required_if:by,node',\n\t\t\t\t'required_if:by,province',\n\t\t\t\t'required_if:by,zone',\n\t\t\t\tRule::in($this->getArrayFrom('technologies'))\n\t\t\t],\n\t\t\t'vendor' => [\n\t\t\t\t'required_if:by,province',\n\t\t\t\t'required_if:by,zone',\n\t\t\t\tRule::in($this->getArrayFrom('vendor'))\n\t\t\t],\n\t\t\t'end_date' => [\n\t\t\t\t'required',\n\t\t\t\t'date_format:\"Y-m-d H:i\"',\n\t\t\t],\n\t\t\t'for' => [\n\t\t\t\t'required',\n\t\t\t\tRule::in(array_keys(config('filter.for')))\n\t\t\t],\n\t\t\t'resolution' => [\n\t\t\t\t'required',\n\t\t\t\tRule::in($this->getResolutions(request()->get('for'))),\n\t\t\t],\n\t\t\t'zone' => [\n\t\t\t\t'required_if:by,zone',\n\t\t\t\tRule::in(array_pluck(config('filter.zones'), 'value'))\n\t\t\t],\n\t\t\t'zone_aggregate' => [\n\t\t\t\t'required_if:by,zone',\n\t\t\t\tRule::in($this->getAggregates())\n\t\t\t],\n\t\t\t'values' => [\n\t\t\t\t'required_unless:by,zone',\n\t\t\t]\n\t\t];\n\t}", "public function filters()\n {\n return [\n \"info.gravatar\" => \"trim|cast:boolean\",\n \"info.first_name\" => \"trim|strip_tags|cast:string\",\n \"info.last_name\" => \"trim|strip_tags|cast:string\",\n \"info.gender\" => \"trim|strip_tags|cast:string\",\n \"info.birthday\" => \"trim|strip_tags|cast:string\",\n \"info.mobile_phone\" => \"trim|strip_tags|cast:string\",\n \"info.address\" => \"trim|strip_tags|cast:string\",\n \"info.city\" => \"trim|strip_tags|cast:string\",\n \"info.country\" => \"trim|strip_tags|cast:string\",\n\n \"info.username\" => \"trim|strip_tags|cast:string\",\n \"info.displayname\" => \"trim|strip_tags|cast:string\",\n \"info.email\" => \"trim|strip_tags|cast:string\",\n \"info.password\" => \"trim|strip_tags|cast:string\",\n\n \"action\" => \"trim|strip_tags|cast:string\",\n \"_token\" => \"trim|strip_tags|cast:string\",\n \"_method\" => \"trim|strip_tags|cast:string\"\n ];\n }", "public function validationProvider() {\n return [\n [['path' => 'some_field', 'value' => 'some_value'], NULL],\n [\n ['path' => 'some_field', 'value' => 'some_value', 'operator' => '='],\n NULL,\n ],\n [['path' => 'some_field', 'operator' => 'IS NULL'], NULL],\n [['path' => 'some_field', 'operator' => 'IS NOT NULL'], NULL],\n [\n ['path' => 'some_field', 'operator' => 'IS', 'value' => 'some_value'],\n new BadRequestHttpException(\"The 'IS' operator is not allowed in a filter parameter.\"),\n ],\n [\n [\n 'path' => 'some_field',\n 'operator' => 'NOT_ALLOWED',\n 'value' => 'some_value',\n ],\n new BadRequestHttpException(\"The 'NOT_ALLOWED' operator is not allowed in a filter parameter.\"),\n ],\n [\n [\n 'path' => 'some_field',\n 'operator' => 'IS NULL',\n 'value' => 'should_not_be_here',\n ],\n new BadRequestHttpException(\"Filters using the 'IS NULL' operator should not provide a value.\"),\n ],\n [\n [\n 'path' => 'some_field',\n 'operator' => 'IS NOT NULL',\n 'value' => 'should_not_be_here',\n ],\n new BadRequestHttpException(\"Filters using the 'IS NOT NULL' operator should not provide a value.\"),\n ],\n [\n ['path' => 'path_only'],\n new BadRequestHttpException(\"Filter parameter is missing a '\" . EntityCondition::VALUE_KEY . \"' key.\"),\n ],\n [\n ['value' => 'value_only'],\n new BadRequestHttpException(\"Filter parameter is missing a '\" . EntityCondition::PATH_KEY . \"' key.\"),\n ],\n ];\n }", "public static function getUiFilterFields()\n\t{\n\t\treturn array();\n\t}", "public function filters()\n {\n return array(\n 'accessControl', /// perform access control for CRUD operations\n array(\n 'application.filters.UserLoginFilter + index, AdminPositionCode, CrearPosition ',/*cuando no estas logeado*/\n ),\n array(\n 'application.filters.UserUpdateFilter + index, AdminPositionCode, CrearPosition',\n )\n );\n }", "public function getFilters(): array\n {\n return $this->filters;\n }", "public static function GET_FILTER(): array\n\t{\n\t\treturn self::$filters;\n\t}", "public function filters() {\n\t\treturn array(\n\t\t\t'accessControl',\n\t\t);\n\t}", "protected function get_filters() {\n $langautoass = get_string('auto_assign', 'local_elisprogram');\n $filters = array(\n new deepsight_filter_usersetuser_autoassigned($this->DB, 'autoass', $langautoass, array(), $this->endpoint)\n );\n $filters = array_merge(parent::get_filters(), $filters);\n return $filters;\n }", "public function getValidators() {}", "public function getFilters()\n {\n if (empty($this->filters)) {\n $this->filters = [\n new Filter\\LicenceType(),\n new Filter\\LicenceStatus(),\n new Filter\\LicenceTrafficArea(),\n new Filter\\EntityType(),\n new Filter\\GoodsOrPsv(),\n ];\n }\n\n return $this->filters;\n }", "private function filters() {\n\n\n\t}", "public static function validators() {\n return [\n 'application_id' => 'validateApplicationId',\n 'is_default' => 'validateIsDefault',\n 'role' => 'validateRole',\n 'type' => 'validateType',\n '_issues' => 'validateIssues'\n ];\n }", "public function filters()\n {\n return [\n 'first_name' => 'trim|escape',\n 'last_name' => 'trim|escape',\n 'email_address' => 'trim|escape',\n 'message' => 'trim|escape',\n 'business_name' => 'trim|escape'\n ];\n }", "public function getFilters()\n {\n return array_merge(parent::getFilters(), array(\n 'date' => new \\Twig_Filter_Function('ionic_date'),\n 'relativedate' => new \\Twig_Filter_Function('ionic_date_rel'),\n 'specialdate' => new \\Twig_Filter_Function('ionic_date_special'),\n 'url' => new \\Twig_Filter_Function('url'),\n 'nl2br_noescape' => new \\Twig_Filter_Function('nl2br'),\n 'limit' => new \\Twig_Filter_Function('Str::limit'),\n 'md5' => new \\Twig_Filter_Function('md5'),\n 'addslashes' => new \\Twig_Filter_Function('addslashes')\n ));\n }", "public function getFilters() {\n\t\treturn array(\n\t\t\tnew Twig_SimpleFilter('trans', '__'),\n\t\t\tnew Twig_SimpleFilter('c', '__c'),\n\t\t\tnew Twig_SimpleFilter('d', '__d'),\n\t\t\tnew Twig_SimpleFilter('dc', '__dc'),\n\t\t\tnew Twig_SimpleFilter('n', '__n')\n\t\t);\n\t}", "public static function validators() {\n return [\n 'tenant_id' => 'validateTenantId',\n 'expires_in' => 'validateExpiresIn',\n 'scopes' => 'validateScopes'\n ];\n }", "public function rules()\n {\n return [\n 'filter' => 'array',\n 'filter.id' => 'numeric',\n 'filter.base_currency' => 'numeric',\n 'filter.date_from' => 'date',\n 'filter.date' => 'date',\n 'filter.date_to' => 'date',\n 'page' => 'array',\n 'page.number' => 'numeric',\n 'page.size' => 'numeric'\n ];\n }", "public function getFilters() : array\n {\n return $this->getLoader()->getFilters();\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public function getFilters()\n {\n $filters = array(\n new Twig_SimpleFilter('age', 'twig_age_filter'),\n );\n\n return $filters;\n }", "public function getValidationRules()\n {\n return [];\n }", "function getValidators() {\n $extra_validators = array();\n \n foreach ($this->_widgets as $oWidget) {\n $res = $oWidget->getValidators();\n \n if (!is_null($res)) {\n if (is_array($res)) {\n $extra_validators = kt_array_merge($extra_validators, $res);\n } else {\n $extra_validators[] = $res;\n }\n }\n }\n \n $oVF =& KTValidatorFactory::getSingleton(); \n return array($oVF->get('ktcore.validators.fieldset', array(\n 'test' => $this->sBasename, \n 'validators' => &$extra_validators,\n )));\n }", "public function getFilters ()\n {\n $filters = [];\n\n return $filters;\n }", "public function getFilters()\n {\n if (empty($this->filters)) {\n $this->filters = [\n new Filter\\AddressType(),\n new Filter\\AddressComplaint(),\n new Filter\\AddressOpposition(),\n new Filter\\LicenceStatus(),\n new Filter\\ApplicationStatus(),\n new Filter\\AddressConditionUndertaking(),\n new Filter\\GoodsOrPsv(),\n ];\n }\n\n return $this->filters;\n }", "public function getFilters() \n {\n return $this->filters;\n }", "public static function getFilterableFields(): array\n {\n return ['name', 'accessCode'];\n }", "public function getInputFilterSpecification()\n {\n return\n [\n 'interpreter_id' => [\n 'name' => 'interpreter_id',\n 'required' => true,\n 'allow_empty' => false,\n 'validators' => [\n ['name' => 'Digits'],\n ],\n ],\n 'event_id' => [\n 'name' => 'event_id',\n 'required' => true,\n 'allow_empty' => true,\n 'validators' => [\n ['name' => 'Digits'],\n ],\n ],\n 'index' => [\n 'name' => 'index',\n 'required' => true,\n 'allow_empty' => false,\n 'validators' => [\n ['name' => 'Digits'],\n ]\n ],\n 'name' => [\n 'name' => 'name',\n 'required' => false,\n 'allow_empty' => true,\n 'validators' => [\n [ 'name' => 'StringLength',\n 'options' => [\n 'max' => 152,\n 'min' => 5,\n ],\n ],\n ],\n ],\n ];\n }", "public function getFilters() {\n\t\treturn array(\n\t\t\t'size' => new Twig_Filter_Function('Cake_Number_Filters::size'),\n\t\t\t'pct' => new Twig_Filter_Function('Cake_Number_Filters::percentage'),\n\t\t\t'curr' => new Twig_Filter_Function('Cake_Number_Filters::currency'),\n\t\t\t'p' => new Twig_Filter_Function('Cake_Number_Filters::precision'),\n\t\t);\n\t}", "public function rules()\n {\n return [\n 'country' => [Rule::in(['Morocco','Cameroon','Uganda','Mozambique','Ethiopia','All'])],\n 'valid' => [Rule::in(['yes','no','all'])]\n ];\n }", "public function rules()\n {\n return [\n 'name' => '',\n 'email' => 'email',\n 'given_name' => '',\n 'family_name' => '',\n 'birthday' => 'date',\n 'gender' => 'in:'.implode(',', User::GENDERS),\n ];\n }", "public function rules()\n {\n return [\n ['filterTypeId', 'numerical', 'min'=>1, 'max'=>999],\n ['filterId', 'numerical', 'min'=>1, 'max'=>9999],\n ];\n }", "public function getApplicableFilters()\n\t{\n\t\t$filters = App::getEntityRepository('DeskPRO:TicketFilter')->getAll();\n\t\t$filters_apply = array();\n\n\t\t$this->logMessage(\"Filters to check: \" . count($filters));\n\n\t\t$changed_fields = $this->getChangedFields();\n\t\t$new_messages = $this->tracker->getChangedProperty('messages') ? true : false;\n\n\t\t$hidden_changed = false;\n\t\tif (in_array('ticket.hidden_status', $changed_fields)) {\n\t\t\t$hidden_changed = true;\n\t\t}\n\n\t\tforeach ($filters as $filter) {\n\t\t\tif ($new_messages || $hidden_changed || $filter->getSearcher()->hasAnyAffectedFields($changed_fields)) {\n\t\t\t\t$filters_apply[] = $filter;\n\t\t\t}\n\t\t}\n\n\t\t$this->logMessage(\"Passed filters: \" . count($filters_apply));\n\n\t\treturn $filters_apply;\n\t}", "public function filters() {\n\t\treturn array(\n\t\t TRUE => array(array('trim')),\n\t\t);\n\t}", "public function filters()\n\t{\n\t\treturn array(\n\t\t\t'rights', // perform access control for CRUD operations\n\t\t);\n\t}", "public function rules()\n {\n $rules = [\n 'sort' => 'integer',\n 'required' => 'in:1,2',\n 'show' => 'in:1,2',\n ];\n\n return $rules;\n }", "public static function getFilterType() {\n return array(\n self::RG_FILTER_TYPE_DROPDN => Yii::t('RgdesignerModule.rgattr', 'DropDown List'),\n self::RG_FILTER_TYPE_TEXTINP => Yii::t('RgdesignerModule.rgattr', 'Text filter'),\n self::RG_FILTER_TYPE_NONE => Yii::t('RgdesignerModule.rgattr', 'Not specified'),\n );\n }", "public function rules()\n {\n $rules = [\n 'vertices' => 'required|array|min:2',\n 'buffer' => 'required|numeric|min:1|max:100000', // think radius but for a line (meters)\n ];\n\n $rules = array_merge($rules, $this->getFilterRules());\n $rules = array_merge($rules, $this->arrayFieldRules('vertices', 'required|geopoint'));\n\n return $rules;\n }", "public static function filter($rules)\n\t{ \n\t\tstatic::$filters[] = $rules;\n\t}", "public function getFilters()\r\n {\r\n return $this->filters;\r\n }", "public function filters()\n\t{\n \treturn array(\n \t\t'accessControl'\n\t\t);\n\t}", "public function getFilters (): array\n\t{\n\t\treturn [\n\t\t\t\"itemName\" => \"itemName\"\n\t\t];\n\t}", "public function getFilters()\n {\n $filters = [];\n\n $filters[] = new \\Twig_Filter('date_format', [$this, 'filterDateFormat']);\n $filters[] = new \\Twig_Filter('truncate', 'b_truncate');\n $filters[] = new \\Twig_Filter('nl2p', 'b_nl2p', ['is_safe' => ['html']]);\n $filters[] = new \\Twig_Filter('human_file_size', 'b_human_file_size');\n $filters[] = new \\Twig_Filter('json_decode', 'json_decode');\n\n return $filters;\n }", "public function getFilters()\n {\n return [\n new \\Twig_SimpleFilter('getBarMsgs', [$this, 'getRedisMsgs']),\n new \\Twig_SimpleFilter('json_decode', [$this, 'jsonDecode']),\n new \\Twig_SimpleFilter('routeExists', [$this, 'routeExists'])\n ];\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function getFilterParameters(): array;", "public function filters() {\n\t\treturn array(\n\t\t 'name' => array(array('trim')),\n\t\t);\n\t}", "public function fieldValidationArray()\n {\n return [\n 'name' => 'required|codename|min:2|max:255',\n 'label' => 'string',\n 'description' => 'string',\n 'required' => 'boolean',\n 'mode' => 'string|in:prefer_local,prefer_external,only_local,only_external',\n 'script' => 'string'\n ];\n }", "protected function getFilterable()\n {\n return [];\n }", "public function getFilters() \r\n\t{\r\n\t\treturn $this->_filters;\r\n\t}", "public function rules()\n {\n return [\n 'limit' => ['sometimes', 'numeric', 'min:1', 'max:500'],\n 'filter' => ['sometimes', 'in:asc,desc'],\n 'sort_by' => ['sometimes', new InTableColumnsRule(with(new Product())->getTable())]\n ];\n }", "private function defineFilters() {\n\n // init local filters variable as empty array\n $filters = [];\n\n // parse each filter to apply\n // and add the valid once to filters\n\n // filters by name\n if (isset($_GET['s'])) {\n\n $filters['name'] = $_GET['s'];\n\n }\n\n // filter by categories\n if (isset($_GET['c'])) {\n\n $categories = explode(\"_\", $_GET['c']);\n foreach ($categories as $key => $value) {\n if (is_numeric($value)) {\n $filters['categories'][] = $value;\n }\n }\n\n }\n\n // filter by areas\n if (isset($_GET['a'])) {\n\n $areas = explode(\"_\", $_GET['a']);\n foreach ($areas as $key => $value) {\n if (is_numeric($value)) {\n $filters['areas'][] = $value;\n }\n }\n\n }\n\n // Check if any filter has been set\n\n if (count($filters)>0) {\n\n $this->filters = $filters;\n return true;\n\n }\n\n\n return false;\n\n }", "public function getFilters()\n {\n $filters = [];\n\n return $filters;\n }", "public function getFilters()\n\t{\n\t\treturn array(\n\t\t\tnew \\Twig_SimpleFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)),\n\t\t\t// @deprecated 3.2.0 Uses twig's JS escape method instead of addslashes\n\t\t\tnew \\Twig_SimpleFilter('addslashes', 'addslashes'),\n\t\t);\n\t}", "public function getFilters()\r\n {\r\n\r\n return array(new \\Twig_SimpleFilter('montantTva', array($this, 'montantTva')));\r\n }", "public function filters()\r\n\t{\r\n\t\treturn array(\r\n\t\t\t'rights', // perform access control for CRUD operations\r\n\t\t);\r\n\t}", "public function getFilter(): array\n {\n return $this->filter;\n }", "public function getFilter(): array\n {\n return $this->filter;\n }", "function get_filters($init_data = true) {\n //no filters by default\n return array();\n }", "private function firmRules()\n {\n return [\n 'country' => 'required_with_all:region,city|required_if:status,Enable',\n 'region' => 'required_with_all:country,city',\n 'city' => 'required_with_all:country,region',\n 'address' => 'nullable|string|between:0,255',\n 'status' => 'required|integer',\n ];\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}" ]
[ "0.7110237", "0.7044571", "0.6867282", "0.6866568", "0.6751181", "0.6749878", "0.6742077", "0.6700555", "0.6688895", "0.6685439", "0.66606724", "0.6619742", "0.6615641", "0.6606403", "0.6602754", "0.6562738", "0.6517233", "0.6516824", "0.6516824", "0.65137947", "0.65105283", "0.6501698", "0.6498335", "0.6493616", "0.6493616", "0.6493616", "0.648634", "0.6452834", "0.6448476", "0.64382297", "0.64305204", "0.64189076", "0.64113003", "0.6398741", "0.6387826", "0.6376242", "0.6358055", "0.6336007", "0.63337123", "0.6332079", "0.6325254", "0.6317426", "0.6300868", "0.62858635", "0.6285377", "0.6279248", "0.62693876", "0.6247108", "0.6246806", "0.62434596", "0.6241612", "0.6240428", "0.62378556", "0.6234035", "0.6214375", "0.62118816", "0.6206618", "0.6196817", "0.61876005", "0.61763775", "0.6167194", "0.61633664", "0.6162131", "0.6142835", "0.6138577", "0.6137456", "0.61298895", "0.61188954", "0.6099053", "0.60980296", "0.6096568", "0.6092145", "0.6082999", "0.6081369", "0.6078681", "0.6078268", "0.6069606", "0.6054435", "0.60526425", "0.60488814", "0.60476416", "0.6047047", "0.60427696", "0.604274", "0.6039754", "0.6039247", "0.6036108", "0.6032103", "0.60289705", "0.60205716", "0.6016932", "0.6016633", "0.6009948", "0.60079813", "0.60050416", "0.6001271", "0.59998417", "0.59998417", "0.5996806", "0.5989145", "0.59862715" ]
0.0
-1
Get the default template components.
public function getDefaultTemplateComponents() : array { $components = []; /** @var \Drupal\Core\Entity\EntityFieldManagerInterface $field_manager */ $field_manager = \Drupal::service('entity_field.manager'); foreach ($field_manager->getFieldDefinitions('task', 'task') as $name => $definition) { if ( !$definition->isRequired() || $definition->isReadOnly() || $definition->isComputed() || ($name === 'job') ) { continue; } $components[$name] = [ 'id' => 'field.widget_input:task.' . $name, 'uuid' => $name, ]; } $components['start'] = [ 'id' => 'field.data_select:task.start', 'uuid' => 'start', 'selector' => 'current_date', ]; $components['due'] = [ 'id' => 'field.data_select:task.due', 'uuid' => 'due', 'selector' => 'current_date | date_add(1 day)', ]; if ($this->getJob() && ($definitions = $this->getJob()->getContextDefinitions())) { foreach ($definitions as $key => $definition) { $components["context:{$key}"] = [ 'id' => 'task_context.data_select', 'task_context' => $key, 'uuid' => "context:{$key}", ]; } } $trigger = $this->getTrigger(); \Drupal::moduleHandler()->alter( 'task_job_trigger_default_template_components', $components, $trigger, ); return $components; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getDefaultComponents()\n {\n return [\n new THead,\n new TFoot\n ];\n }", "function defaultTemplate(){\n $this->addLocations(); // add addon files to pathfinder\n return array($this->template_file);\n }", "function defaultTemplate() {\n\t\t$l = $this->api->locate('addons',__NAMESPACE__,'location');\n\t\t$addon_location = $this->api->locate('addons',__NAMESPACE__);\n\t\t$this->api->pathfinder->addLocation($addon_location,array(\n\t\t\t//'js'=>'templates/js',\n\t\t\t//'css'=>'templates/css',\n //'template'=>'templates',\n\t\t))->setParent($l);\n\n //return array('view/lister/tags');\n return parent::defaultTemplate();\n }", "public function renderDefault() {\n\t\t$this->onlyForAdmins();\n\t\t$this->template->instances = $this->configManager->getInstances($this->fileName);\n\t}", "function templates()\n {\n return [];\n }", "protected function registerDefaultComponents() {\n\n\t\t$components = [\n\t\t\tBlock::class,\n\t\t\tEditor::class,\n\t\t\tIntegration::class\n\t\t];\n\n\t\tforeach ( $components as $component ) {\n\t\t\t$this->registerComponent( $component );\n\t\t}\n\t}", "protected function getDefaultTemplate()\n {\n return 'modules/XCExample/Recommendations/recommendation/body.twig';\n }", "protected function getDefaultTemplate()\n {\n return 'modules/XC/Velocity/payment.tpl';\n }", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate();", "public function getTemplate() {}", "protected function getDefaultTemplate()\n {\n return 'modules/CDev/FileAttachments/product.twig';\n }", "protected function template()\n\t{\n\t\treturn Phpfox::getLib('template');\t\n\t}", "function get_default_block_template_types()\n {\n }", "function defaultTemplate() {\n//\t\t$l = $this->api->locate('addons',__NAMESPACE__,'location');\n//\t\t$addon_location = $this->api->locate('addons',__NAMESPACE__);\n//\t\t$this->api->pathfinder->addLocation($addon_location,array(\n//\t\t\t'js'=>'templates/js',\n//\t\t\t'css'=>'templates/css',\n// 'template'=>'templates',\n//\t\t))->setParent($l);\n\n return array('view/draw');\n }", "public function get_default_template() {\n\t\t\t$file = file_get_contents( dirname( __FILE__ ).'/assets/template.html' );\n\t\t\treturn $file;\n\t\t}", "abstract public function getTemplate();", "public function getFormTemplates();", "public function get_custom_templates()\n {\n }", "public function getTemplate(){\n\t\treturn $this->CustomTemplate ? $this->CustomTemplate : $this->config()->get('default_template');\n\t}", "function getTemplate();", "public function getTemplates()\n {\n return [\n// 'paths' => [\n// 'auth' => [__DIR__ . '/../templates/auth'],\n//\n// 'app' => [__DIR__ . '/../templates/app'],\n// 'error' => [__DIR__ . '/../templates/error'],\n// 'layout' => [__DIR__ . '/../templates/layout'],\n// ],\n ];\n }", "public function get_template()\n {\n }", "public function get_template()\n {\n }", "public function getNewsModalTemplates()\n {\n return $this->getTemplateGroup('news_');\n }", "public function get_template_parts()\n {\n }", "public function getTemplates()\n {\n return [\n 'paths' => [\n 'app' => ['templates/app'],\n 'error' => ['templates/error'],\n 'layout' => ['templates/layout'],\n 'oauth' => ['templates/oauth'],\n ],\n ];\n }", "public function get_template_root()\n {\n }", "public function getTemplates()\n {\n $templates = SSViewer::get_templates_by_class(static::class, '', __CLASS__);\n // Prefer any custom template\n if ($this->getTemplate()) {\n array_unshift($templates, $this->getTemplate());\n }\n return $templates;\n }", "public function getItemTemplates()\n\t{\n\t\treturn $this->getTemplateGroup('item_');\n\t}", "public function default_template()\n {\n return array(\n 'table_open' => '<table border=\"0\" cellpadding=\"4\" cellspacing=\"0\">',\n 'heading_row_start' => '<tr>',\n 'heading_previous_cell' => '<th><a href=\"{previous_url}\">&lt;&lt;</a></th>',\n 'heading_title_cell' => '<th colspan=\"{colspan}\">{heading}</th>',\n 'heading_next_cell' => '<th><a href=\"{next_url}\">&gt;&gt;</a></th>',\n 'heading_row_end' => '</tr>',\n 'week_row_start' => '<tr>',\n 'week_day_cell' => '<td>{week_day}</td>',\n 'week_row_end' => '</tr>',\n 'cal_row_start' => '<tr>',\n 'cal_cell_start' => '<td>',\n 'cal_cell_start_today' => '<td>',\n 'cal_cell_no_content' => '<a href=\"{content}\" class=\"{class}\">{day}</a>',\n 'cal_cell_no_content_today' => '<a href=\"{content}\" class=\"{class}\"><strong>{day}</strong></a>',\n 'cal_cell_content' => '{day}',\n 'cal_cell_content_today' => '<strong>{day}</strong>',\n 'cal_cell_blank' => '&nbsp;',\n 'cal_cell_end' => '</td>',\n 'cal_cell_end_today' => '</td>',\n 'cal_row_end' => '</tr>',\n 'table_close' => '</table>'\n );\n }", "public function getModulTemplates()\n\t{\n\t\treturn $this->getTemplateGroup('mod_bn_');\n\t}", "public function getMainTpl(){\n return $this->templates['main'];\n }", "final public function getTemplate() {\n\t\treturn '';\n\t}", "public function get()\n {\n return $this->templates;\n }", "protected function defaultTemplate()\n {\n return array('S3File');\n }", "public static function getAll(){\n\t\treturn self::$components;\n\t}", "function get_template()\n {\n }", "public function getNewsTemplates()\n\t{\n\t\treturn $this->getTemplateGroup('news_');\n\t}", "public function getContentPageTpl()\n {\n $aTemplate = array();\n $sContentId = $this->getContent()->oxcontents__oxloadid->value;\n $myConfig = $this->getConfig();\n if ($sContentId == $myConfig->getConfigParam('sRDFaBusinessEntityLoc')) {\n $aTemplate[] = $this->_sBusinessTemplate;\n }\n if ($sContentId == $myConfig->getConfigParam('sRDFaDeliveryChargeSpecLoc')) {\n $aTemplate[] = $this->_sDeliveryTemplate;\n }\n if ($sContentId == $myConfig->getConfigParam('sRDFaPaymentChargeSpecLoc')) {\n $aTemplate[] = $this->_sPaymentTemplate;\n }\n\n return $aTemplate;\n }", "public function getTemplates()\n {\n return [\n 'paths' => [\n 'app' => [__DIR__ . '/../templates/app'],\n 'error' => [__DIR__ . '/../templates/error'],\n 'layout' => [__DIR__ . '/../templates/layout'],\n 'mail' => [__DIR__ . '/../templates/mail'],\n ],\n ];\n }", "public static function getTemplatesUsed()\n {\n return static::$allTemplates;\n }", "public function getTemplates() : array\n {\n return [\n 'paths' => [\n 'elements' => [__DIR__ . '/../templates/'],\n ],\n ];\n }", "public function getModuleTemplate() {}", "public function getModuleTemplate() {}", "public function getTemplates()\n\t{\n\t\t$templates = [\n\t\t\t'br' => '<br/>',\n\t\t\t'e' => '',\n\t\t\t'i' => '',\n\t\t\t'p' => '<p><xsl:apply-templates/></p>',\n\t\t\t's' => ''\n\t\t];\n\n\t\tforeach ($this->configurator->tags as $tagName => $tag)\n\t\t{\n\t\t\tif (isset($tag->template))\n\t\t\t{\n\t\t\t\t$templates[$tagName] = (string) $tag->template;\n\t\t\t}\n\t\t}\n\n\t\tksort($templates);\n\n\t\treturn $templates;\n\t}", "protected function getPageTemplate()\n {\n return new Template();\n }", "public function getTemplates()\n {\n return $this->templates;\n }", "public function getTemplates()\n {\n return $this->templates;\n }", "private function _initComponents()\n {\n $componentsFolder = 'Components';\n $directory = dirname(__FILE__) . '/' . $componentsFolder;\n $components = array();\n foreach (@glob($directory . '/*', GLOB_ONLYDIR) as $folder) {\n $componentName = basename($folder);\n $components[$folder] = array(\n 'componentName' => $componentName,\n 'namespace' =>\n '\\H22\\Plugins\\VisualComposer\\\\' .\n $componentsFolder .\n '\\\\' .\n $componentName .\n '\\\\' .\n $componentName,\n );\n }\n return $components;\n }", "public function template() {\n\n // check for a cached template name\n if(isset($this->cache['template'])) return $this->cache['template'];\n\n // get the template name\n $templateName = $this->intendedTemplate();\n\n if($this->kirby->registry->get('template', $templateName)) {\n return $this->cache['template'] = $templateName; \n } else {\n return $this->cache['template'] = 'default';\n }\n\n }", "public function getBaseTemplateClass()\n {\n return $this->baseTemplateClass;\n }", "public function getGathercontentTemplate();", "public function getTemplateHelper(){\n if( $this->_flexryTemplateHelper === null ){\n $templateHandle = $this->currentTemplateHandle();\n if( empty($templateHandle) ){\n $this->_flexryTemplateHelper = FlexryBlockTemplateOptions::setup(self::TEMPLATE_DEFAULT_HANDLE, self::templateDefaultPath(), $this->parsedTemplateData() );\n }else{\n $templatesList = $this->templateAndDirectoryList();\n $this->_flexryTemplateHelper = FlexryBlockTemplateOptions::setup($templateHandle, $templatesList[$templateHandle], $this->parsedTemplateData() );\n }\n }\n return $this->_flexryTemplateHelper;\n }", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "protected function getDocumentTemplate() {}", "function getXTemplate() {\n return $this->xTemplate;\n}", "public function own_components() {\n\t\treturn array(\n\t\t\t'login_form' => array(\n\t\t\t\t'config' => array(\n\t\t\t\t\t'FieldsControl' => array(\n\t\t\t\t\t\t'config' => array(\n\t\t\t\t\t\t\t'sortable' => false,\n\t\t\t\t\t\t\t'settings_icon' => 'edit',\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t'AddRemoveLabels' => array(\n\t\t\t\t\t\t'config' => array(\n\t\t\t\t\t\t\t'name' => '',\n\t\t\t\t\t\t\t'label' => __( 'Show labels', 'thrive-cb' ),\n\t\t\t\t\t\t\t'default' => true,\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'extends' => 'Switch',\n\t\t\t\t\t),\n\t\t\t\t\t'RememberMe' => array(\n\t\t\t\t\t\t'config' => array(\n\t\t\t\t\t\t\t'name' => '',\n\t\t\t\t\t\t\t'label' => __( 'Remember me', 'thrive-cb' ),\n\t\t\t\t\t\t\t'default' => true,\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'css_suffix' => ' .tcb-remember-me-item',\n\t\t\t\t\t\t'css_prefix' => '',\n\t\t\t\t\t\t'extends' => 'Switch',\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t}", "public function getTemplateOptions();", "public function getTemplateEngine() {\n\t\treturn parent::getTemplateEngine();\n\t}", "public function own_components() {\n\t\treturn array(\n\t\t\t'borders' => array(\n\t\t\t\t'blocked_controls' => array(\n\t\t\t\t\t'Corners' => __( 'This is disabled for the current element because it can have an unpredictable behaviour', 'thrive-cb' ),\n\t\t\t\t),\n\t\t\t\t'config' => array(\n\t\t\t\t\t'Borders' => array(\n\t\t\t\t\t\t'important' => true,\n\t\t\t\t\t),\n\t\t\t\t\t'Corners' => array(\n\t\t\t\t\t\t'important' => true,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\t\t'shadow' => array(\n\t\t\t\t'config' => array(\n\t\t\t\t\t'important' => true,\n\t\t\t\t\t'default_shadow' => 'none',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'layout' => array(\n\t\t\t\t'disabled_controls' => array(\n\t\t\t\t\t'margin',\n\t\t\t\t\t'.tve-advanced-controls',\n\t\t\t\t\t'Height',\n\t\t\t\t\t'Width',\n\t\t\t\t\t'Alignment',\n\t\t\t\t\t'Display',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'typography' => array( 'hidden' => true ),\n\t\t\t'animation' => array( 'hidden' => true ),\n\t\t\t'responsive' => array( 'hidden' => true ),\n\t\t\t'styles-templates' => array( 'hidden' => true ),\n\n\t\t);\n\t}", "protected function getXTemplate(){\n\t\treturn new XTemplate( CDT_MVC_TEMPLATE_EXCEL );\n\t}", "public static function getDefaultTemplateConfig()\n\t{\n\t\treturn self::getTemplatesDir() . '/default/config.neon';\n\t}", "protected function GetTemplate()\n\t{\n\t\treturn 'heads.tpl';\n\t}", "public function getTemplate(): string;", "public function getTemplate(): string;", "public function getTemplate(): string;", "public function getTemplate(): string;", "public function getDefaultSettings()\n {\n return array(\n // by separating them with ':'\n 'ldelim' => '{', // tag delimiter\n 'rdelim' => '}',\n 'extension' => '.html', // template file extension\n );\n }", "protected function getTemplateService()\n {\n return $this->services['template'] = new \\phpbb\\template\\twig\\twig(${($_ = isset($this->services['path_helper']) ? $this->services['path_helper'] : $this->getPathHelperService()) && false ?: '_'}, ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['template_context']) ? $this->services['template_context'] : ($this->services['template_context'] = new \\phpbb\\template\\context())) && false ?: '_'}, ${($_ = isset($this->services['template.twig.environment']) ? $this->services['template.twig.environment'] : $this->getTemplate_Twig_EnvironmentService()) && false ?: '_'}, './../cache/production/twig/', ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['template.twig.extensions.collection']) ? $this->services['template.twig.extensions.collection'] : $this->getTemplate_Twig_Extensions_CollectionService()) && false ?: '_'}, ${($_ = isset($this->services['ext.manager']) ? $this->services['ext.manager'] : $this->getExt_ManagerService()) && false ?: '_'});\n }", "function app_template() {\n\t$template = <<<HTML\n\n\n\nHTML;\n\n $navigation = app_template_navigation();\n $dialogs = app_template_dialogs();\n\t$data['blocks'] = empty($navigation) ? array($dialogs) : array($dialogs, $navigation);\n\t$data['template'] = $template;\n\treturn $data;\n}", "protected function getTemplate() {\n\t\treturn new Template('Premanager', 'userForm');\n\t}", "public function getTemplateClass();", "public function templateData() {\n return array();\n }", "function getTemplateVariableContainer() ;", "public function getComponentsProvider() {\n return [\n [\n // Input.\n 'name@example.com',\n // Expected.\n [\n 'name' => '',\n 'email' => 'name@example.com',\n ],\n ],\n [\n ' name@example.com',\n [\n 'name' => '',\n 'input' => 'name@example.com',\n 'email' => 'name@example.com',\n ],\n ],\n [\n 'name@example.com ',\n [\n 'name' => '',\n 'input' => 'name@example.com',\n 'email' => 'name@example.com',\n ],\n ],\n [\n 'some name <address@example.com>',\n [\n 'name' => 'some name',\n 'email' => 'address@example.com',\n ],\n ],\n [\n '\"some name\" <address@example.com>',\n [\n 'name' => 'some name',\n 'email' => 'address@example.com',\n ],\n ],\n [\n '<address@example.com>',\n [\n 'name' => '',\n 'email' => 'address@example.com',\n ],\n ],\n ];\n }", "public static function getModules(){\n if(!function_exists('the_flexible_field') || !function_exists('get_row_layout')) return;\n while(the_flexible_field('underpin_flex_content')) TemplateLoader::getTemplate(str_replace('_', '-', get_row_layout()));\n }", "public function getAvailableTemplate()\r\n {\r\n $panels = $this->_panel->getCollection()\r\n ->addFieldToFilter('status', '1');\r\n $listPanel = array();\r\n foreach ($panels as $panel) {\r\n $listPanel[] = array('label' => $panel->getName(),\r\n 'value' => $panel->getId());\r\n }\r\n // echo 'test';\r\n // die();\r\n return $listPanel;\r\n }", "public function getHtmlTemplate() {}", "public static function getTemplate() {\n $settings = self::getSettings();\n \n return $settings->template;\n }", "public function templateTags() : array\n {\n return [\n 'get_page_part' => [$this, 'getPagePart'],\n 'get_header' => [$this, 'getHeader'],\n 'get_footer' => [$this, 'getFooter'],\n 'get_sidebar' => [$this, 'getSidebar'],\n 'get_template_part' => [$this, 'getTemplatePart']\n ];\n }", "public function getTemplates (){\n $dir = conf::pathHtdocs() . \"/templates\";\n $templates = file::getFileList($dir, array('dir_only' => true));\n\n $ary = array ();\n foreach ($templates as $val){\n $info = $this->getSingleTemplate($val);\n if (empty($info)) {\n continue;\n }\n $ary[] = $info;\n }\n return $ary;\n }", "public function getTemplateRoot()\n {\n return TEMPLATE_ROOT;\n }", "function CreateDefaultDocumentTemplateEntity()\n {\n\t\t$result = $this->sendRequest(\"CreateDefaultDocumentTemplateEntity\", array());\n\t\treturn $this->getResultFromResponse($result);\n }", "public function getDefaultBlade();", "public function getTemplate()\r\n {\r\n return $this->_customTemplate;\r\n }", "public function getComponents();", "public function getComponents();", "private function getTemplate(): string\n {\n $sTemplate = $this->getViewPath() . static::TEMPLATE . static::TEMPLATE_EXT;\n if (!is_file($sTemplate)) {\n $sTemplate = $this->getViewRootDirectory();\n $sTemplate .= $this->getCurrentClassName() . DIRECTORY_SEPARATOR;\n $sTemplate .= static::TEMPLATE . static::TEMPLATE_EXT;\n if (!is_file($sTemplate)) {\n $sTemplate = $this->getViewRootDirectory();\n $sTemplate .= static::TEMPLATE . static::TEMPLATE_EXT;\n }\n }\n\n return $sTemplate;\n }" ]
[ "0.747713", "0.6948634", "0.64774054", "0.64469826", "0.6415054", "0.63784856", "0.62615037", "0.6224359", "0.61802447", "0.61802447", "0.61802447", "0.61802447", "0.61802447", "0.61802447", "0.61299235", "0.604876", "0.6014143", "0.6000013", "0.5997274", "0.5994137", "0.5977049", "0.5976163", "0.59462464", "0.5944488", "0.5930848", "0.59011817", "0.5899834", "0.5898582", "0.5897547", "0.58935386", "0.585351", "0.58445936", "0.5834706", "0.5819217", "0.58172303", "0.58039176", "0.57727575", "0.57710844", "0.57653075", "0.5745301", "0.5741466", "0.57314", "0.5729567", "0.57149965", "0.56929857", "0.5679677", "0.5675127", "0.5672631", "0.5672631", "0.56526184", "0.5643803", "0.5640423", "0.5640423", "0.562927", "0.56292397", "0.56174314", "0.56016576", "0.559476", "0.5590532", "0.5590532", "0.5589067", "0.5589067", "0.5589067", "0.5589067", "0.5588635", "0.55872005", "0.55872005", "0.558544", "0.5567994", "0.5564463", "0.55602616", "0.55579853", "0.55555797", "0.5551082", "0.5539656", "0.55327666", "0.55327666", "0.55327666", "0.55327666", "0.55165213", "0.5512462", "0.5508404", "0.55062985", "0.54986274", "0.54963255", "0.54875493", "0.5476208", "0.54747635", "0.5453806", "0.5429277", "0.5428125", "0.5423735", "0.5420223", "0.5412186", "0.5412039", "0.5406595", "0.54008895", "0.5399736", "0.5399736", "0.5391472" ]
0.68817365
2
Get the template builder manager.
protected function builderManager() { return \Drupal::service('plugin.manager.entity_template.builder'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBuilder() {\n if (!isset($this->builder)) {\n if (empty($this->configuration['builder'])) {\n $this->builder = $this->builderManager->createInstance('standard', []);\n }\n else {\n $this->builder = $this->builderManager->createInstance($this->configuration['builder'], []);\n }\n }\n return $this->builder;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager()\n {\n return $this->manager;\n }", "public function getManager(): Gutenberg\n {\n return $this->manager;\n }", "protected function getManager()\n {\n return $this->manager;\n }", "public function getManager() {\n return $this->manager;\n }", "protected function getBuilder()\n {\n return $this->builder;\n }", "public function getTranslationManager()\n {\n return $this->getKernel()->getContainer()->get('worldia.textmaster.manager.translation');\n }", "public function getBuilder()\n {\n return $this->_builder;\n }", "public function getPersistenceBuilder()\n {\n if (!$this->persistenceBuilder) {\n $this->persistenceBuilder = new PersistenceBuilder($this->dm, $this, $this->cmd);\n }\n return $this->persistenceBuilder;\n }", "public function getFormBuilder()\n {\n return $this['form.factory'];\n }", "public function getBuilder()\n {\n return $this->builder;\n }", "public function getBuilder()\n {\n return $this->builder;\n }", "public function builder()\n {\n return $this->builder;\n }", "public function getViewManager()\n {\n return $this->viewManager;\n }", "protected function entityFormBuilder() {\n if (!$this->entityFormBuilder) {\n $this->entityFormBuilder = $this->container()->get('entity.form_builder');\n }\n return $this->entityFormBuilder;\n }", "public function getObjectManager() {\n\t\tif(($this->objectManager instanceof \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager) === false) {\n\t\t\t$this->objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Object\\ObjectManager::class);\n\t\t}\n\n\t\treturn $this->objectManager;\n\t}", "public function getFormBuilder()\n {\n $this->formOptions['data_class'] = $this->getClass();\n\n $this->formOptions['allow_extra_fields'] = true;\n $this->formOptions['validation_groups'] = false;\n $this->formOptions['error_bubbling'] = false;\n\n $formBuilder = $this->getFormContractor()->getFormBuilder(\n $this->getUniqid(),\n $this->formOptions\n );\n\n $this->defineFormBuilder($formBuilder);\n\n return $formBuilder;\n }", "public function getDocumentManager()\n {\n return $this->getObjectManager();\n }", "public function getObjectManager() {\n\t\tif(($this->objectManager instanceof \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager) === false) {\n\t\t\t$this->objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\t\t}\n\n\t\treturn $this->objectManager;\n\t}", "public function getTemplateHelper(){\n if( $this->_flexryTemplateHelper === null ){\n $templateHandle = $this->currentTemplateHandle();\n if( empty($templateHandle) ){\n $this->_flexryTemplateHelper = FlexryBlockTemplateOptions::setup(self::TEMPLATE_DEFAULT_HANDLE, self::templateDefaultPath(), $this->parsedTemplateData() );\n }else{\n $templatesList = $this->templateAndDirectoryList();\n $this->_flexryTemplateHelper = FlexryBlockTemplateOptions::setup($templateHandle, $templatesList[$templateHandle], $this->parsedTemplateData() );\n }\n }\n return $this->_flexryTemplateHelper;\n }", "public function getFormManager()\n {\n if(!$this->formManager){\n $this->setFormManager( $this->getServiceLocator()->get('FormElementManager') );\n }\n return $this->formManager;\n\n return $this->formManager;\n }", "public function getTranslationGenerator()\n {\n return $this->getKernel()->getContainer()->get('worldia.textmaster.generator.translation');\n }", "public function getDocumentManager()\n {\n return $this->documentManager;\n }", "public static function instance() {\n return Doctrine::getTable('DocumentTemplate');\n }", "public static function get() {\n\t\tif (self::$web_template === null) {\n\t\t\tself::$web_template = new Template();\n\t\t}\n\n\t\treturn self::$web_template;\n\t}", "protected function getTemplateRepo()\n {\n if ($this->_templatesRepo === null || !$this->_templatesRepo) {\n $this->_templatesRepo = $this->getEntityRepository(Template::class);\n }\n\n return $this->_templatesRepo;\n }", "public function getEngine(): \\Twig\\Environment\n {\n return $this->template;\n }", "public function getDBManagerHandler()\n {\n\t\tif (empty($this->dbManager)) {\n\t\t\t$this->dbManager = new DatabaseManager($this->config['database'], new ConnectionFactory());\n\t\t}\n\t\treturn $this->dbManager;\n\t}", "public function getTemplatesEngine() {\n\t\treturn $this->templatesEngine;\n\t}", "public function getDatabaseManager(): DatabaseManager\n {\n return $this->manager;\n }", "public function getPagesManager() {\n\t\treturn $this->wire('lab_tools');\n\t}", "public function getManager() {\n return $this->em;\n }", "protected function getEM() {\n return $this->getDoctrine()->getEntityManager();\n }", "public function builder()\n {\n if ($this->parent) {\n return $this->parent->builder();\n }\n\n if (is_null($this->builder)) {\n $this->builder = new Builder($this);\n }\n\n return $this->builder;\n }", "protected function getObjectManager()\n {\n return $this->managerRegistry->getManager($this->managerName);\n }", "public function getRequestBuilder(): RequestBuilderInterface\n {\n return new RequestBuilder();\n }", "public function getRequestBuilder(): RequestBuilderInterface\n {\n return new RequestBuilder();\n }", "public function getRequestBuilder(): RequestBuilderInterface\n {\n return new RequestBuilder();\n }", "public function getSchemaBuilder(): SchemaBuilder\n {\n return $this->getContainer()[SchemaBuilder::class];\n }", "public function getDBManagerHandler(): DatabaseManager\n {\n if (empty($this->dbManager)) {\n $this->dbManager = new DatabaseManager(Config::get('database'), new ConnectionFactory());\n }\n return $this->dbManager;\n }", "protected function getFormTool()\n {\n return $this->mod->getFormTool();\n }", "function analogue()\n {\n return Manager::getInstance();\n }", "public function getHandlerManager()\n {\n return $this->handlerManager;\n }", "public function getOptionManager()\n {\n return $this->optionManager;\n }", "static protected function getConfigurationManager()\n\t{\n\t\tif (!is_null(static::$configurationManager)) {\n\t\t\treturn static::$configurationManager;\n\t\t}\n\t\t$objectManager = GeneralUtility::makeInstance(ObjectManager::class);\n\t\t$configurationManager = $objectManager->get(ConfigurationManagerInterface::class);\n\t\tstatic::$configurationManager = $configurationManager;\n\t\treturn $configurationManager;\n\t}", "protected function getTemplateHandler()\n {\n return new TemplateHandler();\n }", "protected function getMessageManager()\n {\n return $this->getContext()->getMessageManager();\n }", "public static function getInstance()\n {\n $objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');\n\n $nestedSetTreeWalkerVisitor = $objectManager->get('Tx_PtExtbase_Tree_NestedSetVisitor');\n $nestedSetTreeWalker = $objectManager->get('Tx_PtExtbase_Tree_NestedSetTreeWalker', [$nestedSetTreeWalkerVisitor], $nestedSetTreeWalkerVisitor);\n return $nestedSetTreeWalker;\n }", "public static function getInstance()\n\t{\n\t\tif ( NULL === self::$instance )\n\t\t{\n\t\t\tself::$instance = new Template;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public function getEngine(): Engine\r\n {\r\n return $this->template;\r\n }", "public function hookManager()\n {\n return $this->hookManager;\n }", "private function getHelper()\n {\n if ($this->helper === null) {\n $this->helper = new ComposerConfig($this->context);\n }\n \n return $this->helper;\n }", "protected function getTempDirManager() {\n\t\tif ( !$this->tempDirManager ) {\n\t\t\t$tempDirBase = $this->tempDirBase;\n\t\t\tif ( $tempDirBase === null ) {\n\t\t\t\t$tempDirBase = sys_get_temp_dir();\n\t\t\t}\n\n\t\t\t$this->tempDirManager = new TempDirManager(\n\t\t\t\t$tempDirBase . '/shellbox-' . Shellbox::getUniqueString()\n\t\t\t);\n\t\t}\n\t\treturn $this->tempDirManager;\n\t}", "public function getTemplateEngine() {\n\t\treturn parent::getTemplateEngine();\n\t}", "public function getGrammarManager(): Manager|null;", "protected function getTemplate() {\n\t\treturn new Template('Premanager', 'userForm');\n\t}", "public function getBuilder()\n {\n $class = '\\ReneDeKat\\Quickbooks\\Builders\\\\'.$this->getClassName();\n\n return new $class($this);\n }", "protected function getIntentionManager()\n {\n return $this->get('intention.execution_manager');\n }", "public function getContentMigrator(): MigrationManager\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('contentMigrator');\n }", "public function getObjectManager(): mixed\n {\n return $this->objectManager;\n }", "protected function getCacheManager()\n {\n if (!$this->cacheManager) {\n $this->cacheManager = $this->getContainer()->get('fos_http_cache.cache_manager');\n }\n\n return $this->cacheManager;\n }", "protected function getSchemaBuilder()\n {\n return $this->getConnection()->getSchemaBuilder();\n }", "public function getObjectManager()\r\n {\r\n return $this->objectManager;\r\n }", "protected function getTemplateService()\n {\n return $this->services['template'] = new \\phpbb\\template\\twig\\twig(${($_ = isset($this->services['path_helper']) ? $this->services['path_helper'] : $this->getPathHelperService()) && false ?: '_'}, ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['template_context']) ? $this->services['template_context'] : ($this->services['template_context'] = new \\phpbb\\template\\context())) && false ?: '_'}, ${($_ = isset($this->services['template.twig.environment']) ? $this->services['template.twig.environment'] : $this->getTemplate_Twig_EnvironmentService()) && false ?: '_'}, './../cache/production/twig/', ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['template.twig.extensions.collection']) ? $this->services['template.twig.extensions.collection'] : $this->getTemplate_Twig_Extensions_CollectionService()) && false ?: '_'}, ${($_ = isset($this->services['ext.manager']) ? $this->services['ext.manager'] : $this->getExt_ManagerService()) && false ?: '_'});\n }", "protected function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getObjectManager()\n {\n return $this->objectManager;\n }", "public function getServiceManager()\n {\n return $this->sm;\n }", "protected function getObjectManager()\n {\n return $this->_objectManager;\n }", "function engine() {\n\n if ( $this->_engine ) {\n return $this->_engine;\n } elseif ( ($template = Liber::conf('TEMPLATE_ENGINE')) ) {\n // instancing of Template Engine\n Liber::loadClass($template, 'APP');\n $this->_engine = new $template;\n } else {\n $this->_engine = &$this;\n }\n\n return $this->_engine;\n }", "public function getRequestBuilder()\n {\n return new RequestBuilder();\n }", "public static function getTwig()\r\n {\r\n $loader = new \\Twig_Loader_Filesystem('templates');\r\n return new \\Twig_Environment($loader, array('debug' => true, \r\n 'autoescape' => true, \r\n 'auto_reload' => true));\r\n }", "public static function instance()\n\t{\n\t\tif (!self::$tplInstance) {\n\t\t\tself::$tplInstance = new Template();\n\t\t}\n\t\t\n\t\treturn self::$tplInstance;\n\t}", "public function getServiceManager ()\n {\n return $this->serviceManager;\n }", "public function getBuilderFactory()\n {\n return $this->builderFactory;\n }", "public function getSharedManager();", "private function getArrangementProgramManager() {\n return $this->get('seip.arrangement_program.manager');\n }", "public function getManager()\n {\n $symfonyProcess = new Process($this->command);\n $symfonyProcess->setTimeout($this->timeout);\n\n $process = new InteractiveProcess(\n $symfonyProcess,\n $this->pipe,\n $this->waitStrategy\n );\n\n $this->manager->setProcess($process);\n\n return $this->manager;\n }", "protected function getOptionSetsManager() {\n return \\Drupal::service('option_sets.manager');\n }", "public function get()\n {\n return $this->templates;\n }", "protected function getKitAdmin(): LightKitAdminService\n {\n return $this->getContainer()->get('kit_admin');\n }", "private function getDatabaseManager()\n {\n $file = require __DIR__ . '/../../src/settings.php';\n $dbSettings = $file['settings']['db'];\n\n $capsule = new \\Illuminate\\Database\\Capsule\\Manager;\n $capsule->addConnection($dbSettings);\n $capsule->setAsGlobal();\n $capsule->bootEloquent();\n return $capsule->getDatabaseManager();\n }", "protected function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getFormCreator()\n {\n if ($this->formCreator === null) {\n $this->formCreator = $this->makeFormCreator();\n }\n\n return $this->formCreator;\n }", "protected function getManagerFactory()\n {\n return $this->container->get(ThuataControllerInterface::MANAGER_FACTORY_ID);\n }", "protected function getEntityManager()\n {\n return $this->getContainer()->get('doctrine')->getManager();\n }", "public function getPdfGenerator($template = 'MakePdf') {\n\t\treturn $this->getInstanceOf($template);\n\t}", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function getServiceManager()\n {\n return $this->serviceManager;\n }", "public function builder()\n\t{\n\t\t$builder = new Builder($this->request);\n\t\treturn $builder;\n\t}", "protected function _getTemplateModel()\n\t{\n\t\treturn $this->getModelFromCache('XenForo_Model_Template');\n\t}" ]
[ "0.65663296", "0.6290267", "0.6290267", "0.6290267", "0.62729853", "0.6265055", "0.6221792", "0.60746664", "0.6015199", "0.59984595", "0.59514964", "0.594063", "0.5932067", "0.5932067", "0.5926895", "0.591976", "0.59180784", "0.59067625", "0.58905035", "0.58742106", "0.5870349", "0.5869387", "0.58640206", "0.57857865", "0.5776718", "0.57675964", "0.57670784", "0.5754302", "0.57222134", "0.5709957", "0.5707439", "0.56848496", "0.5623332", "0.5611828", "0.5611161", "0.5599498", "0.5594251", "0.55640966", "0.55640966", "0.55640966", "0.5535692", "0.55302566", "0.55202806", "0.5517074", "0.5497722", "0.5480313", "0.5456884", "0.5454046", "0.544412", "0.5434861", "0.5431878", "0.541629", "0.5396574", "0.53964996", "0.5390928", "0.53864056", "0.5384397", "0.5383914", "0.5383624", "0.53615475", "0.5357204", "0.5353297", "0.5352582", "0.5344328", "0.5341806", "0.53391975", "0.53363776", "0.5330972", "0.5330972", "0.5330972", "0.5330972", "0.5317886", "0.5313782", "0.5310919", "0.52979726", "0.52877235", "0.5286989", "0.52845216", "0.5283938", "0.5282438", "0.5277452", "0.52690184", "0.52614516", "0.5261278", "0.52603185", "0.5253863", "0.525224", "0.524766", "0.5247482", "0.5243362", "0.5225262", "0.522293", "0.522293", "0.522293", "0.522293", "0.522293", "0.522293", "0.522293", "0.52226", "0.5216128" ]
0.7953468
0
Parse the config for the given root and file
public static function parseConfig(string $root, string $environment) : array { $ymlFile = sprintf('%s/%s.yml', $root, $environment); $yamlFile = sprintf('%s/%s.yaml', $root, $environment); if (is_file($ymlFile)) { return Yaml::parseFile($ymlFile) ?? []; } if (is_file($yamlFile)) { return Yaml::parseFile($yamlFile) ?? []; } $cursor = (new Finder) ->files() ->in($root) ->name('*.yml') ->name('*.yaml') ; $envs = collect(iterator_to_array($cursor)) ->values() ->map(function(SplFileInfo $file) { return explode('.', $file->getRelativePathname())[0]; }) ; if ($envs->isEmpty()) { throw new \Exception('There are no environments set up!'); } throw new \Exception(sprintf( 'Unable to find environment file [%s]. Available Environments: [%s]', $environment, $envs->implode(',') )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseConfig() {\n\n\t\t// Make sure our config file exists\n\t\tif(!file_exists(CONFIGPATH . $this->_options['configFile'])) {\n\t\t\tdie('Unable to find <b>'. CONFIGPATH . $this->_options['configFile'] .'</b> file, please check your application configuration');\n\t\t}\n\n\t\t// Switch the file extension\n\t\tswitch(PPI_Helper::getFileExtension($this->_options['configFile'])) {\n\t\t\tcase 'ini':\n\t\t\t\treturn new PPI_Config_Ini(parse_ini_file(CONFIGPATH . $this->_options['configFile'], true, INI_SCANNER_RAW), $this->_options['configBlock']);\n\n\t\t\tcase 'xml':\n\t\t\t\tdie('Trying to load a xml config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'php':\n\t\t\t\tdie('Trying to load a php config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "private function parseConfig(){\n\t\t\treturn parse_ini_file(BASE_PATH . 'config' . DIRECTORY_SEPARATOR . 'config.ini');\n\t\t}", "function config_parser($path)\n{\n $conffile = fopen($path, 'r');\n $config = fread($conffile, filesize($path));\n\n $parsed_config = array();\n $parsed_config['head'] = array();\n $parsed_config['body'] = \"\";\n\n// split into head and body sections\n $lines = explode(\"\\n\", $config);\n\n $head = $body = array();\n $mode = 0;\n\n foreach($lines as $line)\n {\n if(preg_match(\"/--body--/i\", $line) and $mode == 0)\n $mode = 1;\n else {\n if($mode == 0) array_push($head, $line);\n else array_push($body, $line);\n }\n }\n\n// Parse key-value pares\n foreach($head as $line)\n {\n $result = explode(':', $line);\n\n $key = array_shift($result);\n $value = \"\";\n\n $id = 0;\n foreach($result as $item) {\n if($id > 0) $value .= \":$item\";\n else $value .= trim($item);\n\n $id ++;\n }\n\n if($key != \"\") {\n $parsed_config['head'] = array_merge(\n $parsed_config['head'], array(strtolower($key) => $value));\n }\n }\n\n// Re join body\n $body_txt = \"\";\n\n foreach($body as $line)\n $body_txt .= \"$line\\n\";\n\n $parsed_config['body'] = trim($body_txt);\n\n return $parsed_config;\n}", "private function read_config() {\n\t\t$sections = parse_ini_file($this->config['conf'], true);\n\t\tforeach ($sections as $sectionk => $sectionv) {\n\t\t\tforeach ($sectionv as $key => $var)\n\t\t\t\t$this->config[$sectionk . '.' . $key] = $var;\n\t\t}\n\t}", "public function parse()\n {\n $this->data = parse_ini_file($this->fileName);\n }", "private function ParseFile() {\r\n\t\t$this->ini_array = parse_ini_file($this->$results_file, true); //Load the results into a array //\r\n\t}", "protected function initConfigfile($configfile) {\n\t\t$lines = file($configfile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\t\tif ($lines === false) {\n\t\t\treturn false;\n\t\t}\n\t\t$section = '';\n\t\tforeach ($lines as $line) {\n\t\t\tif (preg_match(\"/^\\[(\\S+?)\\]$/\", $line, $matches)) {\n\t\t\t\t$section = strtolower($matches[1]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ((strpos(trim($line), \"#\") === 0) || empty($section)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$entry = explode(\":\",$line,2);\n\t\t\tif (method_exists($this, \"parseSection\".ucfirst($section))) {\n\t\t\t\tcall_user_func(array($this, \"parseSection\".ucfirst($section)), $entry);\n\t\t\t}\n\t\t}\n\t}", "function loadConfig(){\n $file = file_get_contents($this->config_dir, FILE_USE_INCLUDE_PATH);\n $urls = json_decode($file,TRUE);\n //not the best way but error handling\n if ($file == NULL || $urls == NUll ){\n print(\"Error reading the config file or it it is empty\");\n }\n else{\n $this->config_data = $urls;\n\n }\n }", "function parseConfigFile( $file, $options = array( 'mode' => 'w' ) )\n\t{\n\t\treturn\t$this->loadConfig( $file, $options );\n\t}", "private function LoadConfigFile(){\n $a = file_get_contents($this->RootDIR . 'config/main.json');\n $this->Config = json_decode($a, true);\n }", "static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}", "public function parseConfig()\n {\n $fileContents = file_get_contents($this->filename);\n if (!$fileContents) {\n $this->error = 'Failed to read file contents';\n\n return false;\n }\n\n $config = json_decode($fileContents, true);\n if (json_last_error()) {\n $this->error = json_last_error_msg();\n\n return false;\n }\n\n $this->config = new Data(array_replace_recursive($config, $this->overrides));\n\n return true;\n }", "private function parseConfigFile($file) {\n\t\tif (! file_exists($file)) {\n\t\t\treturn '{}';\n\t\t}\n\n\t\t$xml = simplexml_load_file($file);\n\t\tif (! ($xml instanceof SimpleXMLElement)) {\n\t\t\treturn '{}';\n\t\t}\n\n\t\tif (! isset($xml->fieldset)) {\n\t\t\treturn '{}';\n\t\t}\n\n\t\t// Getting the fieldset tags\n\t\t$fieldsets = $xml->fieldset;\n\n\t\t// Creating the data collection variable:\n\t\t$ini = array ();\n\n\t\t// Iterating through the fieldsets:\n\t\tforeach ($fieldsets as $fieldset) {\n\t\t\tif (! count($fieldset->children())) {\n\t\t\t\t// Either the tag does not exist or has no children therefore we return zero files processed.\n\t\t\t\treturn '{}';\n\t\t\t}\n\n\t\t\t// Iterating through the fields and collecting the name/default values:\n\t\t\tforeach ($fieldset as $field) {\n\t\t\t\t// Check against the null value since otherwise default values like \"0\"\n\t\t\t\t// cause entire parameters to be skipped.\n\n\t\t\t\tif (($name = $field->attributes()->name) === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (($value = $field->attributes()->default) === null) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$ini[(string) $name] = (string) $value;\n\t\t\t}\n\t\t}\n\n\t\treturn json_encode($ini);\n\t}", "public abstract function loadConfig($fileName);", "private function parseFile($filename) {\n if (is_null($filename) || !file_exists($filename)) {\n throw new MultidomainException('Missing config.yml file.');\n }\n $this->configFile = $filename;\n\n // get configuration values\n $this->config = json_decode(json_encode(\n Yaml::parseFile($filename)\n ));\n }", "public function parseConfig() {\n $configArray = file('configs/' . $this->_ip . '.ini');\n \n if($configArray === FALSE || sizeof($configArray) <= 1) {\n trigger_error(\"Couldn't read config\");\n return FALSE;\n }\n \n $config = array();\n $configDirective = '';\n \n foreach($configArray as $lineNumber => $line) {\n $line = trim($line);\n \n // Filter out comments\n if(preg_match('/^;/', $line)) {\n continue;\n }\n \n // Config directive\n if(preg_match('/^\\[/', $line)) {\n $configDirective = substr(substr($line, 1), 0, -1);\n continue;\n }\n \n // Filter out blank lines\n if($line == '') {\n continue;\n }\n \n // Looks to be a regular config directive\n // Split on = and place into config array\n \n $lineSplit = explode(\"=\", $line);\n \n $config[$configDirective][$lineSplit[0]] = $lineSplit[1];\n \n unset($lineSplit);\n \n }\n \n return $config;\n }", "public function loadConfig()\n {\n return parse_ini_file(\n DIR_ROOT . '/config.ini', False\n );\n }", "function parse_config($conf,$req) {\r\n\t// Init some Vars.\r\n\t$config = array();\r\n\t$reqdat = array();\r\n\t$err = false;\r\n\t$errline = array();\r\n\t$inblock = false;\r\n\t$blockname = false;\r\n\t$debug = true;\r\n\t\r\n\t// Load our Files.\r\n\t$requirements = explode(\"\\n\",file_get_contents($req));\r\n\t$configdata = explode(\"\\n\",file_get_contents($conf));\r\n\t\r\n\t// Parse our config.\r\n\tif ($debug) { echo \"Parsing Configuration File.\\n\"; }\r\n\tforeach ($configdata as $line => $item) {\r\n\t\t$line++;\r\n\t\t$item = trim($item);\r\n\t\t// Now our fun!\r\n\t\tif (isset($item[0]) && $item[0] != \";\") {\r\n\t\t\t// Not comment, lets go.\r\n\t\t\t$dat = explode(\" \",$item);\r\n\t\t\tif (isset($dat[1]) && ($dat[1] == \"{\")) {\r\n\t\t\t\t// Make a block.\r\n\t\t\t\tif (!$inblock) {\r\n\t\t\t\t\t$blockname = $dat[0];\r\n\t\t\t\t\t$config[$blockname] = array();\r\n\t\t\t\t\t$inblock = true; // We're in a block. EXPECT VALUES!\r\n\t\t\t\t\t// Even though we dont care about being in a block or not, A bracket mismatch could cause HAVOK!\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// Whoa we're already in a block!\r\n\t\t\t\t\tdie(\"Unexpected Start of Block at Line {$line} of {$conf}! Mismatched Brackets?\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ($dat[0] == \"}\") {\r\n\t\t\t\tif ($inblock) {\r\n\t\t\t\t\t// End of a block.\r\n\t\t\t\t\t$inblock = false;\r\n\t\t\t\t\t$blockname = false;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tdie(\"Unexpected Block End Character at Line {$line} in {$conf}\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if (isset($dat[1]) && $dat[1] == \"=\") {\r\n\t\t\t\t// We've got a value. Lets get down to it.\r\n\t\t\t\tif ($blockname) {\r\n\t\t\t\t\t// We're in a block.\r\n\t\t\t\t\t// ATTENTION - DO VAL CHECK!$%&£^%$\r\n\t\t\t\t\t$config[$blockname][$dat[0]] = $dat[2]; // Set the value.\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t// We're outside any blocks.\r\n\t\t\t\t\t$config[$dat[0]] = $dat[2]; // Set the Value.\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ($item == \"\") {\r\n\t\t\t\t// It's a blank line. :(\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t// Whoa WTF are we parsing here?\r\n\t\t\t\tdie(\"Unexpected Configuration Item '{$item}' at Line {$line} in {$conf}\\n\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif ($debug) {\r\n\t\t\t\tif (isset($item[0])) { echo \"Line {$line}, is a comment. Ignoring.\\n\"; }\r\n\t\t\t\telse { echo \"Line {$line}, is a blank line. Ignoring.\\n\"; }\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif ($inblock) {\r\n\t\tdie(\"Expected end of Block '{$blockname}' in {$conf}\\n\");\r\n\t}\r\n\tif ($debug) { var_dump($config); }\r\n\t// Now we've sorted the config out, We need to cycle the Requirements file.\r\n\t$blockname = false; // Reset our block system Even though we should have taken care of it already.\r\n\tif ($debug) { echo \"Parsing Requirements File.\\n\"; }\r\n\t// Essentially we're building a Config 'Model' if our parsed config doesnt meet this criteria we\r\n\t// throw our toys out of the pram.\r\n\tforeach ($requirements as $line => $item) {\r\n\t\t// Sort some initial stuff.\r\n\t\t$item = trim($item);\r\n\t\t$line++;\r\n\t\t$dat = explode(\" \",$item);\r\n\t\tif (isset($item[0]) && $item[0] != \";\") {\r\n\t\t\t// Not a Comment.\r\n\t\t\tif ($dat[0][0] == \"@\") {\r\n\t\t\t\t// Block REQBLOCK\r\n\t\t\t\t$blockname = substr($dat[0],1);\r\n\t\t\t\t$reqdat[$blockname] = array();\r\n\t\t\t\t$inblock = true;\r\n\t\t\t}\r\n\t\t\telse if ($dat[0][0] == \"#\") {\r\n\t\t\t\t// Block REVAL\r\n\t\t\t\t$value = substr($dat[0],1);\r\n\t\t\t\t$type = false;\r\n\t\t\t\tif (isset($dat[1])) {\r\n\t\t\t\t\t$type = $dat[1];\r\n\t\t\t\t}\r\n\t\t\t\tif ($inblock) {\r\n\t\t\t\t\t// You can set a global Requirement Item before ALL Block Requirement Items.\r\n\t\t\t\t\t$reqdat[$blockname][$value] = $type;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$reqdat[$value] = $type;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tdie(\"Unexpected Requirements Item '{$item}' at Line {$line} in {$req}\\n\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tif ($debug) {\r\n\t\t\t\tif (isset($item[0])) {\r\n\t\t\t\t\techo \"Line {$line}, is a comment. Ignoring.\\n\";\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\techo \"Line {$line}, is a blank line. Ignoring.\\n\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif ($debug) { var_dump($reqdat); }\r\n\t\r\n\t// Now we've got everything we need to make a move on checking\r\n\t// that our Parsed config meets our requirements.\r\n\t$inblock = false;\r\n\t$blockname = false;\r\n\tforeach ($reqdat as $key => $value) {\r\n\t\t// Everything is pretty much a simple comparison system.\r\n\t\techo \"Checking config for $key where its equal to $value\";\r\n\t\tif (is_array($value)) {\r\n\t\t\t$inblock = true;\r\n\t\t\t$blockname = $key;\r\n\t\t}\r\n\t\tif ($inblock) {\r\n\t\t\t// We're checking a block\r\n\t\t\t//if (isset($config[$value\r\n\t\t\t// I've got to this point and I dont actually know what the fuck Im doing.\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// We're checking a global Var Space. :o\r\n\t\t\tif (isset($config[$key])) {\r\n\t\t\t\tif ($value == \"int\") {\r\n\t\t\t\t\t$confval = $config[$key];\r\n\t\t\t\t\tif (!is_numeric($conval)) {\r\n\t\t\t\t\t\t$err = true;\r\n\t\t\t\t\t\t$errline[] = \"Expected Interger for '{$key'} in GLOBAL Config.\";\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\t// Its being assumed as text.\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$err = true;\r\n\t\t\t\t$errline[] = \"Missing GLOBAL value '{$key}' in {$conf}.\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif ($err) {\r\n\t\techo count($errline).\" Errors were found when reading {$conf}.\\n\";\r\n\t\tforeach ($errline as $line) {\r\n\t\t\techo \"\\t- \".$line.\"\\n\";\r\n\t\t}\r\n\t\tdie();\r\n\t}\r\n\treturn $config;\r\n}", "public function parse_xml_config ($data, $rootobj)\n {\n $this->cfg = array ();\n $this->curpath = array ();\n $this->depth = 0;\n $this->havedata = 0;\n $this->xml_parser = xml_parser_create ();\n $this->error = NULL;\n\n xml_set_object($this->xml_parser, $this);\n xml_set_element_handler ($this->xml_parser, \"startElement\", \"endElement\");\n xml_set_character_data_handler ($this->xml_parser, \"cData\");\n \n if (!xml_parse ($this->xml_parser, $data))\n {\n\t$this->error = sprintf (\"XML error: %s at line %d\\n\",\n\t\t\t xml_error_string (xml_get_error_code\n\t\t\t\t\t ($this->xml_parser)),\n\t\t\t xml_get_current_line_number ($this->xml_parser));\n\treturn -1;\n }\n if ($this->error != NULL) {\n /* error detected while parsing... */\n return -1;\n }\n xml_parser_free($this->xml_parser);\n\n if (!$this->cfg[$rootobj])\n {\n\t$this->error = \"XML error: no \".$rootobj.\" object found!\\n\";\n\treturn -1;\n }\n\n return 0;\n }", "function getConfig($file) {\n echo $config;\n $config = parse_ini_file($file, true);\n if (! $config) {\n fatal(\"Configuration file missing or incorrect.\"); \n }\n return $config;\n }", "public function readConfigFile(): void\n {\n $configPath = __DIR__ . '/../../.config';\n if (!file_exists($configPath)) {\n echo \"Could not find .config\\n\";\n die;\n }\n $lines = preg_split('/[\\r\\n]+/', file_get_contents($configPath));\n foreach ($lines as $line) {\n if (empty($line)) {\n continue;\n }\n if (substr($line, 0, 1) == '#') {\n continue;\n }\n $kv = preg_split(\"/=/\", $line);\n $key = $kv[0];\n $value = $kv[1];\n $this->data[$key] = $value;\n }\n }", "function config_load() {\n\t\t$config_camera = '/^\\s*([^:]+)\\s*:\\s*([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})[:-]?([0-9a-f]{2})\\s+(\\d+)\\s*x\\s*(\\d+)\\s*$/iu';\n\t\t$config_gate = '/^\\s*(.+)\\s*\\((\\d+)\\s*,\\s*(\\d+)\\)\\s*\\((\\d+),(\\d+)\\)\\s*$/u';\n\n\t\t$data = file(CONFIG_PATH);\n\t\tif ($data === NULL) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$config = array();\n\n\t\t$status = 0;\n\t\tfor ($n=0; $n<sizeof($data); $n++) {\n\t\t\t$str = $data[$n];\n\t\t\n\t\t\tif (preg_match($config_camera, $str, $matches)) {\n\t\t\t\t$name = trim($matches[1]);\n\t\t\t\t$hw_id = $matches[2].$matches[3].$matches[4].$matches[5].$matches[6].$matches[7];\n\t\t\t\t$width = $matches[8];\n\t\t\t\t$height= $matches[9];\n\n\t\t\t\t$gates = array();\n\t\t\t\tarray_push($config, \n\t\t\t\t\t\t array(\"hw\" => $hw_id, \n\t\t\t\t\t\t \"name\" => $name, \n\t\t\t\t\t\t\t\t \"gates\" => &$gates,\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$status = 1;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($status == 1 && preg_match($config_gate, $str, $matches)) {\n\t\t\t\tarray_push($gates, array(\"name\"=>trim($matches[1]),\n\t\t\t\t\t\t\t\t\t\t \"x1\" =>$matches[2],\n\t\t\t\t\t\t\t\t\t\t \"y1\" =>$matches[3],\n\t\t\t\t\t\t\t\t\t\t \"x2\" =>$matches[4],\n\t\t\t\t\t\t\t\t\t\t \"y2\" =>$matches[5]));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn $config;\n\t}", "function parse_xml_config($data, $rootobj) {\n\n\tglobal $config, $depth, $curpath, $cfg, $havedata, $current;\n\t\n\t$listtags = explode(\" \", \"rule user group key dnsserver winsserver pages \" .\n\t\"encryption-algorithm-option hash-algorithm-option hosts tunnel onetoone \" .\n\t\"staticmap route alias pipe queue shellcmd cacert earlyshellcmd mobilekey \" .\n\t\"servernat proxyarpnet passthrumac allowedip wolentry vlan domainoverrides element\");\n\n\n $current = \"\";\n\t$cfg = array();\n\t$curpath = array();\n\t$depth = 0;\n\t$havedata = 0;\n\t$current = \"\";\n\t\n\t$xml_parser = xml_parser_create();\n\t\n\txml_set_element_handler($xml_parser, \"startElement\", \"endElement\");\n\txml_set_character_data_handler($xml_parser, \"cData\");\n\t\n\tif (!xml_parse($xml_parser, $data)) {\n\t\t$current = sprintf(\"XML error: %s at line %d\\n\",\n\t\t\t\t\txml_error_string(xml_get_error_code($xml_parser)),\n\t\t\t\t\txml_get_current_line_number($xml_parser));\n\t\treturn 0;\n\t}\n\txml_parser_free($xml_parser);\n\t\n\tif (!$cfg[$rootobj]) {\n\t\t$current = \"XML error: no \".$rootobj.\" object found!\\n\";\n\t\treturn 0;\n\t}\n\t\n\t$current = $cfg[$rootobj];\n return 1;\n}", "private static function getConfig(){\n return parse_ini_file(__DIR__ . \"/../config/config.ini\");\n }", "private static function getConfig(){\n return parse_ini_file(__DIR__ . \"/../config/config.ini\");\n }", "function getConfig($file) {\n\t\t$config\t= parse_ini_file($file, true);\n\t\tif (! $config) {\n\t\t\t fatal(\"Configuration file missing or incorrect.\"); \n\t\t}\n\t return $config;\n\t}", "function __loadConfig($plugin,$file) {\n // still support config values of v2.3 elements\n if (count(explode('.', $file)) > 0) {\n $file = str_replace('.', '_', $file);\n }\n \n // load config from app config folder\n if (Configure::load($file) === false) {\n // load config from plugin config folder\n if( $plugin ){\n\t if (Configure::load($plugin.'.'.$file) === false) {\n\t echo '<p>Error: The '.$file.'.php could not be found in your app/config or app/plugins/comment/config folder. Please create it from the default comment/config/default.php.</p>';\n\t }\n\t }else\n\t {\n\t if (Configure::load($file) === false) {\n\t echo '<p>Error: The '.$file.'.php could not be found in your app/config or app/plugins/comment/config folder. Please create it from the default comment/config/default.php.</p>';\n\t }\t \n\t }\n }\n }", "function readconfig($filename) {\n $data = implode(\"\",file($filename));\n $parser = xml_parser_create();\n xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);\n xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1);\n xml_parse_into_struct($parser,$data,$values,$tags);\n xml_parser_free($parser);\n\n // loop through the structures\n foreach ($tags as $key=>$val) {\n if ($key == \"db\") {\n $noderanges = $val;\n // each contiguous pair of array entries are the\n // lower and upper range for each node definition\n for ($i=0; $i < count($noderanges); $i+=2) {\n $offset = $noderanges[$i] + 1;\n $len = $noderanges[$i + 1] - $offset;\n $tdb[] = $this->parseXML(array_slice($values, $offset, $len));\n }\n } else {\n continue;\n }\n }\n return $tdb;\n }", "public function parse($file);", "public function parse($file);", "function load_configs($file, $is_global = true)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid config file found in configs folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__CONFIG__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}", "abstract protected function loadConfig();", "public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }", "function getConfig($file) {\n $config = parse_ini_file($file, true);\n if (! $config) {\n echo \"Fatal: Configuration file missing or incorrect.\\n\";\n exit(1);\n }\n return $config;\n }", "private function parse()\n {\n $handle = fopen($this->filepath, 'r');\n if(! $handle) throw new \\Exception(\"Can't read file $this->filepath\");\n\n $plugin = null;\n\n while(($line = fgets($handle)) !== false) {\n\n /* Remove next line character from end of line */\n $line = str_replace(PHP_EOL, '', $line);\n\n /* Skip comments and empty lines */\n if(starts_with($line, '#') || trim($line) === '') continue;\n\n /* Find description setting */\n else if(starts_with($line, 'description')) $this->parseDescription($line);\n\n /* Find help setting */\n else if(starts_with($line, 'help')) $this->parseHelp($line);\n\n /* Capture commands */\n else if(starts_with_whitespace($line)) $plugin->parseCommand($line);\n\n /* Start plugin capture */\n else {\n $plugin = $this->parseCurrentPlugin($line);\n }\n }\n\n fclose($handle);\n\n /* Set state as parsed */\n $this->isParsed = true;\n }", "public function testConfigFromSingleFile()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $config = $cfg->load(\"view\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayHasKey(\"file\", $config);\n $this->assertArrayHasKey(\"config\", $config);\n $this->assertArrayNotHasKey(\"items\", $config);\n $this->assertContains(\"a view\", $config[\"config\"]);\n }", "public function parseFile($filename, $config = null, $encoding = null, $use_include_path = false) {}", "private function loadHookConfig() {\r\n if (!is_readable(self::CONFIG_FILE)) {\r\n throw new \\Slackbot\\Exception\\ConfigException('Missing config file ' . self::CONFIG_FILE);\r\n }\r\n \r\n $config = parse_ini_file(self::CONFIG_FILE, true);\r\n\t\tforeach ($config as $sectionName => $settings) {\r\n\t\t\tif (isset($settings['token'])) {\r\n\t\t\t\tforeach ($this->hooks as $hookName => $hook) {\r\n\t\t\t\t\tif ($hookName === $sectionName) {\r\n\t\t\t\t\t\t$hook->addTokens((array)$settings['token']);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "protected function parse($file) {\n self::loadSpycLibrary();\n $config = Spyc::YAMLLoad($file);\n \n if (!$config) {\n throw new Exception(\"Configuration is either empty or contains fatal errors\");\n }\n \n return $config;\n }", "public function testConfigFromFileAndDirectory()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $config = $cfg->load(\"route\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayHasKey(\"file\", $config);\n $this->assertArrayHasKey(\"config\", $config);\n $this->assertContains(\"a route\", $config[\"config\"]);\n $this->assertArrayHasKey(\"items\", $config);\n $this->assertContains(\"a 404 route\", $config[\"items\"][0][\"config\"]);\n $this->assertContains(\"an internal route\", $config[\"items\"][1][\"config\"]);\n }", "private function loadConfig()\n {\n $files = scandir($this->configPath());\n $configs = [];\n\n foreach ($files as $file) {\n $filePath = $this->configPath() . DIRECTORY_SEPARATOR . $file;\n\n if (is_file($filePath)) {\n $config = [basename($file, '.php') => include $filePath];\n if (is_array($config)) {\n $configs = array_merge($configs, $config);\n }\n }\n }\n\n $this->config = $configs;\n }", "public static function loadConfig($configFile) {\n\t}", "private function configuration() {\n\n $f = \"includes/expr.ini\";\n\n return parse_ini_file($f);\n\n }", "protected function loadConfig($rootDir)\n {\n // Require the config */\n require_once $this->normalizePath($rootDir) . '/config.php';\n }", "public static function parse($dir = null)\n {\n self::$dir = ($dir != null ? rtrim($dir,'/').'/': dirname(dirname(dirname(__FILE__))).'/config/');\n\n $config = (object) array();\n // No configuration needed!\n if(!is_dir(self::$dir)){ return $config; }\n\n if(!is_readable(self::$dir.self::$default_config.'.php')){ return $config; }\n\n $cfg_arr = (array) require_once self::$dir.self::$default_config.'.php';\n\n if(self::$check_keys){\n\n if(!empty($_SERVER[self::$environment_key]) && is_readable(self::$dir.$_SERVER[self::$environment_key].'.php')){\n $env_arr = (array) require_once self::$dir.$_SERVER[self::$environment_key].'.php';\n $cfg_arr = array_replace($cfg_arr,$env_arr);\n }\n\n if(!empty($_SERVER[self::$developer_key]) && is_readable(self::$dir.$_SERVER[self::$developer_key].'.php')){\n $dev_arr = (array) require_once self::$dir.$_SERVER[self::$developer_key].'.php';\n $cfg_arr = array_replace($cfg_arr,$dev_arr);\n }\n\n $config = (object) $cfg_arr;\n }\n return $config;\n }", "public static function parse($filename)\n\t{\n\t\ttry {\n\t\t\t$loaded = parse_ini_file($filename, true);\n\t\t} catch (Exception $e) {\n\t\t\trequire_once 'Syx/Config/Exception.php';\n\t\t\tthrow new Syx_Config_Exception($e->getMessage());\n\t\t}\n\n\t\t$iniArray = array();\n\t\tforeach ($loaded as $section => $data) {\n\t\t\tif (!is_array($data)) {\n\t\t\t\t$iniArray = array_merge_recursive($iniArray, self::_processKey(array(), $section, $data));\n\t\t\t} else {\n\t\t\t\t$config = array();\n\t\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t\t$config = self::_processKey($config, $key, $value);\n\t\t\t\t}\n\t\t\t\t$iniArray[$section] = $config;\n\t\t\t}\n\t\t}\n\n\t\treturn $iniArray;\n\t}", "private function parse($config) {\n\t\t$this->domain = $this->getDomainFromConfig($config);\n\n\t\t$this->configurations = $this->getSettingsFromConfig($config);\n\n\t\t$this->declarations = $this->getDeclarationsFromConfig($config);\n\t}", "public function loadConfig($file) {\n $config = array();\n if (file_exists(PATH_CONFIGS . $file))\n include(PATH_CONFIGS . $file);\n if (!empty($config)) {\n foreach ($config as $name => $array) {\n $this->configs[$name] = $array;\n }\n }\n }", "protected function parseXmlFile() {}", "private static function getConfig() {\n\n\t\t$pathRoot = $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'],0, strpos($_SERVER['PHP_SELF'],\"/\",1)).\"/config/\";\n\n\t\t$jsonConfig = file_get_contents($pathRoot.'config.json');\n\t\tself::$arrayConfig = json_decode($jsonConfig);\n\t}", "function __construct() {\n if (!file_exists($this->configuration_file_path)) {\n \n die(\"FATAL: Missing \" . $this->configuration_file_path . `pwd` );\n \n }\n \n $raw_contents = file_get_contents($this->configuration_file_path);\n\n\n //parse json object\n try {\n\n $this->Config = json_decode( $raw_contents );\n\n } catch (Exception $e) {\n\n die(\"FATAL: Bad configuration file? \");\n\n }\n \n\n }", "protected function parseFileConfig($path, $type) {\n $config = $this->config;\n\n if (is_array($path)) {\n $path = $path[0];\n }\n\n $pos = strpos($path, '::');\n\n if($pos !== false)\n {\n foreach($config['paths'] as $key => $location)\n {\n if(substr($path, 0, $pos) == $key)\n {\n\n \n if (is_array($location))\n {\n $type = Arr::get($location, $type.'_dir', $type .'/');\n \n\n $location = $location['path'];\n }\n\n if ($type and substr($type, -1) != '/')\n {\n $type .= '/';\n }\n\n // a little something for google web fonts\n if(substr($path, $pos+2,1) == '?')\n {\n $type = rtrim($type, '/');\n }\n $path = $location . $type .substr($path, $pos+2);\n\n break;\n }\n }\n }\n else\n {\n $path = $this->assetUrl() . '/'.$type.'/'.$path;\n }\n\n return $path;\n }", "public function getConfig() {\n if ($this->config) {\n return $this->config;\n }\n \n $this->config = $this->parse($this->configFile);\n return $this->config;\n }", "public function init(){\n\t\t$jsonParsed = json_decode($this->configFileRaw, true);\n\t\t\n\t\tif(empty($jsonParsed) || !is_array($jsonParsed)){\n\t\t\tthrow new \\Exception(\"config.json empty or corrupted\");\n\t\t}\n\t\t$this->config = $jsonParsed;\n\t}", "public static function config($_file) {\n\t\t// Generate hash code for config file\n\t\t$_hash='php.'.self::hashCode($_file);\n\t\t$_cached=Cache::cached($_hash);\n\t\tif ($_cached && filemtime($_file)<$_cached['time'])\n\t\t\t// Retrieve from cache\n\t\t\t$_save=gzinflate(Cache::fetch($_hash));\n\t\telse {\n\t\t\tif (!file_exists($_file)) {\n\t\t\t\t// .ini file not found\n\t\t\t\tself::$global['CONTEXT']=$_file;\n\t\t\t\ttrigger_error(self::TEXT_Config);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Map sections to framework methods\n\t\t\t$_map=array('global'=>'set','routes'=>'route','maps'=>'map');\n\t\t\t// Read the .ini file\n\t\t\tpreg_match_all(\n\t\t\t\t'/\\s*(?:\\[(.+?)\\]|(?:;.+?)*|(?:([^=]+)=(.+?)))(?:\\v|$)/s',\n\t\t\t\t\tfile_get_contents($_file),$_matches,PREG_SET_ORDER\n\t\t\t);\n\t\t\t$_cfg=array();\n\t\t\t$_ptr=&$_cfg;\n\t\t\tforeach ($_matches as $_match) {\n\t\t\t\tif ($_match[1]) {\n\t\t\t\t\t// Section header\n\t\t\t\t\tif (!isset($_map[$_match[1]])) {\n\t\t\t\t\t\t// Unknown section\n\t\t\t\t\t\tself::$global['CONTEXT']=$_section;\n\t\t\t\t\t\ttrigger_error(self::TEXT_Section);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$_ptr=&$_cfg[$_match[1]];\n\t\t\t\t}\n\t\t\t\telseif ($_match[2]) {\n\t\t\t\t\t$_csv=array_map(\n\t\t\t\t\t\tfunction($_val) {\n\t\t\t\t\t\t\t// Typecast if necessary\n\t\t\t\t\t\t\treturn is_numeric($_val) ||\n\t\t\t\t\t\t\t\tpreg_match('/^(TRUE|FALSE)\\b/i',$_val)?\n\t\t\t\t\t\t\t\t\teval('return '.$_val.';'):$_val;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tstr_getcsv($_match[3])\n\t\t\t\t\t);\n\t\t\t\t\t// Convert comma-separated values to array\n\t\t\t\t\t$_match[3]=count($_csv)>1?$_csv:$_csv[0];\n\t\t\t\t\tif (preg_match('/(.+?)\\[(.*?)\\]/',$_match[2],$_sub)) {\n\t\t\t\t\t\tif ($_sub[2])\n\t\t\t\t\t\t\t// Associative array\n\t\t\t\t\t\t\t$_ptr[$_sub[1]][$_sub[2]]=$_match[3];\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t// Numeric-indexed array\n\t\t\t\t\t\t\t$_ptr[$_sub[1]][]=$_match[3];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t// Key-value pair\n\t\t\t\t\t\t$_ptr[$_match[2]]=$_match[3];\n\t\t\t\t}\n\t\t\t}\n\t\t\tob_start();\n\t\t\tforeach ($_cfg as $_section=>$_pair) {\n\t\t\t\t$_func=$_map[$_section];\n\t\t\t\tforeach ($_pair as $_key=>$_val)\n\t\t\t\t\t// Generate PHP snippet\n\t\t\t\t\techo 'F3::'.$_func.'('.\n\t\t\t\t\t\tvar_export($_key,TRUE).','.\n\t\t\t\t\t\t($_func=='set' || !is_array($_val)?\n\t\t\t\t\t\t\tvar_export($_val,TRUE):self::listArgs($_val)).\n\t\t\t\t\t');'.\"\\n\";\n\t\t\t}\n\t\t\t$_save=ob_get_contents();\n\t\t\tob_end_clean();\n\t\t\t// Compress and save to cache\n\t\t\tCache::store($_hash,gzdeflate($_save));\n\t\t}\n\t\t// Execute cached PHP code\n\t\teval($_save);\n\t\tif (self::$global['ERROR'])\n\t\t\t// Remove from cache\n\t\t\tCache::remove($_hash);\n\t}", "private function loadConfig() {\n $config = array();\n\n $this->config = $config;\n if (file_exists(__DIR__ . '/../config.php')) {\n require_once(__DIR__. '/../config.php');\n $this->config = array_merge($this->config, $config);\n //TODO check for required config entries\n } else {\n //TODO handle this nicer\n $this->fatalErr('NO_CFG', 'Unable to load config file');\n }\n\n if (array_key_exists('THEME', $this->config)) {\n $this->pageLoader->setTheme($this->config['THEME']);\n }\n }", "private function readConfig(){\n\n\t\t$this->_ini_array = parse_ini_file(CONFIG.'system.ini');\n\n\t\t$this->_host =\t$this->_ini_array['db_host'];\n\t\t$this->_username = $this->_ini_array['db_username'];\n\t\t$this->_password = $this->_ini_array['db_password'];\n\t\t$this->_database = $this->_ini_array['db_database'];\n\t\n\t\t$this->_log_enabled=$this->_ini_array['log_enabled'];\n\t\t$this->_log_level=$this->_ini_array['log_level'];\n\t\t$this->_log_file_path=$this->_ini_array['log_path'];\n\t\n\n\t\t$this->_lang_default=$this->_ini_array['lang_default'];\n\n\t}", "private function readConfigFile($path){\n return parse_ini_file($path);\n }", "protected function process()\r\n\t{\r\n\t\t$this->authentication_sources[\"guest\"] = \"guest\";\t\t\r\n\t\t\r\n\t\tforeach ( $this->xml->configuration->config as $config )\r\n\t\t{\r\n\t\t\t// server specific config,\r\n\t\t\t// e.g., only a test server\r\n\t\t\t\t\r\n\t\t\t$host = (string) $config[\"host\"];\r\n\t\t\t\t\r\n\t\t\tif ( $host != \"\" && isset($_SERVER) )\r\n\t\t\t{\r\n\t\t\t\t// nope not this server, so skip it\r\n\t\t\r\n\t\t\t\tif ($host != $_SERVER['SERVER_NAME'] && $host != $_SERVER['SERVER_ADDR'] )\r\n\t\t\t\t{\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t// name\r\n\t\t\t\t\r\n\t\t\t$name = Parser::strtoupper( $config[\"name\"] );\r\n\t\t\t$lang = (string) $config[\"lang\"];\r\n\t\t\t\t\r\n\t\t\tif ( $lang != \"\" && $lang != $this->initDefaultLanguage() )\r\n\t\t\t{\r\n\t\t\t\t$name .= \"_$lang\";\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\tif ( $config[\"xml\"] == \"true\" )\r\n\t\t\t{\r\n\t\t\t\t// special XML config, already parsed as SimpleXML, leave it that way.\r\n\t\t\t\t$value = $config;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//simple string\r\n\t\t\t\t \r\n\t\t\t\t$value = trim( ( string ) $config );\r\n\t\t\r\n\t\t\t\t// convert simple xml-encoded values to something easier\r\n\t\t\t\t// for the client code to digest\r\n\t\t\r\n\t\t\t\t$value = str_replace( \"&lt;\", \"<\", $value );\r\n\t\t\t\t$value = str_replace( \"&gt;\", \">\", $value );\r\n\t\t\t\t$value = str_replace( \"&amp;\", \"&\", $value );\r\n\t\t\t}\r\n\t\t\r\n\t\t\t// special logic for authentication_source because we can\r\n\t\t\t// have more than one.\r\n\t\t\r\n\t\t\tif ( $name == \"AUTHENTICATION_SOURCE\" )\r\n\t\t\t{\r\n\t\t\t\t$this->authentication_sources[( string ) $config[\"id\"]] = $value;\r\n\t\t\r\n\t\t\t\t// and don't overwrite the first one in our standard config array\r\n\t\t\r\n\t\t\t\tif ( ! empty( $this->arrConfig[\"AUTHENTICATION_SOURCE\"] ) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$value = \"\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t\tif (! empty($value) )\r\n\t\t\t{\r\n\t\t\t\t// add it to the config array\r\n\t\t\r\n\t\t\t\t$this->arrConfig[$name] = $value;\r\n\t\t\r\n\t\t\t\t// types that are listed as 'pass' will be forwarded\r\n\t\t\t\t// on to the xml layer for use in the view\r\n\t\t\r\n\t\t\t\tif ( ( string ) $config[\"pass\"] == \"true\" )\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->arrPass[Parser::strtolower( $name )] = $value;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function parse_file($file) {\n\n // Fetch the contents of the specified file:\n $content = file_get_contents($file);\n // Split the content by line break:\n $lines = explode(\"\\n\",$content);\n // Define an array to tag every property on:\n $array = array();\n // Read all lines:\n foreach ($lines as $value) {\n // If the first character of the line isn't a # (comment character) continue, else ignore:\n if(substr($value,0,1) != \"#\"){\n // Split the line at \"=\" to fetch the property name and value.\n $lineSplit = explode(\"=\",$value);\n // Define the property name:\n $propName = $lineSplit[0];\n // Define the property value:\n $propValue = $lineSplit[1];\n // Get rid of whitespaces:\n $propValue = substr($propValue,0,strlen($propValue)-1);\n // Set the property in the array equal to it's value:\n $array[$propName] = $propValue;\n }\n }\n return $array;\n }", "private function parseConfig(array $config = [])\n {\n $this->apiConfig = $this->extractGuzzleConfig($config);\n\n if (ConfigUtils::configurationExists($this->apiConfig, 'apiDescription')) {\n $this->apiDescription = $this->apiConfig['apiDescription'];\n }\n if (ConfigUtils::configurationExists($this->apiConfig, 'authType')) {\n $this->authType = $this->apiConfig['authType'];\n }\n if (ConfigUtils::configurationExists($this->apiConfig, 'debug')) {\n $this->debugMode = $this->apiConfig['debug'];\n if (ConfigUtils::configurationExists($this->apiConfig, 'debugLogger')) {\n $this->debugLogger = $this->apiConfig['debugLogger'];\n }\n }\n }", "function parse_amportal_conf_bootstrap($filename) {\n\t$file = file($filename);\n\tforeach ($file as $line) {\n\t\tif (preg_match(\"/^\\s*([\\w]+)\\s*=\\s*\\\"?([\\w\\/\\:\\.\\*\\%-]*)\\\"?\\s*([;#].*)?/\",$line,$matches)) {\n\t\t\t$conf[ $matches[1] ] = $matches[2];\n\t\t}\n\t}\n\tif ( !isset($conf[\"AMPWEBROOT\"]) || ($conf[\"AMPWEBROOT\"] == \"\")) {\n\t\t$conf[\"AMPWEBROOT\"] = \"/var/www/html\";\n\t} else {\n\t\t$conf[\"AMPWEBROOT\"] = rtrim($conf[\"AMPWEBROOT\"],'/');\n\t}\n\n\treturn $conf;\n}", "function readConfigXML($fileName) {\n\n $this->currentFile = $fileName;\n $this->_getFileXML($fileName);\n $this->_parseXML();\n }", "public function testConfigFromDirectory()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $config = $cfg->load(\"response\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayNotHasKey(\"file\", $config);\n $this->assertArrayNotHasKey(\"config\", $config);\n $this->assertArrayHasKey(\"items\", $config);\n $this->assertContains(\"part1\", $config[\"items\"][0][\"config\"]);\n $this->assertContains(\"part2\", $config[\"items\"][1][\"config\"]);\n }", "function config(string $file, string $path = '')\n {\n if($path == ''){\n if(defined('LARAPRESS_PATH')){\n $path = LARAPRESS_PATH . '/config/';\n }\n }\n\n if(!is_string($path))\n return;\n\n $configFile = $path . $file . '.php';\n if(file_exists($configFile)){\n $array = include($configFile);\n\n if(!is_array($array))\n return;\n\n return $array;\n }\n }", "public function loadConfig($file)\n {\n $options = [];\n try {\n $loader = new PhpConfig();\n $options = $loader->read($file);\n } catch (\\Exception $e) {\n Log::warning($e->getMessage());\n }\n\t\t$this->config('options', $options);\n\t}", "protected function _findConfigs()\n {\n foreach (new DirectoryIterator($this->_configPath) as $fileInfo) {\n if ($fileInfo->isDot()) {\n continue;\n }\n if ($fileInfo->isDir()) {\n continue;\n }\n if ($fileInfo->getExtension() !== 'xml') {\n continue;\n }\n\n $name = str_replace('.' . $fileInfo->getExtension(), '', $fileInfo->getFilename());\n $this->_configFiles[$name] = [\n 'name' => $name,\n 'basename' => $fileInfo->getBasename(),\n 'pathname' => $fileInfo->getPathname(),\n ];\n }\n }", "function read_config($file = false)\n{\n global $config, $databases;\n $ret = false;\n if (!$file) {\n $file = $config['config_file'];\n }\n // protect from including external files\n $search = array(':', 'http', 'ftp', ' ');\n $replace = array('', '', '', '');\n $file = str_replace($search, $replace, $file);\n\n if (is_readable($config['paths']['config'] . $file . '.php')) {\n // to prevent modern server from caching the new configuration we need to evaluate it this way\n clearstatcache();\n $f = implode('', file($config['paths']['config'] . $file . '.php'));\n $f = str_replace('<?php', '', $f);\n $f = str_replace('?>', '', $f);\n eval($f);\n $config['config_file'] = $file;\n $_SESSION['config_file'] = $config['config_file'];\n $ret = true;\n }\n\n return $ret;\n}", "public function newRootConfig($file, $data)\n {\n $config = new RootConfig($file, $data);\n $config->setOverrides($this->rootConfigOverrides);\n return $config;\n }", "protected function _load_config($type) {\r\n\t\t$this->regx_parse = new FileSystem_File(\r\n\t\t\tROOT_BACK.MODELS_DIRECTORY.DS.'Filesystem'.DS.'File'.DS.'settings',\r\n\t\t\t$type.'.xml'\r\n\t\t);\r\n\t\t$this->regx_parse->open('read','settings');\r\n }", "function Event_Config_Read()\n {\n if (empty($this->Event_Config))\n {\n $this->Event_Config=$this->ReadPHPArray($this->Event_Config_File());\n $groups=$this->Dir_Files($this->Event_Config_Path.\"/Config\",'\\.php$');\n $this->Event_Config_Group=$this->Event_Config[ \"Config_Group_Default\" ];\n \n }\n }", "private function loadConfigurations(YAMLParser $parser, array $nodeConfig)\n {\n\n // $subdirectories = $this->getDirectoryList();\n\n //first load the system service configurations\n $parser->setFilePath(__SITE_PATH . '/app/config/services.yml');\n $config = $parser->loadConfig();\n\n if (is_array($config)) {\n $this->config[] = $config;\n }\n $folder = str_replace('\\\\', DIRECTORY_SEPARATOR, $nodeConfig['namespace']) . DIRECTORY_SEPARATOR . $nodeConfig['componentFolder'];\n //now load all the component configurations\n// foreach ($subdirectories as $folder) {\n// $parser->setFilePath($folder . '/config/services.yml');\n// $config = $parser->loadConfig();\n//\n// if (is_array($config)) {\n// $this->config[] = $config;\n// }\n// }\n\n $parser->setFilePath(__SITE_PATH . DIRECTORY_SEPARATOR . $folder . '/config/services.yml');\n $config = $parser->loadConfig();\n // file_put_contents(__DEBUG_OUTPUT_PATH, print_r($config, true), FILE_APPEND);\n if (is_array($config)) {\n $this->config[] = $config;\n }\n\n // file_put_contents(__DEBUG_OUTPUT_PATH, print_r($this->config, true), FILE_APPEND);\n\n // file_put_contents(__DEBUG_OUTPUT_PATH,__SITE_PATH . DIRECTORY_SEPARATOR . $folder . '/config/services.yml'.\"\\r\\n\", FILE_APPEND);\n\n }", "public function getConfig($file) {\n $config = array();\n if (file_exists($file)) {\n $yaml = new Parser();\n $config = $yaml->parse(file_get_contents($file));\n }\n return $config;\n }", "public function setupConfig()\n {\n registry::getInstance()->set('config', $this->parseConfig());\n }", "function get_config($filename)\n{\n\t$config = parse_ini_file($filename);\n\n\tif ($config === FALSE) {\n\t\tthrow new Exception(\"could not read configuration from '{$filename}'\");\n\t}\n\n\tif (!isset($config['url'])) {\n\t\tthrow new Exception(\"url not found in '{$filename}'\");\n\t}\n\tif (!isset($config['username'])) {\n\t\tthrow new Exception(\"username not found in '{$filename}'\");\n\t}\n\tif (!isset($config['password'])) {\n\t\tthrow new Exception(\"password not found in '{$filename}'\");\n\t}\n\tif (!isset($config['source'])) {\n\t\tthrow new Exception(\"source project not found in '{$filename}'\");\n\t}\n\tif (!isset($config['destination'])) {\n\t\tthrow new Exception(\"destination project not found in '{$filename}'\");\n\t}\n\n\treturn $config;\n}", "public function getConfig(string $file, string $returnKey = null)\n\t{\n\t\t// default to BP./app/config/ dir\n\t\tif (substr($file, 0, 1 ) != \"/\")\n\t\t\t$file = BP.'/app/config/'.$file;\n\t\n\t\t$config = parse_ini_file($file, true, INI_SCANNER_TYPED);\n\t\t$configOutput = (object)[];\n\n\t\tif (!is_null($returnKey) and !empty($returnKey))\n\t\t\treturn $config[$returnKey];\n\n\t\t// has section headings\n\t\tif (is_array($config[key($config) ])) {\n\t\t\tforeach($config as $section => $values) {\n\t\t\t\t$configOutput->{$section} = (object)$values;\n\t\t\t}\n\t\t} else { // does not have sections\n\t\t\tforeach($config as $key => $value) {\n\t\t\t\t$configOutput->{$key} = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $configOutput;\n\t}", "public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\n }", "public function getConfigFile();", "private function loadConfig()\n {\n\n $this->config = include(__DIR__ . '/../../config/config.php');\n\n }", "protected function _getConfigFile()\n {\n $moduleName = get_class($this);\n $moduleName = strtolower(substr($moduleName, 0, strpos($moduleName, '_')));\n\n if(!in_array($moduleName,\n array_keys(Zend_Controller_Front::getInstance()->getControllerDirectory())))\n {\n $moduleName = \"\";\n }\n\n $loader = null;\n\n foreach(Zend_Loader_Autoloader::getInstance()->getAutoloaders() as $autoloader)\n {\n if(strtolower($autoloader->getNamespace()) == $moduleName)\n {\n $loader = $autoloader;\n break;\n }\n }\n\n $moduleName = get_class($this);\n $path = $loader->getResourceTypes();\n\n $path = $path['configs']['path'];\n if(substr($path, -1) != '/' && substr($path, -1) != '\\\\')\n {\n $path .= '/';\n }\n\n $pathPart = str_replace(\n \"_\", \"/\",\n substr(\n stristr($moduleName, $this->_namespaceMapper),\n (strlen($this->_namespaceMapper) + 1)\n )\n );\n\n $config = array();\n\n foreach(array('ini' => 'Ini', 'yml' => 'Yaml', 'xml' => 'Xml') as $configExt => $parserType)\n {\n if(file_exists($path . $pathPart . '.' . $configExt))\n {\n $parser = 'Zend_Config_' . $parserType;\n $parser = new $parser($path . $pathPart . '.' . $configExt);\n $config = $parser->toArray();\n }\n }\n return $config;\n }", "public function parseConfig()\n {\n parent::parseConfig();\n if(empty($this->config['parentClass'])) {\n throw new \\InvalidArgumentException(\"parentClass configuration option is required to use parent factory\");\n }\n $this->parentClass = $this->config['parentClass'] ?: null;\n $this->parentNamespace = $this->config['parentNamespace'] ?: $this->namespace;\n }", "private function __construct($configFile) {\n $this->parseFile($configFile);\n\n // if we are in cli, do nothing more\n if (!isset($_SERVER) || !isset($_SERVER['HTTP_HOST'])) {\n return;\n }\n\n $this->fetchCurrentDomainConfiguration();\n }", "private function apiConfigFromFile(string $file = null)\r\n {\r\n $file = is_null($file) ? getenv(\"HOME\") . \"config.json\" : $file;\r\n if (empty($this->api_key) === false || empty($this->api_secret) === false) {\r\n return;\r\n }\r\n if (file_exists($file) === false) {\r\n echo \"Unable to load config from: \" . $file . PHP_EOL;\r\n echo \"API KEY or SECRET not found\" . PHP_EOL;\r\n return;\r\n }\r\n $contents = json_decode(file_get_contents($file), true);\r\n $this->api_key = isset($contents['api-key']) ? $contents['api-key'] : \"\";\r\n $this->api_secret = isset($contents['api-secret']) ? $contents['api-secret'] : \"\";\r\n }", "function read_openvpn_config($config_file_name){\r\n\t//Global $a_config_lines, $port_values, $proto_values, $dev_values, $ca_values, $key_values, $crt_values, $key_values, $group_values, $user_values, $dh_values, $server_values, $ifconfig_pool_values, $keepalive_values, $comp_values, $verb_values, $status_values, $management_values, $a_extra_config_settings;\r\n \t$a_config_lines = file($config_file_name);//read file to array\r\n\t//push the values that have no \"config settings\" like \"client-to-client\" to an array\r\n\tGlobal $a_extra_config_settings;\r\n $a_extra_config_settings = array();\r\n\t$i = 0;\r\n\tforeach ($a_config_lines as $line_num => $line) {\r\n\t\tif (stristr($line, \"cert\")){\r\n\t\t\t$crt_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"port\")){\r\n\t\t\t$port_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"proto\")){\r\n\t\t\t$proto_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"dev\")){\r\n\t\t\t$dev_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"ca\")){\r\n\t\t\t$ca_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"key \")){\r\n\t\t\t$key_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"dh\")){\r\n\t\t\t$dh_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\t\r\n\t\tif (stristr($line, \"server\")){\r\n\t\t\t$server_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"ifconfig-pool-persist\")){\r\n\t\t\t$ifconfig_pool_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"keepalive\")){\r\n\t\t\t$keepalive_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"status\")){\r\n\t\t\t$status_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"verb\")){\r\n\t\t\t$verb_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\t\r\n\t\tif (stristr($line, \"management\")){\r\n\t\t\t$management_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"user \")){\r\n\t\t\t$user_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tif (stristr($line, \"group \")){\r\n\t\t\t$group_values = explode(\" \", trim($line));\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\telse{array_push($a_extra_config_settings, trim($line));}\r\n\t$i++;\r\n\t} \r\nGlobal $num_settings; \r\n$num_settings = $i;\r\n//return value will be array of arrays\r\n$return_value = array('a_config_lines' => $a_config_lines, 'port_values' => $port_values, 'proto_values' => $proto_values, 'dev_values' => $dev_values, 'ca_values' => $ca_values, 'key_values' => $key_values, 'crt_values' => $crt_values, 'key_values' => $key_values, 'group_values' => $group_values, 'user_values' => $user_values, 'dh_values' => $dh_values, 'server_values' => $server_values, 'ifconfig_pool_values' => $ifconfig_pool_values, 'keepalive_values' => $keepalive_values, 'comp_values' => $comp_values, 'verb_values' => $verb_values, 'status_values' => $status_values, 'management_values' => $management_values, 'a_extra_config_settings' => $a_extra_config_settings);\r\nreturn $return_value;\r\n}", "protected function read() {\n\t\t$fileContent = trim(file_get_contents($this->filepath));\n\t\t$pattern = '/\\$([^=]+)=([^;]+);/';\n\t\t$matches = null;\n\t\t$matchesFound = preg_match_all($pattern, $fileContent, $matches);\n\t\t$configContents = array();\n\t\tif ($matchesFound) {\n\t\t\t$configContents = $matches[0];\n\t\t}\n\t\t$this->rows = array();\n\t\tforeach ($configContents as $configLine) {\n\t\t\t$this->rows[] = new ConfigFileRow($configLine, $this);\n\t\t}\n\t\t$this->rowIndex = -1;\n\t\tunset($fileContent);\n\t}", "function c_ini_data($filename,$process_sections=false)\r\n {\r\n\r\n if (file_exists($filename))\r\n {\r\n $output = parse_ini_file($filename,$process_sections);\r\n return (array) $output;\r\n }\r\n else\r\n {\r\n trigger_error($filename.' configuration file not found.');\r\n }\r\n\r\n }", "function get_parse_ini($file)\n{\n if (!is_file($file))\n return false;\n\n $ini = file($file);\n\n // to hold the categories, and within them the entries\n $cats = array();\n\n foreach ($ini as $i) {\n if (@preg_match('/\\[(.+)\\]/', $i, $matches)) {\n $last = $matches[1];\n } elseif (@preg_match('/(.+)=(.+)/', $i, $matches)) {\n $cats[$last][trim($matches[1])] = trim($matches[2]);\n }\n }\n\n return $cats;\n\n}", "protected function loadConfig() {\n $json = new JSON();\n $viewConfig = $json->readFile(__SITE_PATH . \"\\\\config\\\\view.json\");\n $this->meta_info = $viewConfig['meta'];\n $this->js_files = $viewConfig['javascript'];\n $this->css_files = $viewConfig['css'];\n }", "function tidy_parse_file($filename, $config = null, $encoding = null, $use_include_path = false) {}", "function loadSettings($config_file) {\n\n\t\tif ($settings = $this->xml_parser->parseXml($config_file, true, CONFIG_UTF8ENCODE)) {\n\t\t\t// read the XML structure into an array\n\t\t\t$aseco = $settings['SETTINGS']['XASECO2'][0];\n\n\t\t\t// read settings and apply them\n\t\t\t$this->chat_colors = $aseco['COLORS'][0];\n\t\t\t$this->chat_messages = $aseco['MESSAGES'][0];\n\t\t\t$this->masteradmin_list = $aseco['MASTERADMINS'][0];\n\t\t\tif (!isset($this->masteradmin_list) || !is_array($this->masteradmin_list))\n\t\t\t\ttrigger_error('No MasterAdmin(s) configured in config.xml!', E_USER_ERROR);\n\n\t\t\t// check masteradmin list consistency\n\t\t\tif (empty($this->masteradmin_list['IPADDRESS'])) {\n\t\t\t\t// fill <ipaddress> list to same length as <tmlogin> list\n\t\t\t\tif (($cnt = count($this->masteradmin_list['TMLOGIN'])) > 0)\n\t\t\t\t\t$this->masteradmin_list['IPADDRESS'] = array_fill(0, $cnt, '');\n\t\t\t} else {\n\t\t\t\tif (count($this->masteradmin_list['TMLOGIN']) != count($this->masteradmin_list['IPADDRESS']))\n\t\t\t\t\ttrigger_error(\"MasterAdmin mismatch between <tmlogin>'s and <ipaddress>'s!\", E_USER_WARNING);\n\t\t\t}\n\n\t\t\t// set admin lock password\n\t\t\t$this->settings['lock_password'] = $aseco['LOCK_PASSWORD'][0];\n\t\t\t// set cheater action\n\t\t\t$this->settings['cheater_action'] = $aseco['CHEATER_ACTION'][0];\n\t\t\t// set script timeout\n\t\t\t$this->settings['script_timeout'] = $aseco['SCRIPT_TIMEOUT'][0];\n\t\t\t// set minimum number of records to be displayed\n\t\t\t$this->settings['show_min_recs'] = $aseco['SHOW_MIN_RECS'][0];\n\t\t\t// show records before start of map?\n\t\t\t$this->settings['show_recs_before'] = $aseco['SHOW_RECS_BEFORE'][0];\n\t\t\t// show records after end of map?\n\t\t\t$this->settings['show_recs_after'] = $aseco['SHOW_RECS_AFTER'][0];\n\t\t\t// show MX world record?\n\t\t\t$this->settings['show_mxrec'] = $aseco['SHOW_MXREC'][0];\n\t\t\t// show played time at end of map?\n\t\t\t$this->settings['show_playtime'] = $aseco['SHOW_PLAYTIME'][0];\n\t\t\t// show current map at start?\n\t\t\t$this->settings['show_curmap'] = $aseco['SHOW_CURMAP'][0];\n\t\t\t// set default filename for readmaplist/writemaplist\n\t\t\t$this->settings['default_maplist'] = $aseco['DEFAULT_MAPLIST'][0];\n\t\t\t// set minimum number of ranked players in a clan to be included in /topclans\n\t\t\t$this->settings['topclans_minplayers'] = $aseco['TOPCLANS_MINPLAYERS'][0];\n\t\t\t// set multiple of win count to show global congrats message\n\t\t\t$this->settings['global_win_multiple'] = ($aseco['GLOBAL_WIN_MULTIPLE'][0] > 0 ? $aseco['GLOBAL_WIN_MULTIPLE'][0] : 1);\n\t\t\t// timeout of the message window in seconds\n\t\t\t$this->settings['window_timeout'] = $aseco['WINDOW_TIMEOUT'][0];\n\t\t\t// set filename of admin/operator/ability lists file\n\t\t\t$this->settings['adminops_file'] = $aseco['ADMINOPS_FILE'][0];\n\t\t\t// set filename of banned IPs list file\n\t\t\t$this->settings['bannedips_file'] = $aseco['BANNEDIPS_FILE'][0];\n\t\t\t// set filename of blacklist file\n\t\t\t$this->settings['blacklist_file'] = $aseco['BLACKLIST_FILE'][0];\n\t\t\t// set filename of guestlist file\n\t\t\t$this->settings['guestlist_file'] = $aseco['GUESTLIST_FILE'][0];\n\t\t\t// set filename of map history file\n\t\t\t$this->settings['maphist_file'] = $aseco['MAPHIST_FILE'][0];\n\t\t\t// set minimum admin client version\n\t\t\t$this->settings['admin_client'] = $aseco['ADMIN_CLIENT_VERSION'][0];\n\t\t\t// set minimum player client version\n\t\t\t$this->settings['player_client'] = $aseco['PLAYER_CLIENT_VERSION'][0];\n\t\t\t// set default rounds points system\n\t\t\t$this->settings['default_rpoints'] = $aseco['DEFAULT_RPOINTS'][0];\n\n\t\t\t// set windows style (none = Card)\n\t\t\t$this->settings['window_style'] = $aseco['WINDOW_STYLE'][0];\n\t\t\tif ($this->settings['window_style'] == '')\n\t\t\t\t$this->settings['window_style'] = 'Card';\n\n\t\t\t// set admin panel (none = no panel)\n\t\t\t$this->settings['admin_panel'] = $aseco['ADMIN_PANEL'][0];\n\t\t\t// set donate panel (none = no panel)\n\t\t\t$this->settings['donate_panel'] = $aseco['DONATE_PANEL'][0];\n\t\t\t// set records panel (none = no panel)\n\t\t\t$this->settings['records_panel'] = $aseco['RECORDS_PANEL'][0];\n\t\t\t// set vote panel (none = no panel)\n\t\t\t$this->settings['vote_panel'] = $aseco['VOTE_PANEL'][0];\n\n\t\t\t// set panel background (none = Card)\n\t\t\t$this->settings['panel_bg'] = $aseco['PANEL_BG'][0];\n\t\t\tif ($this->settings['panel_bg'] == '')\n\t\t\t\t$this->settings['panel_bg'] = 'PanelBGCard';\n\n\t\t\t// display welcome message as window ?\n\t\t\tif (strtoupper($aseco['WELCOME_MSG_WINDOW'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['welcome_msg_window'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['welcome_msg_window'] = false;\n\t\t\t}\n\n\t\t\t// log all chat, not just chat commands ?\n\t\t\tif (strtoupper($aseco['LOG_ALL_CHAT'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['log_all_chat'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['log_all_chat'] = false;\n\t\t\t}\n\n\t\t\t// show timestamps in /chatlog, /pmlog & /admin pmlog ?\n\t\t\tif (strtoupper($aseco['CHATPMLOG_TIMES'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['chatpmlog_times'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['chatpmlog_times'] = false;\n\t\t\t}\n\n\t\t\t// show records range?\n\t\t\tif (strtoupper($aseco['SHOW_RECS_RANGE'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['show_recs_range'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['show_recs_range'] = false;\n\t\t\t}\n\n\t\t\t// show records in message window?\n\t\t\tif (strtoupper($aseco['RECS_IN_WINDOW'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['recs_in_window'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['recs_in_window'] = false;\n\t\t\t}\n\n\t\t\t// show round reports in message window?\n\t\t\tif (strtoupper($aseco['ROUNDS_IN_WINDOW'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['rounds_in_window'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['rounds_in_window'] = false;\n\t\t\t}\n\n\t\t\t// add random filter to /admin writemaplist output\n\t\t\tif (strtoupper($aseco['WRITEMAPLIST_RANDOM'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['writemaplist_random'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['writemaplist_random'] = false;\n\t\t\t}\n\n\t\t\t// add explanation to /help output\n\t\t\tif (strtoupper($aseco['HELP_EXPLANATION'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['help_explanation'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['help_explanation'] = false;\n\t\t\t}\n\n\t\t\t// color nicknames in the various /top... etc lists?\n\t\t\tif (strtoupper($aseco['LISTS_COLORNICKS'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['lists_colornicks'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['lists_colornicks'] = false;\n\t\t\t}\n\n\t\t\t// color mapnames in the various /lists... lists?\n\t\t\tif (strtoupper($aseco['LISTS_COLORMAPS'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['lists_colormaps'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['lists_colormaps'] = false;\n\t\t\t}\n\n\t\t\t// display checkpoints panel?\n\t\t\tif (strtoupper($aseco['DISPLAY_CHECKPOINTS'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['display_checkpoints'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['display_checkpoints'] = false;\n\t\t\t}\n\n\t\t\t// enable /cpsspec command?\n\t\t\tif (strtoupper($aseco['ENABLE_CPSSPEC'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['enable_cpsspec'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['enable_cpsspec'] = false;\n\t\t\t}\n\n\t\t\t// automatically enable /cps for new players?\n\t\t\tif (strtoupper($aseco['AUTO_ENABLE_CPS'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['auto_enable_cps'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['auto_enable_cps'] = false;\n\t\t\t}\n\n\t\t\t// automatically enable /dedicps for new players?\n\t\t\tif (strtoupper($aseco['AUTO_ENABLE_DEDICPS'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['auto_enable_dedicps'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['auto_enable_dedicps'] = false;\n\t\t\t}\n\n\t\t\t// automatically add IP for new admins/operators?\n\t\t\tif (strtoupper($aseco['AUTO_ADMIN_ADDIP'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['auto_admin_addip'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['auto_admin_addip'] = false;\n\t\t\t}\n\n\t\t\t// automatically force spectator on player using /afk ?\n\t\t\tif (strtoupper($aseco['AFK_FORCE_SPEC'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['afk_force_spec'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['afk_force_spec'] = false;\n\t\t\t}\n\n\t\t\t// provide clickable buttons in lists?\n\t\t\tif (strtoupper($aseco['CLICKABLE_LISTS'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['clickable_lists'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['clickable_lists'] = false;\n\t\t\t}\n\n\t\t\t// show logins in /recs?\n\t\t\tif (strtoupper($aseco['SHOW_REC_LOGINS'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['show_rec_logins'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['show_rec_logins'] = false;\n\t\t\t}\n\n\t\t\t// display individual stats panels at scoreboard?\n\t\t\tif (strtoupper($aseco['SB_STATS_PANELS'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['sb_stats_panels'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['sb_stats_panels'] = false;\n\t\t\t}\n\n\t\t\t// read the XML structure into an array\n\t\t\t$tmserver = $settings['SETTINGS']['TMSERVER'][0];\n\n\t\t\t// read settings and apply them\n\t\t\t$this->server->login = $tmserver['LOGIN'][0];\n\t\t\t$this->server->pass = $tmserver['PASSWORD'][0];\n\t\t\t$this->server->port = $tmserver['PORT'][0];\n\t\t\t$this->server->ip = $tmserver['IP'][0];\n\t\t\tif (isset($tmserver['TIMEOUT'][0])) {\n\t\t\t\t$this->server->timeout = (int)$tmserver['TIMEOUT'][0];\n\t\t\t} else {\n\t\t\t\t$this->server->timeout = null;\n\t\t\t\ttrigger_error('Server init timeout not specified in config.xml !', E_USER_WARNING);\n\t\t\t}\n\n\t\t\t// initialise default window style\n\t\t\t$style_file = 'styles/' . $this->settings['window_style'] . '.xml';\n\t\t\t$this->console_text('[XAseco2] Load default window style [{1}]', $style_file);\n\t\t\t// load default style\n\t\t\tif (($this->style = $this->xml_parser->parseXml($style_file)) && isset($this->style['STYLES'])) {\n\t\t\t\t$this->style = $this->style['STYLES'];\n\t\t\t} else {\n\t\t\t\t// Could not parse XML file\n\t\t\t\ttrigger_error('Could not read/parse style file ' . $style_file . ' !', E_USER_ERROR);\n\t\t\t}\n\n\t\t\t// initialise default panel background\n\t\t\t$panelbg_file = 'panels/' . $this->settings['panel_bg'] . '.xml';\n\t\t\t$this->console_text('[XAseco2] Load default panel background [{1}]', $panelbg_file);\n\t\t\t// load default background\n\t\t\tif (($this->panelbg = $this->xml_parser->parseXml($panelbg_file)) && isset($this->panelbg['PANEL']['BACKGROUND'][0])) {\n\t\t\t\t$this->panelbg = $this->panelbg['PANEL']['BACKGROUND'][0];\n\t\t\t} else {\n\t\t\t\t// Could not parse XML file\n\t\t\t\ttrigger_error('Could not read/parse panel background file ' . $panelbg_file . ' !', E_USER_ERROR);\n\t\t\t}\n\n\t\t\t$this->panels = array();\n\t\t\t$this->panels['admin'] = '';\n\t\t\t$this->panels['donate'] = '';\n\t\t\t$this->panels['records'] = '';\n\t\t\t$this->panels['vote'] = '';\n\n\t\t\tif ($this->settings['admin_client'] != '' &&\n\t\t\t preg_match('/^2\\.11\\.[12][0-9]$/', $this->settings['admin_client']) != 1 ||\n\t\t\t $this->settings['admin_client'] == '2.11.10')\n\t\t\t\ttrigger_error('Invalid admin client version : ' . $this->settings['admin_client'] . ' !', E_USER_ERROR);\n\t\t\tif ($this->settings['player_client'] != '' &&\n\t\t\t preg_match('/^2\\.11\\.[12][0-9]$/', $this->settings['player_client']) != 1 ||\n\t\t\t $this->settings['player_client'] == '2.11.10')\n\t\t\t\ttrigger_error('Invalid player client version: ' . $this->settings['player_client'] . ' !', E_USER_ERROR);\n\t\t} else {\n\t\t\t// could not parse XML file\n\t\t\ttrigger_error('Could not read/parse config file ' . $config_file . ' !', E_USER_ERROR);\n\t\t}\n\t}", "public function __construct($config_file)\n {\n try \n {\n self::$config_array = Yaml::parse(file_get_contents($config_file))[\"system\"];\n }\n catch (ParseException $e) \n {\n printf(\"Unable to parse the YAML String: %s\", $e->getMessage());\n }\n }", "private function userCurlConfigFromFile(string $file = null)\r\n {\r\n $file = is_null($file) ? getenv(\"HOME\") . \"config.json\" : $file;\r\n if (count($this->curlUserDef) > 0) {\r\n return;\r\n }\r\n if (file_exists($file) === false) {\r\n echo \"Unable to load config from: \" . $file . PHP_EOL;\r\n echo \"No found user curl options\" . PHP_EOL;\r\n return;\r\n }\r\n $contents = json_decode(file_get_contents($file), true);\r\n $this->curlUserDef = isset($contents['curlUserDef']) && is_array($contents['curlUserDef']) ? $contents['curlUserDef'] : [];\r\n }", "function load_config() {\n\t\t$conf_file = @file_get_contents( LDAP_LOGIN_PATH.'data.dat' );\n\t\tif ($conf_file!==false)\n\t\t{\n\t\t\t$this->config = unserialize($conf_file);\n\t\t}\n\t}", "public function parseFiles()\n {\n $this->files->each(function ($file) {\n $this->store[] = $this->getTree($this->parseFile($file), $file);\n });\n }", "private function parsePluginsFile($raw_file)\n\t{\n\t\t// Check for #-comments\n\t\t$lines = explode(\"\\n\", $raw_file);\n\t\tforeach ($lines as $line) {\n\t\t\tif (preg_match('/^\\s*#/', $line)) {\n\t\t\t\treturn \\Result\\Result::err('Comments beginning with # are not permitted');\n\t\t\t}\n\t\t}\n\n\t\t$plugins = parse_ini_string($raw_file);\n\n\t\tif (!is_array($plugins)) {\n\t\t\treturn \\Result\\Result::err('Unable to parse Plugins file');\n\t\t}\n\n\t\t// Got plugins - turn names to sources\n\t\t$source = $append = '';\n\t\t$plugins_manifest = new \\stdClass();\n\n\t\tforeach ($plugins as $plugin => $data) {\n\t\t\t//\n\t\t\t// Special lines\n\t\t\t//\n\n\t\t\tif ($plugin == 'source') {\n\t\t\t\tif (empty($data)) {\n\t\t\t\t\treturn \\Result\\Result::err(\"Source is empty. It should just specify a repo root:\\n\\n source = 'git@git.govpress.com:wordpress-plugins/'\\n\\nWhippet will attempt to find a source for your plugins by appending the plugin name to this URL.\");\n\t\t\t\t}\n\n\t\t\t\t$source = $data;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($plugin == 'append') {\n\t\t\t\t$append = $data;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$repository = $revision = '';\n\n\t\t\t//\n\t\t\t// Everything else should be a plugin\n\t\t\t//\n\n\t\t\t// First see if there is data.\n\t\t\tif (!empty($data)) {\n\t\t\t\t// Format: LABEL[, REPO]\n\t\t\t\tif (strpos($data, ',') !== false) {\n\t\t\t\t\tlist($revision, $repository) = explode(',', $data);\n\t\t\t\t} else {\n\t\t\t\t\t$revision = $data;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// if (empty($repository)) {\n\t\t\t// $repository = \"{$source}{$plugin}{$append}\";\n\t\t\t// }\n\n\t\t\tif (empty($revision)) {\n\t\t\t\t$revision = 'master';\n\t\t\t}\n\n\t\t\t// We should now have repo and revision\n\t\t\t$plugins_manifest->$plugin = new \\stdClass();\n\t\t\t$plugins_manifest->$plugin->repository = $repository;\n\t\t\t$plugins_manifest->$plugin->revision = $revision;\n\t\t}\n\n\t\treturn \\Result\\Result::ok([\n\t\t\t'source' => $source,\n\t\t\t'plugins' => $plugins_manifest,\n\t\t]);\n\t}", "public static function getConfig() {\n return parse_ini_file(__DIR__ . '/config.ini');\n }", "protected function _getSections ($fn) {\n # Starting from the configuration file, construct a relative\n # path to the directory where this file resides. For example, if\n # the configuration file resides at /home/tronkko and this file\n # is located at /home/tronkko/public_html/config/class directory,\n # then the relative directory name is public_html/config/class.\n $root = dirname ($fn) . '/';\n $dir = __DIR__ . '/';\n $n = strlen ($root);\n if (substr ($dir, 0, $n) == $dir) {\n\n # This file resides in a subdirectory compared to\n # configuration file\n $relative = substr ($dir, $n - 1);\n\n } else {\n\n # No common root => use whole path\n $relative = $dir;\n\n }\n\n # Split relative directory name into subdirectories\n $subdirs = explode ('/', trim ($relative, '/'));\n\n # Reverse the order of subdirectories and make them sections.\n # For example, if the list of subdirectories is public_html,\n # config and class, then the list of searched sections will be\n # class, config and finally public_html.\n $sections = array ();\n foreach (array_reverse ($subdirs) as $subdir) {\n # Append dot to section name to simplify searches\n $sections[] = $subdir . '.';\n }\n\n # Append global section. This ensures that options without an\n # explicit section name will be searched from global section.\n $sections[] = 'global.';\n\n # Append empty section. This ensures that options with explicit\n # section names will be search from respective sections.\n $sections[] = '';\n\n return $sections;\n }", "function loadSettings($config_file) {\n\n\t\tif ($settings = $this->xml_parser->parseXml($config_file)) {\n\n\t\t\t// read the xml structure into an array ...\n\t\t\t$aseco = $settings['SETTINGS']['ASECO'][0];\n\n\t\t\t// read settings and apply them ...\n\t\t\t$this->masterserver->login = $aseco['LOGIN'][0];\n\t\t\t$this->masterserver->pass = $aseco['PASSWORD'][0];\n\t\t\t$this->masterserver->ip = $aseco['SERVERIP'][0];\n\t\t\t$this->masterserver->port = $aseco['SERVERPORT'][0];\n\t\t\t$this->chat_colors = $aseco['COLORS'][0];\n\t\t\t$this->chat_messages = $aseco['MESSAGES'][0];\n\t\t\t$this->admin_list = $aseco['ADMINS'][0];\n\n\t\t\t// set script timeout ...\n\t\t\t$this->settings['script_timeout'] = $aseco['SCRIPT_TIMEOUT'][0];\n\n\t\t\t// display welcome message as window ?\n\t\t\tif (strtoupper($aseco['WELCOME_MSG_WINDOW'][0]) == 'TRUE') {\n\t\t\t\t$this->settings['welcome_msg_window'] = true;\n\t\t\t} else {\n\t\t\t\t$this->settings['welcome_msg_window'] = false;\n\t\t\t}\n\n\t\t\t// read the xml structure into an array ...\n\t\t\t$tmserver = $settings['SETTINGS']['TMSERVER'][0];\n\n\t\t\t// read settings and apply them ...\n\t\t\t$this->server->login = $tmserver['LOGIN'][0];\n\t\t\t$this->server->pass = $tmserver['PASSWORD'][0];\n\t\t\t$this->server->port = $tmserver['PORT'][0];\n\t\t\t$this->server->ip = $tmserver['IP'][0];\n\n\t\t\t// settings loaded ...\n\t\t\treturn true;\n\n\t\t} else {\n\n\t\t\t// Could not parse XML file ...\n\t\t\ttrigger_error('You\\'ve got an XML error in you Aseco config file!');\n\t\t\treturn false;\n\t\t}\n\t}", "private function _config()\n\t{\n\t\t// Get the base path for the smarty base directory\n\t\t$basePath\t= $this->getBasePath();\n\t\t$configFile\t= $this->getConfigFile();\n\t\t\n\t\tif (null === $basePath){\n\t\t\tthrow new Exception('No view base path specified');\n\t\t}\n\t\t\n\t\tif (null === $configFile){\n\t\t\tthrow new Exception('No config file specified');\n\t\t}\n\t\t\n\t\t// Generate the path to the view xml config file\n\t\tif ( file_exists(Package::buildPath( $basePath , $configFile)) ) {\n\t\t\t$viewBuildFile = Package::buildPath( $basePath , $configFile);\n\t\t} else {\n\t\t\tthrow new Exception(\"Unable to find config file: \" . $configFile);\n\t\t}\n\t\t \n\t\t// Load the config file\n\t\tif (! $viewXml = Zend_Registry::get('site_config_cache')->load('view_config') ) {\n\t\t\ttry {\n\t\t\t\t$xmlSection = (defined('BUILD_ENVIRONMENT')) ? BUILD_ENVIRONMENT : strtolower($_SERVER['SERVER_NAME']);\n\t\t\t\t$viewXml = new Zend_Config_Xml($viewBuildFile, $xmlSection);\n\t\t\t\tZend_Registry::get('site_config_cache')->save($viewXml, 'view_config');\n\t\t\t} catch (Zend_Exception $e) {\n\t\t\t\tthrow new Exception( 'There was a problem caching the config file: ' . $e->getMessage() );\n\t\t\t}\n\t\t}\n\t\tunset($viewBuildFile, $xmlSection);\n\t\t\n\t\t\n\t\t// Alias' replacements\n\t\t$replacements = array(\n ':baseDir' => $basePath\n ); \n\t\t\n $params = str_replace(array_keys($replacements), array_values($replacements), $viewXml->smarty->params->toArray());\n\n\t\t// Set the base smarty parameters\n\t\t$this->setParams($params);\n\t\t\n\t\t// Register plugins\n\t\t/*\n\t\tif (isset($viewXml->smarty->plugins)){\n\t\t\t$plugins\t= $viewXml->smarty->plugins->toArray();\n\t\t\t\n\t\t\t// Loop each plugin entry\n\t\t\tforeach($plugins as $key => $plugin)\n\t\t\t{\n\t\t\t\t// Check if a plugin type has been specified\n\t\t\t\tif (isset($plugin['type'])){\n\t\t\t\t\tswitch($plugin['type'])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'resource':\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t$methodArgs\t= array(\n\t\t\t\t\t\t\t\t\t$key . '_get_source',\n\t\t\t\t\t\t\t\t\t$key . '_get_timestamp',\n\t\t\t\t\t\t\t\t\t$key . '_get_secure',\n\t\t\t\t\t\t\t\t\t$key . '_get_trusted'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$methodArgs\t= (is_array($plugin['parameters'])) ? $plugin['parameters'] : array();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t//$methodName\t= 'register_' . $plugin['type'];\n\t\t\t\t\t//$this->_setSmartyMethod($methodName, array($key, $methodArgs));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t*/\n\t\t\n\t}", "public function getConfig(string $fileName): array;", "public function parseDbManagerConfig()\n {\n $dbManagerConfig =\n simplexml_load_file(\n $this->getConfig()->databaseManager->config,\n 'SimpleXMLElement',\n LIBXML_DTDLOAD + LIBXML_DTDVALID + LIBXML_NOCDATA);\n\n if ($libXmlError = libxml_get_last_error()) {\n $libXmlError->message;\n } else {\n $this->setSvnRepoUri($dbManagerConfig->svn_repo_uri);\n $this->setSqlDirectory($dbManagerConfig->sql_directory);\n\n $deltas = array();\n\n // get the cut-off point - when should we look in trunk for previous deltas\n foreach ($dbManagerConfig->branches->branch as $branch) {\n if (trim((string) $branch->name) == $this->getBranch()) {\n $lastUpdateFromTrunk = $branch->last_update_from_trunk;\n }\n }\n\n // gather all possible deltas for this branch\n\n $deltaOrderCounter = 0;\n\n // first, process trunk\n foreach ($dbManagerConfig->branches->branch as $branch) {\n if (trim((string) $branch->name) == 'trunk') {\n foreach($branch->deltas->delta as $delta) {\n if ((int) $delta <= $lastUpdateFromTrunk) {\n $deltaAttributes = $delta->attributes();\n\n $deltaInfo =\n array('deltaNum' => (int) $delta,\n 'branch' => trim((string) $branch->name),\n 'src' => trim((string) $deltaAttributes['src']),\n 'originalBranch' => null);\n\n $originalBranch = trim((string) $deltaAttributes['original_branch']);\n\n if (!is_null($originalBranch) && !empty($originalBranch)) {\n $deltaInfo['originalBranch'] = $originalBranch;\n }\n\n $deltas[$deltaOrderCounter] = $deltaInfo;\n $deltaOrderCounter++;\n }\n }\n }\n }\n\n // process specified branch, if it's not trunk\n foreach ($dbManagerConfig->branches->branch as $branch) {\n if ($branch->name == $this->getBranch()) {\n foreach($branch->deltas->delta as $delta) {\n if ((int) $delta > $lastUpdateFromTrunk) {\n $deltaAttributes = $delta->attributes();\n\n $deltaInfo =\n array('deltaNum' => (int) $delta,\n 'branch' => trim((string) $branch->name),\n 'src' => trim((string) $deltaAttributes['src']),\n 'originalBranch' => null);\n\n $originalBranch = trim((string) $deltaAttributes['original_branch']);\n\n if (!is_null($originalBranch) && !empty($originalBranch)) {\n $deltaInfo['originalBranch'] = $originalBranch;\n }\n\n $deltas[$deltaOrderCounter] = $deltaInfo;\n $deltaOrderCounter++;\n }\n }\n }\n }\n\n $this->setDeltas($deltas);\n }\n }" ]
[ "0.69769716", "0.6922469", "0.64037454", "0.61257", "0.60782206", "0.60533464", "0.604528", "0.5995563", "0.59748065", "0.5957334", "0.58515745", "0.5836796", "0.5814718", "0.580706", "0.5784067", "0.5779937", "0.5777985", "0.5769148", "0.57426184", "0.5710082", "0.5697156", "0.569334", "0.56808233", "0.56602836", "0.56602836", "0.56598777", "0.5653632", "0.56362617", "0.5634875", "0.5634875", "0.56341743", "0.5630989", "0.56199765", "0.56172264", "0.5560297", "0.5550153", "0.55389667", "0.5535883", "0.54793644", "0.54762447", "0.5467708", "0.5458636", "0.5454278", "0.54276216", "0.5409908", "0.53964376", "0.5396172", "0.5371807", "0.5368757", "0.53592324", "0.5358128", "0.5356895", "0.53545445", "0.5326937", "0.5302928", "0.5291366", "0.52873415", "0.5286242", "0.52862173", "0.52709365", "0.52610844", "0.52579695", "0.5256307", "0.52549225", "0.52508926", "0.52292025", "0.5222066", "0.5205181", "0.5203502", "0.51834285", "0.5180062", "0.5174242", "0.5173999", "0.5173775", "0.51633", "0.5156775", "0.51502204", "0.51414895", "0.5134616", "0.5131394", "0.5130488", "0.5104183", "0.50998217", "0.5088542", "0.5079441", "0.5077572", "0.50712657", "0.506564", "0.50597423", "0.5057093", "0.50493455", "0.50469625", "0.5045608", "0.504291", "0.50398856", "0.5039223", "0.5032551", "0.50288063", "0.50253177", "0.5017666", "0.5016849" ]
0.0
-1
Get an item from the config
public function get(string $key, $default = null) { return array_get($this->raw, $key, $default); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getItem ($name, $type) {\n\t\tif ($this->existsItemStrict ($name, $type)) {\n\t\t\t$fullName = $fullName = '/'.$type.$name;\n\t\t\tif (array_key_exists ($fullName, $this->allConfigItems)) {\n\t\t\t\treturn $this->allConfigItems[$fullName];\n\t\t\t} else {\n\t\t\t\treturn $this->allUserItems[$fullName];\n\t\t\t}\n\t\t} else {\n\t\t\treturn new Error ('CONFIGURATOR_ITEM_DOESNT_EXISTS', $name);\n\t\t}\n\t}", "public function item($item = '', $index = ''){\n\t\t$value = false;\n\t\tif($index == ''){\n\t\t\tif(isset($this->config[$item])){\n\t\t\t\t$value = $this->config[$item];\n\t\t\t}\n\t\t}else{\n\t\t\tif(array_key_exists($index, $this->config) && in_array($item, $this->config)){\n\t\t\t\t$value = $this->config[$index][$item];\n\t\t\t}\n\t\t}\n\t\treturn $value;\n\t}", "function configItem($key) {\n global $db;\n global $lang;\n\n if(configEnabled() == true) {\n $resp = $db->query(\"SELECT `val` FROM `\".$lang[\"config_db_name\"].\"`.`\".$lang[\"config_table_name\"].\"` WHERE `key` = '\".$key.\"' LIMIT 1\");\n if($resp) {\n if($resp->num_rows == 0) {\n return \"Unknown key\";\n } else {\n while($data = $resp->fetch_assoc()) {\n return $data[\"val\"];\n }\n }\n } else {\n return \"Unknown key\";\n }\n } else {\n return \"Not enabled\";\n }\n }", "function getConfig($item) {\n if (array_key_exists($item, CONFIG)) return CONFIG[$item];\n if (array_key_exists($item, DEFAULTS)) return DEFAULTS[$item];\n}", "public function getConfig($a_configItem)\n {\n if (!isset($this->m_config[$a_configItem]))\n {\n throw \"Unknown Config Item\";\n }\n\n return $this->m_config[$a_configItem];\n }", "function config_item($index)\n{\n\tglobal $config;\n\treturn isset($config[$index])? $config[$index] : false;\n}", "public function get($key){\r\n\t\tif(key_exists($key, $this->config)){\r\n\t\t\treturn $this->config[$key];\r\n\t\t}\r\n\t\tdie('Index is out of range');\r\n\t}", "public function get($key)\r\n {\r\n return $this->config[$key];\r\n }", "protected function get($name) {\n return $this->configuration->get($name);\n }", "public function get($configKey, $key);", "public function getConfig($item = null) {\n\t\treturn isset($item) ? $this->config->get($item) : $this->config;\n\t}", "function sconfig_item($name, $item) {\r\r\n\r\r\n static $config_item = array();\r\r\n\r\r\n if (!isset($config_item[$item])) {\r\r\n\r\r\n $config = config_load($name);\r\r\n\r\r\n if (!isset($config[$item]))\r\r\n return FALSE;\r\r\n\r\r\n $config_item[$item] = $config[$item];\r\r\n }\r\r\n\r\r\n return $config_item[$item];\r\r\n}", "public static function event_config($item) {\n global $session;\n $get_record = self::find_all(\"id ASC\",\" WHERE site_id={$session->site_id}\");\n $get_record = $get_record[0];\n return $get_record->$item;\n }", "public function getConfig($item)\n {\n $app = \\Slim\\Slim::getInstance();\n\n return $app->config($item);\n }", "function config_item($item)\r\n{\r\n\tstatic $config_item = array();\r\n\r\n\tif ( ! isset($config_item[$item]))\r\n\t{\r\n\t\t$config =& get_config();\r\n\t\t\r\n\t\tif ( ! isset($config[$item]))\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\t$config_item[$item] = $config[$item];\r\n\t}\r\n\r\n\treturn $config_item[$item];\r\n}", "abstract function get ($item);", "public function get($item)\n {\n return $this->items[$item];\n }", "public function item($item, $index = '')\n\t{\n\t\tif ($index == '')\n\t\t{\n\t\t\tif ( ! isset(GSMS::$config[$item]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$pref = GSMS::$config[$item];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( ! isset(GSMS::$config[$index]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\tif ( ! isset(GSMS::$config[$index][$item]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$pref = GSMS::$config[$index][$item];\n\t\t}\n\n\t\treturn $pref;\n\t}", "public function get(String $name=\"\"){\n\t\tif(isset($this->config[$name])){\n\t\t\treturn $this->config[$name];\n\t\t}\n\t\t\n\t\t// We need to split anyway if successful and sizeof is cheaper than a string search\n\t\t$split = explode(\"\\\\\",$name);\n\t\tif(sizeof($split) > 1){\n\t\t\tif(isset($this->config[$split[0]]) && isset($this->config[$split[0]][$split[1]])){\n\t\t\t\treturn $this->config[$split[0]][$split[1]];\n\t\t\t}\n\t\t}\n\t\t\n\t\tthrow new \\Exception($name.\" could not be found in config.json\");\n\t}", "public function getCustomConfigItem($element,$sub_element=\"\"){\n\t $config_element=Yii::$app->params[$element];\n\t return empty($sub_element) ? $config_element : $config_element[$sub_element];\n\t}", "static function getValue($name) {\r\n if (isset(self::$config[$name])) \r\n return self::$config[$name];\r\n else {\r\n return DB::getConfig($name);\r\n }\r\n }", "public function get($name)\n {\n $config = $this->fromCache();\n return isset($config[$name]) ? $config[$name] : null;\n }", "public function get($item)\r\n {\r\n $instance = $this->getInstance($item);\r\n return $instance->get();\r\n }", "function my_config($index = '') \n\t{\t\n\t\tglobal $CI;\n\n\t\treturn $CI->my_config->item($index); \n\t}", "public function get($key) {\n try{\n if (isset($this->Items[$key])) {\n return $this->Items[$key];\n } else {\n return false;\n }\n }catch(Exception $e){\n throw $e;\n }\n }", "final public function getConfig( $item = NULL, $index = NULL )\n\t{\n\t\tif ( isset( $item ) )\n\t\t{\n\t\t\tif ( isset( $this->_config[ $item ] ) )\n\t\t\t{\n\t\t\t\tif ( isset( $index ) )\n\t\t\t\t{\n\t\t\t\t\treturn isset( $this->_config[ $item ][ $index ] ) ? $this->_config[ $item ][ $index ] : NULL;\n\t\t\t\t}\n\n\t\t\t\treturn $this->_config[ $item ];\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_config;\n\t}", "public function __get($key)\n {\n if (is_object($this->config)) {\n $value = $this->config->where('key', $key)->first();\n\n return $value ? $value->value : null;\n }\n }", "public function __get($name): mixed {\n if (isset($this->data[$name]))\n return $this->data[$name];\n\n trigger_error(\n __(\"Requested configuration setting not found.\"),\n E_USER_NOTICE\n );\n\n return null;\n }", "public function get ( $name ) {\n\t\tif( !$this->has ( $name ) ) {\n\t\t\tthrow new \\InvalidArgumentException(sprintf('The name \"%s\" is invalid.', $name));\n\t\t}\n\t\treturn $this->config[$name];\n\t}", "public function getItem() {}", "public function getItem() {}", "public function get($index) {\n if (key_exists($index, $this->items)) {\n return $this->items[$index];\n }\n return false;\n }", "function getItem( $id = null ){\r\n\t\tif( $id === null ){\r\n\t\t\t$id = rsgInstance::getInt( 'id', null );\r\n\r\n\t\t\tif( $id === null ){\r\n\t\t\t\t// there is no item set, return the first value from getItems()\r\n\t\t\t\t$items = $this->items();\r\n\r\n\t\t\t\treturn array_shift( $items );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$items = $this->items();\r\n\t\treturn $items[$id];\r\n\t}", "public static function get($key)\n {\n return Arr::get(static::$config, $key);\n }", "function getItem() ;", "private static function getConfigItem($configRequest)\n {\n $configRequestItems = explode('::', $configRequest);\n // first item is config file name\n $configFileName = array_shift($configRequestItems);\n\n // contains complete config array\n $requestedConfig = include (ROOT_PATH.'config/'.$configFileName.'.php');\n\n // contains requested indexes separated by dot\n $configRequestIndexes = array_shift($configRequestItems);\n\n $configItems = explode('.', $configRequestIndexes);\n\n foreach ($configItems as $configItem)\n {\n if (! isset($requestedConfig[$configItem]))\n {\n break;\n }\n // scope of requested config is reduced by current index\n $requestedConfig = $requestedConfig[$configItem];\n }\n\n return $requestedConfig;\n }", "function config_item($field)\r\r\n {\r\r\n $CI =& get_instance(); \r\r\n //return the full asset path\r\r\n return $CI->config->config[$field];\r\r\n }", "public function getItem();", "protected function _getValueFromConfig()\n {\n return $this->_scopeConfig->getValue(\n \\Magento\\GiftMessage\\Helper\\Message::XPATH_CONFIG_GIFT_MESSAGE_ALLOW_ITEMS,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "public function getItem($key){}", "function get($name) \n {\n return $this->instance->get($name);\n }", "static public function get($key) {\n if (!property_exists(self::getConfig(), $key))\n return null;\n else\n return self::getConfig()->$key;\n }", "protected function config($name) {\n return $this->configFactory->get($name);\n }", "public static function get( $key ) {\n\t\tif ( ! static::$config ) {\n\t\t\tstatic::_set_config_data();\n\t\t}\n\n\t\tif ( array_key_exists( $key, static::$config ) ) {\n\t\t\treturn static::$config[ $key ];\n\t\t}\n\t}", "public function get(string $name)\n {\n // Load\n $this->loadConfigRepository();\n\n // Load DB\n if (isset($this->configs[$name]) && '' !== $this->configs[$name]) {\n return $this->configs[$name];\n }\n\n // Load Symfony Parameters\n if ($this->bag->has($name)) {\n return $this->bag->get($name);\n }\n\n return null;\n }", "public function get($key)\n {\n return $this->settings[$key];\n }", "public function getItem()\n {\n return $this->get(self::ITEM);\n }", "function item_get()\n {\n $key = $this->get('id');\n $result = $this->supplies->get($key);\n if ($result != null)\n $this->response($result, 200);\n else\n $this->response(array('error' => 'Supplies item not found!'), 404);\n }", "function backup_migrate_crud_get_item($type, $id) {\n if ($type = backup_migrate_crud_type_load($type)) {\n return $type->item($id);\n }\n}", "public function getSystemSettingItemAt($offset)\n {\n return $this->get(self::_SYSTEM_SETTING_ITEM, $offset);\n }", "public function __get($name)\n\t{\n\t\tif($this->contains($name))\n\t\t\treturn $this->itemAt($name);\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn $this->loadParam($name);\n\t\t\t}\n\t\t\tcatch (CException $e)\n\t\t\t{\n\t\t\t\treturn parent::__get($name);\n\t\t\t}\n\t\t}\n\t}", "public function retrieve($item);", "public function find($position)\n {\n return $this->config->get(\"_menus.{$position}\");\n }", "public function get($key)\n\t{\n\t\t$default = array_key_exists($key, $this->defaultConfig) ? $this->defaultConfig[$key] : null;\n\n\t\treturn $this->componentConfig->get($key, $default);\n\t}", "public static function read(string $key, string $config = 'default'): mixed\n {\n return static::pool($config)->get($key);\n }", "protected function getSingle($key) \n {\n if ($this->exists($key)) {\n return is_array($this->items[$key]) ? new ArrayOk($this->items[$key]) : $this->items[$key];\n }\n }", "abstract public function getItem();", "public function getItem($id) {\n foreach($this->all as $item) {\n if ($id == $item->getId()) {\n return $item;\n }\n }\n }", "public function get($index) {\n return $this->items[$index];\n }", "abstract public function getItem($name);", "public function getSetting() {}", "public function getSetting() {}", "protected function get(string $key)\n {\n if (!array_key_exists($key, $this->config)) throw new InvalidConfigException(\"Your configuration doesn't have a value for the key `$key`\");\n return $this->config[$key];\n }", "public static function get (string $key)\n {\n $value = null;\n\n if (function_exists('resolve')) {\n $repo = resolve('config');\n\n if ($repo && method_exists($repo, 'get')) {\n $value = $repo->get($key);\n }\n }\n\n return $value;\n }", "public function getItem()\n {\n $query = $this->grammar->compileGetItem($this);\n\n $result = $this->connection->getClient()->getItem($query);\n\n return $this->processor->processItem($result);\n }", "function item($item, $index = '', $raw_value = FALSE)\n\t{\n\t\tif ($index == '')\n\t\t{\n\t\t\tif (isset($this->config[$item]))\n\t\t\t{\n\t\t\t\t$pref = $this->config[$item];\n\t\t\t}\n\t\t\telse if (isset($this->defaults[$item]))\n\t\t\t{\n\t\t\t\t$pref = $this->defaults[$item];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( ! isset($this->config[$index]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\tif ( ! isset($this->config[$index][$item]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$pref = $this->config[$index][$item];\n\t\t}\n\n\t\treturn $raw_value ? $pref : parse_config_variables($pref);\n\t}", "public static function get($key)\n\t{\n\t\tif (is_array(self::$_CONF) AND array_key_exists($key, self::$_CONF))\n\t\t\treturn self::$_CONF[$key];\n\t\telseif($value = Db::getInstance()->getValue('SELECT `value` FROM `'.DB_PREFIX.'configuration` WHERE `name` = \\''.pSQL($key).'\\'')){\n\t\t\tself::$_CONF[$key] = $value;\n\t\t\treturn $value;\n\t\t}\n\t\treturn false;\n\t}", "protected function _getFromConfig($key) {\n return $this->getConfig()->getData($key);\n }", "public function get( $option );", "function get($key) {\n\n $get = \\M\\Config::get('GET');\n if (isset($get[$key])) {\n return $get[$key];\n } else {\n\n return false;\n }\n}", "public static function get($key=null){\n\t\t $connection = MyActiveRecord::getDb();\n\t\t if(empty(self::$psconfig_values))\n\t\t {\n\t\t\t $query = \"SELECT name, value FROM \" . SITE_CONFIG;\n\t\t\t $rst = $connection->createCommand($query)->queryAll();\n\t\t\t foreach($rst as $v){\n\t\t\t\t self::$psconfig_values[$v['name']] = $v['value'];\n\t\t\t }\n\t\t }\n \t\treturn self::$psconfig_values[$key];\n\t\t}", "public static function get(string $config): mixed {\n if(!isset(self::$configurations[$config])) {\n throw new ConfigurationException('No configuration set for \"' . $config . '\"');\n }\n return self::$configurations[$config];\n }", "public function __get($key) {\n\t\treturn $this->config->{$key};\n\t}", "public static function getConfig() {\n // get all params pushed here\n $args = func_get_args();\n\n if (empty($args[0])) {\n return NULL;\n }\n $itemMethod = 'config' . ConfigHandlerBehaviour::optionToName($args[0]);\n if (method_exists('ConfigHandlerBehaviour', $itemMethod)) {\n // we passed first step, send the rest to handler function\n unset($args[0]);\n return ConfigHandlerBehaviour::$itemMethod(array_values($args));\n } else {\n return NULL;\n }\n }", "public function get($key) {\r\n\t\t$keys = explode('/', $key);\r\n\t\t$value = &$this->conf;\r\n\r\n\t\tforeach ($keys as $k) {\r\n\t\t\tif (!isset($value[$k])) {\r\n\t\t\t\tthrow new \\Exception(\"There is no entry for key \" . $key);\r\n\t\t\t}\r\n\t\t\t$value = &$value[$k];\r\n\t\t}\r\n\r\n\t\treturn $value;\r\n\t}", "function get($name, $site_guid = 0) {\n\n\n\t\t$name = trim($name);\n\n\t\t$site_guid = (int) $site_guid;\n\n\t\t// check for deprecated values.\n\t\t// @todo might be a better spot to define this?\n\t\t$new_name = false;\n\t\tswitch($name) {\n\t\t\tcase 'pluginspath':\n\t\t\t\t$new_name = 'plugins_path';\n\t\t\t\tbreak;\n\n\t\t\tcase 'sitename':\n\t\t\t\t$new_name = 'site_name';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// @todo these haven't really been implemented in Elgg 1.8. Complete in 1.9.\n\t\t// show dep message\n\t\tif ($new_name) {\n\t\t\t//\t$msg = \"Config value $name has been renamed as $new_name\";\n\t\t\t$name = $new_name;\n\t\t\t//\telgg_deprecated_notice($msg, $dep_version);\n\t\t}\n\n\t\tif ($site_guid == 0) {\n\t\t\t$site_guid = (int) $this->CONFIG->site_guid;\n\t\t}\n\n\t\t// decide from where to return the value\n\t\tif ($site_guid == $this->CONFIG->site_guid && isset($this->CONFIG->$name)) {\n\t\t\treturn $this->CONFIG->$name;\n\t\t}\n\n\t\t$escaped_name = sanitize_string($name);\n\t\t$result = _elgg_services()->db->getDataRow(\"SELECT value FROM {$this->CONFIG->dbprefix}config\n\t\t\tWHERE name = '$escaped_name' AND site_guid = $site_guid\");\n\n\t\tif ($result) {\n\t\t\t$result = unserialize($result->value);\n\n\t\t\tif ($site_guid == $this->CONFIG->site_guid) {\n\t\t\t\t$this->CONFIG->$name = $result;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}\n\n\t\treturn null;\n\t}", "public function getItem($key);", "public function getItem($key);", "public function getItem($key);", "public function getItem($key);", "function getConfigValue($key) {\r\n\t\t$db = & JFactory::getDBO() ;\r\n\t\t$sql = 'SELECT config_value FROM #__osmembership_configs WHERE config_key=\"'.$key.'\"';\r\n\t\t$db->setQuery($sql) ;\t\t\r\n\t\treturn $db->loadResult();\r\n\t}", "public function getItem($id)\n {\n return $this->where('id', $id)->first();\n }", "function config(string $name)\n {\n return container_object(ConfigInterface::class)->get($name);\n }", "public function get(string $option);", "public function get(string $option);", "function get($key) {\n\t\t\treturn $this->inst->get($key);\n\t\t}", "public function get($name) { \n \n if (isset($this->settings[$name])) return $this->settings[$name];\n return null;\n \n }", "public function item($index) {\n return isset($this->list[$index]) ? $this->list[$index] : null;\n }", "private function config($key)\n {\n return Config::get('mediabrowser::mediabrowser.' . $key);\n }", "public static function get($key){\n if ( static::$settings == null ){\n $jsonString = file_get_contents(\n SiteUtil::toAbsolute(static::CONFIG_FILE)\n );\n static::$settings = json_decode($jsonString,true);\n\n // random version number in dev, to auto-refresh all assets\n if ( static::$settings[\"environment\"] == \"dev\"){\n static::$settings[\"version\"] = random_int(0,8000000000000000);\n }\n }\n\n return static::$settings[$key] ?? null;\n }", "public function get( $key ) {\n\t\tif ( isset( $this->config[ $key ] ) ) {\n\t\t\treturn $this->config[ $key ];\n\t\t}\n\t\treturn null;\n\t}", "public function get($key)\n {\n if (array_key_exists($key, $this->config)) {\n $value = $this->config[ $key ];\n } elseif ($this->offsetExists($key)) {\n $value = $this->defaults[ $key ];\n } else {\n throw new Exception(\"Config entry «{$key}» doesn't exists. \");\n }\n\n return $value;\n }", "public function get(string $key)\n {\n if (! $this->has($key)) {\n return false;\n }\n\n return $this->items[$key];\n }", "private function getConfig($key)\n {\n return $this->config->get($key);\n }", "public function __get ($name) {\t\t\n\t\tif ( $name=='config') {\n\t\t\treturn $this->config;\n\t\t}\n\t\treturn $this->load($name);\n\t}", "public static function get($name)\n {\n self::loadConfiguration();\n\n return self::$configuration[$name] ?? null;\n }", "public function getItem( $id );", "public static function get($type)\n\t{\n\t\tif(!isset(self::$_items[$type]))\n\t\t\tself::loadItems();\n\t\treturn self::$_items[$type];\n\t}", "public function getItem() {\n\t\treturn $this->item;\n\t}", "public function get_value($index = NULL,$item = NULL){\n if(is_null($index)){\n return $this->ini_file_array;\n } else if(is_null($item)){\n if(array_key_exists($index,$this->ini_file_array)){\n return $this->ini_file_array[\"$index\"];\n } else {\n return NULL;\n }\n } else {\n if(isset($this->ini_file_array[\"$index\"][\"$item\"])){\n return $this->ini_file_array[\"$index\"][\"$item\"];\n } else {\n return NULL;\n }\n }\n }", "public function getItem($key)\n\t{\n\t\tif(array_key_exists($key, $this->items))\n\t\t{\n\t\t\treturn $this->items[$key];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}" ]
[ "0.71268916", "0.6818368", "0.6688351", "0.6671121", "0.6539564", "0.6513986", "0.6458946", "0.6444225", "0.64397746", "0.643024", "0.6395134", "0.6385866", "0.6372807", "0.6294141", "0.6240842", "0.6235466", "0.6222869", "0.61674684", "0.6105866", "0.60581076", "0.60462224", "0.600286", "0.5996363", "0.59330684", "0.59070504", "0.5896479", "0.58843315", "0.58317333", "0.5822353", "0.58134085", "0.58134085", "0.5812224", "0.58106214", "0.58090293", "0.58068895", "0.57842696", "0.5764529", "0.5756002", "0.5754979", "0.57371986", "0.57343364", "0.57258004", "0.57184", "0.57135826", "0.57083434", "0.5688125", "0.56846684", "0.5683756", "0.5674841", "0.56653666", "0.5658651", "0.56511927", "0.5649987", "0.56497604", "0.5646969", "0.5637541", "0.56355476", "0.5631684", "0.56285304", "0.5624696", "0.560803", "0.560803", "0.56075233", "0.56003696", "0.5596998", "0.55907124", "0.55798364", "0.55657494", "0.55653566", "0.5563955", "0.5562978", "0.55597275", "0.5557247", "0.5555269", "0.55520815", "0.5547594", "0.55442566", "0.55442566", "0.55442566", "0.55442566", "0.5544199", "0.5542554", "0.5532461", "0.55319107", "0.55319107", "0.55281234", "0.55263245", "0.55263174", "0.5525932", "0.5521552", "0.5515246", "0.55085677", "0.54994714", "0.54959327", "0.549546", "0.54864013", "0.5477185", "0.5475727", "0.5474326", "0.54732496", "0.54707396" ]
0.0
-1
Get an item from the config, erroring if nothing is in there
public function getOrError(string $key) { $default = function() {}; // a function object for strict uniqueness $value = array_get($this->raw, $key, $default); if ($value === $default) { throw new \Error('Unable to find option ' . $key); } return $value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getItem ($name, $type) {\n\t\tif ($this->existsItemStrict ($name, $type)) {\n\t\t\t$fullName = $fullName = '/'.$type.$name;\n\t\t\tif (array_key_exists ($fullName, $this->allConfigItems)) {\n\t\t\t\treturn $this->allConfigItems[$fullName];\n\t\t\t} else {\n\t\t\t\treturn $this->allUserItems[$fullName];\n\t\t\t}\n\t\t} else {\n\t\t\treturn new Error ('CONFIGURATOR_ITEM_DOESNT_EXISTS', $name);\n\t\t}\n\t}", "function getConfig($item) {\n if (array_key_exists($item, CONFIG)) return CONFIG[$item];\n if (array_key_exists($item, DEFAULTS)) return DEFAULTS[$item];\n}", "function config_item($index)\n{\n\tglobal $config;\n\treturn isset($config[$index])? $config[$index] : false;\n}", "function configItem($key) {\n global $db;\n global $lang;\n\n if(configEnabled() == true) {\n $resp = $db->query(\"SELECT `val` FROM `\".$lang[\"config_db_name\"].\"`.`\".$lang[\"config_table_name\"].\"` WHERE `key` = '\".$key.\"' LIMIT 1\");\n if($resp) {\n if($resp->num_rows == 0) {\n return \"Unknown key\";\n } else {\n while($data = $resp->fetch_assoc()) {\n return $data[\"val\"];\n }\n }\n } else {\n return \"Unknown key\";\n }\n } else {\n return \"Not enabled\";\n }\n }", "public function item($item = '', $index = ''){\n\t\t$value = false;\n\t\tif($index == ''){\n\t\t\tif(isset($this->config[$item])){\n\t\t\t\t$value = $this->config[$item];\n\t\t\t}\n\t\t}else{\n\t\t\tif(array_key_exists($index, $this->config) && in_array($item, $this->config)){\n\t\t\t\t$value = $this->config[$index][$item];\n\t\t\t}\n\t\t}\n\t\treturn $value;\n\t}", "function sconfig_item($name, $item) {\r\r\n\r\r\n static $config_item = array();\r\r\n\r\r\n if (!isset($config_item[$item])) {\r\r\n\r\r\n $config = config_load($name);\r\r\n\r\r\n if (!isset($config[$item]))\r\r\n return FALSE;\r\r\n\r\r\n $config_item[$item] = $config[$item];\r\r\n }\r\r\n\r\r\n return $config_item[$item];\r\r\n}", "function config_item($item)\r\n{\r\n\tstatic $config_item = array();\r\n\r\n\tif ( ! isset($config_item[$item]))\r\n\t{\r\n\t\t$config =& get_config();\r\n\t\t\r\n\t\tif ( ! isset($config[$item]))\r\n\t\t{\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t\t$config_item[$item] = $config[$item];\r\n\t}\r\n\r\n\treturn $config_item[$item];\r\n}", "public function get($key){\r\n\t\tif(key_exists($key, $this->config)){\r\n\t\t\treturn $this->config[$key];\r\n\t\t}\r\n\t\tdie('Index is out of range');\r\n\t}", "public function getConfig($item = null) {\n\t\treturn isset($item) ? $this->config->get($item) : $this->config;\n\t}", "public function item($item, $index = '')\n\t{\n\t\tif ($index == '')\n\t\t{\n\t\t\tif ( ! isset(GSMS::$config[$item]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$pref = GSMS::$config[$item];\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( ! isset(GSMS::$config[$index]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\tif ( ! isset(GSMS::$config[$index][$item]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$pref = GSMS::$config[$index][$item];\n\t\t}\n\n\t\treturn $pref;\n\t}", "public function get($key) {\n try{\n if (isset($this->Items[$key])) {\n return $this->Items[$key];\n } else {\n return false;\n }\n }catch(Exception $e){\n throw $e;\n }\n }", "abstract function get ($item);", "public function getConfig($a_configItem)\n {\n if (!isset($this->m_config[$a_configItem]))\n {\n throw \"Unknown Config Item\";\n }\n\n return $this->m_config[$a_configItem];\n }", "public function get(String $name=\"\"){\n\t\tif(isset($this->config[$name])){\n\t\t\treturn $this->config[$name];\n\t\t}\n\t\t\n\t\t// We need to split anyway if successful and sizeof is cheaper than a string search\n\t\t$split = explode(\"\\\\\",$name);\n\t\tif(sizeof($split) > 1){\n\t\t\tif(isset($this->config[$split[0]]) && isset($this->config[$split[0]][$split[1]])){\n\t\t\t\treturn $this->config[$split[0]][$split[1]];\n\t\t\t}\n\t\t}\n\t\t\n\t\tthrow new \\Exception($name.\" could not be found in config.json\");\n\t}", "protected function getSingle($key) \n {\n if ($this->exists($key)) {\n return is_array($this->items[$key]) ? new ArrayOk($this->items[$key]) : $this->items[$key];\n }\n }", "public static function event_config($item) {\n global $session;\n $get_record = self::find_all(\"id ASC\",\" WHERE site_id={$session->site_id}\");\n $get_record = $get_record[0];\n return $get_record->$item;\n }", "final public function getConfig( $item = NULL, $index = NULL )\n\t{\n\t\tif ( isset( $item ) )\n\t\t{\n\t\t\tif ( isset( $this->_config[ $item ] ) )\n\t\t\t{\n\t\t\t\tif ( isset( $index ) )\n\t\t\t\t{\n\t\t\t\t\treturn isset( $this->_config[ $item ][ $index ] ) ? $this->_config[ $item ][ $index ] : NULL;\n\t\t\t\t}\n\n\t\t\t\treturn $this->_config[ $item ];\n\t\t\t}\n\t\t}\n\n\t\treturn $this->_config;\n\t}", "public function get($configKey, $key);", "public function __get($name): mixed {\n if (isset($this->data[$name]))\n return $this->data[$name];\n\n trigger_error(\n __(\"Requested configuration setting not found.\"),\n E_USER_NOTICE\n );\n\n return null;\n }", "function item($item, $index = '', $raw_value = FALSE)\n\t{\n\t\tif ($index == '')\n\t\t{\n\t\t\tif (isset($this->config[$item]))\n\t\t\t{\n\t\t\t\t$pref = $this->config[$item];\n\t\t\t}\n\t\t\telse if (isset($this->defaults[$item]))\n\t\t\t{\n\t\t\t\t$pref = $this->defaults[$item];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( ! isset($this->config[$index]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\tif ( ! isset($this->config[$index][$item]))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$pref = $this->config[$index][$item];\n\t\t}\n\n\t\treturn $raw_value ? $pref : parse_config_variables($pref);\n\t}", "public static function get($path = null)\r\n\t{\r\n\t\tif($path)\r\n\t\t{\r\n\t\t\t$config = $GLOBALS['config'];\t\t//ARRAY NAME for configurations \r\n\t\t\t$path = explode('/', $path);\r\n\r\n\t\t\tforeach ($path as $bit) {\r\n\t\t\t\tif(isset($config[$bit]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$config = $config[$bit]; //To access to second level of config\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn $config;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "static function getValue($name) {\r\n if (isset(self::$config[$name])) \r\n return self::$config[$name];\r\n else {\r\n return DB::getConfig($name);\r\n }\r\n }", "protected function get($name) {\n return $this->configuration->get($name);\n }", "public function get($key) {\r\n\t\t$keys = explode('/', $key);\r\n\t\t$value = &$this->conf;\r\n\r\n\t\tforeach ($keys as $k) {\r\n\t\t\tif (!isset($value[$k])) {\r\n\t\t\t\tthrow new \\Exception(\"There is no entry for key \" . $key);\r\n\t\t\t}\r\n\t\t\t$value = &$value[$k];\r\n\t\t}\r\n\r\n\t\treturn $value;\r\n\t}", "public function __get($key)\n {\n if (is_object($this->config)) {\n $value = $this->config->where('key', $key)->first();\n\n return $value ? $value->value : null;\n }\n }", "function fetchConfigParameter($name){\n try {\n global $db_table_prefix;\n\n $results = array();\n\n $db = pdoConnect();\n\n $query = \"SELECT id, value\n\t\tFROM \".$db_table_prefix.\"configuration WHERE name = :name\";\n\n if (!$stmt = $db->prepare($query))\n return false;\n\n $sqlVars[\":name\"] = $name;\n\n if (!$stmt->execute($sqlVars)){\n // Error\n return false;\n }\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n if ($row)\n return $row['value'];\n else {\n addAlert(\"danger\", \"The specified configuration parameter could not be found.\");\n return false;\n }\n\n } catch (PDOException $e) {\n addAlert(\"danger\", \"Oops, looks like our database encountered an error.\");\n error_log(\"Error in \" . $e->getFile() . \" on line \" . $e->getLine() . \": \" . $e->getMessage());\n return false;\n } catch (ErrorException $e) {\n addAlert(\"danger\", \"Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.\");\n return false;\n }\n}", "public function getConfig($item)\n {\n $app = \\Slim\\Slim::getInstance();\n\n return $app->config($item);\n }", "public function getCustomConfigItem($element,$sub_element=\"\"){\n\t $config_element=Yii::$app->params[$element];\n\t return empty($sub_element) ? $config_element : $config_element[$sub_element];\n\t}", "public function get($name)\n {\n $config = $this->fromCache();\n return isset($config[$name]) ? $config[$name] : null;\n }", "public function get($key)\r\n {\r\n return $this->config[$key];\r\n }", "private static function getConfigItem($configRequest)\n {\n $configRequestItems = explode('::', $configRequest);\n // first item is config file name\n $configFileName = array_shift($configRequestItems);\n\n // contains complete config array\n $requestedConfig = include (ROOT_PATH.'config/'.$configFileName.'.php');\n\n // contains requested indexes separated by dot\n $configRequestIndexes = array_shift($configRequestItems);\n\n $configItems = explode('.', $configRequestIndexes);\n\n foreach ($configItems as $configItem)\n {\n if (! isset($requestedConfig[$configItem]))\n {\n break;\n }\n // scope of requested config is reduced by current index\n $requestedConfig = $requestedConfig[$configItem];\n }\n\n return $requestedConfig;\n }", "function getItem( $id = null ){\r\n\t\tif( $id === null ){\r\n\t\t\t$id = rsgInstance::getInt( 'id', null );\r\n\r\n\t\t\tif( $id === null ){\r\n\t\t\t\t// there is no item set, return the first value from getItems()\r\n\t\t\t\t$items = $this->items();\r\n\r\n\t\t\t\treturn array_shift( $items );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$items = $this->items();\r\n\t\treturn $items[$id];\r\n\t}", "function my_config($index = '') \n\t{\t\n\t\tglobal $CI;\n\n\t\treturn $CI->my_config->item($index); \n\t}", "function item_get()\n {\n $key = $this->get('id');\n $result = $this->supplies->get($key);\n if ($result != null)\n $this->response($result, 200);\n else\n $this->response(array('error' => 'Supplies item not found!'), 404);\n }", "public function get($index) {\n if (key_exists($index, $this->items)) {\n return $this->items[$index];\n }\n return false;\n }", "public static function get(string $config): mixed {\n if(!isset(self::$configurations[$config])) {\n throw new ConfigurationException('No configuration set for \"' . $config . '\"');\n }\n return self::$configurations[$config];\n }", "public function __get($name)\n\t{\n\t\tif($this->contains($name))\n\t\t\treturn $this->itemAt($name);\n\t\telse\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\treturn $this->loadParam($name);\n\t\t\t}\n\t\t\tcatch (CException $e)\n\t\t\t{\n\t\t\t\treturn parent::__get($name);\n\t\t\t}\n\t\t}\n\t}", "public static function get($key)\n\t{\n\t\tif (is_array(self::$_CONF) AND array_key_exists($key, self::$_CONF))\n\t\t\treturn self::$_CONF[$key];\n\t\telseif($value = Db::getInstance()->getValue('SELECT `value` FROM `'.DB_PREFIX.'configuration` WHERE `name` = \\''.pSQL($key).'\\'')){\n\t\t\tself::$_CONF[$key] = $value;\n\t\t\treturn $value;\n\t\t}\n\t\treturn false;\n\t}", "protected function get(string $key)\n {\n if (!array_key_exists($key, $this->config)) throw new InvalidConfigException(\"Your configuration doesn't have a value for the key `$key`\");\n return $this->config[$key];\n }", "public function get($key)\n {\n if (array_key_exists($key, $this->config)) {\n $value = $this->config[ $key ];\n } elseif ($this->offsetExists($key)) {\n $value = $this->defaults[ $key ];\n } else {\n throw new Exception(\"Config entry «{$key}» doesn't exists. \");\n }\n\n return $value;\n }", "function getConfig($key, $default)\n{\n global $config;\n return isset($config[$key])\n ? $config[$key]\n : $default;\n}", "function get_config_value($config_name)\n\t{\n\t\tglobal $db, $table_prefix;\n\t\t$sql = \"SELECT config_value\n\t\t\t\t\t\tFROM \" . CONFIG_TABLE . \"\n\t\t\t\t\t\tWHERE config_name = '\" . $config_name . \"'\n\t\t\t\t\t\tLIMIT 1\";\n\t\tif (!($result = $db->sql_query($sql)))\n\t\t{\n\t\t\t$config_value = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$row = $db->sql_fetchrow($result);\n\t\t\t$config_value = !empty($row['config_value']) ? $row['config_value'] : '';\n\t\t}\n\t\treturn $config_value;\n\t}", "function get($name, $site_guid = 0) {\n\n\n\t\t$name = trim($name);\n\n\t\t$site_guid = (int) $site_guid;\n\n\t\t// check for deprecated values.\n\t\t// @todo might be a better spot to define this?\n\t\t$new_name = false;\n\t\tswitch($name) {\n\t\t\tcase 'pluginspath':\n\t\t\t\t$new_name = 'plugins_path';\n\t\t\t\tbreak;\n\n\t\t\tcase 'sitename':\n\t\t\t\t$new_name = 'site_name';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// @todo these haven't really been implemented in Elgg 1.8. Complete in 1.9.\n\t\t// show dep message\n\t\tif ($new_name) {\n\t\t\t//\t$msg = \"Config value $name has been renamed as $new_name\";\n\t\t\t$name = $new_name;\n\t\t\t//\telgg_deprecated_notice($msg, $dep_version);\n\t\t}\n\n\t\tif ($site_guid == 0) {\n\t\t\t$site_guid = (int) $this->CONFIG->site_guid;\n\t\t}\n\n\t\t// decide from where to return the value\n\t\tif ($site_guid == $this->CONFIG->site_guid && isset($this->CONFIG->$name)) {\n\t\t\treturn $this->CONFIG->$name;\n\t\t}\n\n\t\t$escaped_name = sanitize_string($name);\n\t\t$result = _elgg_services()->db->getDataRow(\"SELECT value FROM {$this->CONFIG->dbprefix}config\n\t\t\tWHERE name = '$escaped_name' AND site_guid = $site_guid\");\n\n\t\tif ($result) {\n\t\t\t$result = unserialize($result->value);\n\n\t\t\tif ($site_guid == $this->CONFIG->site_guid) {\n\t\t\t\t$this->CONFIG->$name = $result;\n\t\t\t}\n\n\t\t\treturn $result;\n\t\t}\n\n\t\treturn null;\n\t}", "function config($key){\n $config = include 'config.php';\n\n if(key_exists($key,$config)){\n return $config[$key];\n }\n return false;\n}", "public static function get($path = null) {\n //create variable to store config \n if($path) {\n //defines where config comes from\n //seperates by '/'\n $config = $GLOBALS['config']; \n $path = explode('/', $path);\n\n foreach($path as $bit) {\n //if config is set, set config to bit\n //i.e config = remember\n //checks against the bit aka cookie_name\n if(isset($config[$bit])) {\n $config = $config[$bit];\n }\n }\n\n return $config;\n }\n //if path doesn't exsists return false\n return false;\n }", "static public function get($key) {\n if (!property_exists(self::getConfig(), $key))\n return null;\n else\n return self::getConfig()->$key;\n }", "function get($key) {\n\n $get = \\M\\Config::get('GET');\n if (isset($get[$key])) {\n return $get[$key];\n } else {\n\n return false;\n }\n}", "public function get(string $name)\n {\n // Load\n $this->loadConfigRepository();\n\n // Load DB\n if (isset($this->configs[$name]) && '' !== $this->configs[$name]) {\n return $this->configs[$name];\n }\n\n // Load Symfony Parameters\n if ($this->bag->has($name)) {\n return $this->bag->get($name);\n }\n\n return null;\n }", "public function slash_item($item)\n\t{\n\t\tif ( ! isset($this->config[$item]))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$pref = $this->config[$item];\n\n\t\tif ($pref != '' && substr($pref, -1) != '/')\n\t\t{\n\t\t\t$pref .= '/';\n\t\t}\n\n\t\tif (defined('EE_APPPATH'))\n\t\t{\n\t\t\t$pref = str_replace(APPPATH, EE_APPPATH, $pref);\n\t\t}\n\n\t\treturn parse_config_variables($pref);\n\t}", "function config_item($field)\r\r\n {\r\r\n $CI =& get_instance(); \r\r\n //return the full asset path\r\r\n return $CI->config->config[$field];\r\r\n }", "public static function getConfig() {\n // get all params pushed here\n $args = func_get_args();\n\n if (empty($args[0])) {\n return NULL;\n }\n $itemMethod = 'config' . ConfigHandlerBehaviour::optionToName($args[0]);\n if (method_exists('ConfigHandlerBehaviour', $itemMethod)) {\n // we passed first step, send the rest to handler function\n unset($args[0]);\n return ConfigHandlerBehaviour::$itemMethod(array_values($args));\n } else {\n return NULL;\n }\n }", "function getConfigValue($key) {\r\n\t\t$db = & JFactory::getDBO() ;\r\n\t\t$sql = 'SELECT config_value FROM #__osmembership_configs WHERE config_key=\"'.$key.'\"';\r\n\t\t$db->setQuery($sql) ;\t\t\r\n\t\treturn $db->loadResult();\r\n\t}", "public static function get($key=null){\n\t\t $connection = MyActiveRecord::getDb();\n\t\t if(empty(self::$psconfig_values))\n\t\t {\n\t\t\t $query = \"SELECT name, value FROM \" . SITE_CONFIG;\n\t\t\t $rst = $connection->createCommand($query)->queryAll();\n\t\t\t foreach($rst as $v){\n\t\t\t\t self::$psconfig_values[$v['name']] = $v['value'];\n\t\t\t }\n\t\t }\n \t\treturn self::$psconfig_values[$key];\n\t\t}", "function getItem($key, $array, $default=null) {\n\t\tif (array_key_exists($key, $array)) {\n\t\t\treturn $array[$key];\n\t\t} else {\n\t\t\tif (func_num_args() === 3) {\n\t\t\t\treturn $default;\n\t\t\t} else {\n\t\t\t\tthrow Exception('Unable to find key '.$key.' in the array '.var_dump($array, true));\n\t\t\t}\n\t\t}\n\t}", "public function getItem($key)\n\t{\n\t\tif(array_key_exists($key, $this->items))\n\t\t{\n\t\t\treturn $this->items[$key];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}", "function getItem() ;", "function get_config_value($cfgset, $key, $defval)\n{\n if (array_key_exists($key, $cfgset)) {\n return $cfgset[$key];\n }\n else if ($defval !== null) {\n return $defval;\n }\n else {\n return null;\n }\n}", "public static function getConfig($param){\n\n if(isset(self::$config[$param])){\n return self::$config[$param];\n } else {\n return null;\n }\n\n }", "public static function get($name, $default = null, $config = null)\n {\n $instance = self::getInstance();\n $found = false;\n $result = $instance->_get($config, $name, $found);\n if (!$found) {\n return ($default);\n }\n if ($result instanceof Zend_Config) {\n $result = $result->toArray();\n if (sizeof($result) > 1) {\n trigger_error('Multiple results found for configuration option: ' . $name, E_USER_WARNING);\n }\n reset($result);\n $result = current($result);\n }\n return ($result);\n }", "public function get_value($index = NULL,$item = NULL){\n if(is_null($index)){\n return $this->ini_file_array;\n } else if(is_null($item)){\n if(array_key_exists($index,$this->ini_file_array)){\n return $this->ini_file_array[\"$index\"];\n } else {\n return NULL;\n }\n } else {\n if(isset($this->ini_file_array[\"$index\"][\"$item\"])){\n return $this->ini_file_array[\"$index\"][\"$item\"];\n } else {\n return NULL;\n }\n }\n }", "static public function get($key)\r\n {\r\n /* If the config variable has no value, throw an exception */\r\n if(!self::has($key))\r\n {\r\n throw new Exception(\"The config key '\" . $key . \"' does not exist\");\r\n }\r\n\r\n /* Otherwise, fetch and return the value */\r\n return Fset::get(self::$values, $key);\r\n }", "public static function get($path) {\n $pathArray = explode('.', $path);\n $current = static::$config;\n if(static::exists($current, $pathArray[0])) {\n //check the namespace exists\n foreach($pathArray as $item) {\n if(static::exists($current, $item)) {\n $current = &$current[$item];\n }\n }\n return $current;\n }\n return null;\n }", "public static function get(string $key): mixed\n {\n if (!isset(static::$config[$key])) {\n throw new Exception(\n sprintf(\n 'Configuration with key %s not found!',\n $key\n )\n );\n }\n\n return static::$config[$key];\n }", "function getConfig($param, $return = false) {\n\n $json = new JSONParser(D . '/config.json', 'en-en');\n $r = (string) $json->stream->data[0]->{$param};\n\n if ($return) {\n return (isset($r) && !empty($r)) ? $r : false;\n } else {\n echo (isset($r) && !empty($r)) ? $r : '';\n }\n}", "private function get_item_from_api() {\n\t\t$result = false;\n\n\t\t// Sanity check.\n\t\tif ( is_array( $this->vendor_api ) && isset( $this->vendor_api['translations'] ) && is_array( $this->vendor_api['translations'] ) ) {\n\n\t\t\t// Loop results.\n\t\t\tforeach ( $this->vendor_api['translations'] as $translation ) {\n\n\t\t\t\t// Check if item exists for the language and version specified.\n\t\t\t\tif ( isset( $translation['language'] ) && $this->lang === $translation['language'] && isset( $translation['version'] ) && $this->ver === $translation['version'] ) {\n\t\t\t\t\t$result = $translation;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Return the result (falls-back to false if none was found).\n\t\treturn $result;\n\t}", "public function item($index) {\n return isset($this->list[$index]) ? $this->list[$index] : null;\n }", "function chevereto_config($config_key) {\n\tglobal $config;\n\treturn $config[$config_key];\n}", "public function get($key)\n\t{\n\t\t$default = array_key_exists($key, $this->defaultConfig) ? $this->defaultConfig[$key] : null;\n\n\t\treturn $this->componentConfig->get($key, $default);\n\t}", "public function getEntry($pos)\n {\n if (isset($this->items[$pos])) {\n return $this->items[$pos];\t\n }\n return false;\n }", "protected function _get($config, $name, &$found)\n {\n if (is_array($config)) {\n return ($this->_getFromArray($config, $name, $found));\n }\n $cacheable = false;\n $found = false;\n if (($config !== null) && (!$config instanceof Zend_Config)) {\n trigger_error('Custom configuration object should be instance of Zend_Config', E_USER_WARNING);\n $config = null;\n }\n if ($config === null) {\n $config = $this->_getConfig();\n // For non-custom and read-only configuration object we can cache\n // configuration options values for faster repetitive access\n if ($config->readOnly()) {\n $cacheable = true;\n }\n }\n $name = trim($name);\n if ($cacheable) {\n if (array_key_exists($name, $this->_configOptions)) {\n $found = true;\n return ($this->_configOptions[$name]);\n }\n if (in_array($name, $this->_missedOptions)) {\n $found = false;\n return (null);\n }\n }\n $parts = explode('.', $name);\n foreach ($parts as $part) {\n if (!isset($config->$part)) {\n if ($cacheable) {\n $this->_missedOptions[] = $name;\n }\n $found = false;\n return (null);\n }\n $config = $config->$part;\n }\n if ($cacheable) {\n $this->_configOptions[$name] = $config;\n }\n $found = true;\n return ($config);\n }", "function configurationLoad() {\n\t\tglobal $podserver_config_map;\n\t\t$item_idx = 0;\n\t\tunset($this->itemsConfiguration);\n\t\t$this->itemsConfiguration = array();\n\t\t// load the configuration details for each item in the map\n\t\tforeach ($podserver_config_map as $itemToConfigure){\n\t\t\t// get the configuration variable by indirection ($$)\n\t\t\tglobal $$itemToConfigure[0];\n\t\t\t// get the label for the item in the correct language by indirection ($$)\n\t\t\t$label_item_variable = 'label_'.$itemToConfigure[0];\n\t\t\tglobal $$label_item_variable;\n\t\t\tif ($$label_item_variable == '') $$label_item_variable = '$'.$label_item_variable;\n\t\t\tif (isset($_SESSION['lang']) && $_SESSION['lang'] == 'debug') $$label_item_variable = '$'.$label_item_variable;\n\t\t\t// get the help for the item in the correct language by indirection ($$)\n\t\t\t$help_item_variable = 'help_'.$itemToConfigure[0];\n\t\t\tglobal $$help_item_variable;\n\t\t\tif (isset($_SESSION['lang']) && $_SESSION['lang'] == 'debug') $$help_item_variable = '$'.$help_item_variable;\n\t\t\t// get the title for the item in the correct language by indirection ($$)\n\t\t\t$title_item_variable = 'title_'.$itemToConfigure[0];\n\t\t\tglobal $$title_item_variable;\n\t\t\t// show title variable name for language debug\n\t\t\tif (isset($_SESSION['lang']) && $_SESSION['lang'] == 'debug') $$title_item_variable = '$'.$title_item_variable;\n\t\t\t// get the default value from configuration map if no value found for the item in the configuration file\n\t\t\tif ($$itemToConfigure[0] == '') $$itemToConfigure[0] = $itemToConfigure[4];\n\t\t\t// load the item with all datas (map, value, title and label)\n\t\t\t$this->itemsConfiguration[] = new ItemConfiguration(\n\t\t\t\t\t\t\t$itemToConfigure[0],\n\t\t\t\t\t\t\t$itemToConfigure[1],\n\t\t\t\t\t\t\t$itemToConfigure[2],\n\t\t\t\t\t\t\t$itemToConfigure[3],\n\t\t\t\t\t\t\t$$itemToConfigure[0],\n\t\t\t\t\t\t\t$itemToConfigure[5],\n\t\t\t\t\t\t\t$$label_item_variable,\n\t\t\t\t\t\t\t$$title_item_variable,\n\t\t\t\t\t\t\t$$help_item_variable\n\t\t\t\t\t\t\t);\t\t\t\n\t\t}\n\t}", "public function get($item)\n {\n return $this->items[$item];\n }", "function getItem($section='', $key='') {\r\n if(!empty($section) and !empty($key)){\r\n return $this->parsed_ini_file[$section][$key];\r\n } else {\r\n return '';\r\n }\r\n }", "public function getItem($id) {\n foreach($this->all as $item) {\n if ($id == $item->getId()) {\n return $item;\n }\n }\n }", "public static function get( $key ) {\n\t\tif ( ! static::$config ) {\n\t\t\tstatic::_set_config_data();\n\t\t}\n\n\t\tif ( array_key_exists( $key, static::$config ) ) {\n\t\t\treturn static::$config[ $key ];\n\t\t}\n\t}", "public function get(string $key)\n {\n if (! $this->has($key)) {\n return false;\n }\n\n return $this->items[$key];\n }", "public static function get($config,$path = NULL) {\n\t\tif($path) {\n\n\t\t\tswitch ($config) {\n\n\t\t\t\tcase 'autoload':\n\t\t\t\t\t$config = $GLOBALS[\"autoload\"];\n\t\t\t\t\t$path = explode('/', $path);\n\t\t\t\t\tforeach ($path as &$key) {\n\t\t\t\t\t\tif(isset($config[$key])) {\n\t\t\t\t\t\t\t$config = $config[$key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $config;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'config':\n\t\t\t\t\t$config = $GLOBALS[\"config\"];\n\t\t\t\t\t\n\t\t\t\t\tforeach ($config as $key => &$value) {\n\t\t\t\t\t\tif($path == $key) {\n\t\t\t\t\t\t\t$res = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $res;\n\n\t\t\t\tcase 'instances':\n\t\t\t\t\t$config = $GLOBALS[\"instances\"];\n\t\t\t\t\t\n\t\t\t\t\tforeach ($config as $key => &$value) {\n\t\t\t\t\t\tif($path == $key) {\n\t\t\t\t\t\t\t$res = $value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $res;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\n\t\t}\n\n\t\treturn false;\n\t}", "public function get( $key ) {\n\t\tif ( isset( $this->config[ $key ] ) ) {\n\t\t\treturn $this->config[ $key ];\n\t\t}\n\t\treturn null;\n\t}", "protected function _getValueFromConfig()\n {\n return $this->_scopeConfig->getValue(\n \\Magento\\GiftMessage\\Helper\\Message::XPATH_CONFIG_GIFT_MESSAGE_ALLOW_ITEMS,\n \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE\n );\n }", "static public function get($configRequest)\n {\n if (empty($configRequest))\n {\n return false;\n }\n if (stristr($configRequest, '::'))\n {\n return self::getConfigItem($configRequest);\n }\n\n if (file_exists(ROOT_PATH.'config/'.$configRequest.'.php'))\n {\n return include (ROOT_PATH.'config/'.$configRequest.'.php');\n }\n\n return false;\n }", "public static function get (string $key)\n {\n $value = null;\n\n if (function_exists('resolve')) {\n $repo = resolve('config');\n\n if ($repo && method_exists($repo, 'get')) {\n $value = $repo->get($key);\n }\n }\n\n return $value;\n }", "function getItemLookup ( $asin, $associatedid, $use_cache = TRUE )\n\t{\n\t\t$is_cached = false;\n\t\tif ( $use_cache ) {\n\t\t\t$cached_item = get_option( $this->db_options_name_cached_item );\n\t\t\tif ( is_array( $cached_item ) ) {\n\t\t\t\tif ( isset( $cached_item[$asin] ) ) {\n\t\t\t\t\tif ( (time() - $cached_item[$asin]['time']) < 60 * 60 * 23 ) {\n\t\t\t\t\t\t$item_result = $cached_item[$asin]['item'];\n\t\t\t\t\t\t$is_cached = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $is_cached ) {\n\t\t\t$item_result = $this->handleRESTcall( $this->getRestItemLookupParams( $asin, $associatedid ) );\n\t\t\tif ( ! (isset( $item_result['Error'] ) || isset( $item_result['Items']['Request']['Errors'] )) ) {\n\t\t\t\t$cached_item[$asin]['time'] = time();\n\t\t\t\t$cached_item[$asin]['item'] = $item_result;\n\t\t\t\tupdate_option( $this->db_options_name_cached_item, $cached_item );\n\t\t\t}\n\t\t}\n\t\treturn ($item_result);\n\t}", "function getConfig($key = '')\n {\n return isset($this->config[$key]) ? $this->config[$key] : null;\n }", "function igit_config_get( $key, $default = null ) {\n\n // Return the default value if settings aren't set or the key is missing.\n if ( false === ( $settings = get_option( IGIT_SETTINGS ) ) || ! isset( $settings[$key] ) ) {\n return $default;\n };\n\n return $settings[$key];\n\n}", "public function getItem($key){}", "abstract protected function getConfig();", "function get_config_data()\n{\n global $dbh;\n $config = null;\n\n $result = $dbh->query(\"SELECT * FROM configuration\");\n if ($result)\n $config = $result->fetch(PDO::FETCH_OBJ);\n\n return $config;\n}", "abstract public function getItem($name);", "public function __get(string $name)\n {\n if (isset($this->settings[$name])) {\n return $this->settings[$name];\n }\n if (in_array($name, $this->current)) {\n return true;\n }\n return false;\n }", "protected function _getFromConfig($key) {\n return $this->getConfig()->getData($key);\n }", "public function get($item)\r\n {\r\n $instance = $this->getInstance($item);\r\n return $instance->get();\r\n }", "public function get ( $name ) {\n\t\tif( !$this->has ( $name ) ) {\n\t\t\tthrow new \\InvalidArgumentException(sprintf('The name \"%s\" is invalid.', $name));\n\t\t}\n\t\treturn $this->config[$name];\n\t}", "public function tryGet($key)\n {\n foreach ($this->backends as $b) {\n try {\n if (($value = $b->get($key)) !== false) {\n return $value;\n }\n } catch (Exception $e) {\n // todo: shall we log this error?\n continue;\n }\n }\n\n return;\n }", "public function value($value)\n {\n if ($this->contains($value)) {\n foreach ($this->items as $key => $val) {\n if ($val === $value) {\n return $val;\n }\n }\n }\n throw new InvalidArgumentException(\"Value {$value} not found.\");\n }", "public function getConfig()\n {\n try {\n return $this->db->query(\"SELECT * FROM `\".DB_PREFIX.$this->_table.\"` WHERE `id` = 1\")->row;\n } catch (Exception $e) {\n return false; \n }\n }", "function config($key) {\n global $config;\n\n return !empty($config[$key]) ? $config[$key] : false;\n}", "public function getValueOf($id) {\n\t\t$config = $this->em->getRepository('SSNTherapassBundle:Config')->find($id);\n\t\tif (is_null($config)) {\n\t\t\treturn null;\n\t\t}\n\t\treturn $config->getValue();\n\t}", "static public function get($project, $param) {\n $settings = self::getAll($project);\n if (!isset($settings[$param])) {\n throw new Exception('Cannot find $settings[$param] value at ' . $file);\n }\n return $settings[$param];\n }", "abstract public function getItem($url,$itemId);", "function cfg_get(...$args)\n{\n\tglobal $CONFIG;\n\tswitch( count($args) )\n\t{\n\t\tcase 1: return isset($CONFIG[$args[0]])?$CONFIG[$args[0]]:false;\n\t\tcase 2: return isset($CONFIG[$args[0]][$args[1]])?$CONFIG[$args[0]][$args[1]]:false;\n\t\tcase 3: return isset($CONFIG[$args[0]][$args[1]][$args[2]])?$CONFIG[$args[0]][$args[1]][$args[2]]:false;\n\t\tcase 4: return isset($CONFIG[$args[0]][$args[1]][$args[2]][$args[3]])?$CONFIG[$args[0]][$args[1]][$args[2]][$args[3]]:false;\n\t\tcase 5: return isset($CONFIG[$args[0]][$args[1]][$args[2]][$args[3]][$args[4]])?$CONFIG[$args[0]][$args[1]][$args[2]][$args[3]][$args[4]]:false;\n\t\tcase 6: return isset($CONFIG[$args[0]][$args[1]][$args[2]][$args[3]][$args[4]][$args[5]])?$CONFIG[$args[0]][$args[1]][$args[2]][$args[3]][$args[4]][$args[5]]:false;\n\t\tdefault: WdfException::Raise(\"Illegal argument count: \".count($args));\n\t}\n}", "abstract public function getItem();" ]
[ "0.71993977", "0.6967329", "0.6866654", "0.68031263", "0.6737038", "0.6654353", "0.66260296", "0.65019864", "0.6166941", "0.61620617", "0.60999274", "0.6069719", "0.5970457", "0.5953733", "0.59422123", "0.59132206", "0.5898154", "0.58424336", "0.582102", "0.5788359", "0.57608163", "0.57599646", "0.57559067", "0.57418025", "0.5725785", "0.5719566", "0.56954455", "0.56909543", "0.5680747", "0.5674879", "0.5673485", "0.5664867", "0.56571907", "0.56439716", "0.56431556", "0.564176", "0.56242657", "0.5596179", "0.55756253", "0.55519694", "0.5533714", "0.5519792", "0.55185205", "0.55102444", "0.5505338", "0.5501515", "0.5496266", "0.5491727", "0.54905397", "0.5487122", "0.5485214", "0.54713863", "0.5468009", "0.5456396", "0.5455719", "0.5455466", "0.5448125", "0.544698", "0.5438641", "0.54373807", "0.5416192", "0.5415291", "0.54108065", "0.5403647", "0.54006433", "0.5394598", "0.53851074", "0.5372884", "0.537271", "0.5372171", "0.5367159", "0.53663164", "0.53651464", "0.5362472", "0.5352473", "0.53494483", "0.5347467", "0.53457254", "0.5326025", "0.53160423", "0.5302438", "0.52985114", "0.5292384", "0.5287458", "0.5283649", "0.52834016", "0.5280442", "0.5280047", "0.52764523", "0.5271423", "0.52684975", "0.5263115", "0.52546436", "0.52519715", "0.52492416", "0.5247988", "0.524198", "0.52387", "0.52361", "0.5236034", "0.5235311" ]
0.0
-1
Get the project environment
public function environment() : string { return $this->environment; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "function getEnvironment() {\n return Environment::env();\n}", "public function environment()\n {\n return $this->env;\n }", "public static function environment() {\n return self::$environment;\n }", "function getEnvironment(){ return $_ENV['CURRENT_ENVIRONMENT']; }", "public function getEnvironment(): Environment;", "public function environment()\n {\n return \\Config::get('app')['env'];\n }", "public function getEnvironment()\n {\n return self::$_environment;\n }", "public function getEnvironment() {\n\t\treturn $this->getKernel()->getEnvironment();\n\t}", "public function getEnvironment()\n {\n return $this->getConfig('environment');\n }", "public function getEnv()\n {\n return self::$environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function get_env()\n {\n return $this->env;\n }", "public function getEnvironment()\n {\n return $this->_environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "public function getEnvironment() {\n return $this->environment; \n }", "public function getEnvironment()\n\t{\n\t\treturn $this->_environment;\n\t}", "public function getEnvironment()\n {\n return $this->getConfigData('environment');\n }", "public static function env()\n {\n return self::context()->env();\n }", "public function getEnvironment()\n {\n return $this->config['environment'];\n }", "public static function environment() {\n\t\tif (!isset(self::$_environment)) {\n\t\t\tself::$_environment=new \\GO\\Base\\Environment();\n\t\t}\n\t\treturn self::$_environment;\n\t}", "public function getEnvironment() { return $this->environment; }", "public static function getEnvironment() {\n return self::whichEnv();\n }", "public function getEnv()\n {\n return $this->env;\n }", "public function getEnv()\n {\n return $this->env;\n }", "public function getAppEnvironment()\n {\n return $this->appEnvironment;\n }", "public static function get()\n\t{\n\t\t// then return content of APPLICATION_ENV\n\t\t// else return \"development\"\n\t\treturn (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : \"development\");\n\t}", "public function getEnvironment()\n {\n return $this->environmentNode;\n }", "protected function get_environment()\n\t{\n\t\treturn $this->environment ?: PHPBB_ENVIRONMENT;\n\t}", "function get_environment(): string {\n return getenv('APP_ENV') ?\n getenv('APP_ENV') : 'default';\n}", "public function getEnvironment($name);", "public function getEnv():string\n {\n return $this->env;\n }", "public function getEnvironment() {\n\n return trim($this->environment);\n }", "public function env()\n {\n // TODO: Implement env() method.\n }", "public function environment()\n {\n return 'local';\n }", "public function getEnv() {\n\t\treturn APPLICATION_ENV;\n\t}", "public static function environment()\n {\n $clientId = getenv(\"CLIENT_ID\") ?: warehouse::get_paypal_client_id();\n $clientSecret = getenv(\"CLIENT_SECRET\") ?: warehouse::get_paypal_secret();\n\n if (rex_config::get('warehouse', 'sandboxmode')) {\n return new SandboxEnvironment($clientId, $clientSecret);\n } else {\n return new ProductionEnvironment($clientId, $clientSecret);\n }\n }", "public static function environment(){\n return \\Illuminate\\Foundation\\Application::environment();\n }", "private function getEnvironment(): Environment\n {\n if ($this->environment === null) {\n $this->environment = new Environment();\n }\n\n return $this->environment;\n }", "public static function environment() {\n\t\treturn env('HORIZON_MODE');\n\t}", "public static function getEnvironment() : array\n {\n return self::$env;\n }", "protected function getEnvironmentMode() {}", "public static function environment()\n {\n $clientId = \"AeJcD0QwLDMAQZH5HHNDfJBKvIxDMd0SWKca3rrX3IdhK62xLu0EInhkOScSskKtxVhNBjroPkIX0Oeu\"; //live;\n// $clientSecret = \"EJs4udErZIsmm1rxvSR_6JIVqojRadq_oDkLLN1nQuqkaq5k8fSKX6CZQvUQzf3dLGdJthYh6xNLgHd3\"; //sandbox;\n $clientSecret = \"EEKCrsLBLWIVx4MTf8Qi1t2uTVNymwpUCxCnhsoZuAFpHPzpqBVliAiIBeSyHoEpeQya8TJdkgrDvXDM\"; //live;\n return new ProductionEnvironment($clientId, $clientSecret);\n }", "public function getEngine()\n {\n return $this->environment;\n }", "public static function project()\n {\n return self::context()->project();\n }", "public function getEnvironments();", "protected function deriveEnvironment()\n {\n $confDir = $this->getAppConfigDir();\n\n if (file_exists($confDir . 'development.php')) {\n return 'development';\n } elseif (file_exists($confDir . 'testing.php')) {\n return 'testing';\n } elseif (file_exists($confDir . 'production.php')) {\n return 'production';\n } else {\n throw new \\RuntimeException(\n 'Environment Not Specified And Unable To Derive',\n 500\n );\n }\n }", "public function getEnvironmentFile(): string;", "public function getEnvironmentPath(): string;", "public function getEnvs();", "public static function getDevelopment()\r\n {\r\n return self::get('dev');\r\n }", "function env();", "public function getDefaultEnvironment();", "public function getEnvironment()\n {\n return 'branch';\n }", "private function getEnvironmentMode() {\n return $this->config->get('api.mode') === 'live' ? 'prod' : 'dev';\n }", "public static function getEnv()\n {\n //($s = yaml_parse_file(\"/var/www/app.env\")) || die(\"YAML file not found\");\n //var_dump($s);\n //$thing = file_get_contents(\"/var/www/app.env\");\n //$data = Spyc::YAMLLoad('../spyc-0.6.1/spyc.yaml');\n return yaml_parse_file(\"/var/www/app.env\");\n }", "function derive_environment()\n{\n $envname = 'crm'; // Assume prod environment for now.\n $env_shortname = strrchr(BASE_DIR, '_');\n if ($env_shortname !== false) {\n $env_shortname = substr($env_shortname, 1);\n if ($env_shortname != 'prod') {\n $envname = \"crm$env_shortname\";\n }\n }\n return $envname;\n}", "public static function environmentFile(){\n return \\Illuminate\\Foundation\\Application::environmentFile();\n }", "public function getEnv(): array\n {\n return $this->env;\n }", "private static function loadEnvSettings()\n {\n require_once self::$envPath;\n return $env;\n }", "protected function getCurrentEnv() {\n if (empty($this->env)) {\n $this->env = shell_exec('echo -n $'.self::ENV_VARIABLE_NAME);\n }\n return $this->env;\n }", "function env($name)\n{\n return Env::get($name);\n}", "protected static function environment() {\n if (app()->environment('production')) {\n $clientId = config('app.paypal_live_client_id');\n $clientSecret = config('app.paypal_live_client_secret');\n return new ProductionEnvironment($clientId, $clientSecret);\n }\n $clientId = config('app.paypal_sandbox_client_id');\n $clientSecret = config('app.paypal_sandbox_client_secret');\n return new SandboxEnvironment($clientId, $clientSecret);\n }", "public function environment() {\n $this->envPath = base_path('.env');\n $this->envExamplePath = base_path('.env.example');\n \n $envConfig = $this->getEnvContent();\n \n return view('installer::environment', compact('envConfig'));\n }", "protected function getEnvironments()\n {\n return array('dev', 'test', 'preprod');\n }", "public function getEnvPath()\n {\n return $this->envPath;\n }", "public function getEnvironmentPath()\n {\n return $this->environmentPath ?: $this->configuration->getRootPath();\n }", "protected function get_wp_environment()\n {\n }", "public function getEnv($name);", "private function getTwigEnvironment(): Environment\n {\n if (null == $this->twigEnvironment) {\n $this->twigEnvironment = $this->createTwigEnvironment();\n }\n return $this->twigEnvironment;\n }", "public static function environmentPath(){\n return \\Illuminate\\Foundation\\Application::environmentPath();\n }", "public function getEnviado()\n {\n return $this->enviado;\n }", "public function getEnvironmentFilePath(): string;", "public function getViewEnvironment()\n {\n return $this->view;\n }", "public function getEnvironments(): array\n {\n return $this->environments;\n }", "public function getEnvironmentFile()\n {\n return $this->environmentFile ?: '.env';\n }", "public function return_oCRNRSTN_ENV(){\n\n return self::$oCRNRSTN_ENV;\n\n }", "public function getEnvironmentVariables()\n {\n return $this->environment_variables;\n }", "private function getParentEnvironment() {\n\t\tif ( PHP_SAPI === 'cli' ) {\n\t\t\treturn getenv();\n\t\t} elseif ( isset( $_ENV['PATH'] ) ) {\n\t\t\treturn [ 'PATH' => $_ENV['PATH'] ];\n\t\t} else {\n\t\t\treturn [];\n\t\t}\n\t}", "function env($key = null)\n{\n if (!isset($GLOBALS['configs']))\n $GLOBALS['configs'] = json_decode(file_get_contents($GLOBALS['config_path'] . DIRECTORY_SEPARATOR . 'env.json'));\n\n if (!is_null($key) && isset($GLOBALS['configs']->$key))\n return $GLOBALS['configs']->$key;\n elseif (is_null($key) && isset($GLOBALS['configs']))\n return $GLOBALS['configs'];\n else\n Throw new \\Atom\\Environment\\EnvironmentException(\"Environment variable \" . $key . \" not found.\");\n}", "public function environmentPath(): string\n {\n return $this->environmentPath ?: $this->basePath;\n }", "public static function getEnvMode()\n {\n return (Configuration::get('PAYLINE_LIVE_MODE') == '1' ? PaylineSDK::ENV_PROD : PaylineSDK::ENV_HOMO);\n }", "function isDev(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_DEV; }", "public static function getEnvironments()\n {\n $instanceSpecificKeys = [\n 'app_frontend_url',\n 'app_backend_url'\n ];\n\n $globalKeys = [\n 'app_config_path',\n 'server_config_path',\n 'isolation_config_path',\n 'handlers_config_path',\n 'configuration:Magento/Mtf/TestSuite/MtfTests',\n 'app_instances',\n 'events_preset',\n 'log_directory'\n ];\n\n $globalEnvironmentVariables = [];\n foreach ($globalKeys as $key) {\n if (isset($_ENV[$key])) {\n $globalEnvironmentVariables[$key] = $_ENV[$key];\n }\n }\n\n $environments = [];\n if (isset($_ENV['app_instances'])) {\n $instancesCount = $_ENV['app_instances'];\n\n for ($x = 0; $x < $instancesCount; $x++) {\n $environmentVariables = [];\n\n foreach ($instanceSpecificKeys as $key) {\n $instanceKey = $key . \"_\" . $x;\n if (isset($_ENV[$instanceKey])) {\n $environmentVariables[$key] = $_ENV[$instanceKey];\n }\n }\n\n $mergedEnvironmentVariables = array_merge(\n $globalEnvironmentVariables,\n $environmentVariables\n );\n $environments[] = new Environment($mergedEnvironmentVariables);\n }\n } else {\n $environmentVariables = [];\n\n foreach ($instanceSpecificKeys as $key) {\n if (isset($_ENV[$key])) {\n $environmentVariables[$key] = $_ENV[$key];\n }\n }\n\n $mergedEnvironmentVariables = array_merge(\n $globalEnvironmentVariables,\n $environmentVariables\n );\n $environments[] = new Environment($mergedEnvironmentVariables);\n }\n\n return $environments;\n }", "public function getEnvironmentVariables()\n {\n return $this->environmentVariables;\n }", "function env() {\n if (defined('WP_ENV')) {\n return WP_ENV;\n } else {\n define('WP_ENV', getenv('WP_ENV') ?? 'production');\n }\n return WP_ENV;\n}", "public function getEnvironmentVariables()\n {\n return $this->_environmentVariables;\n }", "public function needsEnvironment()\n {\n return $this->options['needs_environment'];\n }", "public function getEnvironmentVariables()\n {\n return $this->_envVars;\n }", "public function getPhoneEnvironment()\n {\n return $this->_aPhoneEnvironment;\n }", "public function getTwigEnvironment(): Environment\n {\n return $this->twigEnvironment;\n }" ]
[ "0.83430827", "0.83430827", "0.83430827", "0.83430827", "0.83430827", "0.83430827", "0.82238406", "0.8157302", "0.8133287", "0.80208516", "0.8003106", "0.794177", "0.7915496", "0.7906926", "0.78929406", "0.78573525", "0.7840056", "0.78385305", "0.7832444", "0.78295106", "0.78295106", "0.78295106", "0.78295106", "0.78295106", "0.7809281", "0.78051883", "0.7782327", "0.77643496", "0.77570075", "0.77374023", "0.7672348", "0.75965494", "0.7525956", "0.7525956", "0.7467358", "0.7458791", "0.74388933", "0.7415252", "0.73730445", "0.7274654", "0.7237021", "0.7209028", "0.71539885", "0.71334904", "0.70998335", "0.70969826", "0.70754206", "0.70274335", "0.69867575", "0.6984117", "0.6900634", "0.6896283", "0.6876131", "0.68676907", "0.68327785", "0.68277454", "0.6813334", "0.67739826", "0.67533", "0.67459935", "0.67446566", "0.6744234", "0.6743841", "0.6727482", "0.6704481", "0.67043155", "0.67020714", "0.6681974", "0.66663915", "0.66369075", "0.66250575", "0.66021025", "0.6590082", "0.6588795", "0.6556845", "0.6548586", "0.6494146", "0.64648384", "0.6444668", "0.64342636", "0.6419122", "0.6406049", "0.6390493", "0.6379569", "0.6379511", "0.63765705", "0.6374943", "0.6372304", "0.6364255", "0.6359949", "0.63365644", "0.6294615", "0.62815964", "0.62776166", "0.62760615", "0.62736547", "0.62715304", "0.6270643", "0.6268545", "0.6262954" ]
0.7655883
31
================================ OUTPUT ================================ Get the project name in fortrabbit
public function projectName() : string { return (string) $this->getOrError('name'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_forge_project_name()\n\t{\n\t\treturn '';\n\t}", "public abstract function getProjectName();", "public function getProjectName() : string\n {\n return $this->projectName;\n }", "public function getProjectTitle();", "public function getProject()\r\n {\r\n return $this->_params['project'];\r\n }", "function rawpheno_function_getproject($project_id) {\n $result = chado_query(\"SELECT name FROM {project} WHERE project_id = :project_id LIMIT 1\", array(\n ':project_id' => $project_id,\n ));\n\n return ($result) ? $result->fetchField() : 0;\n}", "public function getProjectName($project)\n {\n return self::get(\"SELECT * FROM $this->table WHERE project_name = '$project'\");\n }", "public static function getProjectName()\n {\n $name = array();\n $items = Cart::getCart();\n foreach($items as $key => $item) {\n $name[] = $item['title'];\n }\n \n return implode(', ', $name);\n }", "public static function label()\n {\n return 'Projects';\n }", "public function getProjectTItle() {\n $project = \"Yii2\";\n return $project;\n }", "public abstract function getProjectFieldName();", "private function getProjectNameAndProjectID(){\r\n $this->jsonOutput[\"projectID\"] = utils\\Encryption::encode($this->settingVars->projectID);\r\n $this->jsonOutput[\"projectName\"] = $this->settingVars->pageArray[\"PROJECT_NAME\"];\r\n }", "public static function retrieveProjectTitle($projectID) {\n try {\n $project = ArmyDB::retrieveProjectInfo($projectID);\n //var_dump($unit);\n return $project['projectname'];\n }\n catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }", "protected function getNewProjectName() {\n\t\tdo {\n\t\t\t$t_name = $this->getName() . '_' . rand();\n\t\t\t$t_id = $this->client->mc_project_get_id_from_name( $this->userName, $this->password, $t_name );\n\t\t} while( $t_id != 0 );\n\t\treturn $t_name;\n\t}", "public static function projectName(string $project): string\n {\n return self::getPathTemplate('project')->render([\n 'project' => $project,\n ]);\n }", "public static function projectName(string $project): string\n {\n return self::getPathTemplate('project')->render([\n 'project' => $project,\n ]);\n }", "public function getProject();", "function getProjectName($con, $inpProj)\n\t{\n\t\t$sql_projName = $con->prepare(\"SELECT projectName FROM projects WHERE projectID = ?\");\n\t\t$sql_projName->bind_param(\"i\", $inpProj);\n\t\t$sql_projName->execute();\n\n\t\t$result_projName = $sql_projName->get_result();\n\n\t\twhile($row = mysqli_fetch_array($result_projName))\n\t\t{\n\t\t\t$projName = $row['projectName'];\n\t\t}\n\n\t\treturn $projName;\n\t}", "public function getProjectId(): string\n {\n return $this->_projectId;\n }", "public function fetchProjectID(): string;", "private function getProject()\n {\n $url = $this->base_uri.\"project/\".$this->project;\n $project = $this->request($url);\n return $project;\n }", "function fcollab_project_list(){\r\n\t$output = 'list project';\r\n\t\r\n\treturn $output;\r\n}", "function get_project_name($project_id, &$link){\n \t$resp = 'Unknown';\n \t$query = \"select name from healingcrystals_projects where id='\" . $project_id . \"'\";\n \t$result = mysql_query($query, $link);\n \tif (mysql_num_rows($result)){\n \t\t$info = mysql_fetch_assoc($result);\n \t\t$resp = $info['name'];\n \t}\n \treturn $resp;\n }", "public function getProject()\n {\n return $this->project;\n }", "public function getProject()\n {\n return $this->project;\n }", "public function getProject()\n {\n return $this->project;\n }", "public function getTskProject()\n {\n return $this->tsk_project;\n }", "public function getProject() {\n\t\treturn $this->project;\n\t}", "public function project_info (Project $project)\n {\n return $project;\n }", "public function getNameProjectType()\n {\n return $this->name_project_type;\n }", "public static function agentName(string $project): string\n {\n return self::getPathTemplate('agent')->render([\n 'project' => $project,\n ]);\n }", "public static function projectAgentName(string $project): string\n {\n return self::getPathTemplate('projectAgent')->render([\n 'project' => $project,\n ]);\n }", "function get_project_name_by_id($id)\n{\n $CI =& get_instance();\n $CI->db->select('name');\n $CI->db->where('id', $id);\n $project = $CI->db->get('tblprojects')->row();\n if ($project) {\n return $project->name;\n }\n\n return '';\n}", "public static function project()\n {\n return self::context()->project();\n }", "function projectname($id)\n{\n\t$name=mysql_fetch_array(mysql_query(\"select property_name from manage_property where pid='$id'\"));\n\treturn $name['property_name'];\n\t}", "public function fortrabbitRemoteName() : string\n {\n return 'frb-' . $this->environment();\n }", "public function getTaskName($taskProjectId){\n \n // echo '$getUpdateId-------'.$getUpdateId; exit;\n\t\n\t\t\tif(empty($taskProjectId)) :\n\t\t\t\n\t\t\t\t$taskNamesQ \t= $this->db->select('task_Id,task_name')->from('task_details')->group_by('task_name')->order_by('task_Id' , 'desc')->get();\n\t\t\t\n\t\t\telse:\n\t\t\t\n\t\t\t\t$taskNamesQ \t= $this->db->select('task_Id,task_name')->from('task_details')->where('project_Id',$taskProjectId)->order_by('task_Id' , 'desc')->get();\n\t\t\t\n\t\t\tendif; \t\n\t\t\t\n\t\t\treturn $taskNamesQ->result();\n\t\t\n\t}", "public function getGathercontentProject();", "public function getName(): string {\n\t\treturn $this->l10nFactory->get($this->appName)->t('Nextcloud announcements');\n\t}", "function getProjectName($lm_id){\n if (empty($lm_id)){\n $reply = array(0,'?');\n }else{\n $m = $this->getMember($lm_id);\n $reply = array($m['lm_value'],$m['lm_key']);\n }\n //b_debug::print_r($reply);\n return $reply;\n }", "function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}", "public function getProject()\n\t{\n\t\tif (!$this->projectId)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t$query = $this->db->getQuery(true);\n\t\t$query->select('id, name, alias, description, url, logo, logo_alt, issue_template')\n\t\t\t->from('#__monitor_projects')\n\t\t->where(\"id = \" . $query->q($this->projectId));\n\n\t\t$this->db->setQuery($query);\n\n\t\treturn $this->db->loadObject();\n\t}", "public function get_project(){\n if ( $this->project != NULL){\n $myProject= new Project();\n return $myProject->get_by_ID($this->project);\n }\n }", "public function getResourceId()\n {\n return 'project::' . $this->id;\n }", "function cs_get_project_url() {\n\tif (function_exists('get_field')) {\n\t\tglobal $post;\n\t\t$project_url = get_field('project_url', $post->ID);\n\t\techo $project_url;\n\t}\n}", "public function path()\n {\n return \"/projects/{$this->id}\";\n }", "private function showProjectInfo()\n {\n // URLs\n $this->output->writeln('');\n $this->output->writeln('<info>'. $this->project->getName(false) .'</info> has now been created.');\n $this->output->writeln('<comment>Development:</comment> ' . $this->project->getDevUrl());\n $this->output->writeln('<comment>Staging:</comment> ' . $this->project->getStagingUrl());\n $this->output->writeln('<comment>Production:</comment> N/A');\n\n // Database credentials\n $databaseCredentials = $this->project->getDatabaseCredentials('dev');\n $this->output->writeln('');\n $this->output->writeln('<info>Development MySQL credentials</info>');\n $this->output->writeln('Username: ' . $databaseCredentials['username']);\n $this->output->writeln('Password: ' . $databaseCredentials['password']);\n $this->output->writeln('Database: ' . $databaseCredentials['database']);\n\n $databaseCredentials = $this->project->getDatabaseCredentials('staging');\n $this->output->writeln('');\n $this->output->writeln('<info>Staging MySQL credentials</info>');\n $this->output->writeln('Username: ' . $databaseCredentials['username']);\n $this->output->writeln('Password: ' . $databaseCredentials['password']);\n $this->output->writeln('Database: ' . $databaseCredentials['database']);\n $this->output->writeln('');\n\n // We're done!\n $this->output->writeln('<info>You can now run \"cd '. $this->project->getName() .' && vagrant up\"</info>');\n }", "public function get_name() {\n return get_string('circleci', 'assignsubmission_circleci');\n }", "public function PrintProject(){\r\n\t\tprint \"id: $this->id<br>\\n\";\r\n\t\tprint \"number: $this->number<br>\\n\";\r\n\t\tprint \"name: $this->name<br>\\n\";\r\n\t\tprint \"status: $this->status<br>\\n\";\r\n\t\tprint \"manager: $this->manager<br>\\n\";\t\r\n\t\tprint \"location: $this->location<br>\\n\";\r\n\t\tprint \"information: $this->information<br>\\n\";\r\n\t\tprint \"showme: $this->show<br>\\n\";\r\n\t\tprint \"cadmin: $this->cadmin<br>\\n\";\r\n\t\tprint \"changeday: $this->changeday<br>\\n\";\t\r\n\t\tprint \"location_name: $this->location_name<br>\\n\";\r\n\t\tprint \"manager_name: $this->manager_name<br>\\n\";\r\n\t\tprint \"cadmin_name: $this->cadmin_name<br>\\n\";\r\n\t}", "public function get_task_name()\n\t{\n\t\treturn $this->task_name;\n\t}", "public function get_task_name()\n\t{\n\t\treturn $this->task_name;\n\t}", "public function getUrl()\n\t{\n\t\t$url = strtolower($this->_name);\n\t\t$url = str_replace(' ', '-', $url);\n\t\t$url = str_replace('&-', '', $url);\n\n\t\t# retrieves a sanitized url from the project name :3\n\t\treturn $this->getId() . DIRECTORY_SEPARATOR . $url;\n\t}", "public function getTaskTitle() {}", "public function getProjectInformation() {\n $query = \"select * from projects\";\n $result = mysql_query($query);\n return $result;\n }", "public function getProject() {\n\t\tif ($this->_project === null) {\n\t\t\t$this->analyzeURL();\n\t\t}\n\t\treturn $this->_project;\n\t}", "public function getDepandTaskName()\n {\n return $this->get(self::DEPAND_TASK_NAME);\n }", "public function projectTitle($id_project) {\n\t\t$this->db->select(\"project_title\");\n\t\t$this->db->from(\"project\");\n\t\t$this->db->where(\"id_project\",$id_project);\n\t\treturn $this->db->get();\n\t}", "function get_cur_project() {\n\t\tif (!isset($_SESSION['dfl_project'])) {\n\t\t\tlgi_mysql_fetch_session(\"SELECT `dfl_project` AS `dfl_project` FROM %t(users) WHERE `name`='%%'\", $this->userid);\n\t\t\t// if not set, return first project found\n\t\t\tif (!isset($_SESSION['dfl_project']))\n\t\t\t\tlgi_mysql_fetch_session(\"SELECT `name` AS `dfl_project` FROM %t(userprojects) AS p, %t(usercerts) AS c WHERE p.`usercertid`=c.`id` AND c.`user`='%%' LIMIT 1\", $this->userid);\n\t\t\tif (!isset($_SESSION['dfl_project']))\n\t\t\t\tthrow new LGIPortalException(\"No LGI projects for user: check certificate.\");\n\t\t}\n\t\treturn $_SESSION['dfl_project'];\n\t}", "public function getProjectId()\n {\n return $this->project_id;\n }", "public function getProjectId()\n {\n return $this->project_id;\n }", "public function getProjectId()\n {\n return $this->project_id;\n }", "public function getName() : string\n\t{\n\t\treturn $this->getContext()->getI18n()->dt( 'controller/jobs', 'Send email to vendor' );\n\t}", "public function getProjectNameWithCustomerName($projectId, $glue = \" - \") {\n\n\t\t$project = $this->getProjectById($projectId);\n\t\t$projectName = $project->getCustomer()->getName() . $glue . $project->getName();\n\n\t\treturn $projectName;\n\t}", "public function getProjectDetails($projectId)\n {\n $registry = Zend_Registry::getInstance();\n\t\t$DB = $registry['DB'];\n $sql = \"SELECT prj.project_id,project_name,config.config_id FROM `tbl_projects` as prj \n\t\tleft join tbl_config as config on config.project_id = prj.project_id WHERE prj.`deleted` = 0 AND prj.project_id = $projectId \";\n \t\t$result = $DB->fetchAssoc($sql);\n\t\treturn $result;\n }", "private static function GetProject($value)\n\t{\n\t\tif ($value instanceof GitPHP_Project) {\n\t\t\treturn $value->GetProject();\n\t\t} else if (is_string($value)) {\n\t\t\treturn $value;\n\t\t}\n\t}", "private static function _getBackendNameByProject($prj_id)\n {\n static $backends;\n\n if (isset($backends[$prj_id])) {\n return $backends[$prj_id];\n }\n\n $stmt = \"SELECT\n prj_id,\n prj_customer_backend\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"project\n ORDER BY\n prj_id\";\n $res = DB_Helper::getInstance()->getAssoc($stmt);\n if (PEAR::isError($res)) {\n\t /** @var $res PEAR_Error */\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return '';\n } else {\n $backends = $res;\n return @$backends[$prj_id];\n }\n }", "public function show()\n {\n $service = Config::get(\"ProjectLister::service\");\n $method = \"fetch_$service\";\n // Fetch\n $projects = self::$method();\n // Sort the list\n $projects = Project::sort( $projects );\n\n $output = '';\n foreach($projects as $project)\n {\n $template = ( Config::get(\"ProjectLister::template\") ) ? Config::get(\"ProjectLister::template\") : Project::getProjectTemplate();\n\n $template = str_replace('{{PROJECT_URL}}', $project->url, $template);\n $template = str_replace('{{PROJECT_NAME}}', htmlentities($project->name), $template);\n $template = str_replace('{{PROJECT_WATCHER_COUNT}}', $project->watchers, $template);\n $template = str_replace('{{PROJECT_DESCRIPTION}}', htmlentities($project->description), $template);\n $template = str_replace('{{PROJECT_SOURCE}}', $project->source, $template);\n $template = str_replace('{{PROJECT_WATCHER_NOUN}}', $project->watcher_noun, $template);\n\n $output .= $template . \"\\n\";\n }\n return $output;\n }", "public function getTaskName() : string\n {\n return $this->taskName;\n }", "public function getName() {\n\t\t\treturn $this->MODULE_NAME;\t\n\t\t}", "public function getProjects()\n {\n }", "public function index($project = null)\n {\n //\n var_dump($project);\n }", "public static function retrieveUserNameFromProject($projectid) {\n $project = R::getRow('SELECT username from project WHERE id ='. $projectid);\n\n if(empty($project)) {\n throw new Exception(\"There is no username associated with $projectid.\");\n }\n\n return $project;\n }", "public function getTaskName() : string {\n return $this->taskName;\n }", "public static function defaultAppName():string {\n\n # Set result\n $result = \"Crazy Project\";\n\n # Get current app path\n $appPath = File::path(\"@app_root\");\n\n # Check app path\n if($appPath){\n\n # Set composer path\n $conposerAppPath = \"$appPath/composer.json\";\n\n # Check composer name\n if(File::exists($conposerAppPath) && ($composerName = Composer::get(\"name\", $conposerAppPath)) !== null)\n\n # Set result\n $result = $composerName;\n\n else\n\n # Extract name from app path\n $result = Strings::getLastString(trim($appPath, \"/\"), \"/\");\n\n }\n\n # Then add space before capital letters\n $result = Process::spaceBeforeCapital($result);\n\n # Return result\n return $result;\n\n }", "private function namebase() {\n return $this->module->name;\n }", "public function get_name() {\n return \\enrol_oes_string::display('sync_taskname');\n }", "function project_by_index($index) {\n $project = $this->parsed_items[$this->projects[$index]];\n return $project;\n }", "public function get_project_all(){\n }", "public function name()\n {\n return $this->program->name.' '.$this->year;\n }", "public function getSolutionName()\n {\n return $this->solution_name;\n }", "public function getIdProject()\n {\n return $this->idProject;\n }", "public function name(): string\n {\n return 'PROD';\n }", "public function getProjects();", "public function getProject() {\n return ProjectManager::getActiveProject();\n }", "public function getAssetsPrefix(): string\n\t{\n\t\treturn Config::getProjectName();\n\t}", "public function getTaskName()\n {\n return $this->taskName;\n }", "function getVerboseProjectRole($project) {\n if($this->isProjectLeader($project)) {\n return lang('Project Leader');\n } else if($this->isAdministrator()) {\n return lang('System Administrator');\n } elseif($this->isProjectManager()) {\n return lang('Project Manager');\n } else {\n $role = $this->getProjectRole($project);\n if(instance_of($role, 'Role')) {\n return $role->getname();\n } else {\n return lang('Custom');\n } // if\n } // if\n }", "public function getUiCallText() {\n return \"UCC Flash Project\";\n }", "private function getProjectTitle($user_id, $level_id)\n\t{\n\t\t// Check if reference to this project is stored\n\t\t$db = JFactory::getDBO();\n\t\t$query = $db->getQuery(true)\n\t\t\t->select($db->qn('pf_projects_id'))\n\t\t\t->from($db->qn('#__akeebasubs_pf4_projects'))\n\t\t\t->where($db->qn('users_id') . ' = ' . $db->q($user_id))\n\t\t\t->where($db->qn('akeebasubs_level_id') . ' = ' . $db->q($level_id));\n\t\t$db->setQuery($query);\n\t\t$proj_id = $db->loadResult();\n\t\tif($proj_id == null) return \"\";\n\t\t\n\t\t// Get the title\n\t\t$query = $db->getQuery(true)\n\t\t\t->select($db->qn('title'))\n\t\t\t->from($db->qn('#__pf_projects'))\n\t\t\t->where($db->qn('id') . ' = ' . $db->q($proj_id));\n\t\t$db->setQuery($query);\n\t\t$proj_title = $db->loadResult();\n\t\tif($proj_title == null) return \"\";\n\t\t\n\t\treturn $proj_title;\n\t}", "private function projectPath()\n { }", "public function get_name();", "public function get_name();", "public function get_name();", "public static function getTitle()\n {\n global $application_name;\n return $application_name;\n }", "function project_by_task($key) {\n $project_key = $this->projects[$this->task_project[$key]];\n $project = $this->parsed_items[$project_key];\n return $project;\n }", "public function Name() {\n\t\treturn $this->jobId;\n\t}", "public function get_title() {\n\t\treturn __( 'Team', 'qazana' );\n\t}", "function getProject($projectid)\n\t{\n\t\tforeach($this->Project_List as $project)\n\t\t\tif($project->getProjectID() == $projectid)\n\t\t\t\treturn $project;\n\t}", "function the_project_link($project) {\n $link = '';\n \n if ($project['project_url']) {\n $link = '<a class=\"project-link\" href=\"'. $project['project_url'].'\" target=\"_blank\">#</a>';\n }\n \n echo $link;\n}", "function GetProjectInfoBasedOnId($projId)\n {\n $ret = '';\n \n $sql = 'SELECT * ' .\n ' FROM PROJECTS ' .\n ' WHERE PROJECT_ID = ' . $projId;\n \n $result = QueryDB($sql);\n \n while($result != null && $row = $result->fetch_array(MYSQLI_ASSOC))\n {\n $info = array();\n $info['name'] = $row['PROJECT_NAME'];\n $info['desc'] = $row['PROJECT_DESC'];\n $info['id'] = $row['PROJECT_ID'];\n $info['timestamp'] = $row['PROJECT_TIMESTAMP'];\n $ret = $info;\n }\n \n return $ret;\n }" ]
[ "0.7883026", "0.78474265", "0.7644333", "0.727933", "0.7108012", "0.7103572", "0.70317435", "0.69737643", "0.69415855", "0.6874081", "0.6865497", "0.6860642", "0.6855624", "0.68054545", "0.6805123", "0.6805123", "0.67758447", "0.6752159", "0.67405194", "0.66817", "0.6669343", "0.663483", "0.6590191", "0.6581682", "0.6581682", "0.6581682", "0.6544047", "0.6541542", "0.6444686", "0.6415518", "0.64050883", "0.63449323", "0.6315283", "0.6227156", "0.6223695", "0.6206614", "0.620063", "0.6194596", "0.61932135", "0.61890215", "0.6175428", "0.614157", "0.61310977", "0.6127976", "0.612437", "0.60961956", "0.60757685", "0.6071476", "0.6067428", "0.60647005", "0.60647005", "0.60592794", "0.6041313", "0.603869", "0.6028853", "0.6024062", "0.60236067", "0.59923923", "0.5991367", "0.5991367", "0.5991367", "0.59894454", "0.59735173", "0.5968513", "0.5959153", "0.5946488", "0.5942989", "0.5919922", "0.59084713", "0.58998436", "0.5896558", "0.58936125", "0.5886883", "0.5884101", "0.5866643", "0.5864781", "0.58520555", "0.5840079", "0.5838575", "0.5836904", "0.58352274", "0.5833924", "0.58306986", "0.5827279", "0.5823891", "0.5823169", "0.5821271", "0.5818064", "0.5816756", "0.5801525", "0.5798249", "0.5798249", "0.5798249", "0.57977366", "0.57730466", "0.5771485", "0.57710654", "0.576052", "0.57540405", "0.57339084" ]
0.7125553
4
Get local branch to deploy from
public function targetBranch() : string { return (string) $this->getOrError('target_branch'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function branch()\n {\n $result = $this->git('symbolic-ref --short HEAD');\n if (empty($result)) {\n return 'master';\n }\n\n return $result;\n }", "public function remoteBranch() : string\n {\n return (string) $this->getOrError('remote_branch');\n }", "public function getCurrentBranch() : string\n {\n $process = $this->runProcess(new Process('git branch'));\n\n $branches = collect(explode(PHP_EOL, $process->getOutput()));\n\n $currentBranch = $branches->first(function(string $branch) {\n return str_contains($branch, '*');\n });\n\n return trim(str_replace('*', '', $currentBranch));\n }", "protected function getBranch()\n {\n $branches = $this->terminal->run($this->git->branch());\n\n preg_match('/\\*\\s([\\w]*)/', $branches, $matches);\n \n if (!empty($matches[1])) {\n $this->branch = $matches[1];\n }\n \n $this->output->write('<info>' . $this->branch . '</info>' . PHP_EOL);\n }", "public function getBranch()\n {\n return $this->_options['branch'];\n }", "public function getBranch()\n {\n return $this->branch;\n }", "public function getBranch()\n {\n return $this->branch;\n }", "public function getExistingBranchForTestCase()\n {\n $branchName = $this->getDevBranchName();\n $devBranch = new DevBranches($this->getDefaultClient());\n\n $branches = $devBranch->listBranches();\n $branch = null;\n // get branch detail\n foreach ($branches as $branchItem) {\n if ($branchItem['name'] === $branchName) {\n $branch = $branchItem;\n }\n }\n if (!isset($branch)) {\n $this->testCase->fail(sprintf('Reuse existing branch: branch %s not found.', $branchName));\n }\n\n return $branch;\n }", "public function getEnvironment()\n {\n return 'branch';\n }", "function determine_branch_name( $request) {\n // push request, branch is in request[ref]\n if (isset($reqest['ref'])) {\n // strip out the refs/head nonsense -- doesn't look like bare\n // branch is listed anywhere in the request\n return preg_replace(\"|refs/heads/|\", \"\", $request['ref']);\n }\n\n _log(\"Unable to determine branch name. Maybe this wasn't a pull or merge request?\");\n}", "public function git_working_branch()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git status', $status );\n\t\t$status = $status[0];\n\n\t\treturn preg_replace( '/# On branch/', '', $status );\n\t}", "function changeBranch(){\r\n\t\t// $gitpss = isset($_COOKIE['gitpss']) ? $_COOKIE['gitpss'] : '';\r\n\t\t// $repo = 'https://'.$gitusr.':'.$gitpss.'@github.com/nelsoft/nelsoft_inventory.git';\r\n\t\tchdir($_POST['path']);\r\n\t\texec('git clean -df');\r\n\t\texec('git checkout -- .');\r\n\t\t// exec('git fetch '.$repo);\r\n\t\texec('git checkout '.$_POST['branch'], $data);\r\n\t\t// exec('git pull '.$repo.' '.$_POST['branch'], $data);\r\n\r\n\t\t$return['version'] = '0.00';\r\n\t\t$return['version'] = getversion($_POST['path'], 'version');\t\r\n\t\t$return['data'] = $data;\r\n\r\n\t\tjdie($return);\r\n}", "public function getBranch() /*: string*/ {\n if ($this->branch === null) {\n throw new \\Exception(\"Branch is not initialized\");\n }\n return $this->branch;\n }", "function do_checkout_branch($req, $deployto, $operation){\n \n\tif($operation != \"TAG\"){\n\t//if($operation == \"Push Hook\" && !empty($DEPLOY_BRANCH)){\n\t\t$branch=determine_branch_name($req);\n\t\tif($branch == $operation){\n\t\t\t$cmd = \"bash -c 'cd $deployto; git checkout $branch' 2>&1\";\n\t\t}\n\t\telse{\n\t\t\t$cmd = \"bash -c 'cd $deployto; git checkout $operation' 2>&1\";\n\t\t}\n\t}\n\telse{\n\t\t$tag= $req['ref'];\n\t\t$cmd = \"bash -c 'cd $deployto; git checkout $tag' 2>&1\";\n\t}\n\t\n\tif(file_exists($deployto . \"/.gitmodules\")){\n\t\t_log(\"Initializing and Updating submodules...\\n\");\n\t\t$subcmd = \"bash -c 'cd $deployto; git submodule init; git submodule update' 2>&1\";\n\t}\n\n\t_debug(\"Operation: $operation\\n\");\n _log(\"Exec Command: $cmd\\n\");\n\n\t$result = shell_exec($cmd);\n\tif(isset($subcmd)){\n\t\t$result .= shell_exec($subcmd);\n \t}\n \treturn $result;\n\n}", "public function getBranch()\n {\n return new GitBranch($this->getProjectBase());\n }", "public function getDefaultBranch() {\n $repoApi = new \\Drupal\\config_pr\\RepoControllers\\GitLabApi($this->getClient());\n $path = '/api/v4/projects/' . $this->getProjectId();\n $response = $repoApi->get($path);\n\n return $response['default_branch'];\n }", "public function getBranchName()\n {\n if ($this->_branch === false) {\n $this->_branch = preg_match('#^/-([^/]+)-#', $this->getPathInfo(), $matches)\n ? $matches[1]\n : null;\n }\n\n return $this->_branch;\n }", "public function getSource()\n {\n return 'branch';\n }", "public function getBranchOf()\n {\n return $this->branchOf;\n }", "static function getCurrentVersion($branch=\"latest_stable\")\n\t{\n\t\t$url = \"svn://localhost/ci_base_core/branches/\".$branch.\"/.version\";\n\t\t//file_put_contents(\"../logs/index.getCurrentVersion.branch_url.txt\", print_r($url, true));\n\t\t$out = false;\n\t\n\t\tif (function_exists('curl_init'))\n\t\t{\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\tcurl_setopt($ch, CURLOPT_USERAGENT, 'BA5E');\n\t\t\t$out = curl_exec($ch);\n\t\n\t\t\tif (false === $out)\n\t\t\t{\n\t\t\t\ttrigger_error('Not sure what it is, but there\\'s a problem with contacting the update server. Maybe this will help: \"' . curl_error($ch) . '\"');\n\t\t\t}\n\t\t\techo curl_error($ch);\n\t\t\tcurl_close($ch);\n\t\t}else{\n\t\t\tthrow new Exception(\"curl is required for this action\");\n\t\t}\n\t\n\t\t\n\t\treturn ($out !== false) ? $out : VERSION;\n\t}", "public function generateBranchName()\n {\n $client_remote = $this->client_remote;\n $branch_prefix = $this->branch_prefix;\n $remotes = $this->git->branch()->remotes()->getNames();\n $remotes = array_filter(\n $remotes,\n function ($name) use ($client_remote, $branch_prefix) {\n return Strings::startsWith($name, $client_remote . '/'\n . $branch_prefix);\n }\n );\n\n rsort($remotes);\n if (isset($remotes[0])) {\n $last_branch_number = substr(\n $remotes[0],\n strlen($client_remote . '/' . $branch_prefix)\n );\n }\n\n $i = $last_branch_number > 0 ? $last_branch_number : 1;\n do {\n $branch = $branch_prefix . $i;\n $i++;\n } while (in_array($client_remote . '/' . $branch, $remotes));\n\n $this->branch = $branch;\n }", "protected function getStableTag($branch) {\n\t\t\t$remoteReadme = $this->getRemoteReadme($branch);\n\t\t\tif ( !empty($remoteReadme['stable_tag']) ) {\n\t\t\t\t$tag = $remoteReadme['stable_tag'];\n\n\t\t\t\t//You can explicitly opt out of using tags by setting \"Stable tag\" to\n\t\t\t\t//\"trunk\" or the name of the current branch.\n\t\t\t\tif ( ($tag === $branch) || ($tag === 'trunk') ) {\n\t\t\t\t\treturn $this->getBranch($branch);\n\t\t\t\t}\n\n\t\t\t\treturn $this->getTag($tag);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}", "public function getBranchBaseUrl()\n {\n $baseUrl = trim($this->getBaseUrl(), '/');\n\n return $this->getBranchName()\n ? $baseUrl . '/-' . $this->getBranchName() . '-'\n : $baseUrl;\n }", "public function list_remote_branches() {\n\t\t\t$branchArray = explode(\"\\n\", $this->run(\"branch -r\"));\n\t\t\tforeach ($branchArray as $i => &$branch) {\n\t\t\t\t$branch = trim($branch);\n\t\t\t\tif ($branch == \"\" || strpos($branch, 'HEAD -> ') !== false) {\n\t\t\t\t\tunset($branchArray[$i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $branchArray;\n\t\t}", "public static function getDevelopmentRevision()\n {\n $branch = '';\n $rev = 0;\n $date = '';\n \n try {\n // try to find the .git dir\n $dir = realpath(dirname(dirname(dirname(__FILE__)))) . '/.git';\n if (file_exists($dir)) {\n $HEAD = trim(str_replace('ref: ', '', @file_get_contents(\"$dir/HEAD\")));\n $explodedHead = explode('/', $HEAD);\n \n $branch = array_pop($explodedHead);\n $rev = trim(@file_get_contents(\"$dir/$HEAD\"));\n \n $hashes = str_split($rev, 2);\n \n $objPath = \"$dir/objects\";\n while (count($hashes) != 0) {\n $objPath .= '/' . array_shift($hashes);\n $objFile = \"$objPath/\" . implode('', $hashes);\n if (@file_exists($objFile)) {\n $date = date_create('@' . filemtime($objFile))->format('Y-m-d H:i:s');\n break;\n }\n }\n }\n $revision = \"$branch: $rev ($date)\";\n } catch (\\Exception $e) {\n $revision = 'not resolvable';\n }\n \n return $revision;\n }", "protected function determineBuildBranchAncestor($branch) {\n // Check whether the latest build of the production branch is something we\n // can start from with.\n $productionBranch = $this->phappManifest->getGitBranchProduction();\n $productionBuildBranch = $this->phappManifest->getGitBranchForBuild($productionBranch);\n $process = $this->_execSilent(\"git log --format=oneline $productionBuildBranch --grep \\\"Build .* commit \\\"\");\n\n if ($process->isSuccessful() && $output = $process->getOutput()) {\n // Parse the message to get the source commit hash.\n list($first_line) = explode(\"\\n\", $output, 2);\n $matches = [];\n if (preg_match('/Build .* commit (\\S*)./', $first_line, $matches)) {\n $sourceCommit = $matches[1];\n }\n }\n\n // If the source commit of the last build has been found, verify the\n // to-be-built branch is based upon it. Else, we need to start a new build\n // branch.\n if (!empty($sourceCommit)) {\n $process = $this->_execSilent(\"git log --format=oneline $sourceCommit..$branch\");\n $sourceIsParent = $process->isSuccessful() && $process->getOutput() != '';\n\n if ($sourceIsParent) {\n return $productionBuildBranch;\n }\n\n // Check whether the source commit is the same as to-be-built commit.\n $process = $this->_execSilent(\"git reflog $sourceCommit\");\n $hash1 = $process->isSuccessful() ? $process->getOutput() : FALSE;\n $process = $this->_execSilent(\"git reflog $branch\");\n $hash2 = $process->isSuccessful() ? $process->getOutput() : FALSE;\n if ($hash1 && $hash2 && $hash1 == $hash2) {\n return $productionBuildBranch;\n }\n }\n\n // No relationship between the to-be-built and the last built commit could\n // be found. Thus, start a new build branch based upon the to-be-built\n // branch.\n return $branch;\n }", "public function deploy()\n {\n \n $this->terminal = new LocalTerminal($this->project->getDirectory(), $this->output);\n $this->git = new GitBuilder();\n \n \n $this->output->writeln('Starting deployment process... ');\n \n $this->output->write('Getting current working branch... ');\n $this->getBranch();\n \n $this->output->write('Checking for changes in branch ' . $this->branch . '...');\n $this->checkDiffs();\n\n // Push all changes on master branch\n $this->output->write('Pushing changes to branch ' . $this->branch . '...');\n $this->push();\n \n $this->output->write('<info>Deployment to branch ' . $this->branch . ' successful.</info>' . PHP_EOL);\n }", "protected function getProjectFromRemote(): string\n {\n $process = new Process((array) 'git config --get remote.origin.url');\n $process->run();\n $remote_url = trim($process->getOutput());\n preg_match('#.*\\/(.*)\\.git$#', $remote_url, $matches);\n return $matches[1] ?? '';\n }", "private function getProjectBase()\n {\n $process = new Process('git rev-parse --show-toplevel');\n $process->run();\n\n return \\trim($process->getOutput());\n }", "function _versioncontrol_git_log_get_branches() {\n $logs = _versioncontrol_git_log_exec('git show-ref --heads'); // Query branches.\n $branches = _versioncontrol_git_log_parse_branches($logs); // Parse output.\n return $branches;\n}", "public function getBranch($branch_id) {\r\n\r\n $sql = \"SELECT name FROM branch WHERE id=?\";\r\n\r\n $stmt = $this->connect()->prepare($sql);\r\n\r\n $stmt->execute([$branch_id]);\r\n\r\n return ($stmt->fetch());\r\n }", "public function checkout($branch) {\n\t\t\treturn $this->run('checkout \"$branch\"');\n\t\t}", "public function branches()\n {\n return $this->_refs('heads');\n }", "protected function getCurrentConstraint(): string {\n $branch = trim(shell_exec('git rev-parse --abbrev-ref HEAD'));\n if ($branch !== 'HEAD') {\n return \"${branch}-dev\";\n } else {\n $tag = trim(shell_exec('git describe --exact-match --tags $(git log -n1 --pretty=\\'%h\\')'));\n if ($tag) {\n return $tag;\n } else {\n // Maybe we are on a PR.\n $branch = $_SERVER['GITHUB_HEAD_REF'];\n $branch_parts = explode('/', $branch);\n $branch = end($branch_parts);\n if ($branch) {\n return \"${branch}-dev\";\n }\n }\n }\n // Final fallback, return \"^8\";\n return '^8';\n }", "function pull( $remote, $branch ) {\n return $this->_exec( \"pull {$remote} {$branch}\" );\n }", "public function getBranchId()\n {\n return $this->branch_id;\n }", "private static function git_origin(): ?string {\n\t\tif ( ! self::$root_path ) {\n\t\t\treturn null;\n\t\t}\n\t\t$cmd = 'git -C ' . escapeshellarg( self::$root_path ) . ' remote get-url origin';\n\t\t$response = exec( $cmd );\n\t\treturn $response ?: null;\n\t}", "public function branchCheckout($name = 'staging')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// Execute the command.\n\t\t$wd = getcwd();\n\t\tchdir($this->_root);\n\t\texec('git checkout -q ' . escapeshellarg($name), $out, $return);\n\t\tchdir($wd);\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('Branch %s could not be checked out with code %d and message %s.', $name, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getSearchBranch()\n {\n return $this->search_branch;\n }", "public function gitPull() {\n $current_branch = exec('git rev-parse --abbrev-ref HEAD');\n\n $collection = $this->collectionBuilder();\n $collection->taskGitStack()\n ->pull()\n ->run();\n\n $name = $this->confirm(\"Run Composer Install?\");\n if ($name) {\n $this->composerInstall();\n }\n\n $name = $this->confirm(\"Run Config Import?\");\n if ($name) {\n $this->drushCim();\n }\n }", "protected function getTarball() {\n // Exported configuration after a minimal profile install.\n return $this->versionTarball('minimal.tar.gz');\n }", "private function restoreBranch() {\n $repository_api = $this->getRepositoryAPI();\n $repository_api->execxLocal(\n 'checkout %s',\n $this->oldBranch);\n if ($this->isGit) {\n $repository_api->execxLocal(\n 'submodule update --init --recursive');\n }\n echo phutil_console_format(\n \"Switched back to {$this->branchType} **%s**.\\n\",\n $this->oldBranch);\n }", "function branchcreate(array $args, array $assoc_args ) {\n $branch_name = array_shift($args);\n $data = array(\n 'refspec' => 'refs/heads/' . $branch_name,\n );\n //TODO: format output\n\n return $this->terminus_request(\"site\", $this->_siteInfo->site_uuid, 'code-branch', \"POST\", $data);\n }", "function get_feature_from_branch_name($branch) {\n return preg_replace('/^.*feature\\//', '', $branch);\n}", "public function getBranchesBranch()\n {\n return $this->hasOne(Branches::className(), ['branch_id' => 'branches_branch_id']);\n }", "public function getBranchlessPath()\n {\n $pattern = '#^/?-' . $this->getBranchName() . '-/?#';\n return preg_replace($pattern, '', $this->getPathInfo());\n }", "public function head($branch = 'master', $value = NULL)\n {\n if ($value == NULL)\n return $this->factory(\n 'commit', $this->_ref('heads' . DIRECTORY_SEPARATOR . $branch)\n );\n\n file_put_contents(\n $this->_path . DIRECTORY_SEPARATOR\n . 'refs' . DIRECTORY_SEPARATOR\n . 'heads' . DIRECTORY_SEPARATOR . 'master',\n $value\n );\n }", "public function getBranchSlug(): ?string\n {\n return $this->getClaimSafe(SSODataClaimsInterface::CLAIM_BRANCH_SLUG);\n }", "public function get_ref( $ref = '' ){\n\n\t\t\tif( empty( $ref ) )\n\t\t\t\t$ref = 'heads/master';\n\t\t\telse\n\t\t\t\t$ref = sprintf( 'heads/%s', str_replace( 'heads/', '', $ref ) );\n\n\t\t\treturn $this->get_github_data( 'ref', $ref );\n\n\t\t}", "function checkCurrentVersion() {\n $request = new Request();\n $url = 'https://api.github.com/repos/pantheon-systems/cli/releases';\n $url .= '?per_page=1';\n $response = $request->simpleRequest($url, array('absolute_url' => true));\n $release = array_shift($response['data']);\n Terminus::getCache()->putData(\n 'latest_release',\n array('version' => $release->name, 'check_date' => time())\n );\n return $release->name;\n}", "public static function get_wp_branch( $version ) {\n\t\treturn implode( '.', array_slice( preg_split( '/[.-]/', $version ), 0, 2 ) );\n\t}", "public function getBranchInfo()\n {\n $this->db->select('*');\n $this->db->where('komoku_id', KOMOKU_SHOUSHA);\n $result = $this->db->get('m_komoku');\n return $result->result_array();\n }", "public function get_branch_location() {\n $data['category_branch_location'] = $this->Category_model->get_branch_location();\n return $data['category_branch_location'];\n }", "public function getBranchID()\n {\n return $this->BranchID;\n }", "private function githubSyncProcess()\n\t{\n\n\t\t// Delete any existing file.\n\t\tif(file_exists(e_TEMP.\"e107-master.zip\"))\n\t\t{\n\t\t\tunlink(e_TEMP.\"e107-master.zip\");\n\t\t}\n\n\t\t$result = e107::getFile()->getRemoteFile('https://codeload.github.com/e107inc/e107/zip/master', 'e107-master.zip', 'temp');\n\n\t\tif($result == false)\n\t\t{\n\t\t\te107::getMessage()->addError( DBLAN_118 );\n\t\t}\n\n\n\t\t$localfile = 'e107-master.zip';\n\n\t\tchmod(e_TEMP.$localfile, 0755);\n\t\trequire_once(e_HANDLER.\"pclzip.lib.php\");\n\n//\t$base = realpath(dirname(__FILE__));\n\n\n\t\t$newFolders = array(\n\t\t\t'e107-master/e107_admin/' => e_BASE.e107::getFolder('ADMIN'),\n\t\t\t'e107-master/e107_core/' => e_BASE.e107::getFolder('CORE'),\n\t\t\t'e107-master/e107_docs/' => e_BASE.e107::getFolder('DOCS'),\n\t\t\t'e107-master/e107_handlers/' => e_BASE.e107::getFolder('HANDLERS'),\n\t\t\t'e107-master/e107_images/' => e_BASE.e107::getFolder('IMAGES'),\n\t\t\t'e107-master/e107_languages/' => e_BASE.e107::getFolder('LANGUAGES'),\n\t\t\t'e107-master/e107_media/' => e_BASE.e107::getFolder('MEDIA'),\n\t\t\t'e107-master/e107_plugins/' => e_BASE.e107::getFolder('PLUGINS'),\n\t\t\t'e107-master/e107_system/' => e_BASE.e107::getFolder('SYSTEM'),\n\t\t\t'e107-master/e107_themes/' => e_BASE.e107::getFolder('THEMES'),\n\t\t\t'e107-master/e107_web/' => e_BASE.e107::getFolder('WEB'),\n\t\t\t'e107-master/' => e_BASE\n\t\t);\n\n\t\t$srch = array_keys($newFolders);\n\t\t$repl = array_values($newFolders);\n\n\t\t$archive \t= new PclZip(e_TEMP.$localfile);\n\t\t$unarc \t\t= ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_TEMP, PCLZIP_OPT_SET_CHMOD, 0755)); // Store in TEMP first.\n\n\t\t$error = array();\n\t\t$success = array();\n\t\t$skipped = array();\n//\tprint_a($unarc);\n\n\n\t\t$excludes = array('e107-master/','e107-master/install.php','e107-master/favicon.ico');\n\n\t\tforeach($unarc as $k=>$v)\n\t\t{\n\t\t\tif(in_array($v['stored_filename'],$excludes))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$oldPath = $v['filename'];\n\t\t\t$newPath = str_replace($srch,$repl, $v['stored_filename']);\n\n\t\t\t$message = e107::getParser()->lanVars(DBLAN_121, array('x'=>$oldPath, 'y'=>$newPath));\n\n\t\t\tif($v['folder'] ==1 && is_dir($newPath))\n\t\t\t{\n\t\t\t\t// $skipped[] = $newPath. \" (already exists)\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(!rename($oldPath,$newPath))\n\t\t\t{\n\t\t\t\t$error[] = $message;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$success[] = $message;\n\t\t\t}\n\n\n\t\t\t//\techo $message.\"<br />\";\n\n\t\t}\n\n\t\tif(!empty($success))\n\t\t{\n\t\t\te107::getMessage()->addSuccess(print_a($success,true));\n\t\t}\n\n\t\tif(!empty($skipped))\n\t\t{\n\t\t\te107::getMessage()->setTitle(\"Skipped\",E_MESSAGE_INFO)->addInfo(print_a($skipped,true));\n\t\t}\n\n\t\tif(!empty($error))\n\t\t{\n\t\t\te107::getMessage()->addError(print_a($error,true));\n\t\t}\n\n\n\n\n\t\te107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_112, e107::getMessage()->render());\n\n\t}", "public function getDeployment();", "public function getBranch()\n {\n return $this->hasOne(CompanyBranches::className(), ['BranchID' => 'BranchID']);\n }", "public function execute()\n {\n return $this->scm->runForCurrentRelease('rev-parse', ['--abbrev-ref','HEAD']);\n }", "public function getBranchDetails_post()\n {\n\t\t$token = '1';\n\t\t//$tokens = AUTHORIZATION::validateToken($token);\n\t\t// print_r(getallheaders());\n\t\t// echo $token;die();\n\t\t//print_r($tokens);die;\n $requestedBy = $this->post('requestedBy');\n $getBranch = $this->branch_model->getBranch($requestedBy);\n if ($getBranch['branchStatus'])\n {\n // Set the response and exit\n $this->response($getBranch);\n }\n else\n {\n // Set the response and exit\n $this->response([\n 'message' => 'No records found!',\n 'branchStatus' => false\n ]);\n }\n }", "public function get_login_branch_name(){\n $settings = new Settings();\n $branch_id=$settings->employeeBranch();\n return response()->json([\n 'branch_id' => $branch_id\n ], $this->successStatus);\n }", "public function createNewBranch()\n {\n try {\n // Fetch latest changes to master branch, then switch to master\n $this->git->fetch()->execute($this->typolib_remote, 'master');\n $this->git->checkout()->execute($this->typolib_remote . '/master');\n\n // Generate the name after we fetch from remote to get all branches.\n $this->git->fetch()->execute($this->client_remote);\n $this->generateBranchName();\n\n // Remove branches both remotely and locally\n $remotes = $this->git->branch()->remotes()->getNames();\n if (in_array($this->client_remote . '/' . $this->branch, $remotes)) {\n $this->git->push()->execute($this->client_remote, ':' . $this->branch);\n }\n if (in_array($this->branch, $this->git->branch()->getNames())) {\n $this->git->branch()->delete()->execute($this->branch);\n }\n\n // Create a fresh branch\n $this->git->branch()->execute($this->branch);\n $this->git->checkout()->execute($this->branch);\n\n // Push to create the branch remotely\n $this->git->push()->execute($this->client_remote, $this->branch);\n } catch (GitException $e) {\n $this->logger->error('Failed to create a new branch. Error: '\n . $e->getMessage());\n }\n }", "public function isAllowedBranch(){\r\n\t\t// checker\r\n\t\t$check = false;\r\n\t\t// check if the payload with ref exists\r\n\t\tif (isset($this->payload->ref) && strpos($this->payload->ref, GIT_BRANCH)) {\r\n\t\t\t$check = true;\r\n\t\t}\r\n\t\t// return the checker\r\n\t\treturn $check;\r\n\t}", "private function _populateBranch()\n {\n return $this->branch->create(\n $this->branchData['name'], \n $this->branchData['region_ID'], \n $this->branchData['promotor_ID']\n );\n }", "function rdeploy() {\n\t\techo BR, TAB, TAB, '### checkOnce', BR;\n\t\t$this->checkOnce();\n\n\t\techo BR, TAB, TAB, '### pushAll', BR;\n\t\t$this->pushAll();\n\t\ttry {\n\t\t\t$exists = $this->rexists();\n\t\t} catch (\\SystemCommandException $e) {\n\t\t\t$exists = false;\n\t\t}\n\n\t\techo 'The destination folder ', $this->getVersionPath() . ($exists ? ' exists' : 'does not exist'), BR, BR;\n\t\tif ($exists) {\n\t\t\techo BR, TAB, TAB, '### rpull', BR;\n\t\t\t$this->rpull();\n\t\t\t$this->rcomposer();\n\t\t\t$this->postinstall();\n\t\t\t$this->rinstall();\n\t\t} else {\n\t\t\techo BR, TAB, TAB, '### mkdir', BR;\n\t\t\t$this->mkdir();\n\n\t\t\techo BR, TAB, TAB, '### rclone', BR;\n\t\t\t$this->rclone();\n\t\t}\n\n\t\techo BR, TAB, TAB, '### rupdate', BR;\n\t\t$this->rupdate();\n\n\t\techo BR, TAB, TAB, '### rcomposer', BR;\n\t\t$this->rcp('composer.json');\n\t\t$this->rcp('composer.lock');\n\t\t$this->rcomposer();\n\n\t\techo BR, TAB, TAB, '### postinstall', BR;\n\t\t$this->rpostinstall();\n\n\t\techo BR, TAB, TAB, '### rinstall', BR;\n\t\t$this->rinstall();\n\n\t\techo BR, TAB, TAB, '### rstatus', BR;\n\t\t$this->rstatus();\n\n\t\techo BR, TAB, TAB, '### deployDependencies', BR;\n\t\t$this->deployDependencies();\n\t\t$nr = $this->getMain()->nr();\n\t\t$this->exec('start http://'.$this->liveServer.'/v'.$nr);\n\t}", "public function company_lookup_branch() {\n $this->layout = 'ajax';\n $this->loadModel('Branch');\n $branches = $this->Branch->find('all', array(\n 'conditions' => array('Branch.comp_id' => $this->Auth->user('id'))\n ));\n $this->set('branch', $branches);\n }", "public function getBranchId(): ?string\n {\n return $this->getClaimSafe(SSODataClaimsInterface::CLAIM_BRANCH_ID);\n }", "function prueba_git ()\r\n{\r\n\t/* Aqui estaria el codigo de la funcion */\r\n\r\n}", "public function github(){\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\tnew d_shopunity\\GitHub($user, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch );\n\t}", "function GetBranch($usn){\r\n\t$formattedusn = preg_replace('/\\s+/', '', $usn);\r\n\t$properusn = strtolower($formattedusn);\r\n\t$branch = ($properusn[5].$properusn[6]);\r\n\tif($branch==cs) {\r\n $branch=\"C.S.E.\";\r\n }elseif ($branch==ec){\r\n $branch=\"E.C.E.\";\r\n\t}elseif ($branch==me) {\r\n $branch=\"Mech Eng.\";\r\n }elseif ($branch==cv){\r\n $branch=\"Civil Eng.\";\r\n }else{\r\n\t\t$branch=\"No Branch set.\";\r\n\t}\r\n\treturn $branch;\r\n}", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "public function create_branch($branch) {\n\t\t\treturn $this->run(\"branch $branch\");\n\t\t}", "public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t]+git@github.com\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}", "public function getOnlyActiveBranch(): bool;", "function check_branch($appid,$steamcmd) { \t\n \n$cmd = \"$steamcmd +app_info_update 1 +app_info_print $appid +quit 2>/dev/null\"; \n$data= shell_exec($cmd);\nfile_put_contents(\"$appid.txt\",$data);\n$kv = VDFParse(\"$appid.txt\");\nunlink(\"$appid.txt\");\nreturn $kv[$appid]['depots']['branches']; // just send the branches back\n}", "public function getRevision(RepositoryEntry $repository, $branch);", "function test_get_branch()\r\n\t{\r\n\t\t$rnc = 1;\r\n\t\t$depth = 2;\r\n\t\t$npl = 3; \r\n\t\t// Create a new tree\r\n\t\t$this->_create_sub_node($rnc, $depth, $npl);\r\n\t\t$allnodes = $this->_tree->get_all_nodes();\r\n\t\t$branch = $this->_tree->get_branch($npl, true);\r\n\t\t$this->assertEqual($allnodes, $branch, 'Result differs from getAllNodes()');\r\n\t}", "public function fetch($from = null, $branch = null) {\n\t\t$this->repository->fetch($from, $branch);\n\t}", "public function findbranch()\n\t{\n\t\t$post = $this->input->post();\n\t\t$data = $this->AjaxDB->findBranch(['course'=>$post['id']]);\n\t\t$d[] = 'Choose Branch';\n\t\tif (!empty($data)) {\n\t\t\tforeach ($data as $key => $value) {\n\t\t\t\t$d[$value->id] = $value->branch_name;\n\t\t\t}\n\t\t}\n\t\t$result = form_dropdown('branch',$d,'',['class'=>'form-control input-sm','id'=>'bid']);\n\t\techo $result;\n\t}", "private function _getBranches()\n\t{\n\t\t// If we don't have a configuration file for the repository PANIC!\n\t\tif (!file_exists($this->_root . '/.git/config'))\n\t\t{\n\t\t\tthrow new RuntimeException('Not a valid Git repository at ' . $this->_root);\n\t\t}\n\n\t\t// Initialize variables.\n\t\t$branches = array();\n\n\t\t// Parse the repository configuration file.\n\t\t$config = parse_ini_file($this->_root . '/.git/config', true);\n\n\t\t// Go find the remotes from the configuration file.\n\t\tforeach ($config as $section => $data)\n\t\t{\n\t\t\tif (strpos($section, 'branch ') === 0)\n\t\t\t{\n\t\t\t\t$branches[] = trim(substr($section, 7));\n\t\t\t}\n\t\t}\n\n\t\treturn $branches;\n\t}", "protected function getTagFromBranch($branch)\n {\n $git = new GitRepository($this->input->getArgument('git-dir'));\n $tag = trim($git->describe()->tags()->always()->execute($branch));\n $hash = trim($git->revParse()->short(false)->execute($branch));\n return $hash !== $tag ? $tag : null;\n }", "protected static function findGitVersion($projectDir)\n {\n $branch = static::revParse('--abbrev-ref HEAD', $projectDir);\n\n if (empty($branch)) {\n return null;\n }\n\n return $branch . ' ' . static::revParse('--short HEAD', $projectDir);\n }", "public function get_url(){\n\n\t\t\treturn $this->api_urls['giturl'];\n\n\t\t}", "function get_single_branche($branch_id)\r\r\n\t{\r\r\n\t\t$this->db->where('branch_id',$branch_id);\r\r\n\r\r\n\t\t$query = $this->db->get($this->_table_branches);\r\r\n\t\t\r\r\n\t\t// Check if Result is Greater Than Zero\r\r\n\t\tif($query->num_rows() > 0)\r\r\n\t\t{\r\r\n\t\t\treturn $query->row();\r\r\n\t\t}\r\r\n\t}", "public function show($id) {\n return Branch::firstOrFail($id);\n }", "public function getSha($branch) {\n if ($result = $this->findBranch($branch)) {\n return $result['commit']['id'];\n }\n }", "public function getWorkingDirectory(RepositoryEntry $repository, $branch);", "public function checkout($version);", "function isFeature($branch)\n{\n return strpos($branch, \"origin/feature/\") !== false;\n}", "protected function siteAndEnvFromRepo()\n {\n $repo_url = exec('git config --get remote.origin.url');\n if (\n !preg_match(\n '#ssh://[^@]*@codeserver\\.[^.]*\\.([^.]*)\\.drush\\.in:2222/~/repository\\.git#',\n $repo_url,\n $matches\n )\n ) {\n return ['',''];\n }\n\n $site_id = $matches[1];\n $site = $this->getSiteById($site_id);\n\n // Get the current branch\n $env = exec('git rev-parse --abbrev-ref HEAD');\n if ($env == 'master') {\n $env = 'dev';\n }\n\n return [$site->getName(), $env];\n }", "public function branch() {\r\nreturn $this->db->get('branch')->result();\r\n}", "public function getMaintenanceBranch($username,$target,$inventoryType) {\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT branch from branch order by branch asc \");\n\nwhile($row = mysqli_fetch_array($result))\n {\n\nif($inventoryType == \"CSR\" || $inventoryType == \"PHARMACY\") {\necho \"<li><a href='http://\".$this->getMyUrl().\"/COCONUT/masterfile/inventory.php?username=$username&branch=$row[branch]&inventoryType=$inventoryType&show=All' target='$target'>Stocklist of $inventoryType in \".$row['branch'].\"</a></li>\";\n}else {\necho \"<li><a href='http://\".$this->getMyUrl().\"/COCONUT/masterfile/inventory.php?username=$username&branch=$row[branch]&inventoryType=$inventoryType&show=All' target='$target'>List of $inventoryType in \".$row['branch'].\"</a></li>\";\n}\n }\n\n}", "public function pull($remote, $branch) {\n\t\t\treturn $this->run(\"pull $remote $branch\");\n\t\t}", "public function branch()\n\t{\n\t\treturn $this->hasOne('App\\Models\\Branch', 'id', 'branch_id');\n\t}", "function target_gitup()\n{\n\t// git remote add upstream git://github.com/<user>/<repo>.git\n\tsystem('git fetch upstream');\n\tsystem('git merge upstream/master');\n}", "private function _fetchCurrentRelease()\n {\n $version = $this->getNodeText('/p:package/p:version/p:release');\n foreach ($this->findNodes('/p:package/p:changelog/p:release') as $release) {\n if ($this->getNodeTextRelativeTo('./p:version/p:release', $release) == $version) {\n return $release;\n }\n }\n }", "public static function branchName(string $project, string $location, string $catalog, string $branch): string\n {\n return self::getPathTemplate('branch')->render([\n 'project' => $project,\n 'location' => $location,\n 'catalog' => $catalog,\n 'branch' => $branch,\n ]);\n }", "public function branchRemove($name = 'staging')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// If the branch doesn't already exist we have nothing to do.\n\t\tif (!in_array($name, $this->_getBranches()))\n\t\t{\n\t\t\treturn $this;\n\t\t}\n\n\t\t// Execute the command.\n\t\t$wd = getcwd();\n\t\tchdir($this->_root);\n\t\texec('git branch -D ' . escapeshellarg($name), $out, $return);\n\t\tchdir($wd);\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('Branch %s could not be removed with code %d and message %s.', $name, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "public function setBranch($var)\n {\n GPBUtil::checkString($var, True);\n $this->branch = $var;\n\n return $this;\n }", "function particularbranch($id)\n\t{\n\t\t$getParsubbrand=\"SELECT * from brand where brand_id = $id\";\n\t\t$subbrand_data=$this->get_results( $getParsubbrand );\n\t\treturn $subbrand_data;\n\t}", "public static function getCurrentRevision() {\n $settings = self::getSettings();\n return $settings->headrevision;\n }" ]
[ "0.6761025", "0.6580478", "0.65734947", "0.65082616", "0.6493382", "0.645897", "0.645897", "0.6356909", "0.63332474", "0.6311879", "0.6267298", "0.6199653", "0.61782026", "0.61521477", "0.6139389", "0.609849", "0.5967119", "0.59348583", "0.58420044", "0.58297014", "0.5766322", "0.57020414", "0.5695237", "0.5665534", "0.5657167", "0.5648663", "0.5567707", "0.55516213", "0.55512077", "0.5492461", "0.54755193", "0.5472883", "0.5468629", "0.544973", "0.54268646", "0.5423305", "0.5421231", "0.54188776", "0.53986", "0.53776556", "0.5369236", "0.5364318", "0.53051794", "0.5301456", "0.5291965", "0.52856094", "0.5271106", "0.526432", "0.52496547", "0.52477914", "0.52419406", "0.5239223", "0.52350855", "0.5226647", "0.52263415", "0.5224631", "0.5221571", "0.5206812", "0.51979274", "0.519785", "0.51974547", "0.51809704", "0.5130961", "0.5117789", "0.5085071", "0.5083156", "0.5076734", "0.5073559", "0.5073511", "0.5070668", "0.5062228", "0.50602704", "0.5059752", "0.50557244", "0.50524795", "0.5045409", "0.5034562", "0.5026465", "0.5009766", "0.5009163", "0.4990013", "0.4988052", "0.4984196", "0.49818462", "0.49658", "0.4961082", "0.4959387", "0.4943841", "0.4924568", "0.49237058", "0.49236786", "0.49136797", "0.49026045", "0.49003178", "0.48974237", "0.4889891", "0.48797932", "0.48755562", "0.48749328", "0.486949" ]
0.60168034
16
Get the remote fortrabbit branch to deploy to
public function remoteBranch() : string { return (string) $this->getOrError('remote_branch'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function list_remote_branches() {\n\t\t\t$branchArray = explode(\"\\n\", $this->run(\"branch -r\"));\n\t\t\tforeach ($branchArray as $i => &$branch) {\n\t\t\t\t$branch = trim($branch);\n\t\t\t\tif ($branch == \"\" || strpos($branch, 'HEAD -> ') !== false) {\n\t\t\t\t\tunset($branchArray[$i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $branchArray;\n\t\t}", "protected function getProjectFromRemote(): string\n {\n $process = new Process((array) 'git config --get remote.origin.url');\n $process->run();\n $remote_url = trim($process->getOutput());\n preg_match('#.*\\/(.*)\\.git$#', $remote_url, $matches);\n return $matches[1] ?? '';\n }", "public function getRemote()\n {\n return $this->remote;\n }", "function pull( $remote, $branch ) {\n return $this->_exec( \"pull {$remote} {$branch}\" );\n }", "public function getBranch()\n {\n return $this->_options['branch'];\n }", "public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t]+git@github.com\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}", "public function getBranch()\n {\n return $this->branch;\n }", "public function getBranch()\n {\n return $this->branch;\n }", "public function getEnvironment()\n {\n return 'branch';\n }", "protected function getBranch()\n {\n $branches = $this->terminal->run($this->git->branch());\n\n preg_match('/\\*\\s([\\w]*)/', $branches, $matches);\n \n if (!empty($matches[1])) {\n $this->branch = $matches[1];\n }\n \n $this->output->write('<info>' . $this->branch . '</info>' . PHP_EOL);\n }", "public function getRemote();", "public function getExistingBranchForTestCase()\n {\n $branchName = $this->getDevBranchName();\n $devBranch = new DevBranches($this->getDefaultClient());\n\n $branches = $devBranch->listBranches();\n $branch = null;\n // get branch detail\n foreach ($branches as $branchItem) {\n if ($branchItem['name'] === $branchName) {\n $branch = $branchItem;\n }\n }\n if (!isset($branch)) {\n $this->testCase->fail(sprintf('Reuse existing branch: branch %s not found.', $branchName));\n }\n\n return $branch;\n }", "function changeBranch(){\r\n\t\t// $gitpss = isset($_COOKIE['gitpss']) ? $_COOKIE['gitpss'] : '';\r\n\t\t// $repo = 'https://'.$gitusr.':'.$gitpss.'@github.com/nelsoft/nelsoft_inventory.git';\r\n\t\tchdir($_POST['path']);\r\n\t\texec('git clean -df');\r\n\t\texec('git checkout -- .');\r\n\t\t// exec('git fetch '.$repo);\r\n\t\texec('git checkout '.$_POST['branch'], $data);\r\n\t\t// exec('git pull '.$repo.' '.$_POST['branch'], $data);\r\n\r\n\t\t$return['version'] = '0.00';\r\n\t\t$return['version'] = getversion($_POST['path'], 'version');\t\r\n\t\t$return['data'] = $data;\r\n\r\n\t\tjdie($return);\r\n}", "public function getRemoteSite() {\n return $this->remoteSite;\n }", "public function getCurrentBranch() : string\n {\n $process = $this->runProcess(new Process('git branch'));\n\n $branches = collect(explode(PHP_EOL, $process->getOutput()));\n\n $currentBranch = $branches->first(function(string $branch) {\n return str_contains($branch, '*');\n });\n\n return trim(str_replace('*', '', $currentBranch));\n }", "public function pull($remote, $branch) {\n\t\t\treturn $this->run(\"pull $remote $branch\");\n\t\t}", "public function getDefaultBranch() {\n $repoApi = new \\Drupal\\config_pr\\RepoControllers\\GitLabApi($this->getClient());\n $path = '/api/v4/projects/' . $this->getProjectId();\n $response = $repoApi->get($path);\n\n return $response['default_branch'];\n }", "public function fortrabbitRemoteName() : string\n {\n return 'frb-' . $this->environment();\n }", "public function getBranch() /*: string*/ {\n if ($this->branch === null) {\n throw new \\Exception(\"Branch is not initialized\");\n }\n return $this->branch;\n }", "private static function git_origin(): ?string {\n\t\tif ( ! self::$root_path ) {\n\t\t\treturn null;\n\t\t}\n\t\t$cmd = 'git -C ' . escapeshellarg( self::$root_path ) . ' remote get-url origin';\n\t\t$response = exec( $cmd );\n\t\treturn $response ?: null;\n\t}", "public function targetBranch() : string\n {\n return (string) $this->getOrError('target_branch');\n }", "private function _getBranches()\n\t{\n\t\t// If we don't have a configuration file for the repository PANIC!\n\t\tif (!file_exists($this->_root . '/.git/config'))\n\t\t{\n\t\t\tthrow new RuntimeException('Not a valid Git repository at ' . $this->_root);\n\t\t}\n\n\t\t// Initialize variables.\n\t\t$branches = array();\n\n\t\t// Parse the repository configuration file.\n\t\t$config = parse_ini_file($this->_root . '/.git/config', true);\n\n\t\t// Go find the remotes from the configuration file.\n\t\tforeach ($config as $section => $data)\n\t\t{\n\t\t\tif (strpos($section, 'branch ') === 0)\n\t\t\t{\n\t\t\t\t$branches[] = trim(substr($section, 7));\n\t\t\t}\n\t\t}\n\n\t\treturn $branches;\n\t}", "public function getRemote()\n {\n if (null === $this->getData('remote')) {\n $remote = Mage::getResourceModel('tmcore/module_remoteCollection')\n ->getItemById($this->getId());\n\n $this->setData('remote', $remote);\n }\n return $this->getData('remote');\n }", "public function get_url(){\n\n\t\t\treturn $this->api_urls['giturl'];\n\n\t\t}", "public function branch()\n {\n $result = $this->git('symbolic-ref --short HEAD');\n if (empty($result)) {\n return 'master';\n }\n\n return $result;\n }", "function determine_branch_name( $request) {\n // push request, branch is in request[ref]\n if (isset($reqest['ref'])) {\n // strip out the refs/head nonsense -- doesn't look like bare\n // branch is listed anywhere in the request\n return preg_replace(\"|refs/heads/|\", \"\", $request['ref']);\n }\n\n _log(\"Unable to determine branch name. Maybe this wasn't a pull or merge request?\");\n}", "public function addEnvironmentRemote(Config $config) : Git\n {\n return $this->addRemote(\n $config->fortrabbitRemoteName(),\n $config->gitUrl()\n );\n }", "public function gitPull() {\n $current_branch = exec('git rev-parse --abbrev-ref HEAD');\n\n $collection = $this->collectionBuilder();\n $collection->taskGitStack()\n ->pull()\n ->run();\n\n $name = $this->confirm(\"Run Composer Install?\");\n if ($name) {\n $this->composerInstall();\n }\n\n $name = $this->confirm(\"Run Config Import?\");\n if ($name) {\n $this->drushCim();\n }\n }", "function do_checkout_branch($req, $deployto, $operation){\n \n\tif($operation != \"TAG\"){\n\t//if($operation == \"Push Hook\" && !empty($DEPLOY_BRANCH)){\n\t\t$branch=determine_branch_name($req);\n\t\tif($branch == $operation){\n\t\t\t$cmd = \"bash -c 'cd $deployto; git checkout $branch' 2>&1\";\n\t\t}\n\t\telse{\n\t\t\t$cmd = \"bash -c 'cd $deployto; git checkout $operation' 2>&1\";\n\t\t}\n\t}\n\telse{\n\t\t$tag= $req['ref'];\n\t\t$cmd = \"bash -c 'cd $deployto; git checkout $tag' 2>&1\";\n\t}\n\t\n\tif(file_exists($deployto . \"/.gitmodules\")){\n\t\t_log(\"Initializing and Updating submodules...\\n\");\n\t\t$subcmd = \"bash -c 'cd $deployto; git submodule init; git submodule update' 2>&1\";\n\t}\n\n\t_debug(\"Operation: $operation\\n\");\n _log(\"Exec Command: $cmd\\n\");\n\n\t$result = shell_exec($cmd);\n\tif(isset($subcmd)){\n\t\t$result .= shell_exec($subcmd);\n \t}\n \treturn $result;\n\n}", "public function getBranch()\n {\n return new GitBranch($this->getProjectBase());\n }", "protected function getStableTag($branch) {\n\t\t\t$remoteReadme = $this->getRemoteReadme($branch);\n\t\t\tif ( !empty($remoteReadme['stable_tag']) ) {\n\t\t\t\t$tag = $remoteReadme['stable_tag'];\n\n\t\t\t\t//You can explicitly opt out of using tags by setting \"Stable tag\" to\n\t\t\t\t//\"trunk\" or the name of the current branch.\n\t\t\t\tif ( ($tag === $branch) || ($tag === 'trunk') ) {\n\t\t\t\t\treturn $this->getBranch($branch);\n\t\t\t\t}\n\n\t\t\t\treturn $this->getTag($tag);\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}", "public function git_working_branch()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git status', $status );\n\t\t$status = $status[0];\n\n\t\treturn preg_replace( '/# On branch/', '', $status );\n\t}", "public function getSource()\n {\n return 'branch';\n }", "static function getCurrentVersion($branch=\"latest_stable\")\n\t{\n\t\t$url = \"svn://localhost/ci_base_core/branches/\".$branch.\"/.version\";\n\t\t//file_put_contents(\"../logs/index.getCurrentVersion.branch_url.txt\", print_r($url, true));\n\t\t$out = false;\n\t\n\t\tif (function_exists('curl_init'))\n\t\t{\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\tcurl_setopt($ch, CURLOPT_USERAGENT, 'BA5E');\n\t\t\t$out = curl_exec($ch);\n\t\n\t\t\tif (false === $out)\n\t\t\t{\n\t\t\t\ttrigger_error('Not sure what it is, but there\\'s a problem with contacting the update server. Maybe this will help: \"' . curl_error($ch) . '\"');\n\t\t\t}\n\t\t\techo curl_error($ch);\n\t\t\tcurl_close($ch);\n\t\t}else{\n\t\t\tthrow new Exception(\"curl is required for this action\");\n\t\t}\n\t\n\t\t\n\t\treturn ($out !== false) ? $out : VERSION;\n\t}", "protected function getTarball() {\n // Exported configuration after a minimal profile install.\n return $this->versionTarball('minimal.tar.gz');\n }", "function _versioncontrol_git_log_get_branches() {\n $logs = _versioncontrol_git_log_exec('git show-ref --heads'); // Query branches.\n $branches = _versioncontrol_git_log_parse_branches($logs); // Parse output.\n return $branches;\n}", "public function testBitBucketRemoteRepository(): void\n {\n $repo = new BitBucketRemoteRepository('r/r', './');\n $this->assertEquals('https://bitbucket.org/r/r/src/v2/src/Project.php#Project.php-30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "protected function siteAndEnvFromRepo()\n {\n $repo_url = exec('git config --get remote.origin.url');\n if (\n !preg_match(\n '#ssh://[^@]*@codeserver\\.[^.]*\\.([^.]*)\\.drush\\.in:2222/~/repository\\.git#',\n $repo_url,\n $matches\n )\n ) {\n return ['',''];\n }\n\n $site_id = $matches[1];\n $site = $this->getSiteById($site_id);\n\n // Get the current branch\n $env = exec('git rev-parse --abbrev-ref HEAD');\n if ($env == 'master') {\n $env = 'dev';\n }\n\n return [$site->getName(), $env];\n }", "public function push($remote, $branch) {\n\t\t\treturn $this->run(\"push --tags $remote $branch\");\n\t\t}", "public function getBranchInfo()\n {\n $this->db->select('*');\n $this->db->where('komoku_id', KOMOKU_SHOUSHA);\n $result = $this->db->get('m_komoku');\n return $result->result_array();\n }", "public function remote()\n\t{\n\t\treturn $this->CLI->boolQuery($this->SqueezePlyrID.\" remote ?\");\n\t}", "public function fortrabbitRemoteNeedsConfiguring(Config $config) : bool\n {\n $process = $this->runProcess(new Process('git branch -a'));\n\n $remoteBranchExists = collect(explode(PHP_EOL, $process->getOutput()))\n ->map(function($branch) {\n return trim($branch);\n })\n ->first(function($branch) use ($config) {\n $target = sprintf('remotes/%s/%s', $config->fortrabbitRemoteName(), $config->remoteBranch());\n\n return starts_with($branch, $target);\n })\n ;\n\n return !$remoteBranchExists;\n }", "public function branches()\n {\n return $this->_refs('heads');\n }", "public function getBranchOf()\n {\n return $this->branchOf;\n }", "function rpull() {\n\t\t$this->checkOnce();\n\t\t$versionPath = $this->getVersionPath();\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path, BR;\n\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\ttry {\n\t\t\t\t$exists = $this->rexists($deployPath);\n\t\t\t\tif ($exists) {\n\t\t\t\t\t$remoteCmd = 'cd ' . $deployPath . ' && hg pull';\n\t\t\t\t\t$this->ssh_exec($remoteCmd);\n\t\t\t\t} else {\n\t\t\t\t\techo TAB, '*** path ', $deployPath, ' does not exist', BR;\n\t\t\t\t}\n\t\t\t} catch (\\SystemCommandException $e) {\n\t\t\t\techo 'Error: '.$e, BR;\n\t\t\t}\n\t\t}\n\t}", "public function get_ssh_url(): ?string;", "public function getBranchesBranch()\n {\n return $this->hasOne(Branches::className(), ['branch_id' => 'branches_branch_id']);\n }", "public function getBranchBaseUrl()\n {\n $baseUrl = trim($this->getBaseUrl(), '/');\n\n return $this->getBranchName()\n ? $baseUrl . '/-' . $this->getBranchName() . '-'\n : $baseUrl;\n }", "public function isAllowedBranch(){\r\n\t\t// checker\r\n\t\t$check = false;\r\n\t\t// check if the payload with ref exists\r\n\t\tif (isset($this->payload->ref) && strpos($this->payload->ref, GIT_BRANCH)) {\r\n\t\t\t$check = true;\r\n\t\t}\r\n\t\t// return the checker\r\n\t\treturn $check;\r\n\t}", "function rdeploy() {\n\t\techo BR, TAB, TAB, '### checkOnce', BR;\n\t\t$this->checkOnce();\n\n\t\techo BR, TAB, TAB, '### pushAll', BR;\n\t\t$this->pushAll();\n\t\ttry {\n\t\t\t$exists = $this->rexists();\n\t\t} catch (\\SystemCommandException $e) {\n\t\t\t$exists = false;\n\t\t}\n\n\t\techo 'The destination folder ', $this->getVersionPath() . ($exists ? ' exists' : 'does not exist'), BR, BR;\n\t\tif ($exists) {\n\t\t\techo BR, TAB, TAB, '### rpull', BR;\n\t\t\t$this->rpull();\n\t\t\t$this->rcomposer();\n\t\t\t$this->postinstall();\n\t\t\t$this->rinstall();\n\t\t} else {\n\t\t\techo BR, TAB, TAB, '### mkdir', BR;\n\t\t\t$this->mkdir();\n\n\t\t\techo BR, TAB, TAB, '### rclone', BR;\n\t\t\t$this->rclone();\n\t\t}\n\n\t\techo BR, TAB, TAB, '### rupdate', BR;\n\t\t$this->rupdate();\n\n\t\techo BR, TAB, TAB, '### rcomposer', BR;\n\t\t$this->rcp('composer.json');\n\t\t$this->rcp('composer.lock');\n\t\t$this->rcomposer();\n\n\t\techo BR, TAB, TAB, '### postinstall', BR;\n\t\t$this->rpostinstall();\n\n\t\techo BR, TAB, TAB, '### rinstall', BR;\n\t\t$this->rinstall();\n\n\t\techo BR, TAB, TAB, '### rstatus', BR;\n\t\t$this->rstatus();\n\n\t\techo BR, TAB, TAB, '### deployDependencies', BR;\n\t\t$this->deployDependencies();\n\t\t$nr = $this->getMain()->nr();\n\t\t$this->exec('start http://'.$this->liveServer.'/v'.$nr);\n\t}", "public function getSearchBranch()\n {\n return $this->search_branch;\n }", "public function getCommitUrl(): string\n {\n return $this->data->url;\n }", "public function testDestiny2PullFromPostmaster()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function deploy()\n {\n \n $this->terminal = new LocalTerminal($this->project->getDirectory(), $this->output);\n $this->git = new GitBuilder();\n \n \n $this->output->writeln('Starting deployment process... ');\n \n $this->output->write('Getting current working branch... ');\n $this->getBranch();\n \n $this->output->write('Checking for changes in branch ' . $this->branch . '...');\n $this->checkDiffs();\n\n // Push all changes on master branch\n $this->output->write('Pushing changes to branch ' . $this->branch . '...');\n $this->push();\n \n $this->output->write('<info>Deployment to branch ' . $this->branch . ' successful.</info>' . PHP_EOL);\n }", "public function getBranchName()\n {\n if ($this->_branch === false) {\n $this->_branch = preg_match('#^/-([^/]+)-#', $this->getPathInfo(), $matches)\n ? $matches[1]\n : null;\n }\n\n return $this->_branch;\n }", "protected function determineBuildBranchAncestor($branch) {\n // Check whether the latest build of the production branch is something we\n // can start from with.\n $productionBranch = $this->phappManifest->getGitBranchProduction();\n $productionBuildBranch = $this->phappManifest->getGitBranchForBuild($productionBranch);\n $process = $this->_execSilent(\"git log --format=oneline $productionBuildBranch --grep \\\"Build .* commit \\\"\");\n\n if ($process->isSuccessful() && $output = $process->getOutput()) {\n // Parse the message to get the source commit hash.\n list($first_line) = explode(\"\\n\", $output, 2);\n $matches = [];\n if (preg_match('/Build .* commit (\\S*)./', $first_line, $matches)) {\n $sourceCommit = $matches[1];\n }\n }\n\n // If the source commit of the last build has been found, verify the\n // to-be-built branch is based upon it. Else, we need to start a new build\n // branch.\n if (!empty($sourceCommit)) {\n $process = $this->_execSilent(\"git log --format=oneline $sourceCommit..$branch\");\n $sourceIsParent = $process->isSuccessful() && $process->getOutput() != '';\n\n if ($sourceIsParent) {\n return $productionBuildBranch;\n }\n\n // Check whether the source commit is the same as to-be-built commit.\n $process = $this->_execSilent(\"git reflog $sourceCommit\");\n $hash1 = $process->isSuccessful() ? $process->getOutput() : FALSE;\n $process = $this->_execSilent(\"git reflog $branch\");\n $hash2 = $process->isSuccessful() ? $process->getOutput() : FALSE;\n if ($hash1 && $hash2 && $hash1 == $hash2) {\n return $productionBuildBranch;\n }\n }\n\n // No relationship between the to-be-built and the last built commit could\n // be found. Thus, start a new build branch based upon the to-be-built\n // branch.\n return $branch;\n }", "private function getProjectBase()\n {\n $process = new Process('git rev-parse --show-toplevel');\n $process->run();\n\n return \\trim($process->getOutput());\n }", "private function githubSyncProcess()\n\t{\n\n\t\t// Delete any existing file.\n\t\tif(file_exists(e_TEMP.\"e107-master.zip\"))\n\t\t{\n\t\t\tunlink(e_TEMP.\"e107-master.zip\");\n\t\t}\n\n\t\t$result = e107::getFile()->getRemoteFile('https://codeload.github.com/e107inc/e107/zip/master', 'e107-master.zip', 'temp');\n\n\t\tif($result == false)\n\t\t{\n\t\t\te107::getMessage()->addError( DBLAN_118 );\n\t\t}\n\n\n\t\t$localfile = 'e107-master.zip';\n\n\t\tchmod(e_TEMP.$localfile, 0755);\n\t\trequire_once(e_HANDLER.\"pclzip.lib.php\");\n\n//\t$base = realpath(dirname(__FILE__));\n\n\n\t\t$newFolders = array(\n\t\t\t'e107-master/e107_admin/' => e_BASE.e107::getFolder('ADMIN'),\n\t\t\t'e107-master/e107_core/' => e_BASE.e107::getFolder('CORE'),\n\t\t\t'e107-master/e107_docs/' => e_BASE.e107::getFolder('DOCS'),\n\t\t\t'e107-master/e107_handlers/' => e_BASE.e107::getFolder('HANDLERS'),\n\t\t\t'e107-master/e107_images/' => e_BASE.e107::getFolder('IMAGES'),\n\t\t\t'e107-master/e107_languages/' => e_BASE.e107::getFolder('LANGUAGES'),\n\t\t\t'e107-master/e107_media/' => e_BASE.e107::getFolder('MEDIA'),\n\t\t\t'e107-master/e107_plugins/' => e_BASE.e107::getFolder('PLUGINS'),\n\t\t\t'e107-master/e107_system/' => e_BASE.e107::getFolder('SYSTEM'),\n\t\t\t'e107-master/e107_themes/' => e_BASE.e107::getFolder('THEMES'),\n\t\t\t'e107-master/e107_web/' => e_BASE.e107::getFolder('WEB'),\n\t\t\t'e107-master/' => e_BASE\n\t\t);\n\n\t\t$srch = array_keys($newFolders);\n\t\t$repl = array_values($newFolders);\n\n\t\t$archive \t= new PclZip(e_TEMP.$localfile);\n\t\t$unarc \t\t= ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_TEMP, PCLZIP_OPT_SET_CHMOD, 0755)); // Store in TEMP first.\n\n\t\t$error = array();\n\t\t$success = array();\n\t\t$skipped = array();\n//\tprint_a($unarc);\n\n\n\t\t$excludes = array('e107-master/','e107-master/install.php','e107-master/favicon.ico');\n\n\t\tforeach($unarc as $k=>$v)\n\t\t{\n\t\t\tif(in_array($v['stored_filename'],$excludes))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$oldPath = $v['filename'];\n\t\t\t$newPath = str_replace($srch,$repl, $v['stored_filename']);\n\n\t\t\t$message = e107::getParser()->lanVars(DBLAN_121, array('x'=>$oldPath, 'y'=>$newPath));\n\n\t\t\tif($v['folder'] ==1 && is_dir($newPath))\n\t\t\t{\n\t\t\t\t// $skipped[] = $newPath. \" (already exists)\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(!rename($oldPath,$newPath))\n\t\t\t{\n\t\t\t\t$error[] = $message;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$success[] = $message;\n\t\t\t}\n\n\n\t\t\t//\techo $message.\"<br />\";\n\n\t\t}\n\n\t\tif(!empty($success))\n\t\t{\n\t\t\te107::getMessage()->addSuccess(print_a($success,true));\n\t\t}\n\n\t\tif(!empty($skipped))\n\t\t{\n\t\t\te107::getMessage()->setTitle(\"Skipped\",E_MESSAGE_INFO)->addInfo(print_a($skipped,true));\n\t\t}\n\n\t\tif(!empty($error))\n\t\t{\n\t\t\te107::getMessage()->addError(print_a($error,true));\n\t\t}\n\n\n\n\n\t\te107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_112, e107::getMessage()->render());\n\n\t}", "public function getRemote_version()\n {\n $request = wp_remote_post( $this->update_path, array( 'body' => array( 'action' => 'version' ) ) );\n if ( !is_wp_error( $request ) || wp_remote_retrieve_response_code( $request ) === 200 ) {\n return $request['body'];\n }\n return false;\n }", "public function getRemotes()\n {\n return $this->repository->run('ls-remote');\n }", "public function getName()\n {\n return 'Deploy via remote cached git repository [built-in]';\n }", "public function getDeployment();", "public function getVcs()\n {\n return $this->getGoal('git');\n }", "public function getBranchId()\n {\n return $this->branch_id;\n }", "private function branches()\r\n {\r\n return (isset($this->_session[$this->_branchKey]) ?\r\n $this->_session[$this->_branchKey] : []);\r\n }", "public function getBranchDetails_post()\n {\n\t\t$token = '1';\n\t\t//$tokens = AUTHORIZATION::validateToken($token);\n\t\t// print_r(getallheaders());\n\t\t// echo $token;die();\n\t\t//print_r($tokens);die;\n $requestedBy = $this->post('requestedBy');\n $getBranch = $this->branch_model->getBranch($requestedBy);\n if ($getBranch['branchStatus'])\n {\n // Set the response and exit\n $this->response($getBranch);\n }\n else\n {\n // Set the response and exit\n $this->response([\n 'message' => 'No records found!',\n 'branchStatus' => false\n ]);\n }\n }", "function getRemoteTable(){\n\t\treturn $this->remote_table;\n\t}", "public function getSDKDeployURL() {\n\t\treturn $this->sdkSettings['sdk_deploy_url'];\n\t}", "public function gitUrl() : string\n {\n return sprintf(\n '%s@%s:%s.git',\n $this->projectName(),\n $this->getOrError('frb_zone'),\n $this->projectName()\n );\n }", "public function getDeployment()\n {\n return $this->deployment;\n }", "public function getDeployment()\n {\n return $this->deployment;\n }", "public function getDeployment()\n {\n return $this->deployment;\n }", "public function git_remotes()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote', $remotes );\n\n\t\treturn $remotes;\n\t}", "public static function bitbucket()\n {\n return 'bitbucket';\n }", "public function getRemoteGateway()\n {\n return $this->remote_gateway;\n }", "function getRemote($var) {\n\n\t\tswitch($var) {\n\n\t\t\tcase 'ip':\n\t\t\t\treturn isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '0.0.0.0';\n\n\t\t\tcase 'referer':\n\t\t\t\treturn isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';\n\n\t\t\tcase 'userAgent':\n\t\t\t\treturn isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';\n\n\t\t\tcase 'browser':\n\t\t\tcase 'browserVersion':\n\t\t\tcase 'browserAndVersion':\n\t\t\t\t// @tbc\n\t\t\t\tbreak;\n\t\t}\n\n\t}", "public function getRemoteHomePath() {\n return @$this->attributes['remote_home_path'];\n }", "public function compare()\n {\n $remoteRevision = null;\n $tempFile = tmpfile();\n $filesToUpload = array();\n $filesToDelete = array();\n\n // The revision file goes inside the submodule.\n if ($this->isSubmodule)\n {\n $this->revisionFile = $this->isSubmodule.'/'.$this->revisionFile;\n }\n\n // When a revision file exists, get the version,\n // so a diff can be made.\n if (@ftp_fget($this->connection, $tempFile, $this->revisionFile, FTP_ASCII))\n {\n fseek($tempFile, 0);\n $remoteRevision = trim(fread($tempFile, 1024));\n fclose($tempFile);\n\n $message = \"\\r\\n» Taking it from '\".substr($remoteRevision, 0, 7).\"'\";\n }\n // Otherwise it will start a fresh upload.\n else\n {\n $message = \"\\r\\n» Fresh deployment - grab a coffee\";\n }\n\n // A remote version exists.\n if ($remoteRevision)\n {\n // Get the files from the diff.\n $output = $this->git->diff($remoteRevision);\n\n foreach ($output as $line)\n {\n // Added, changed or modified.\n if ($line[0] == 'A' or $line[0] == 'C' or $line[0] == 'M')\n {\n $filesToUpload[] = trim(substr($line, 1));\n }\n // Deleted.\n elseif ($line[0] == 'D')\n {\n $filesToDelete[] = trim(substr($line, 1));\n }\n // Unknown status.\n else\n {\n throw new Exception(\"Unknown git-diff status: {$line[0]}\");\n }\n }\n }\n // No remote version. Get all files.\n else\n {\n $filesToUpload = $this->git->files();\n }\n\n // Remove ignored files from the list of uploads.\n $filesToUpload = array_diff($filesToUpload, $this->ignoredFiles);\n\n $this->filesToUpload = $filesToUpload;\n $this->filesToDelete = $filesToDelete;\n\n return $message;\n }", "function target_gitup()\n{\n\t// git remote add upstream git://github.com/<user>/<repo>.git\n\tsystem('git fetch upstream');\n\tsystem('git merge upstream/master');\n}", "public function init_repo() {\n\n\t\t\t// include the repository configuration\n\t\t\t$repos = include_once(CONFIGPATH . 'repositories.php' );\n\n\t\t\t// the $_GET['deploy'] parameter from request\n\t\t\t$requested_deploy = filter_input( \\INPUT_GET, 'deploy', \\FILTER_SANITIZE_STRING );\n\n\t\t\t// assume that no repository is selected for deployment\n\t\t\t$selected = false;\n\n\t\t\t// if no deploy param was found, maybe pick up the first (and often, only) repository config\n\t\t\tif ( empty( $requested_deploy ) ) {\n\n\t\t\t\t$selected = $this->maybe_select_deploy( $repos[ 0 ], $requested_deploy );\n\n\t\t\t// otherwise, loop through repositories to select the requested one\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tforeach ( $repos as $deploy_config ) {\n\n\t\t\t\t\t$selected = $this->maybe_select_deploy( $deploy_config, $requested_deploy );\n\n\t\t\t\t\t// if we found one, break the loop\n\t\t\t\t\tif ( $selected === true ) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// we didn't find any, throw an error\n\t\t\tif ( $selected === false ) {\n\t\t\t\terror(\n\t\t\t\t\t'501 Not Implemented', 'Configuration not found for the requested deploy'\n\t\t\t\t);\n\t\t\t}\n\t\t}", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "public static function getDevelopmentRevision()\n {\n $branch = '';\n $rev = 0;\n $date = '';\n \n try {\n // try to find the .git dir\n $dir = realpath(dirname(dirname(dirname(__FILE__)))) . '/.git';\n if (file_exists($dir)) {\n $HEAD = trim(str_replace('ref: ', '', @file_get_contents(\"$dir/HEAD\")));\n $explodedHead = explode('/', $HEAD);\n \n $branch = array_pop($explodedHead);\n $rev = trim(@file_get_contents(\"$dir/$HEAD\"));\n \n $hashes = str_split($rev, 2);\n \n $objPath = \"$dir/objects\";\n while (count($hashes) != 0) {\n $objPath .= '/' . array_shift($hashes);\n $objFile = \"$objPath/\" . implode('', $hashes);\n if (@file_exists($objFile)) {\n $date = date_create('@' . filemtime($objFile))->format('Y-m-d H:i:s');\n break;\n }\n }\n }\n $revision = \"$branch: $rev ($date)\";\n } catch (\\Exception $e) {\n $revision = 'not resolvable';\n }\n \n return $revision;\n }", "function get_remote($url) {\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n\n $contents = curl_exec($ch);\n curl_close($ch);\n return $contents;\n\n }", "public function getBranch()\n {\n return $this->hasOne(CompanyBranches::className(), ['BranchID' => 'BranchID']);\n }", "public function upload() {\n // FYI. We are on master now.\n $m_ftp = new \\Model_Ftp();\n $m_ftp->user_id = $this->user_id;\n $branch = $this->branch;\n // Get ftp data for the respective branch\n $ftp_data = $m_ftp->get($branch['ftp_id']);\n\n if (count($ftp_data) !== 1) {\n $this->log('Failed: Enviornment does not have a Linked FTP account.');\n throw new Exception(\"No Linked FTP for enviornment.\");\n } else {\n $ftp_data = $ftp_data[0];\n }\n\n // Testing if the FTP server works.\n try {\n $ftp_data['user'] = $ftp_data['username'];\n $ftp_url = http_build_url($ftp_data);\n// $ftp_test = utils::test_ftp($ftp_url);\n $ftp_test = new \\Banago\\Bridge\\Bridge($ftp_url);\n if ($ftp_test) {\n $this->log('ftp_connect', 'connected');\n }\n } catch (Exception $e) {\n $this->log('ftp_connect', 'connection failed: ' . $e->getMessage());\n throw new Exception('We are sending msg here.' . $e->getMessage());\n }\n\n // LOG --------------------------------\n $this->log('deploy_branch', $branch['branch_name']);\n $this->log('deploy_branch_env', $branch['name']);\n $this->output('Deploy to branch name: ' . $branch['branch_name']);\n // LOG END ----------------------------\n\n /*\n * Data is ready, need to get ready with repository state.\n * Has to be checked out to the branch specified\n * and has to be checked out to the commit specified.\n */\n\n /*\n * pull and clone done,\n * checkout to branch now.\n */\n\n $this->output('Checkout to ' . $branch['branch_name']);\n \\Utils::gitCommand(\"checkout \" . $this->branch['branch_name']);\n $this->log('revision_on_server_before', $branch['revision']);\n $this->output('Revision on FTP: ' . $branch['revision']);\n\n // Setting options for gitcore\n $options = array(\n 'record_id' => $this->record_id,\n 'repo' => $this->repo_dir,\n 'debug' => $this->debug,\n 'deploy_id' => $this->deploy_id,\n 'server' => 'default',\n 'ftp' => array(\n 'default' => array(\n 'scheme' => $ftp_data['scheme'],\n 'host' => $ftp_data['host'],\n 'user' => $ftp_data['username'],\n 'pass' => $ftp_data['pass'],\n 'port' => $ftp_data['port'],\n 'path' => $ftp_data['path'],\n 'passive' => TRUE,\n 'skip' => unserialize($this->branch['skip_path']),\n 'purge' => unserialize($this->branch['purge_path']),\n )\n ),\n 'remoteRevision' => $branch['revision'],\n );\n\n // if type_rollback.\n if ($this->record['record_type'] == $this->m_record->type_rollback && !empty($this->record['hash'])) {\n // checkout the the specific hash.\n \\Utils::gitCommand('checkout ' . $this->record['hash']);\n }\n\n // if type_sync\n if ($this->record['record_type'] == $this->m_record->type_sync) {\n // upload all files please.\n $options['remoteRevision'] = '';\n }\n\n if ($this->record['record_type'] == $this->m_record->type_service_push) {\n // push from github/bitbucket.\n if (!empty($this->record['hash']))\n \\Utils::gitCommand('checkout ' . $this->record['hash']);\n }\n\n // else its update\n\n $localRevision = \\Utils::gitCommand('rev-parse HEAD');\n if (isset($localRevision[0])) {\n $localRevision = trim($localRevision[0]);\n $options['localRevision'] = $localRevision;\n }\n\n if ($options['localRevision'] == $options['remoteRevision']) {\n $this->output('FTP server has the latest changes!');\n $this->log('FTP server has the latest changes!');\n }\n\n $this->output($localRevision);\n\n $gitcore = new \\Gitcore($options);\n try {\n // todo: we're inside.\n $gitcore->startDeploy();\n } catch (Exception $e) {\n // Store logs from GITCORE.\n $this->log('deploy_log', $gitcore->log);\n $this->output($this->log);\n throw new \\Exception($e->getMessage());\n }\n\n // Store Logs from GITCORE.\n $this->log['deploy_log'] = $gitcore->log;\n $this->output($this->log);\n\n $before_revision = $this->log['deploy_log']['remoteRevision_before'];\n $current_revision = $this->log['deploy_log']['remoteRevision_after'];\n\n // Storing output from GITCORE.\n $this->m_record->set($this->record_id, array(\n 'raw' => serialize($this->log),\n 'amount_deployed' => $this->log['deploy_log']['deployed']['human'],\n 'amount_deployed_raw' => $this->log['deploy_log']['deployed']['data'],\n 'file_add' => $this->log['deploy_log']['files']['upload'],\n 'file_remove' => $this->log['deploy_log']['files']['delete'],\n 'file_skip' => $this->log['deploy_log']['files']['skip'],\n 'hash' => $current_revision,\n 'hash_before' => $before_revision,\n ));\n\n // OK,\n // Update branch to ready,\n // Update branch revision.\n $this->m_branches->set($branch['id'], array(\n 'ready' => 1,\n 'revision' => $current_revision\n ));\n\n // OK, checkout to master.\n \\Utils::gitCommand('checkout master');\n }", "function getRemoteField(){\n\t\treturn $this->remote_field;\n\t}", "function rvendor() {\n\t\t$this->checkOnce();\n\t\t$remotePath = $this->getVersionPath().'/';\n\t\t$this->system('scp -r -v -i '.$this->id_rsa.' vendor '.\n\t\t\t$this->remoteUser.'@'.$this->liveServer.':'.$remotePath);\n\t}", "public function getRemoteUrl();", "public function github(){\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\tnew d_shopunity\\GitHub($user, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch );\n\t}", "public function sshUrl() : string\n {\n return sprintf(\n '%s@%s',\n $this->projectName(),\n $this->getOrError('frb_zone')\n );\n }", "public function bitbucket() {\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$pass = '';\n\t\tif(isset($this->request->get['pass'])){\n\t\t\t$pass = $this->request->get['pass'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\t$owner = '';\n\t\tif(isset($this->request->get['owner'])){\n\t\t\t$owner = $this->request->get['owner'];\n\t\t}\n\n\t\tnew d_shopunity\\Bitbucket($user, $pass, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch, $owner);\n\t}", "function brv_host()\n{\n return str_replace(HOST_TOKEN, DEBUG ? DEV_HOST : HOST, MAIN_HOST);\n}", "private function get_repository_info() {\n if ( is_null( $this->github_response ) ) {\n $request_uri = sprintf( 'https://api.github.com/repos/%s/%s/releases', $this->username, $this->repository );\n\n $response = json_decode( wp_remote_retrieve_body( wp_remote_get( $request_uri ) ), true );\n if( is_array( $response ) ) {\n $response = current( $response );\n }\n $this->github_response = $response;\n }\n }", "function check_branch($appid,$steamcmd) { \t\n \n$cmd = \"$steamcmd +app_info_update 1 +app_info_print $appid +quit 2>/dev/null\"; \n$data= shell_exec($cmd);\nfile_put_contents(\"$appid.txt\",$data);\n$kv = VDFParse(\"$appid.txt\");\nunlink(\"$appid.txt\");\nreturn $kv[$appid]['depots']['branches']; // just send the branches back\n}", "function do_pull($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'cd $path; ssh-add $key; git reset --hard; git pull' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}", "public function getMasterRabbit()\n {\n return $this->rabbitConn;\n }", "public function repo($dir, $remote);", "public function getBranch($branch_id) {\r\n\r\n $sql = \"SELECT name FROM branch WHERE id=?\";\r\n\r\n $stmt = $this->connect()->prepare($sql);\r\n\r\n $stmt->execute([$branch_id]);\r\n\r\n return ($stmt->fetch());\r\n }", "public function get_id() {\n return 'remote';\n }", "public function getTargetCommitish() : string\n {\n return $this->targetCommitish;\n }" ]
[ "0.65224206", "0.6259599", "0.62317294", "0.6191133", "0.6075909", "0.60703236", "0.60518396", "0.60518396", "0.6004127", "0.59335285", "0.58949876", "0.57196635", "0.5704866", "0.5616115", "0.5611877", "0.56028503", "0.55625117", "0.55576104", "0.5553211", "0.5515577", "0.5510284", "0.55096215", "0.54939276", "0.5482094", "0.54737115", "0.5461102", "0.5435713", "0.54339963", "0.5423268", "0.5421476", "0.542063", "0.5418692", "0.5410088", "0.5398276", "0.53978103", "0.5391137", "0.5365821", "0.5358728", "0.5349163", "0.534776", "0.53457", "0.53420436", "0.533527", "0.53189695", "0.52444845", "0.51847744", "0.51498705", "0.5145513", "0.5126269", "0.5095924", "0.50763166", "0.5073093", "0.50689656", "0.50488347", "0.50433755", "0.50415564", "0.5037375", "0.5033625", "0.50301397", "0.50222665", "0.5017839", "0.50166404", "0.5012795", "0.50117743", "0.5009326", "0.49935788", "0.49918237", "0.4985363", "0.4980984", "0.4980537", "0.4980537", "0.4980537", "0.49802318", "0.49711922", "0.496646", "0.49660024", "0.49627015", "0.49624568", "0.4947359", "0.49372834", "0.4929902", "0.49291623", "0.49246317", "0.4920043", "0.4918318", "0.49045876", "0.49042946", "0.48973587", "0.48895356", "0.4888999", "0.48818737", "0.48802984", "0.48798284", "0.48732296", "0.48729444", "0.48696077", "0.4863011", "0.48612484", "0.48575646", "0.48561266" ]
0.7209364
0
Get the build commands to run
public function buildCommands() : Collection { return collect((array) $this->get('build_commands', [])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCommandsToRun()\n {\n // Get symfony\n $symfony = $this->findSymfony();\n\n // Commands\n $commands = [\n rtrim($symfony . ' new ' . $this->getProjectPath() . ' ' . $this->getVersion()),\n ];\n\n return implode(' && ', $commands);\n }", "private static function commands()\n {\n foreach (self::fetch(static::$root.'Lumos/Commands') as $file) {\n static::need($file);\n }\n }", "protected function getCommands()\n {\n\t$commands[] = new DeployCommand();\n\t$commands[] = new RollbackCommand();\n\t$commands[] = new UpdateCommand();\n\t$commands[] = new DiffCommand();\n\t$commands[] = new CleanupCommand();\n\t$commands[] = new CheckCommand();\n\t$commands[] = new JsonCommand();\n\t$commands[] = new SetupCommand();\n\t$commands[] = new InstallCommand();\n\n\treturn $commands;\n }", "public function getCommands()\n {\n $str = '';\n if (isset($_SERVER['argv'])) {\n $str = \"$ \" . implode(\" \", $_SERVER['argv']);\n }\n\n return $str;\n }", "protected static function commands()\n {\n foreach (self::fetch('support/shell', false) as $file) {\n Bus::need($file);\n }\n }", "public function _getCommands()\n\t{\n\t\t$commands\t= array();\n\t\t$commands[] = array(\"permission\" => \"read\", \"cmd\" => \"view\", \"lang_var\" => \"enter\", \"default\" => true);\n\t\t$commands[] = array(\"permission\" => \"write\", \"cmd\" => \"settings-general\", \"lang_var\" => \"settings\");\n\t\t\n\t\t// alex 3 Oct 2012: this leads to a blank screen, i guess it is a copy/paste bug from files\n\t\t//$commands[] = array(\"permission\" => \"write\", \"cmd\" => \"versions\", \"lang_var\" => \"versions\");\n\n\t\treturn $commands;\n\t}", "protected function packageCommands()\n {\n return [\n NovaMakeCommand::class,\n ReadmeMakeCommand::class,\n TravisMakeCommand::class,\n LicenseMakeCommand::class,\n PhpunitMakeCommand::class,\n StyleciMakeCommand::class,\n CodecovMakeCommand::class,\n ComposerMakeCommand::class,\n BaseTestMakeCommand::class,\n GitignoreMakeCommand::class,\n ContributionMakeCommand::class,\n ];\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "public function getCheckCommands()\n {\n return $this->getCommandList(2);\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function getCommand()\n {\n\n return [\n\n // Usage of the command\n 'usage' => \"Command reads a file and output it in upper or lower case\",\n\n // Options for only this command\n 'options' => [\n '--up' => 'Will put string in uppercase',\n '--low' => 'Will put string in lowercase'\n ],\n\n // 'cast' => [\n // 'up' => 'int', // Cast to int, bool, float. Default is string\n // ],\n\n // Main options, which other commands may have access to\n 'main_options' => [\n '--main' => 'Test with a main option'\n ],\n\n // Are there any arguments and what are they used for.\n // This is only for displaying help. Any number of arguments can be\n 'arguments' => [\n 'File' => 'Read from a file and output to stdout. You can also pipe input to the command',\n ],\n \n // Set a default command if none if given\n // php demos/example --up README.md\n // Instead of:\n // php demos/example echo --up README.md\n // Then set 'is_default' to true\n // 'is_default' => true, \n ];\n }", "function _getCommands()\n\t{\n\t\t$commands = array();\n\t\t$commands[] = array( 'permission' => 'read', 'cmd' => 'view', 'lang_var' => 'show', 'default' => true );\n//\t\t$commands[] = array('permission' => 'read', 'cmd' => 'render', 'lang_var' => 'show', 'default' => true);\n//\t\t$commands[] = array('permission' => 'write', 'cmd' => 'enableAdministrationPanel', 'lang_var' => 'edit_content');\n//\t\t$commands[] = array( 'permission' => 'write', 'cmd' => 'edit', 'lang_var' => 'settings' );\n\n\t\treturn $commands;\n\t}", "public function getCommands()\n {\n return array(\n 'mautic:leadlists:update' => array('title' => 'Update lists', 'description' => 'Updates the leads in the lists. This command is required for basic Mautic functions.'),\n 'mautic:campaigns:update' => array('title' => 'Update campaigns', 'description' => 'Adds/removes leads from campaigns. This command is required for basic Mautic functions.'),\n 'mautic:campaigns:trigger' => array('title' => 'Trigger campaigns', 'description' => 'Triggers the campaign events. This command is required for basic Mautic functions.'),\n 'mautic:email:process' => array('title' => 'Process emails', 'description' => 'Processes the emails in the queue. This command is needed if you configure the emails to be processed in a queue.'),\n 'mautic:fetch:email' => array('title' => 'Fetch emails', 'description' => 'Reads emails from a inbox defined in the Monitored Inbox setting.'),\n 'mautic:iplookup:download' => array('title' => 'Update geoIP', 'description' => 'Downloads/updates the MaxMind GeoIp2 City database. This command is needed only if you use the \"MaxMind - GeoIp2 City Download\" IP lookup service.')\n );\n }", "function _getCommands()\n\t{\n\t\treturn array();\n\t}", "public function getBuiltFiles()\n {\n return $this->builtFiles;\n }", "function _drush_build() {\n drush_invoke('updatedb');\n drush_invoke('features-revert-all', array('force' => TRUE));\n drush_invoke('cc', array('type' => 'all'));\n drush_log(dt('Built!'), 'success');\n}", "protected function getCommands()\n {\n return implode(self::COMMAND_SEPARATOR, $this->chainableCommand);\n }", "public function getCommands()\n {\n return $this->getCommandBus()->getCommands();\n }", "protected function registerCommands()\n {\n $this->add(new Command\\BuildCommand());\n }", "public function getCommands()\n {\n return [\n ];\n }", "public function build()\n {\n $return = '';\n \n foreach ($this->getVars() as $commandName => $tags) {\n foreach ($tags as $tagName => $tagValues) {\n $return .= $this->renderTag($commandName, $tagName, $tagValues, $tags);\n }\n }\n\n return $return;\n }", "public function getCommands()\n\t{\n\t\treturn $this->commands;\t\n\t}", "protected function getScanCommands()\n {\n $files = Finder::create()\n ->in($this->app['path.commands'])\n ->name('*Command.php');\n\n $commands = [];\n\n foreach ($files as $file) {\n if ($command = $this->getCommandFromSource($file)) {\n $commands = array_merge($commands, $command);\n }\n }\n\n return $commands;\n }", "public static function get_build()\n {\n }", "public function getCommands()\n {\n return $this->commands;\n }", "public function getCommands()\n {\n return $this->commands;\n }", "public function getCommands()\n {\n return $this->commands;\n }", "public function formatBuildArguments()\n {\n return array_merge(\n ['__VAPOR_RUNTIME='.Manifest::runtime($this->environment)],\n array_filter($this->cliBuildArgs, function ($value) {\n return ! Str::startsWith($value, '__VAPOR_RUNTIME');\n })\n );\n }", "public static function commands() {\n return self::$_commands;\n }", "private static function get_commands_list(){ return array_keys(self::$current_runner->commands_list); }", "public function getCommands()\n {\n return array();\n }", "public function getCheckoutCommands();", "public function getCommands();", "public function getCommands()\n {\n return $this->data['commands'];\n }", "function getCommands()\n{\n return getSettings()['commands'];\n}", "public function getCommands(): array\n\t{\n\t\treturn $this->commands;\n\t}", "public function getCommands(): array\n {\n return $this->commands;\n }", "public function getCommands(): array\n {\n return $this->commands;\n }", "function pkg_build_repo_list() {\n\t$repos = pkg_list_repos();\n\t$list = array();\n\n\tforeach ($repos as $repo) {\n\t\t$list[$repo['name']] = $repo['descr'];\n\t}\n\n\treturn($list);\n}", "public function listCommands()\n {\n $commands = $this->library->getAll();\n\n foreach ($commands as $name => $details) {\n $this->output->writeln(ucwords($name));\n $this->output->hr(strlen($details['description']), '-');\n $this->output->writeln($details['description']);\n $this->output->hr(strlen($details['description']), '-');\n\n foreach ($details['actions'] as $action) {\n $this->output->writeln(\n sprintf(\n \"%s - php [file] %s%s [params]\",\n $action,\n $name,\n ($action != 'main' ? \":$action\" : '')\n )\n );\n }\n\n // Just for padding\n $this->output->writeln('');\n }\n }", "public function getCommandList(): array\n {\n $commandConfig = $this->getCommandConfig();\n $result = [];\n\n foreach ($commandConfig as $command) {\n try {\n $this->checkCommandConfig($command);\n $result[] = $this->makeCommandObject($command);\n } catch (\\Exception $exception) {\n $this->writeData($exception->getMessage());\n exit();\n }\n }\n\n return $result;\n }", "protected function getDefaultCommands()\n\t{\n\t\t$default_commands = parent::getDefaultCommands();\n\t\t$default_commands[] = new MissingTestsCommand();\n\t\t$default_commands[] = new SyncCommand();\n\t\t$default_commands[] = new ReportCommand();\n\t\t$default_commands[] = new BackwardsCompatibilityCommand();\n\t\t$default_commands[] = new CompletionCommand();\n\n\t\tif ( !$this->isPharFile() ) {\n\t\t\t$default_commands[] = new MigrationCreateCommand();\n\t\t}\n\n\t\treturn $default_commands;\n\t}", "function cos_build_simple($options = null) {\n\n $dir = getcwd();\n $name = basename($dir);\n\n if (file_exists(\"./build/$name\")) {\n common::execCommand(\"sudo rm -rf ./build/$name*\");\n }\n common::execCommand(\"mkdir ./build/$name\");\n\n $htdocs = \"cp -rf htdocs/* ./build/$name\";\n common::execCommand($htdocs);\n\n $domain = conf::getMainIni('domain');\n if (!$domain) {\n $domain = 'default';\n }\n\n $files_rm = \"sudo rm -rf ./build/$name/files/$domain/*\";\n common::execCommand($files_rm);\n\n $config = \"mkdir ./build/$name/config\";\n common::execCommand($config);\n\n $tmp_dir = \"mkdir ./build/$name/tmp\";\n common::execCommand($tmp_dir);\n \n $profiles = \"cp -rf profiles ./build/$name\";\n common::execCommand($profiles);\n\n $sql_scripts = \"cp -rf scripts ./build/$name\";\n common::execCommand($sql_scripts);\n\n $cli = \"cp -rf coscli.sh ./build/$name\";\n common::execCommand($cli);\n \n $composer = \"cp -rf composer.json ./build/$name\";\n common::execCommand($composer);\n\n // reset database password\n $ary = conf::getIniFileArray(\"./config/config.ini\");\n $profile = new profile();\n\n $ary = $profile->iniArrayPrepare($ary);\n\n // clean ini settings for secrets\n $ini_settings = conf::arrayToIniFile($ary);\n\n // add ini dist file\n file_put_contents(\"./build/$name/config/config.ini-dist\", $ini_settings);\n\n $index = \"cp -rf htdocs/index.php ./build/$name/index.php\";\n common::execCommand($index);\n\n $phar_cli = \"cp -rf phar-cli.php ./build/$name/\";\n common::execCommand($phar_cli);\n \n $phar_web = \"cp -rf phar-web.php ./build/$name/\";\n common::execCommand($phar_web);\n\n $module_dir = conf::pathModules();\n $modules = \"cp -rf $module_dir ./build/$name\";\n common::execCommand($modules);\n\n $vendor = \"cp -rf vendor ./build/$name\";\n common::execCommand($vendor);\n\n $rm_git = \"rm `find ./build/$name -name '.git'` -rf\";\n common::execCommand($rm_git);\n\n $rm_ignore = \"rm `find ./build/$name -name '.gitignore'` -rf\";\n common::execCommand($rm_ignore);\n\n $rm_doc = \"rm -rf ./build/vendor/doc\";\n common::execCommand($rm_doc);\n\n $output = array();\n\n exec('git tag -l', $output);\n $version = array_pop($output);\n\n $command = \"cd ./build && tar -Pczf $name-$version.tar.gz $name \";\n common::execCommand($command);\n}", "protected function packageInternalCommands()\n {\n return [\n Replace::class,\n AddPackage::class,\n ClonePackage::class,\n PackageMakeCommand::class,\n SavePackageCredentials::class,\n DeletePackageCredentials::class,\n ];\n }", "public function getCommand(): string\n {\n $port = $this->config->getPort();\n\n $java_bin = $this->config->getJavaBin();\n\n $jars = [];\n $classpaths = $this->config->getClasspaths();\n foreach ($classpaths as $classpath) {\n if (preg_match('/\\*\\.jar$/', $classpath)) {\n $directory = preg_replace('/\\*\\.jar$/', '', $classpath);\n $files = glob(\"$directory/*.jar\");\n //foreach ($files as $file) {\n foreach ($files as $file) {\n $jars[] = $file;\n }\n //}\n } else {\n $jars[] = $classpath;\n }\n }\n\n $jars[] = $this->config->getServerJar();\n $classpath = implode(':', $jars);\n $threads = $this->config->getThreads();\n\n $directives = ' -D' . implode(' -D', [\n 'php.java.bridge.daemon=\"false\"',\n \"php.java.bridge.threads=$threads\"\n ]);\n\n $command = sprintf(\n '%s -cp \"%s\" %s php.java.bridge.Standalone SERVLET:%d',\n $java_bin,\n $classpath,\n $directives,\n $port\n );\n\n return $command;\n }", "public function buildsCommands()\n {\n $client = ScaleEngineClient::factory(['apiSecret' => 'test']);\n $command = $client->getCommand('requestTicket');\n\n $this->assertInstanceOf('\\Guzzle\\Service\\Command\\CommandInterface', $command);\n }", "protected function standardCommands()\n {\n return [\n AnyMakeCommand::class,\n TraitMakeCommand::class,\n ContractMakeCommand::class,\n InterfaceMakeCommand::class,\n ];\n }", "protected function foundationCommands()\n {\n return [\n JobMakeCommand::class,\n MailMakeCommand::class,\n TestMakeCommand::class,\n RuleMakeCommand::class,\n EventMakeCommand::class,\n ModelMakeCommand::class,\n PolicyMakeCommand::class,\n ConsoleMakeCommand::class,\n RequestMakeCommand::class,\n ChannelMakeCommand::class,\n ProviderMakeCommand::class,\n ListenerMakeCommand::class,\n ObserverMakeCommand::class,\n ResourceMakeCommand::class,\n ExceptionMakeCommand::class,\n NotificationMakeCommand::class,\n ];\n }", "public function getBuilds()\n {\n return $this->builds;\n }", "public function consoleCommands()\n {\n return array_merge_recursive($this->defaultCommands(), $this->commands);\n }", "public function getCommands(): array;", "public function getCommands()\n {\n $application = new Application($this->kernel);\n $application->setAutoExit(false);\n\n $input = new ArrayInput([\n 'command' => 'list',\n '--format' => 'xml'\n ]);\n\n $output = new StreamOutput(fopen('php://memory', 'w+'));\n $application->run($input, $output);\n rewind($output->getStream());\n\n return $this->extractCommandsFromXML(stream_get_contents($output->getStream()));\n }", "public function getCommandInfo(): array\n {\n return [\n new BuiltInCommandInfo('alias', 'Add a bash-style alias', true),\n new BuiltInCommandInfo('unalias', 'Remove a bash-style alias', true)\n ];\n }", "protected function assets()\n {\n $output = [];\n if (!file_exists($this->config['build'] . 'node_modules')) {\n putenv('PATH=' . trim(shell_exec('echo $PATH')) . ':' . dirname(MODX_BASE_PATH) . '/');\n if (file_exists($this->config['build'] . 'package.json')) {\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Trying to install or update nodejs dependencies');\n $output = [\n shell_exec('cd ' . $this->config['build'] . ' && npm config set scripts-prepend-node-path true && npm install'),\n ];\n }\n if (file_exists($this->config['build'] . 'gulpfile.js')) {\n $output = array_merge($output, [\n shell_exec('cd ' . $this->config['build'] . ' && npm link gulp'),\n shell_exec('cd ' . $this->config['build'] . ' && gulp copy'),\n ]);\n }\n if ($output) {\n $this->modx->log(xPDO::LOG_LEVEL_INFO, implode(\"\\n\", array_map('trim', $output)));\n }\n }\n if (file_exists($this->config['build'] . 'gulpfile.js')) {\n $output = shell_exec('cd ' . $this->config['build'] . ' && gulp default 2>&1');\n $this->modx->log(xPDO::LOG_LEVEL_INFO, 'Compile scripts and styles ' . trim($output));\n }\n }", "function getCommand(): array\n {\n return [\n '/root/.composer/vendor/bin/phploc',\n ];\n }", "public function buildCommands(Build $build, CommandFactory $commandFactory)\n {\n $commands = array($this->createCommand($commandFactory));\n $storeResultCommand = $this->createStoreResultCommand($commandFactory, $build->getBuildDir($this));\n if ($storeResultCommand instanceof StoreResultCommand) {\n $commands[] = $storeResultCommand;\n }\n\n return $commands;\n }", "private function registeredCommands(): array\n {\n return [\n $this->container->get(SpinUpCommand::class),\n $this->container->get(RemoveCommand::class),\n $this->container->get(InitConfigCommand::class),\n $this->container->get(ReplaceParametersCommand::class),\n $this->container->get(GetFileGroupCommand::class),\n $this->container->get(RunWebhookGroupCommand::class),\n ];\n }", "protected function getCronCommands()\n\t{\n\t\t// Identify the commands configured with a cron line\n $cronCommands = array();\n foreach (Artisan::all() as $command) {\n if ($command instanceOf CronCommandInterface) {\n $cronCommands[] = $command;\n }\n }\n\n return $cronCommands;\n\t}", "public static function GET_COMMANDS(): array\n\t{\n\t\treturn self::$commands::GET_COMMANDS();\n\t}", "public function provides(): array\n {\n $commands = CommandsList::toLoad($this->app::VERSION);\n $customCommands = CommandsList::getCustomCommands();\n $commandsList = array_values($commands) + array_keys($customCommands);\n\n return $commandsList;\n }", "private function buildCommand() {\n $command = $this->getCommand();\n \n if (!is_array($this->args) || count($this->args) == 0) {\n return $command;\n }\n \n $argumentOrder = $this->getArgumentOrder();\n \n $argumentString = '';\n foreach ($argumentOrder as $argumentName) {\n $argumentString .= ' ' . $this->args[$argumentName];\n }\n \n return $command . $argumentString;\n }", "protected function compile()\n {\n $this->runCommand(['npm', 'run', 'dev'], $this->viewsPath(), $this->output);\n }", "function migrate_govcms_drush_command() {\n $items = [];\n\n $items['migrate-govcms-migrate-build'] = [\n 'description' => 'Creates the WordPress migrations',\n 'examples' => array(\n 'migrate-govcms-migrate-build' => 'Creates the WordPress migrations',\n ),\n 'drupal dependencies' => array('migrate_govcms'),\n 'aliases' => array('mgmb'),\n ];\n\n return $items;\n}", "public function getCmdList()\n {\n return $this->get(self::CMDLIST);\n }", "public function getNotificationCommands()\n {\n return $this->getCommandList(1);\n }", "public function buildCommand()\n {\n $command = $this->command . ' >> ' . $this->_output . ' 2>&1 &';\n\n return $this->_user ? 'sudo -u ' . $this->_user . ' ' . $command : $command;\n }", "public function getCommand()\n {\n return\n array(\n 'usage' => 'MySQL DB commands used with configuration set in config/DB.php',\n 'options' => array(\n '--connect' => 'Connect to the database defined in DB.php config',\n '--server-connect' => 'Connect to the server. Same as connect but no database is selected',\n '--backup' => \"Create full backup of the database using mysqldump, which will be placed in './backup'\",\n '--no-data' => 'Only table definitions in database dumps',\n ),\n\n );\n }", "public function generateCommands();", "public function getBuildOptions() {\n return $this->options;\n }", "public function all()\n {\n return $this->commands;\n }", "public function getCommands()\r\r\n {\r\r\n return $this->invalidCommands;\r\r\n }", "public function getAvailableCommands()\n {\n return $this->commands;\n }", "protected function _getCommandsSet()\n {\n $commands[] = \"domain add {$this->_getEscapedDomain()}\";\n $commands[] = \"catchall set {$this->_getEscapedDomain()} {$this->_getEscapedBehavior()}\";\n \n return $commands;\n }", "public function getCommands(): array {\n return [\n new PreloadCommand(),\n ];\n }", "public function __invoke()\n {\n return [\n 'require' => self::getDevRequirements(),\n 'require-dev' => self::getRequirements()\n ];\n }", "public static function commands()\n {\n return [\n // Random Commands\n \\Aloe\\Command\\ServeCommand::class,\n \\Aloe\\Command\\ConsoleCommand::class,\n \\Aloe\\Command\\AppDownCommand::class,\n \\Aloe\\Command\\AppUpCommand::class,\n // Aloe Commands\n \\Aloe\\Command\\AloeInstallCommand::class,\n // \\Aloe\\Command\\InstallDebuggerCommand::class,\n // Scaffold Commands\n \\Aloe\\Command\\ScaffoldAuthCommand::class,\n // Env Commands\n \\Aloe\\Command\\EnvGenerateCommand::class,\n // Generate Commands\n \\Aloe\\Command\\GenerateMigrationCommand::class,\n \\Aloe\\Command\\GenerateModelCommand::class,\n \\Aloe\\Command\\GenerateHelperCommand::class,\n \\Aloe\\Command\\GenerateControllerCommand::class,\n \\Aloe\\Command\\GenerateSeedCommand::class,\n \\Aloe\\Command\\GenerateConsoleCommand::class,\n \\Aloe\\Command\\GenerateFactoryCommand::class,\n \\Aloe\\Command\\GenerateTemplateCommand::class,\n // Delete Commands\n \\Aloe\\Command\\DeleteModelCommand::class,\n \\Aloe\\Command\\DeleteSeedCommand::class,\n \\Aloe\\Command\\DeleteFactoryCommand::class,\n \\Aloe\\Command\\DeleteControllerCommand::class,\n \\Aloe\\Command\\DeleteConsoleCommand::class,\n \\Aloe\\Command\\DeleteMigrationCommand::class,\n // Database Commands\n \\Aloe\\Command\\DatabaseInstallCommand::class,\n \\Aloe\\Command\\DatabaseMigrationCommand::class,\n \\Aloe\\Command\\DatabaseRollbackCommand::class,\n \\Aloe\\Command\\DatabaseSeedCommand::class\n ];\n }", "function getCompiledScripts(): array\n {\n return $this->composer->getPackage()->getScripts();\n }", "protected function _getListInstallerCommandsFull() {\n\t\t$result = [\n\t\t\tCAKE_INSTALLER_SHELL_INSTALLER_TASK_SETUILANG => __d('cake_installer', 'Setting application UI language'),\n\t\t\tCAKE_INSTALLER_SHELL_INSTALLER_TASK_CHECK => __d('cake_installer', 'Checking PHP environment'),\n\t\t\tCAKE_INSTALLER_SHELL_INSTALLER_TASK_SETDIRPERMISS => __d('cake_installer', 'Setting file system permissions on the temporary directory'),\n\t\t\tCAKE_INSTALLER_SHELL_INSTALLER_TASK_SETSECURKEY => __d('cake_installer', 'Setting security key'),\n\t\t\tCAKE_INSTALLER_SHELL_INSTALLER_TASK_SETTIMEZONE => __d('cake_installer', 'Setting timezone'),\n\t\t\tCAKE_INSTALLER_SHELL_INSTALLER_TASK_SETBASEURL => __d('cake_installer', 'Setting base URL'),\n\t\t\tCAKE_INSTALLER_SHELL_INSTALLER_TASK_CONNECT_DB => __d('cake_installer', 'Checking connect to database'),\n\t\t\tCAKE_INSTALLER_SHELL_INSTALLER_TASK_CONFIG_DB => __d('cake_installer', 'Configure database connections'),\n\t\t\tCAKE_INSTALLER_SHELL_INSTALLER_TASK_CREATE_DB => __d('cake_installer', 'Creation database and initialization data'),\n\t\t\tCAKE_INSTALLER_SHELL_INSTALLER_TASK_CREATE_SYMLINKS => __d('cake_installer', 'Creation symbolic links to files'),\n\t\t\tCAKE_INSTALLER_SHELL_INSTALLER_TASK_CREATE_CRONJOBS => __d('cake_installer', 'Creation cron jobs'),\n\t\t\tCAKE_INSTALLER_SHELL_INSTALLER_TASK_INSTALL => __d('cake_installer', 'Install this application'),\n\t\t];\n\n\t\treturn $result;\n\t}", "public function commands()\n {\n $this->load($this->app->path('Console/Commands'));\n }", "public function provides()\n {\n return array_merge(array_values($this->devCommands), [ 'migration.creator' ]);\n }", "protected function makeCommand(): string\n {\n // make all required dirs and validate attributes\n parent::makeCommand();\n\n $path = app()->basePath() . DIRECTORY_SEPARATOR . 'scripts' . DIRECTORY_SEPARATOR;\n $fake = __DIR__ . DIRECTORY_SEPARATOR . 'log.txt';\n\n return \"{$path}fake.sh $fake 0.1\";\n }", "public function coreCommands()\n {\n return [\n 'help' => \\Friday\\Console\\Controller\\HelpController::class,\n 'web-server' => \\Friday\\Console\\Controller\\WebServerController::class,\n ];\n }", "private function setupCommands(): void\n {\n if ($this->app->runningInConsole()) {\n // $this->commands([\n // ]);\n }\n }", "function get_tools()\n {\n }", "public function getCommand() {\n\t\t$spec = self::$specs[$this->id];\n\t\treturn array_value($spec, \"command\", NULL);\n\t}", "function getSubcommands() {\n Utils\\loadAllCommands();\n $subcommands = parent::getSubcommands();\n return $subcommands;\n }", "private function get_protected_commands() {\n\t\treturn [\n\t\t\t'cli info',\n\t\t\t'package',\n\t\t];\n\t}", "public function getMiscCommands()\n {\n return $this->getCommandList(3);\n }", "protected function _getCommands()\n {\n if(!$this->_getCatchAll()->getConflicts()) {\n return null;\n }\n \n return $this->_getCommandsSet();\n }", "public function build() : array\n {\n // Exclude \"$PRELOAD$\" phantom file\n $scripts = $this->excludePreloadVariable($this->list);\n\n // Exclude the files set by the developer\n $scripts = $this->exclude($scripts);\n\n // Sort the scripts by hit ratio\n $scripts = $this->sortScripts($scripts);\n\n // Cull the list by memory usage\n $scripts = $this->cutByMemoryLimit($scripts);\n\n // Add files to the preload.\n $scripts = array_merge($scripts, $this->appended);\n\n // Remove duplicates and return\n return array_unique($scripts);\n }", "abstract protected function getGitCommand(): string;", "public function getCommandClasses();", "static public function list_commands()\n\t{\n\t\tstatic $commands = NULL;\n\n\t\tif ($commands == NULL)\n\t\t{\n\t\t\t// Include paths must be searched in reverse\n\t\t\t$paths = array_reverse(Kohana::list_files('classes/Item/Command/'));\n\n\t\t\t// Array of class names that have been found\n\t\t\t$found = array();\n\n\t\t\tforeach ($paths as $files)\n\t\t\t{\n\t\t\t\t$replacements = array_merge(Kohana::include_paths(), array('classes'.DIRECTORY_SEPARATOR.'Item'.DIRECTORY_SEPARATOR.'Command'.DIRECTORY_SEPARATOR, '.php'));\n\n\t\t\t\tif (is_array($files))\n\t\t\t\t{\n\t\t\t\t\tforeach ($files as $file)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($replacements as $replace)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$file = str_replace($replace, '', $file);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$found[] = $file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$commands = $found;\n\t\t}\n\n\t\treturn $commands;\n\t}", "protected function commands()\n {\n /*-------------------------------------------------------------------------\n | This is where you may define all of your Closure based console\n | commands. Each Closure is bound to a command instance allowing a\n | simple approach to interacting with each command's IO methods.\n *------------------------------------------------------------------------*/\n\n app(\\Illuminate\\Contracts\\Console\\Kernel::class)->command('inspire', function () {\n /** @var \\Illuminate\\Console\\Command $this */\n $this->comment(Inspiring::quote());\n });\n }", "public function getCommand()\n {\n $commands = [];\n foreach ($this->exec as $command) {\n $commands[] = $this->receiveCommand($command);\n }\n\n $remoteDir = $this->remoteDir ? $this->remoteDir : $this->getConfigValue('remoteDir');\n if (!empty($remoteDir)) {\n array_unshift($commands, sprintf('cd \"%s\"', $remoteDir));\n }\n $command = implode($this->stopOnFail ? ' && ' : ' ; ', $commands);\n\n return $this->sshCommand($command);\n }", "protected function getDefaultCommands()\n {\n $defaultCommands = parent::getDefaultCommands();\n\n $defaultCommands[] = new CbCliCommand;\n\n return $defaultCommands;\n }", "public static function compiles()\n\t{\n\t\t$basePath = realpath(__DIR__.'/../');\n\n\t\treturn [\n\t\t\t// $basePath.'/example.php',\n\t\t];\n\t}", "public function getCommandsToExecute()\n {\n return $this->commands()\n ->whereNull('sended_at')\n ->orderBy('created_at', 'ASC')\n ->get();\n }", "function execCmds() {\n\tglobal $commands;\n\tforeach ($commands as $idx => $command) {\n\t\tshowCmdT($idx, $command);\n\t}\n}", "public function getCommand(): string\n {\n $command = 'git'\n . $this->getRootOption()\n . $this->getConfigParameterOptions()\n . ' '\n . $this->getGitCommand();\n return $command;\n }" ]
[ "0.65266496", "0.6486425", "0.64486825", "0.63645273", "0.6264899", "0.6238406", "0.6073823", "0.6070439", "0.59602493", "0.5953021", "0.5891035", "0.5858855", "0.5854843", "0.58218366", "0.5789899", "0.57700354", "0.57596934", "0.5742897", "0.57065547", "0.570477", "0.56995285", "0.5697836", "0.5680903", "0.566648", "0.56598645", "0.56598645", "0.56598645", "0.56585515", "0.5621866", "0.5617424", "0.5612704", "0.5605699", "0.56045216", "0.5593736", "0.55884176", "0.5588407", "0.5581782", "0.5581782", "0.5560324", "0.5557882", "0.55392075", "0.5511008", "0.54988766", "0.5450714", "0.5428842", "0.54224515", "0.54043275", "0.5403746", "0.53923184", "0.53847855", "0.53812724", "0.5377529", "0.5371217", "0.5350786", "0.53496855", "0.53352636", "0.5322439", "0.5319845", "0.5302208", "0.5286003", "0.52856797", "0.52828586", "0.52747506", "0.5273284", "0.52563155", "0.5256081", "0.525553", "0.5241322", "0.5238522", "0.5234882", "0.5233702", "0.5222204", "0.5220298", "0.52156055", "0.52113926", "0.5210688", "0.5204275", "0.5191302", "0.5190214", "0.5183325", "0.5181273", "0.5171159", "0.51623386", "0.5143156", "0.5141998", "0.5135597", "0.51251966", "0.5122619", "0.5110891", "0.51092833", "0.51037973", "0.51033425", "0.51018995", "0.510033", "0.5094457", "0.5085175", "0.5072227", "0.50700426", "0.5066091", "0.50645673" ]
0.67123824
0
Get the build files to deploy
public function buildOutputs() : Collection { return collect((array) $this->get('build_output', [])); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBuiltFiles()\n {\n return $this->builtFiles;\n }", "public function collectBuildFile()\r\n {\r\n if( file_exists($this->site_root . \"/build\") )\r\n {\r\n $this->file_list[] = \"build\";\r\n }\r\n }", "public function getFiles()\n {\n return $this->getConfig('stubs.files');\n }", "protected function assets()\n {\n $output = [];\n if (!file_exists($this->config['build'] . 'node_modules')) {\n putenv('PATH=' . trim(shell_exec('echo $PATH')) . ':' . dirname(MODX_BASE_PATH) . '/');\n if (file_exists($this->config['build'] . 'package.json')) {\n $this->modx->log(modX::LOG_LEVEL_INFO, 'Trying to install or update nodejs dependencies');\n $output = [\n shell_exec('cd ' . $this->config['build'] . ' && npm config set scripts-prepend-node-path true && npm install'),\n ];\n }\n if (file_exists($this->config['build'] . 'gulpfile.js')) {\n $output = array_merge($output, [\n shell_exec('cd ' . $this->config['build'] . ' && npm link gulp'),\n shell_exec('cd ' . $this->config['build'] . ' && gulp copy'),\n ]);\n }\n if ($output) {\n $this->modx->log(xPDO::LOG_LEVEL_INFO, implode(\"\\n\", array_map('trim', $output)));\n }\n }\n if (file_exists($this->config['build'] . 'gulpfile.js')) {\n $output = shell_exec('cd ' . $this->config['build'] . ' && gulp default 2>&1');\n $this->modx->log(xPDO::LOG_LEVEL_INFO, 'Compile scripts and styles ' . trim($output));\n }\n }", "public function getFiles()\n {\n return $this->_configFiles;\n }", "protected function getMainFiles()\n {\n $mainFiles = [];\n foreach ($this->getCssFilesFromConfig() as $scss) {\n $mainFiles[] = realpath($this->getConfig()->getUnglueConfigFolderPath($scss));\n }\n\n return $mainFiles;\n }", "public function loadFilesProduction()\r\n {\r\n $id = Input::get('ID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null)\r\n {\r\n $internalFiles = $project->filesByType(array('vendor','university','designer','writer','attorney','2d'));\r\n foreach($internalFiles as $file)\r\n {\r\n $files[]=['id'=>$file->id,'name'=>$file->fileName,'url'=>$file->url,'date'=>$file->created_at];\r\n }\r\n }\r\n return json_encode($files);\r\n }", "public function getFilesToPush()\n {\n return $this->files_to_push;\n }", "private function getLatestVersionScripts() {\n $latest_version = $this->getLatestVersion();\n \n if($latest_version) {\n $latest_version_path = ROOT . \"/$latest_version\";\n \n return get_files(\"$latest_version_path/upgrade\", 'php');\n } else {\n return array();\n } // if\n }", "function getCompiledScripts(): array\n {\n return $this->composer->getPackage()->getScripts();\n }", "public function listApplicationFiles() {\r\n\t\t$preload = array(\r\n\t\t\t\"config/main.js\"\r\n\t\t);\r\n\t\t\r\n\t\t$return = array();\r\n\t\t$fullPath = $this->applicationPath;\r\n\t\r\n\t\tforeach($preload as $file) {\r\n\t\t\t$return[] = $fullPath.\"/\".$file;\r\n\t\t}\r\n\t\t\r\n\t\t$options = array(\r\n\t\t\t\"fileTypes\" => array(\"js\"),\r\n\t\t\t\"exclude\" => array_merge($preload, array(\r\n\t\t\t\t\"data\", \"messages\", \"compiled.js\"\r\n\t\t\t))\r\n\t\t);\r\n\t\t\r\n\t\t$return = array_merge($return, CFileHelper::findFiles($fullPath,$options));\r\n\t\t\r\n\t\t\r\n\t\treturn $return;\r\n\t}", "public function getFiles()\n {\n return isset($this->source['files']) && is_array($this->source['files']) ? $this->source['files'] : [];\n }", "public function getFiles(): array\n {\n return $this->pluginRepository->config('stubs.files');\n }", "public function getInitFiles() {\n $aOut = array();\n foreach ($this->getBasePaths('init') as $aPaths) {\n foreach ($aPaths as $aInfo) {\n $aOut[] = $aInfo['path'];\n }\n }\n foreach ($this->getBasePaths('include') as $aPaths) {\n foreach ($aPaths as $aInfo) {\n $aOut[] = $aInfo['path'];\n }\n }\n return $aOut;\n }", "public function loadFilesLaunch()\r\n {\r\n $id = Input::get('ID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null)\r\n {\r\n $internalAndPublicFiles = $project->filesByType(array('public','clientVendor'));\r\n foreach($internalAndPublicFiles as $file)\r\n {\r\n $files[]=['id'=>$file->id,'name'=>$file->fileName,'url'=>$file->url,'projectId'=>$id];\r\n }\r\n }\r\n return json_encode($files);\r\n }", "private function getMinifiedFiles() {\n $files = array(\n 'bootstrap-responsive' => 'bootstrap-responsive.min.css',\n 'bootstrap' => 'bootstrap.min.css',\n 'bootstrap-js' => 'bootstrap.min.js'\n );\n return $files;\n }", "public function getSrcFiles()\n\t{\n\t\t// src files are cached to be less calls on the fs\n\t\tif (!$this->srcFiles) {\n\t\t\t$this->srcFiles = $this->getFiles($this->config['src']);\n\t\t}\n\n\t\treturn $this->srcFiles;\n\t}", "protected function sourceFiles()\n {\n static $files;\n\n if ($files === null) {\n $basePath = $this->basePath();\n $includedPaths = $this->includedPaths();\n $excludedPaths = $this->excludedPaths();\n\n $included = [];\n foreach ($includedPaths as $relPath) {\n $included = array_merge($included, $this->globRecursive($basePath.'/'.$relPath, GLOB_BRACE));\n }\n\n $excluded = [];\n foreach ($excludedPaths as $relPath) {\n $excluded = array_merge($excluded, $this->globRecursive($basePath.'/'.$relPath, GLOB_BRACE));\n }\n\n $files = array_diff($included, $excluded);\n }\n\n return $files;\n }", "protected function zipFiles()\n {\n $cacheDir = $this->getCacheDir();\n $zipFile = $cacheDir . '/' . date('Ymd-His');\n $zipCommand = 'zip - ' . implode(' ', $this->folders) . ' | split -b ' . $this->filePartSize . ' - ' . $zipFile;\n\n $this->stdout($zipCommand);\n\n //exec( $zipCommand, $out );\n\n $files = FileHelper::findFiles($cacheDir . '/');\n $uploadedFiles = [];\n\n foreach ($files as $file) {\n $this->dumpFiles[] = $uploadedFiles[] = $file;\n }\n\n return $uploadedFiles;\n }", "public function getFiles() {\n\t\tif ($this->_files === null) {\n\t\t\t$command = 'show --pretty=\"format:\" --name-only '.$this->hash;\n\t\t\tforeach(explode(\"\\n\",$this->branch->repository->run($command)) as $line) {\n\t\t\t\t$this->_files[] = trim($line);\n\t\t\t}\n\t\t}\n\t\treturn $this->_files;\n\t}", "public function getBakedFiles()\n {\n return $this->bakedFiles;\n }", "private function getFiles()\n {\n $process = new Process('git diff --cached --name-status --diff-filter=ACMR');\n $process->run();\n\n if ($process->isSuccessful()) {\n return \\array_filter(\\explode(\"\\n\", $process->getOutput()));\n }\n\n return [];\n }", "protected static function _getFiles() {\n\t\t$libraries = Finder::libraries();\n\t\t$libs = array_keys($libraries);\n\t\t$cachedLibs = &static::$_cachedLibs;\n\t\t$cachedFiles = &static::$_cachedFiles;\n\t\tif (array_diff($cachedLibs, $libs) || array_diff($libs, $cachedLibs)) {\n\t\t\t$cachedLibs = $libs;\n\t\t\t$cachedFiles = array ();\n\t\t\tforeach (Finder::paths('bootstrap') as $dir) {\n\t\t\t\tif ($handle = opendir($dir)) {\n\t\t\t\t\twhile (false !== ($entry = readdir($handle))) {\n\t\t\t\t\t\tif ($entry !== '.' && $entry !== '..') {\n\t\t\t\t\t\t\t$cachedFiles += array ($entry => $dir.$entry);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tclosedir($handle);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $cachedFiles;\n\t}", "public function getBinaries()\n {\n return $this->binaries;\n }", "protected function getConfigurationFiles()\n {\n $files = [];\n $path = $this->laravel->configPath();\n $found = Finder::create()->files()->name('*.php')->depth('== 0')->in($path);\n\n foreach ($found as $file) {\n $files[] = \\basename($file->getRealPath(), '.php');\n }\n\n return $files;\n }", "public function getLoadedConfigFiles() {\n return $this->_files;\n }", "public function build() : array\n {\n // Exclude \"$PRELOAD$\" phantom file\n $scripts = $this->excludePreloadVariable($this->list);\n\n // Exclude the files set by the developer\n $scripts = $this->exclude($scripts);\n\n // Sort the scripts by hit ratio\n $scripts = $this->sortScripts($scripts);\n\n // Cull the list by memory usage\n $scripts = $this->cutByMemoryLimit($scripts);\n\n // Add files to the preload.\n $scripts = array_merge($scripts, $this->appended);\n\n // Remove duplicates and return\n return array_unique($scripts);\n }", "public function getEmbeddedFiles() {}", "public function getFiles()\n\t{\n\t\tif ($this->_files === null) {\n\t\t\t$command = 'show --pretty=\"format:\" --name-only '.$this->hash;\n\t\t\tforeach(explode(\"\\n\",$this->repository->run($command)) as $line) {\n\t\t\t\t$this->_files[] = trim($line);\n\t\t\t}\n\t\t}\n\t\treturn $this->_files;\n\t}", "protected function getFilesToLoad()\n\t{\n\t\t$includingFiles = array(\n\t\t\tRD.\"Functions.php\",\n\t\t);\n\t\t$plugins = $this->getPluginFiles();\n\t\tif(!empty($plugins))\n\t\t\t$includingFiles = array_merge($includingFiles, $plugins);\n\t\treturn $includingFiles;\n\t}", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/trickstr.php',\n 'sources_custom/programe/.htaccess',\n 'sources_custom/programe/aiml/.htaccess',\n 'sources_custom/programe/aiml/index.html',\n 'sources_custom/programe/index.html',\n 'sources_custom/hooks/modules/chat_bots/knowledge.txt',\n 'sources_custom/hooks/modules/chat_bots/trickstr.php',\n 'sources_custom/programe/aiml/readme.txt',\n 'sources_custom/programe/aiml/startup.xml',\n 'sources_custom/programe/aiml/std-65percent.aiml',\n 'sources_custom/programe/aiml/std-pickup.aiml',\n 'sources_custom/programe/botloaderfuncs.php',\n 'sources_custom/programe/customtags.php',\n 'sources_custom/programe/db.sql',\n 'sources_custom/programe/graphnew.php',\n 'sources_custom/programe/respond.php',\n 'sources_custom/programe/util.php',\n );\n }", "public static function getBuildDir()\n {\n return self::getRoot() . DIRECTORY_SEPARATOR . 'build';\n }", "public function getConcatenateFiles() {}", "public function collectComposerJsonFile()\r\n {\r\n\r\n $files_found = $this->findSpecificFile($this->site_root, \"composer.json\");\r\n if($files_found)\r\n $this->file_list = array_merge($this->file_list, $files_found);\r\n }", "public function get_scripts()\n {\n $prefix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.min' : '';\n $assets = $this->get_manifest('../dist/app');\n\n $scripts = [\n 'wprs-tsm-runtime' => [\n 'src' => $this->get_url($assets[ 'runtime.js' ]),\n 'in_footer' => true,\n ],\n 'wprs-tsm-frontend' => [\n 'src' => $this->get_url($assets[ 'frontend.js' ]),\n 'in_footer' => true,\n ],\n ];\n\n return $scripts;\n }", "public function getSettingFiles() {\n $aOut = array();\n foreach ($this->getBasePaths('setting') as $aPaths) {\n foreach ($aPaths as $aInfo) {\n $aOut[] = $aInfo['path'];\n }\n }\n return $aOut;\n }", "protected function getComposerFiles () : array\n {\n $file = new Filesystem();\n\n return $file->glob (base_path ('packages') . '/*/*/composer.json');\n }", "public function getFiles() {}", "protected function pushFiles()\n {\n $branch = $this->getCurrenBranch();\n\n $dir = HOME.'/repos/'.$this->getRepoName().'/'.$branch.'/files/';\n\n if (!$this->getFilesystem()->exists($dir)) {\n $this->getFilesystem()->makeDirectory($dir);\n }\n\n foreach ($this->getAllFiles() as $file) {\n if (empty($file)) {\n continue;\n }\n\n $sourceDir = pathinfo($file, PATHINFO_DIRNAME);\n if (!$this->getFilesystem()->exists($dir.$sourceDir)) {\n $this->getFilesystem()->makeDirectory($dir.$sourceDir);\n }\n\n $source = $this->repository->getDirectory().'/'.$file;\n $this->getFilesystem()->copy($source, $dir.$file);\n }\n\n $this->sync($dir, $this->getConfig()->get('app.bucket'), $this->getRepoName().'/'.$branch.'/files');\n $this->getFilesystem()->deleteDirectory($dir);\n\n return $this->getRepoName().'/'.$branch.'/files';\n }", "public function get_js_files()\n\t{\n\t\treturn $this->_js_files;\n\t}", "function getFiles()\r\n\t{\r\n\t\treturn $this->files;\r\n\t}", "function getFiles(){\n\t\treturn $this->used_files;\n\t}", "public function publishFiles()\n {\n $this->publishes(\n [ __DIR__ . '/../resources/views' => base_path('themes/avored/default/views/vendor')],\n 'avored-module-views'\n );\n $this->publishes(\n [ __DIR__ . '/../dist/js/front' => base_path('public/js')],\n 'avored-front-js'\n );\n $this->publishes(\n [ __DIR__ . '/../dist/js/admin' => base_path('public/avored-admin/js')],\n 'avored-admin-js'\n );\n\n $this->publishes([\n __DIR__ . '/../database/migrations' => database_path('avored-migrations'),\n ]);\n }", "function cemhub_get_generated_flat_files() {\n return file_scan_directory(cemhub_get_files_repository_path(TRUE), '/.*\\.txt|.pgp$/');\n}", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/idolisr.php',\n 'sources_custom/hooks/modules/members/idolisr.php',\n 'sources_custom/miniblocks/main_stars.php',\n 'sources_custom/miniblocks/side_recent_points.php',\n 'themes/default/templates_custom/POINTS_GIVE.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_STARS.tpl',\n 'themes/default/templates_custom/BLOCK_SIDE_RECENT_POINTS.tpl',\n );\n }", "public function getFiles() {\n\t\treturn $this->files;\n\t}", "public static function getIndexFiles()\n\t{\n\t\tif (empty(MHTTPD::$config['Server']['index_files'])) {\n\t\t\treturn array();\n\t\t}\n\t\treturn MHTTPD::$config['Server']['index_files'];\n\t}", "public function getProjectFileList() {\n $list = [];\n /** @var $map SymlinkMap */\n foreach ($this->getSymlinkMaps() as $map) {\n $list[] = $map->getTarget();\n }\n\n return $list;\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/geshi.php',\n 'sources_custom/geshi/.htaccess',\n 'sources_custom/geshi/index.html',\n 'sources_custom/geshi/4cs.php',\n 'sources_custom/geshi/abap.php',\n 'sources_custom/geshi/actionscript.php',\n 'sources_custom/geshi/actionscript3.php',\n 'sources_custom/geshi/ada.php',\n 'sources_custom/geshi/apache.php',\n 'sources_custom/geshi/applescript.php',\n 'sources_custom/geshi/apt_sources.php',\n 'sources_custom/geshi/asm.php',\n 'sources_custom/geshi/asp.php',\n 'sources_custom/geshi/autohotkey.php',\n 'sources_custom/geshi/autoit.php',\n 'sources_custom/geshi/avisynth.php',\n 'sources_custom/geshi/awk.php',\n 'sources_custom/geshi/bash.php',\n 'sources_custom/geshi/basic4gl.php',\n 'sources_custom/geshi/bf.php',\n 'sources_custom/geshi/bibtex.php',\n 'sources_custom/geshi/blitzbasic.php',\n 'sources_custom/geshi/bnf.php',\n 'sources_custom/geshi/boo.php',\n 'sources_custom/geshi/c.php',\n 'sources_custom/geshi/c_mac.php',\n 'sources_custom/geshi/caddcl.php',\n 'sources_custom/geshi/cadlisp.php',\n 'sources_custom/geshi/cfdg.php',\n 'sources_custom/geshi/cfm.php',\n 'sources_custom/geshi/cil.php',\n 'sources_custom/geshi/clojure.php',\n 'sources_custom/geshi/cmake.php',\n 'sources_custom/geshi/cobol.php',\n 'sources_custom/geshi/cpp-qt.php',\n 'sources_custom/geshi/cpp.php',\n 'sources_custom/geshi/csharp.php',\n 'sources_custom/geshi/css.php',\n 'sources_custom/geshi/cuesheet.php',\n 'sources_custom/geshi/d.php',\n 'sources_custom/geshi/dcs.php',\n 'sources_custom/geshi/delphi.php',\n 'sources_custom/geshi/diff.php',\n 'sources_custom/geshi/div.php',\n 'sources_custom/geshi/dos.php',\n 'sources_custom/geshi/dot.php',\n 'sources_custom/geshi/eiffel.php',\n 'sources_custom/geshi/email.php',\n 'sources_custom/geshi/erlang.php',\n 'sources_custom/geshi/fo.php',\n 'sources_custom/geshi/fortran.php',\n 'sources_custom/geshi/freebasic.php',\n 'sources_custom/geshi/fsharp.php',\n 'sources_custom/geshi/gambas.php',\n 'sources_custom/geshi/gdb.php',\n 'sources_custom/geshi/genero.php',\n 'sources_custom/geshi/gettext.php',\n 'sources_custom/geshi/glsl.php',\n 'sources_custom/geshi/gml.php',\n 'sources_custom/geshi/gnuplot.php',\n 'sources_custom/geshi/groovy.php',\n 'sources_custom/geshi/haskell.php',\n 'sources_custom/geshi/hq9plus.php',\n 'sources_custom/geshi/html4strict.php',\n 'sources_custom/geshi/idl.php',\n 'sources_custom/geshi/ini.php',\n 'sources_custom/geshi/inno.php',\n 'sources_custom/geshi/intercal.php',\n 'sources_custom/geshi/io.php',\n 'sources_custom/geshi/java.php',\n 'sources_custom/geshi/java5.php',\n 'sources_custom/geshi/javascript.php',\n 'sources_custom/geshi/jquery.php',\n 'sources_custom/geshi/kixtart.php',\n 'sources_custom/geshi/klonec.php',\n 'sources_custom/geshi/klonecpp.php',\n 'sources_custom/geshi/latex.php',\n 'sources_custom/geshi/lisp.php',\n 'sources_custom/geshi/locobasic.php',\n 'sources_custom/geshi/logtalk.php',\n 'sources_custom/geshi/lolcode.php',\n 'sources_custom/geshi/lotusformulas.php',\n 'sources_custom/geshi/lotusscript.php',\n 'sources_custom/geshi/lscript.php',\n 'sources_custom/geshi/lsl2.php',\n 'sources_custom/geshi/lua.php',\n 'sources_custom/geshi/m68k.php',\n 'sources_custom/geshi/make.php',\n 'sources_custom/geshi/mapbasic.php',\n 'sources_custom/geshi/matlab.php',\n 'sources_custom/geshi/mirc.php',\n 'sources_custom/geshi/mmix.php',\n 'sources_custom/geshi/modula3.php',\n 'sources_custom/geshi/mpasm.php',\n 'sources_custom/geshi/mxml.php',\n 'sources_custom/geshi/mysql.php',\n 'sources_custom/geshi/newlisp.php',\n 'sources_custom/geshi/nsis.php',\n 'sources_custom/geshi/oberon2.php',\n 'sources_custom/geshi/objc.php',\n 'sources_custom/geshi/ocaml-brief.php',\n 'sources_custom/geshi/ocaml.php',\n 'sources_custom/geshi/oobas.php',\n 'sources_custom/geshi/oracle11.php',\n 'sources_custom/geshi/oracle8.php',\n 'sources_custom/geshi/pascal.php',\n 'sources_custom/geshi/per.php',\n 'sources_custom/geshi/perl.php',\n 'sources_custom/geshi/perl6.php',\n 'sources_custom/geshi/php-brief.php',\n 'sources_custom/geshi/php.php',\n 'sources_custom/geshi/pic16.php',\n 'sources_custom/geshi/pike.php',\n 'sources_custom/geshi/pixelbender.php',\n 'sources_custom/geshi/plsql.php',\n 'sources_custom/geshi/povray.php',\n 'sources_custom/geshi/powerbuilder.php',\n 'sources_custom/geshi/powershell.php',\n 'sources_custom/geshi/progress.php',\n 'sources_custom/geshi/prolog.php',\n 'sources_custom/geshi/properties.php',\n 'sources_custom/geshi/providex.php',\n 'sources_custom/geshi/purebasic.php',\n 'sources_custom/geshi/python.php',\n 'sources_custom/geshi/qbasic.php',\n 'sources_custom/geshi/rails.php',\n 'sources_custom/geshi/rebol.php',\n 'sources_custom/geshi/reg.php',\n 'sources_custom/geshi/robots.php',\n 'sources_custom/geshi/rsplus.php',\n 'sources_custom/geshi/ruby.php',\n 'sources_custom/geshi/sas.php',\n 'sources_custom/geshi/scala.php',\n 'sources_custom/geshi/scheme.php',\n 'sources_custom/geshi/scilab.php',\n 'sources_custom/geshi/sdlbasic.php',\n 'sources_custom/geshi/smalltalk.php',\n 'sources_custom/geshi/smarty.php',\n 'sources_custom/geshi/sql.php',\n 'sources_custom/geshi/systemverilog.php',\n 'sources_custom/geshi/tcl.php',\n 'sources_custom/geshi/teraterm.php',\n 'sources_custom/geshi/text.php',\n 'sources_custom/geshi/thinbasic.php',\n 'sources_custom/geshi/tsql.php',\n 'sources_custom/geshi/typoscript.php',\n 'sources_custom/geshi/vb.php',\n 'sources_custom/geshi/vbnet.php',\n 'sources_custom/geshi/verilog.php',\n 'sources_custom/geshi/vhdl.php',\n 'sources_custom/geshi/vim.php',\n 'sources_custom/geshi/visualfoxpro.php',\n 'sources_custom/geshi/visualprolog.php',\n 'sources_custom/geshi/whitespace.php',\n 'sources_custom/geshi/whois.php',\n 'sources_custom/geshi/winbatch.php',\n 'sources_custom/geshi/xml.php',\n 'sources_custom/geshi/xorg_conf.php',\n 'sources_custom/geshi/xpp.php',\n 'sources_custom/geshi/z80.php',\n 'sources_custom/geshi.php',\n 'sources_custom/geshi/.gitignore',\n 'sources_custom/geshi/6502acme.php',\n 'sources_custom/geshi/6502kickass.php',\n 'sources_custom/geshi/6502tasm.php',\n 'sources_custom/geshi/68000devpac.php',\n 'sources_custom/geshi/aimms.php',\n 'sources_custom/geshi/algol68.php',\n 'sources_custom/geshi/arm.php',\n 'sources_custom/geshi/asymptote.php',\n 'sources_custom/geshi/autoconf.php',\n 'sources_custom/geshi/bascomavr.php',\n 'sources_custom/geshi/c_loadrunner.php',\n 'sources_custom/geshi/c_winapi.php',\n 'sources_custom/geshi/chaiscript.php',\n 'sources_custom/geshi/chapel.php',\n 'sources_custom/geshi/coffeescript.php',\n 'sources_custom/geshi/cpp-winapi.php',\n 'sources_custom/geshi/dart.php',\n 'sources_custom/geshi/dcl.php',\n 'sources_custom/geshi/dcpu16.php',\n 'sources_custom/geshi/e.php',\n 'sources_custom/geshi/ecmascript.php',\n 'sources_custom/geshi/epc.php',\n 'sources_custom/geshi/euphoria.php',\n 'sources_custom/geshi/ezt.php',\n 'sources_custom/geshi/f1.php',\n 'sources_custom/geshi/falcon.php',\n 'sources_custom/geshi/freeswitch.php',\n 'sources_custom/geshi/genie.php',\n 'sources_custom/geshi/go.php',\n 'sources_custom/geshi/gwbasic.php',\n 'sources_custom/geshi/haxe.php',\n 'sources_custom/geshi/hicest.php',\n 'sources_custom/geshi/html5.php',\n 'sources_custom/geshi/icon.php',\n 'sources_custom/geshi/ispfpanel.php',\n 'sources_custom/geshi/j.php',\n 'sources_custom/geshi/jcl.php',\n 'sources_custom/geshi/lb.php',\n 'sources_custom/geshi/ldif.php',\n 'sources_custom/geshi/llvm.php',\n 'sources_custom/geshi/magiksf.php',\n 'sources_custom/geshi/modula2.php',\n 'sources_custom/geshi/nagios.php',\n 'sources_custom/geshi/netrexx.php',\n 'sources_custom/geshi/nginx.php',\n 'sources_custom/geshi/nimrod.php',\n 'sources_custom/geshi/objeck.php',\n 'sources_custom/geshi/octave.php',\n 'sources_custom/geshi/oorexx.php',\n 'sources_custom/geshi/oxygene.php',\n 'sources_custom/geshi/oz.php',\n 'sources_custom/geshi/parasail.php',\n 'sources_custom/geshi/parigp.php',\n 'sources_custom/geshi/pcre.php',\n 'sources_custom/geshi/pf.php',\n 'sources_custom/geshi/pli.php',\n 'sources_custom/geshi/postgresql.php',\n 'sources_custom/geshi/postscript.php',\n 'sources_custom/geshi/proftpd.php',\n 'sources_custom/geshi/pycon.php',\n 'sources_custom/geshi/pys60.php',\n 'sources_custom/geshi/q.php',\n 'sources_custom/geshi/qml.php',\n 'sources_custom/geshi/racket.php',\n 'sources_custom/geshi/rbs.php',\n 'sources_custom/geshi/rexx.php',\n 'sources_custom/geshi/rpmspec.php',\n 'sources_custom/geshi/rust.php',\n 'sources_custom/geshi/scl.php',\n 'sources_custom/geshi/spark.php',\n 'sources_custom/geshi/sparql.php',\n 'sources_custom/geshi/standardml.php',\n 'sources_custom/geshi/stonescript.php',\n 'sources_custom/geshi/unicon.php',\n 'sources_custom/geshi/upc.php',\n 'sources_custom/geshi/urbi.php',\n 'sources_custom/geshi/uscript.php',\n 'sources_custom/geshi/vala.php',\n 'sources_custom/geshi/vbscript.php',\n 'sources_custom/geshi/vedit.php',\n 'sources_custom/geshi/xbasic.php',\n 'sources_custom/geshi/yaml.php',\n 'sources_custom/geshi/zxbasic.php',\n );\n }", "private function getNoneMinifiedFiles() {\n $files = array(\n 'bootstrap-responsive' => 'bootstrap-responsive.css',\n 'bootstrap' => 'bootstrap.css',\n 'bootstrap-js' => 'bootstrap.js'\n );\n return $files;\n }", "public function provideRealFiles()\n {\n return [\n [__FILE__]\n ];\n }", "function list_files () {\n\t\t$root = $this->get_root();\n\t\t\n\t\treturn $this->_list_files($root);\n\t}", "public function getJsFiles() {\n //je krijgt op het einde .. en . terug, deze mag je niet opnemen in je links\n $jsFiles = scandir(\"js\", 1);\n \n return $jsFiles;\n }", "private function all(): array\n {\n if (!file_exists($this->envPath)) {\n if (file_exists($this->envExamplePath)) {\n copy($this->envExamplePath, $this->envPath);\n } else {\n touch($this->envPath);\n }\n }\n return file($this->envPath);\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "function happys_getCssAssets() {\n\t \t $filepath = glob(\"wp-content/themes/happys/css/app-v*.css\");\n\t\t $filename = basename($filepath[count($filepath) - 1]).PHP_EOL;\n\t \t echo $filename;\n }", "public function getFilesBase();", "public function getFiles()\n {\n $request = $this->getRequest();\n return (array)$request->getFiles();\n }", "public function getFiles() {\n return $this->files;\n }", "public function getFiles() {\n return $this->files;\n }", "protected function getParameterFiles() {\n // By default.\n $parameter_files = [\n 'drupal-settings/parameters.yml',\n 'drupal-settings/parameters.dist.yml'\n ];\n\n if ($this->extra && isset($this->extra['parameters-file'])) {\n array_unshift($parameter_files, $this->extra['parameters-file']);\n }\n\n return $parameter_files;\n }", "public function loadFilesProject()\r\n {\r\n $id = Input::get('ID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null)\r\n {\r\n $internalAndPublicFiles = $project->filesByType(array('internal','public'));\r\n foreach($internalAndPublicFiles as $file)\r\n {\r\n $files[]=['id'=>$file->id,'name'=>$file->fileName,'url'=>$file->url,'date'=>$file->created_at];\r\n }\r\n }\r\n return json_encode($files);\r\n }", "public function loadFilesVendor()\r\n {\r\n $id = Input::get('ID');\r\n $uid = Input::get('UID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null)\r\n {\r\n $rol = $this->getRol($uid);\r\n $internalFiles = $project->filesByType(array('vendor',$rol));\r\n foreach($internalFiles as $file)\r\n {\r\n $files[]=['id'=>$file->id,'name'=>$file->fileName,'url'=>$file->url];\r\n }\r\n }\r\n return json_encode($files);\r\n }", "public function getFiles(): array\n {\n return $this->files;\n }", "public function getFiles ();", "function _generateFilesList() {\n return array();\n }", "protected function publishAssets()\n {\n $assets = [];\n\n foreach ($this->assets as $location => $asset) {\n $assets[$this->basePath($location)] = base_path($asset);\n }\n\n $this->publishes($assets);\n }", "public function getFiles();", "public function getFiles();", "public function getFiles();", "protected function getAllStaticFiles()\n {\n $dir = $this->dirList->getPath('static');\n $js = [];\n $css = [];\n $this->getDirContents($dir, $js, $css);\n $result = [self::A_JS => $js, self::A_CSS => $css];\n return $result;\n }", "public function files()\n {\n return $this->_array[\"files\"];\n }", "public function allResourcesPath(): string\n {\n return \"/apis/{$this->getApiVersion()}/namespaces/{$this->getNamespace()}/deployments\";\n }", "protected function getFilesToProcess()\n {\n return array(\n 'custom/modules/Quotes/metadata/detailviewdefs.php',\n );\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/google_search.php',\n 'lang_custom/EN/google_search.ini',\n 'sources_custom/blocks/side_google_search.php',\n 'sources_custom/blocks/main_google_results.php',\n 'themes/default/templates_custom/BLOCK_SIDE_GOOGLE_SEARCH.tpl',\n 'themes/default/templates_custom/BLOCK_MAIN_GOOGLE_SEARCH_RESULTS.tpl',\n 'themes/default/css_custom/google_search.css',\n 'pages/comcode_custom/EN/_google_search.txt',\n );\n }", "public function getDeploymentPackageDirectory()\n {\n return __DIR__;\n }", "public function get_file_list()\n {\n return array(\n 'sources_custom/hooks/systems/addon_registry/wiki_sync.php',\n '_tests/tests/unit_tests/wiki_sync.php',\n 'lang_custom/EN/wiki_sync.ini',\n 'sources_custom/wiki_sync.php',\n 'sources_custom/hooks/systems/config/wiki_alt_changes_link_stub.php',\n 'sources_custom/hooks/systems/config/wiki_enable_git_sync.php',\n 'sources_custom/hooks/systems/config/wiki_enable_wysiwyg.php',\n 'sources_custom/hooks/systems/config/wiki_sync_media_directory.php',\n 'sources_custom/hooks/systems/config/wiki_sync_page_directory.php',\n 'sources_custom/hooks/systems/cron/wiki_sync_git.php',\n 'sources_custom/hooks/systems/notifications/wiki_failed_git_pull.php',\n 'sources_custom/wiki.php',\n 'site/pages/modules_custom/wiki.php',\n 'cms/pages/modules_custom/cms_wiki.php',\n );\n }", "public function files()\r\n {\r\n return $this->files;\r\n }", "public function crawl() {\n\t\t$sDirectories = BsConfig::get( 'MW::ExtendedSearch::ExternalRepo' );\n\t\tif ( $sDirectories === '' ) return $sDirectories;\n\n\t\t$aDirectories = explode( ',', $sDirectories );\n\t\tforeach ( $aDirectories as $sDirectory ) {\n\t\t\t$sDir = trim ( $sDirectory );\n\t\t\tif( !is_dir( $sDir ) ) continue;\n\t\t\t$this->readInFiles( $sDir );\n\t\t}\n\t\treturn $this->aFiles;\n\t}", "public function getUsedFiles() {\n $out = array();\n foreach(get_included_files() as $i => $file) {\n $out[] = array('number' => $i + 1, 'filename' => str_replace(SYS_ROOT, '', $file));\n }\n return $out;\n }", "protected function publishFiles()\n {\n $this->publishes([\n __DIR__.'/Config/installer.php' => config_path('installer.php'),\n ], 'nickelcms');\n\n // $this->publishes([\n // __DIR__.'/assets' => resource_path('nicklecms/admin'),\n // ], 'nickelcms_assets');\n\n }", "public static function compiles()\r\n {\r\n $dir = static::guessPackageClassPath('royalcms/storage');\r\n\r\n return [\r\n $dir . \"/Contracts/StorageInterface.php\",\r\n $dir . \"/Adapter/Aliyunoss.php\",\r\n $dir . \"/Adapter/Direct.php\",\r\n $dir . \"/Adapter/Local.php\",\r\n $dir . \"/Filesystem.php\",\r\n $dir . \"/FilesystemAdapter.php\",\r\n $dir . \"/FilesystemBaseTrait.php\",\r\n $dir . \"/FilesystemManager.php\",\r\n $dir . \"/Facades/Storage.php\",\r\n $dir . \"/StorageServiceProvider.php\",\r\n ];\r\n }", "public function getFiles()\n {\n return $this->_files;\n }", "protected function getFiles(): array\n {\n return [];\n }", "public function getFiles(): array\n {\n return [$this->file];\n }", "private function loadContent() {\n\t\t$expression =\n\t\t\t'/sunflower-'. // match only right files\n\t\t\t'(\\d+\\.\\d+\\w?)[\\.-](\\d+)'. // version\n\t\t\t'(?:-(\\d)+)?'. // package build number\n\t\t\t'(?:[\\.-](all|any|noarch|i386|amd64))?(?:\\.([\\w\\d]+))?'. // architecture and os\n\t\t\t'(\\.[\\w\\d\\.]+)/iu'; // extension\n\n\t\t// get files from directory\n\t\t$data = array();\n\t\t$files = scandir($this->file_path);\n\t\tforeach ($files as $file_name) {\n\t\t\t$matched = preg_match($expression, $file_name, $matches) == 1;\n\n\t\t\tif ($matched) {\n\t\t\t\t$build = $matches[2];\n\n\t\t\t\t// create storage array for build number\n\t\t\t\tif (!isset($data[$build]))\n\t\t\t\t\t$data[$build] = array();\n\n\t\t\t\t// treat different extensions differently\n\t\t\t\tswitch($matches[6]) {\n\t\t\t\t\tcase '.tgz.sig':\n\t\t\t\t\tcase '.deb.sig':\n\t\t\t\t\tcase '.rpm.sig':\n\t\t\t\t\t\t$key_name = substr($file_name, 0, strlen($file_name) - 4);\n\n\t\t\t\t\t\t// make sure storage array exists\n\t\t\t\t\t\tif (!isset($data[$build][$key_name]))\n\t\t\t\t\t\t\t$data[$build][$key_name] = array();\n\n\t\t\t\t\t\t// store signature to file name\n\t\t\t\t\t\t$data[$build][$key_name]['signature'] = url_GetFromFilePath($this->file_path.'/'.$file_name);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase '.tgz.sha256':\n\t\t\t\t\tcase '.deb.sha256':\n\t\t\t\t\tcase '.rpm.sha256':\n\t\t\t\t\t\t$key_name = substr($file_name, 0, strlen($file_name) - 7);\n\n\t\t\t\t\t\t// make sure storage array exists\n\t\t\t\t\t\tif (!isset($data[$build][$key_name]))\n\t\t\t\t\t\t\t$data[$build][$key_name] = array();\n\n\t\t\t\t\t\t// store signature to file name\n\t\t\t\t\t\t$data[$build][$key_name]['hash'] = file_get_contents($this->file_path.'/'.$file_name);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// make sure storage array exists\n\t\t\t\t\t\tif (!isset($data[$build][$file_name]))\n\t\t\t\t\t\t\t$data[$build][$file_name] = array();\n\n\t\t\t\t\t\t// get storage array for easier access\n\t\t\t\t\t\t$file_data = $data[$build][$file_name];\n\n\t\t\t\t\t\t// populate parameters\n\t\t\t\t\t\t$file_data['url'] = url_GetFromFilePath($this->file_path.'/'.$file_name);\n\t\t\t\t\t\t$file_data['version'] = $matches[1];\n\t\t\t\t\t\t$file_data['build'] = $matches[2];\n\t\t\t\t\t\t$file_data['package_build'] = $matches[3];\n\t\t\t\t\t\t$file_data['architecture'] = $matches[4];\n\t\t\t\t\t\t$file_data['platform'] = $matches[5];\n\t\t\t\t\t\t$file_data['extension'] = $matches[6];\n\n\t\t\t\t\t\t// store data array back to main array\n\t\t\t\t\t\t$data[$build][$file_name] = $file_data;\n\n\t\t\t\t\t\t// store version to reference list\n\t\t\t\t\t\t$this->version_list[$build] = $matches[1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// sort version list\n\t\tkrsort($this->version_list);\n\n\t\t// store parsed data\n\t\t$this->file_list = $data;\n\t}", "function _drush_patchfile_get_all_files($makefile) {\n $data = make_get_data($makefile);\n if (empty($data)) {\n drush_set_error('MAKE_INVALID_MAKE_FILE', dt('Invalid or empty make file: !makefile', array('!makefile' => $makefile)));\n return array();\n }\n\n $info = _drush_drupal_parse_info_file($data);\n if (empty($info)) {\n return array();\n }\n\n $includes = array();\n\n if (!empty($info['includes']) && is_array($info['includes'])) {\n $include_path = dirname($makefile);\n foreach ($info['includes'] as $include) {\n if (is_string($include)) {\n if (make_valid_url($include, TRUE) && ($file = _drush_patchfile_get_all_files($include))) {\n $includes = array_merge($includes, $file);\n }\n elseif (file_exists($include_path . '/' . $include) && ($file = _drush_patchfile_get_all_files($include_path . '/' . $include))) {\n $includes = array_merge($includes, $file);\n }\n elseif (file_exists($include) && ($file = _drush_patchfile_get_all_files($include))) {\n $includes = array_merge($includes, $file);\n }\n else {\n make_error('BUILD_ERROR', dt(\"Include file missing: !include\", array('!include' => $include)));\n }\n }\n }\n }\n\n return array_merge(array($makefile), $includes);\n}", "public function collectEzLegacyFiles()\r\n {\r\n $folder = array($this->app_root.'/../ezpublish_legacy/settings/', $this->app_root.'/../ezpublish_legacy/settings/override');\r\n $files_found = $this->findFiles($folder, array(\"ini\", \"php\"));\r\n\r\n if($files_found)\r\n $this->file_list = array_merge($this->file_list, $files_found);\r\n $this->filterZipfileList();\r\n\r\n }", "public function getFilesPayload() {\n $payload = [];\n\n if ($this->getFiles()) {\n foreach ($this->getFiles() as $file) {\n $payload[] = $file->flatten();\n }\n }\n\n return $payload;\n }", "public function getExecutedFiles()\n\t\t{\n\t\t\treturn $this->_executedFiles;\n\t\t}", "public\n function copyAssets() {\n $this->info('Clearing webroot and copying assets...');\n// if ($this->_clear($this->_assetDir, '^(?!cover)(?!dashboard)(?!signin)(?!baked-with-cakephp.svg).*$')) {\n// $this->success('All files cleared...');\n// }\n\n $files = [];\n $folders = [];\n $folders[] = new Folder($this->_nodeDir->path . DS . 'bootstrap/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'bootstrap-duration-picker/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'bootstrap-markdown-editor/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'bootstrap-toggle');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'checkboxes.js/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'datepair.js/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'flatpickr/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'jquery/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'jquery-awesome-cursor/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'jquery-mask-plugin/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'markitup/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'popper.js/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'select2/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'vue/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'signature_pad/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'sticky-sidebar/dist');\n $folders[] = new Folder($this->_nodeDir->path . DS . 'timepicker/dist');\n\n foreach ($folders as $folder) {\n foreach ($folder->findRecursive() as $file) {\n $files[] = new File($file);\n }\n }\n try {\n $this->_copy($files);\n } catch (\\Exception $exception) {\n $this->info('Some did not copy. Exception: ' . $exception->getMessage(), 1, ConsoleIo::VERBOSE);\n }\n\n }", "protected static function getCacheStateFiles()\n {\n return array_map(array('static', 'getCacheStateIndicatorFileName'), static::$steps);\n }" ]
[ "0.75753874", "0.66500914", "0.62604445", "0.61545265", "0.609346", "0.6060776", "0.6045629", "0.600241", "0.5923928", "0.5920536", "0.5913206", "0.58929", "0.5866935", "0.58574426", "0.5834476", "0.5831741", "0.57415366", "0.5680746", "0.56795347", "0.5656349", "0.5648179", "0.56284034", "0.56255794", "0.5621377", "0.5620391", "0.5606464", "0.559522", "0.55871105", "0.5561591", "0.55613524", "0.55483866", "0.5543323", "0.5534583", "0.5511338", "0.55070525", "0.54891765", "0.5470156", "0.5458787", "0.5454401", "0.54424757", "0.5438685", "0.54351646", "0.5423715", "0.542019", "0.54188323", "0.5409629", "0.5406363", "0.5399578", "0.5389446", "0.53819776", "0.5374388", "0.537209", "0.5356046", "0.535285", "0.53442305", "0.53442305", "0.53442305", "0.53442305", "0.53442305", "0.53442305", "0.53442305", "0.53442305", "0.53442305", "0.53442305", "0.5341833", "0.53411627", "0.53342545", "0.5334134", "0.5334134", "0.5328336", "0.53244257", "0.53235596", "0.53215116", "0.5319976", "0.5315645", "0.53128594", "0.5310712", "0.5310712", "0.5310712", "0.5309472", "0.52986443", "0.5291131", "0.5282616", "0.5275517", "0.5263166", "0.52616626", "0.5260986", "0.5257169", "0.52567077", "0.5253244", "0.5252296", "0.5250378", "0.52502376", "0.52501357", "0.52484727", "0.5236318", "0.5235131", "0.52342397", "0.5233278", "0.5218706", "0.52121943" ]
0.0
-1
Get the git URL
public function gitUrl() : string { return sprintf( '%s@%s:%s.git', $this->projectName(), $this->getOrError('frb_zone'), $this->projectName() ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_url(){\n\n\t\t\treturn $this->api_urls['giturl'];\n\n\t\t}", "public function getCommitUrl(): string\n {\n return $this->data->url;\n }", "public function get_github_url() {\n\t\treturn $this->get_meta( 'github_url' );\n\t}", "function getUrl() {\n\t\treturn $this->repoObj->lobUrltitle;\n\t}", "protected function getProjectFromRemote(): string\n {\n $process = new Process((array) 'git config --get remote.origin.url');\n $process->run();\n $remote_url = trim($process->getOutput());\n preg_match('#.*\\/(.*)\\.git$#', $remote_url, $matches);\n return $matches[1] ?? '';\n }", "private static function git_origin(): ?string {\n\t\tif ( ! self::$root_path ) {\n\t\t\treturn null;\n\t\t}\n\t\t$cmd = 'git -C ' . escapeshellarg( self::$root_path ) . ' remote get-url origin';\n\t\t$response = exec( $cmd );\n\t\treturn $response ?: null;\n\t}", "public function get_bitbucket_auth_url(){\n\t\tif( empty($this->unauth_token) ){\n\t\t\t$this->request_unauth_token();\n\t\t}\n\t\t\n\t\t$auth_req = OAuthRequest::from_consumer_and_token($this->consumer, $this->unauth_token, \"GET\", $this->oauth_urls['login']);\n\t\t$auth_req->sign_request($this->signature_method, $this->consumer, $this->unauth_token);\n\t\treturn $auth_req->to_url();\n\t}", "public function getRepositoryUrl() {\n\t\t\t// we need to clean the combination of the 2 again because if the subfolder is empty in the config\n\t\t\t// then this will result in 2 slashes\n\t\t\treturn File::getCleanedPath($this->config->svn->getRoot() . $this->config->svn->getSubfolder());\n\t\t}", "public function getAccessUrl(GitRepository $repository) {\n $serverName = $_SERVER['SERVER_NAME'];\n $user = UserManager::instance()->getCurrentUser();\n return $user->getUserName() .'@'. $serverName .':/gitroot/'. $repository->getProject()->getUnixName().'/'.$repository->getName().'.git';\n }", "public function getSvnRepoUri()\n {\n return $this->_svnRepoUri;\n }", "public function getURL(): string\n {\n return $this->http->getURL();\n }", "public function getRemoteAccessUrl($commit=null)\n {\n $conf = $this->getConf();\n $scm = $conf->getVal('scm', 'git');\n $scms = Pluf::f('allowed_scm');\n Pluf::loadClass($scms[$scm]);\n return call_user_func(array($scms[$scm], 'getAnonymousAccessUrl'),\n $this, $commit);\n }", "private function getJenkinsUrl()\n {\n $jenkins_location = $this->app['config']['jenkins']['location'];\n $jenkins_user = $this->app['config']['jenkins']['api_user'];\n $jenkins_token = $this->app['config']['jenkins']['api_token'];\n\n $jenkins_protocol = 'http';\n $jenkins_host = $jenkins_location;\n\n if(preg_match('/^(.*):\\/\\/(.*)$/', $jenkins_location, $matches)) {\n $jenkins_protocol = $matches[1];\n $jenkins_host = $matches[2];\n }\n\n $jenkins_host = rtrim($jenkins_host, '/') . '/';\n\n $jenkins_http_auth_string = '';\n if(!empty($jenkins_user) && !empty($jenkins_token)) {\n $jenkins_http_auth_string = $jenkins_user . ':' . $jenkins_token . '@';\n }\n\n $jenkins_url = $jenkins_protocol . '://' . $jenkins_http_auth_string . $jenkins_host;\n\n return $jenkins_url;\n }", "public function getGitCloneLocation()\n {\n return $this->gitCloneLocation;\n }", "public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t]+git@github.com\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}", "public function getURL(): string\n {\n return $this->url.$this->apiVersion.'/';\n }", "public function getGitRepository(): string\n {\n return 'https://github.com/Sylius/Sylius.git';\n }", "public function get_url(): string\n {\n return $this->get_url_internal();\n }", "private function generateUrl() : string\n {\n return $this->apiUrl.$this->ownerRepo.$this->branchPath.$this->branch;\n }", "protected function get_url()\n {\n return $this->base_url + $this->api_version; \n }", "protected function getTokenUrl()\n {\n return 'https://bitbucket.org/site/oauth2/access_token';\n }", "public function getURL ();", "public function getURL();", "public function getURL();", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "public function get_url () {\r\n\t\treturn $this->url;\r\n\t}", "protected function getUrl()\n {\n if (!empty($this->info['url'])) {\n return $this->info['url'];\n }\n }", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public function get_url() {\n\t\treturn $this->url;\n\t}", "protected function getUrl(): string\n {\n return $this->url;\n }", "public static function get_baseurl()\n {\n }", "public function getRemoteUrl();", "public function getURL() {\n\t\treturn $this->urlStub() .'/' . $this->publicContainer .'/' . $this->getId();\n\t}", "protected function url()\n\t{\n\t\treturn Phpfox::getLib('url');\t\n\t}", "public function getUrl() {\n\t\treturn $this->rawUrl;\n\t}", "public function getURL()\n {\n return $this->finalURL;\n }", "public function get_url()\n {\n return $this->url;\n }", "function config_from_git($git_sources)\n{\n\tglobal $branch, $revision, $commit_url;\n\n\t// only run git stuff, if sources exist, are git and git cli is available\n\tif (@file_exists($git_sources.'/.git') && !exec(\"hash git 2>/dev/null\"))\n\t{\n\t\t$branch = trim(exec(\"cd $git_sources >/dev/null 2>&1 && git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e \\\"s/* \\(.*\\)/\\\\1/\\\"\"));\n\t\t$revision = exec(\"cd $git_sources >/dev/null 2>&1 && git rev-parse --short HEAD &2>/dev/null\");\n\t\t$matches = null;\n\t\tif (empty($commit_url) &&\n\t\t\t($remote = exec(\"cd $git_sources >/dev/null 2>&1 && git remote -v &2>/dev/null\")) &&\n\t\t\tpreg_match('/(git@github.com:|https:\\/\\/github.com\\/)(.*)\\.git/i', $remote, $matches))\n\t\t{\n\t\t\t$commit_url = 'https://github.com/'.$matches[2].'/commit/';\n\t\t}\n\t\t//error_log(__METHOD__.\"('$git_sources') branch='$branch', revision='$revision', commit_url='$commit_url'\");\n\t}\n\t// get revision from request\n\telseif (!empty($_REQUEST['revision']) && preg_match('/^[0-9a-f]+$/', $_REQUEST['revision']))\n\t{\n\t\t$revision = $_REQUEST['revision'];\n\t}\n}", "static public function getURL() {\n\t\treturn self::$url;\n\t}", "public function getUrl(): string\n {\n $query = $this->getQuery();\n return\n $this->getScheme() .\n '://' .\n $this->getHostAndPort() .\n $this->getRoot() .\n $this->getPath() .\n (!empty($query) ? '?' . http_build_query($query) : '');\n }", "public function get_url();", "protected function getUrl() {\r\n\t\treturn $this->url;\r\n\t}", "public function url() {\n return $this->info['url'];\n }", "public function getUrl(): string\n {\n return $this->url;\n }", "public function getUrl(): string\n {\n return $this->url;\n }", "public function get_ssh_url(): ?string;", "public function getUrl() : string\n {\n return $this->url;\n }", "public function getUrl() : string\n {\n return $this->url;\n }", "public static function getCloneUrl($module_name) {\n\n $module_path = conf::pathModules() . \"/$module_name\";\n if (!file_exists($module_path)) {\n common::echoStatus('NOTICE', 'y', \"module $module_name has no module source\");\n return false;\n }\n\n $command = \"cd $module_path && git config --get remote.origin.url\";\n $ret = common::execCommand($command, array('silence' => 1), 0);\n if ($ret == 0) {\n $git_url = shell_exec($command);\n return trim($git_url);\n }\n return false;\n }", "protected function getGitRevision() {}", "public function get_urlChannel () {\r\n\t\treturn $this->get_info()['author_url'];\r\n\t}", "abstract protected function getGitCommand(): string;", "public function getUrl() {\n return $this->get(self::URL);\n }", "public function GetURL() {\n\n return $this->URL;\n }", "public function url(): string\n {\n return $this->url;\n }", "public function url(): string\n {\n return $this->url;\n }", "public function getURL() {\n\t\treturn $this->url;\n\t}", "public function getURL() {\n return $this->apiURL . $this->endPoint . $this->storeID . $this->jsonFile;\n }", "public static function url(): string\n\t{\n\t\treturn static::$url;\n\t}", "public function getUrl(): string {\n\t\treturn $this->_url;\n\t}", "protected static function getGitDir() {\n\t\tif ( !self::$gitDir ) {\n\t\t\t$conf = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( \"MABS\" );\n\t\t\tself::$gitDir = $conf->get( Config::REPO );\n\t\t}\n\t\treturn self::$gitDir;\n\t}", "public function getUrl() {\n\t\treturn $this->url;\n\t}", "public function getUrl() {\n\t\treturn $this->url;\n\t}", "public function getUrl() {\n\t\treturn $this->url;\n\t}", "public function GetUrl() {\n return $this->url;\n }", "public function getUrl()\r\n\t{\r\n\t\treturn $this->url;\r\n\t}", "public function getUrl(): string {\n return $this->url;\n }", "public function getUrl() {\n\t\t$url = $this->getBaseUrl().$this->getBasePath().$this->getOperation();\n\t\t$params = http_build_query($this->getUrlParameters());\n\t\tif ($params) {\n\t\t\t$url .= '?'.$params;\n\t\t}\n\t\treturn $url;\n\t}", "protected function getUrl() {\n return $this->url;\n }", "public function getUrl()\n\t{\n\t\t$url = strtolower($this->_name);\n\t\t$url = str_replace(' ', '-', $url);\n\t\t$url = str_replace('&-', '', $url);\n\n\t\t# retrieves a sanitized url from the project name :3\n\t\treturn $this->getId() . DIRECTORY_SEPARATOR . $url;\n\t}", "public function url()\n {\n return $this->factory->getUrl($this->handle);\n }", "public function getUrl()\n\t{\n\t\treturn $this->url;\n\t}", "public function getUrl()\n\t{\n\t\treturn $this->url;\n\t}", "public function getUrl()\n\t{\n\t\treturn $this->url;\n\t}", "public function getUrl()\n\t{\n\t\treturn $this->url;\n\t}", "public function getUrl()\n\t{\n\t\treturn $this->url;\n\t}", "public function get_url()\n {\n return $this->_url;\n }", "public function get_url()\n {\n return $this->_url;\n }", "public function url()\n\t{\n\t\tif( $this->modified === false ) return $this->url;\n\t\telse\n\t\t{\n\t\t\t$url = $this->generateString();\n\t\t\treturn htmlentities( $url );\n\t\t}\n\t}", "public static function github()\n {\n return 'github';\n }", "public function getUrl()\n {\n return $this->_urlBuilder->getUrl();\n }", "public abstract function getURL();", "public function getUrl()\n {\n return rtrim(empty($this->_config['url']) ? self::URL : $this->_config['url'], '/') . '/';\n }", "public function getUrl(): string\n {\n return self::URL;\n }", "public function getUrl()\n {\n return WEB_SERVER_BASE_URL . '/badges/' . $this->data['id'];\n }", "public function getURL() { return $this->url; }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }", "public function getUrl()\n {\n return $this->url;\n }" ]
[ "0.86241466", "0.7903098", "0.74523854", "0.73158497", "0.6870565", "0.67854977", "0.675056", "0.6714888", "0.6662214", "0.6629114", "0.6623352", "0.66135496", "0.65533596", "0.6542594", "0.65313685", "0.65038073", "0.6503157", "0.6480044", "0.6426344", "0.6394495", "0.63870734", "0.6379639", "0.63789773", "0.63789773", "0.6363002", "0.6353388", "0.63146776", "0.6310874", "0.6310874", "0.6306059", "0.6291732", "0.62676054", "0.62624496", "0.6243073", "0.6225512", "0.6220117", "0.62188673", "0.62142676", "0.6212489", "0.619846", "0.6195273", "0.6193709", "0.61927104", "0.61867267", "0.61867267", "0.6182049", "0.6161312", "0.6161312", "0.61564684", "0.6153281", "0.6150563", "0.6147481", "0.61450773", "0.6143537", "0.6136141", "0.6136141", "0.6126285", "0.6116946", "0.6097556", "0.6095677", "0.60910565", "0.608295", "0.608295", "0.608295", "0.6074327", "0.60722256", "0.60707635", "0.6064451", "0.6058893", "0.60541093", "0.6044543", "0.6033581", "0.6033581", "0.6033581", "0.6033581", "0.6033581", "0.60282147", "0.60282147", "0.60154593", "0.60127664", "0.60091335", "0.60082614", "0.600648", "0.6003754", "0.59990346", "0.59958166", "0.59881836", "0.59881836", "0.59881836", "0.59881836", "0.59881836", "0.59881836", "0.59881836", "0.59881836", "0.59881836", "0.59881836", "0.59881836", "0.59881836", "0.59881836", "0.59881836" ]
0.7926891
1
Get the ssh URL
public function sshUrl() : string { return sprintf( '%s@%s', $this->projectName(), $this->getOrError('frb_zone') ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_ssh_url(): ?string;", "protected function getSshUrl()\n {\n if (!$this->environment) {\n throw new \\Exception(\"No environment selected\");\n }\n\n if (!isset($this->environment['_links']['ssh']['href'])) {\n $id = $this->environment['id'];\n throw new \\Exception(\"The environment $id does not have an SSH URL. There may be an operation in progress.\");\n }\n\n $sshUrl = parse_url($this->environment['_links']['ssh']['href']);\n $host = $sshUrl['host'];\n $user = $sshUrl['user'];\n\n return $user . '@' . $host;\n }", "public function getRemoteUrl();", "protected function getRemoteScmUrl()\n {\n $scm = $this->getScm();\n $url = '';\n if ($scm->getUsername())\n {\n $url .= $scm->getUsername().'@';\n }\n $url .= $scm->getHost();\n if ($scm->getPort())\n {\n $url .= ':'.$scm->getPort();\n }\n $url .= $scm->getPath();\n return $url;\n }", "protected function getRemoteServerUrl(){\n return rtrim(@$this->params['server']);\n }", "public function get_url(){\n\n\t\t\treturn $this->api_urls['giturl'];\n\n\t\t}", "private function getJenkinsUrl()\n {\n $jenkins_location = $this->app['config']['jenkins']['location'];\n $jenkins_user = $this->app['config']['jenkins']['api_user'];\n $jenkins_token = $this->app['config']['jenkins']['api_token'];\n\n $jenkins_protocol = 'http';\n $jenkins_host = $jenkins_location;\n\n if(preg_match('/^(.*):\\/\\/(.*)$/', $jenkins_location, $matches)) {\n $jenkins_protocol = $matches[1];\n $jenkins_host = $matches[2];\n }\n\n $jenkins_host = rtrim($jenkins_host, '/') . '/';\n\n $jenkins_http_auth_string = '';\n if(!empty($jenkins_user) && !empty($jenkins_token)) {\n $jenkins_http_auth_string = $jenkins_user . ':' . $jenkins_token . '@';\n }\n\n $jenkins_url = $jenkins_protocol . '://' . $jenkins_http_auth_string . $jenkins_host;\n\n return $jenkins_url;\n }", "public function getFullUrl()\r\n {\r\n return $this->hostname . '.' . $this->owner->username . '.' . Yii::app()->params['serverBaseHost'];\r\n }", "public function getUrl()\n {\n return $this->scheme . '://' . $this->host . ':' . $this->port . '/' . trim($this->path, '/');\n }", "protected function _getUrl()\n {\n $s = empty($_SERVER['HTTPS']) ? '' : ($_SERVER['HTTPS'] == 'on') ? 's' : '';\n\n $protocol = substr(strtolower($_SERVER['SERVER_PROTOCOL']), 0, strpos(strtolower($_SERVER['SERVER_PROTOCOL']), '/')) . $s;\n\n $port = ($_SERVER['SERVER_PORT'] == '80') ? '' : (':'.$_SERVER['SERVER_PORT']);\n\n return $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];\n }", "public function getServerUrl() {\n return $this->conn->getServerUrl();\n }", "public function getURL(): string\n {\n return $this->http->getURL();\n }", "public function get_url(): string\n {\n return $this->get_url_internal();\n }", "public function getRemoteHomePath() {\n return @$this->attributes['remote_home_path'];\n }", "protected function getRemoteMinerUrl(){\n $minerUrl=trim(@$this->params['minerUrl'],'/');\n return $this->getRemoteServerUrl().($minerUrl!=''?'/'.$minerUrl:'');\n }", "protected function getUrl()\n {\n if (!empty($this->info['url'])) {\n return $this->info['url'];\n }\n }", "public function getHost(): string;", "public function getSshPort() : string {\n return $this->sshPort;\n }", "public static function getHostUrl() : String{\n $protocol = stripos($_SERVER['SERVER_PROTOCOL'],'https') === true ? 'https://' : 'http://';\n $host = $_SERVER['HTTP_HOST'];\n $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n\n return \"$protocol$host$uri\";\n }", "private function course_bank_get_hosturl() {\n\n if (isset($this->hosturl)) {\n return $this->hosturl;\n }\n\n // Defaults.\n $scheme = 'http://';\n $host = rtrim(trim($this->get_config()->url), '/');\n $port = '';\n $path = '';\n\n // Parse URL from the config.\n $parsedurl = parse_url($this->get_config()->url);\n\n // Get scheme: http or https.\n if (isset($parsedurl['scheme'])) {\n $scheme = $parsedurl['scheme'] . '://';\n }\n // Get host.\n if (isset($parsedurl['host'])) {\n $host = $parsedurl['host'];\n }\n // Get port.\n if (isset($parsedurl['port'])) {\n $port = ':' . $parsedurl['port'];\n }\n // Get path only if host is set.\n if (isset($parsedurl['path']) and isset($parsedurl['host'])) {\n $path = $parsedurl['path'];\n }\n\n $this->hosturl = $scheme . $host . $port . $path;\n\n return $this->hosturl;\n }", "public function get_url () {\r\n\t\treturn $this->url;\r\n\t}", "public function getInstanceUrl(): string\n {\n return $this->instanceUrl;\n }", "public function getHostUrl()\n {\n $uri = $this->request->getUri();\n $host = $uri->getHost();\n $port = $uri->getPort();\n $result = $this->isSecure() ? 'https://' : 'http://';\n $result .= (empty($port)) ? $host : $host . \":\" . $port;\n return $result;\n }", "protected function getUrl(): string\n {\n return $this->url;\n }", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public function get_url() {\n\t\treturn $this->url;\n\t}", "public function getServerUrl() {\n $host = $this->getHeader(Header::HEADER_HOST);\n if (!$host) {\n $host = 'localhost';\n }\n\n if ($this->isSecure) {\n return 'https://' . $host;\n }\n\n return 'http://' . $host;\n }", "public function url()\n {\n return $this->factory->getUrl($this->handle);\n }", "public function get_github_url() {\n\t\treturn $this->get_meta( 'github_url' );\n\t}", "protected function getUrl() {\r\n\t\treturn $this->url;\r\n\t}", "protected function _getURL()\n {\n $s = empty($_SERVER[\"HTTPS\"]) ? '' : ($_SERVER[\"HTTPS\"] == \"on\") ? \"s\" : \"\";\n\n $protocol = substr(\n strtolower($_SERVER[\"SERVER_PROTOCOL\"]), 0, strpos(strtolower($_SERVER[\"SERVER_PROTOCOL\"]), \"/\")\n ) . $s;\n\n $port = ($_SERVER[\"SERVER_PORT\"] == \"80\") ? \"\" : (\":\".$_SERVER[\"SERVER_PORT\"]);\n\n return $protocol.\"://\".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];\n }", "public function get_url();", "public function getRemote()\n {\n return $this->remote;\n }", "final public function getHost(): string {}", "public function getUrl() {\n return $this->get(self::URL);\n }", "public function getUrl(){\n return $this->server->getUrl() . \"/\" . $this->name;\n \n }", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "function getHost() {\r\n\r\n $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != \"on\")\r\n ? 'http'\r\n : 'https';\r\n $url = $scheme . '://' . $_SERVER['HTTP_HOST'];\r\n\r\n return $url;\r\n\r\n }", "public function gitUrl() : string\n {\n return sprintf(\n '%s@%s:%s.git',\n $this->projectName(),\n $this->getOrError('frb_zone'),\n $this->projectName()\n );\n }", "public function get_url()\n {\n return $this->url;\n }", "public function getUrl() {\n\t\treturn $this->siteURL;\n\t}", "public function getHost() {}", "public function getHost() {}", "public function getUrl(): string {\n\t\treturn $this->_url;\n\t}", "public function getUrl(): string\n {\n return $this->url;\n }", "public function getUrl(): string\n {\n return $this->url;\n }", "public function getUrl() : string\n {\n return $this->url;\n }", "public function getUrl() : string\n {\n return $this->url;\n }", "public function getURL();", "public function getURL();", "public function getPublicTunnelBaseUrl(SourceInstance $instance)\n {\n return $this->tunnelService->getEndpoint($instance)->getPublicBaseUrl();\n }", "protected function getHost() {\n\t\treturn ($this->router->getParam('HTTPS') ? 'https' : 'http') . '://' . $this->router->getParam('HTTP_HOST');\n\t}", "public function getHost(): string\r\n {\r\n return $this->host;\r\n }", "private function getDestinationUrl()\n {\n if (!empty($this->options->cloneHostname)) {\n return $this->options->cloneHostname;\n }\n\n return trailingslashit(get_site_url()) . $this->options->cloneDirectoryName;\n }", "public function getRemote();", "public function url() {\n return $this->info['url'];\n }", "public function getSiteURL()\n {\n return $this->config->get('site.url').$this->config->get('site.dir');\n }", "protected function getUrl() {\n return $this->url;\n }", "public static function _url() {\n\t\treturn self::pw('pages')->get('pw_template=mpm')->url;\n\t}", "public function getUrl()\n {\n if ($this->urlPartsModified) {\n $scheme = $this->getScheme();\n $host = $this->getHost();\n $port = $this->getPort();\n #$user = isset($parsed_url['user']) ? $parsed_url['user'] : '';\n #$pass = isset($parsed_url['pass']) ? ':' . $parsed_url['pass'] : '';\n #$pass = ($user || $pass) ? \"$pass@\" : '';\n $path = $this->getPath();\n $query = !empty($this->urlParts['query']) ? '?' . $this->urlParts['query'] : '';\n\n if ($scheme == 'http' && $port != 80) {\n $port = ':' . $port;\n } else if ($scheme == 'https' && $port != 443) {\n $port = ':' . $port;\n }\n\n $this->url = \"$scheme://$host$port$path$query\";\n }\n\n return $this->url;\n }", "function getUrl() {\n\t\treturn $this->repoObj->lobUrltitle;\n\t}", "public function getMirrorUrl() {\n\t\t$mirror = $this->getMirror();\n\t\t$mirrorUrl = $mirror['host'] . $mirror['path'];\n\t\treturn 'http://' . $mirrorUrl;\n\t}", "public function get_url()\n {\n return $this->_url;\n }", "public function get_url()\n {\n return $this->_url;\n }", "public function getURL ();", "public function getHost()\n {\n return $this->get('host');\n }", "public function getUrl()\r\n\t{\r\n\t\treturn $this->url;\r\n\t}", "public function getUrl() {\n\t\treturn $this->url;\n\t}", "public function getUrl() {\n\t\treturn $this->url;\n\t}", "public function getUrl() {\n\t\treturn $this->url;\n\t}", "public function getHost(): string {\n return $this->host;\n }", "public static function host(string $url) : string\n\t{\n\t\t$url = trim($url);\n\t\tif (!self::isSSH($url)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$protocolIndex = strpos($url, '://');\n\t\tif ($protocolIndex !== false) {\n\t\t\t$url = substr($url, $protocolIndex + 3);\n\t\t}\n\n\t\t$parts = explode('/', $url);\n\t\t$host = array_shift($parts);\n\n\t\t// user@domain\n\t\t$splits = explode('@', $host);\n\t\tif (count($splits) === 2) {\n\t\t\t$host = $splits[1];\n\t\t}\n\n\t\t// domain.com:port\n\t\t$splits = explode(':', $host);\n\t\tif (count($splits) === 2) {\n\t\t\t$host = $splits[0];\n\t\t}\n\n\t\treturn $host;\n\t}", "public function getSshUsername() : string {\n return $this->sshUser;\n }", "public function getHost()\n {\n return $this->getConfig('host');\n }", "public function getGetUrl()\n {\n $scheme = empty($this->rowUrl[\"scheme\"]) ? \"http://\" : $this->rowUrl[\"scheme\"] . \"://\";\n\n $user = empty($this->rowUrl[\"user\"]) ? \"\" : $this->rowUrl[\"user\"];\n $pass = empty($this->rowUrl[\"pass\"]) ? \"\" : $this->rowUrl[\"pass\"];\n\n if (!empty($pass)) $user .= \":\";\n if (!empty($user) || !empty($pass)) $pass .= \"@\";\n\n $host = $this->rowUrl[\"host\"];\n $port = empty($this->rowUrl[\"port\"]) ? \"\" : \":\" . $this->rowUrl[\"port\"];\n\n $path = empty($this->rowUrl[\"path\"]) ? \"\" : $this->rowUrl[\"path\"];\n\n $urlquery = \"\";\n if (count($this->getParams) > 0)\n {\n $urlquery = \"?\" . http_build_query($this->getParams);\n }\n return $scheme . $user . $pass . $host . $port . $path . $urlquery;\n }", "public function url(): string\n {\n return $this->url;\n }", "public function url(): string\n {\n return $this->url;\n }", "public function tunnelifyUrl(SourceInstance $instance, $url='')\n {\n return $this->tunnelService->getEndpoint($instance)->generatePublicUrl($url);\n }", "public function getUrl()\n\t{\n\t\treturn $this->url;\n\t}", "public function getUrl()\n\t{\n\t\treturn $this->url;\n\t}", "public function getUrl()\n\t{\n\t\treturn $this->url;\n\t}", "public function getUrl()\n\t{\n\t\treturn $this->url;\n\t}", "public function getUrl()\n\t{\n\t\treturn $this->url;\n\t}", "public function getHost(): string\n {\n return $this->configuration[ConfigurationInterface::HOST];\n }", "public function getUrl(): string\n {\n $query = $this->getQuery();\n return\n $this->getScheme() .\n '://' .\n $this->getHostAndPort() .\n $this->getRoot() .\n $this->getPath() .\n (!empty($query) ? '?' . http_build_query($query) : '');\n }", "protected function url()\n\t{\n\t\treturn Phpfox::getLib('url');\t\n\t}", "public function get_http_url()\n {\n $parts = parse_url($this->http_url);\n\n $port = @$parts['port'];\n $scheme = $parts['scheme'];\n $host = $parts['host'];\n $path = @$parts['path'];\n\n $port or $port = ($scheme == 'https') ? '443' : '80';\n\n if (($scheme == 'https' && $port != '443')\n || ($scheme == 'http' && $port != '80')) {\n $host = \"$host:$port\";\n }\n\n return \"$scheme://$host$path\";\n }", "private function getSystemUrl() : string {\n\n\t\t\tif (empty($_SERVER['HTTP_HOST'])) return CONFIG_SYSTEM_URL;\n\n\t\t\treturn ((Request::isSecure() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST']);\n\t\t}", "public function getMirrorUrl() {}", "public function getHost() {\n return $this->getConfig('host', $this->defaults['host']);\n }", "public function getAccessUrl(GitRepository $repository) {\n $serverName = $_SERVER['SERVER_NAME'];\n $user = UserManager::instance()->getCurrentUser();\n return $user->getUserName() .'@'. $serverName .':/gitroot/'. $repository->getProject()->getUnixName().'/'.$repository->getName().'.git';\n }", "public function getUrl()\n {\n return rtrim(empty($this->_config['url']) ? self::URL : $this->_config['url'], '/') . '/';\n }", "public function getHost()\n {\n $host = $this->getHostname();\n\n return sprintf('http%s://%s', ($this->isSSL() ? 's' : ''), $host);\n }", "public function getUrl()\n\t{\n\t\treturn $this->_url;\n\t}", "public function getUrl(): string {\n return $this->url;\n }" ]
[ "0.8100977", "0.8047871", "0.7397919", "0.72392666", "0.6947042", "0.6751836", "0.6653497", "0.6477147", "0.6472667", "0.64135295", "0.6401171", "0.6389541", "0.63601196", "0.6350533", "0.63182867", "0.62878364", "0.62715006", "0.6246647", "0.6246022", "0.6243251", "0.624186", "0.6232074", "0.62259257", "0.62232167", "0.62211776", "0.62211776", "0.6216508", "0.620859", "0.62006813", "0.61813736", "0.6154155", "0.61447287", "0.6143332", "0.6138149", "0.61353886", "0.613462", "0.61287487", "0.61287487", "0.61287487", "0.61287487", "0.61287487", "0.61287487", "0.6127831", "0.61194295", "0.6113957", "0.61132735", "0.6108311", "0.6108311", "0.61019397", "0.60991883", "0.60991883", "0.6092961", "0.6092961", "0.60778904", "0.60778904", "0.60777664", "0.6076946", "0.60766613", "0.6074683", "0.6073885", "0.60736305", "0.6072274", "0.6062472", "0.6061875", "0.6058158", "0.6055877", "0.60295296", "0.60267216", "0.60267216", "0.6021136", "0.601168", "0.60111666", "0.60045373", "0.60045373", "0.60045373", "0.59999293", "0.5994377", "0.59937197", "0.59889823", "0.5988926", "0.5986432", "0.5986432", "0.59855294", "0.59749454", "0.59749454", "0.59749454", "0.59749454", "0.59749454", "0.59726506", "0.5966146", "0.5960851", "0.5960464", "0.5959563", "0.5957755", "0.5955728", "0.5953317", "0.5953228", "0.5946279", "0.59454125", "0.5934859" ]
0.7429286
2
Get the fortrabbit remote name
public function fortrabbitRemoteName() : string { return 'frb-' . $this->environment(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getName(): string\n {\n return 'centreon_configuration_remote';\n }", "public function getRemoteAddress()\n {\n return stream_socket_get_name($this->socket, true);\n }", "public function getReceiverName()\n {\n return $this->get(self::_RECEIVER_NAME);\n }", "public function get_id() {\n return 'remote';\n }", "public function getName()\n {\n return 'travelbase.getHost';\n }", "public function getRemote();", "public function getOrigBrokerName() {}", "public function getName():string\n\t{\n\t\treturn $this->channelName;\n\t}", "public function getRemoteAddress()\n {\n return $this->getKey('RemoteAddress');\n }", "public function getRemoteIdentifier()\n {\n if (array_key_exists(\"remoteIdentifier\", $this->_propDict)) {\n return $this->_propDict[\"remoteIdentifier\"];\n } else {\n return null;\n }\n }", "public function getPeerName()\n {\n return $this->peerName;\n }", "public function getHostName()\n {\n return $this->_hostName;\n }", "public function clientGetname() {\n return $this->returnCommand(['CLIENT', 'GETNAME']);\n }", "function getHostName() {\n\t\treturn $this->hostInfo[0]['dc'][0];\n\t}", "public function getIncomingMailServerDisplayName() {\n\t\treturn $this->ic_mail_server_displayname;\n\t}", "public function getDeviceName() { \n if ($this->name) {\n return $this->name; \n }\n if (is_array($this->rawData)) {\n $this->name = $this->rawData[\"host name\"];\n if (!$this->name) { \n $this->name = $this->rawData[\"имя хоста\"];\n }\n }\n return $this->name;\n }", "public static function getCliName();", "public function getName() {\n\t\treturn $this->selectedEndpoint['name'];\n\t}", "function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}", "public function hostname() {\n $host = $this->client(\"origin\")?? $this->client(\"host\")?? $this->uri(\"host\");\n $host = parse_url($host);\n\n return $host[\"host\"]?? $host[\"path\"];\n }", "public function getHost(): string\n {\n return (string)$this->getEnvKey('SERVER_NAME');\n }", "static function Name()\n {\n return self::Variable('SERVER_NAME');\n }", "protected function getOriginName()\n {\n return $this->container->getParameter('tenside.self_update.origin_name');\n }", "public function getNomConnecter()\n\t{\n\n\t\treturn $this->nom;\n\t}", "public function getVhost(): string\n {\n }", "public function getGearmanHost() : string\n {\n return $this->gearmanHost;\n }", "public function getNickname(): string {\n return $this->nickname;\n }", "public function getAcquiaHostedMachineName() {\n $sub_data = $this->config('acquia_connector.settings')->get('subscription_data');\n\n if ($this->checkAcquiaHosted() && $sub_data) {\n $uuid = new StatusController();\n $sub_uuid = str_replace('-', '_', $uuid->getIdFromSub($sub_data));\n\n return $sub_uuid . '__' . $_SERVER['AH_SITE_NAME'];\n }\n }", "public function getFromName() : string {\n return $this->_fromName;\n }", "public function getRemote()\n {\n return $this->remote;\n }", "public function get_nameChannel () {\r\n\t\treturn $this->get_info()['author_name'];\r\n\t}", "public function clientNickname()\n {\n return $this->bean->client()->nickname;\n }", "function getFromName(){\n\t\t\treturn $this->from_name;\n\t\t}", "public function getGiftcardSenderName();", "public function getCustomNetHost() {\n return (string) $this->getValue('customnethost');\n }", "function title_hostname()\n {\n $port = config('srcds', 'port');\n if (!$port || $port == config('valve', 'default_port', '27015')) {\n $hostname = config('srcds', 'hostname');\n } else {\n $hostname = config('srcds', 'hostname') . \":$port\";\n }\n return $hostname;\n }", "public function getName() : string\n {\n return $this->url;\n }", "public function getHost(): string\n {\n return $this->configuration[ConfigurationInterface::HOST];\n }", "public function getNomeServidor()\n {\n return $this->nome_servidor;\n }", "public function getHost(): string;", "public function getFromName()\n\t{\n\t\treturn $this->from_name;\n\t}", "public function name()\n {\n $response = SubstrateBase::APIHandler('system_'.__FUNCTION__);\n $this->_name = $response['result'];\n return response()->json($this->_name);\n }", "public function getName()\n {\n return 'Deploy via remote cached git repository [built-in]';\n }", "public function getSenderName()\n {\n return $this->get(self::_SENDER_NAME);\n }", "public function get_hostname() {\n\t\treturn $this->hostname;\n\t}", "public function getHost() {\n\t\treturn $this->netxHostname;\n\t}", "public function getNickname()\n {\n return $this->nickname;\n }", "public function getNickname()\n {\n return $this->nickname;\n }", "public function getNickname()\n {\n return $this->nickname;\n }", "public function getNickname()\n {\n return $this->nickname;\n }", "public function getNickname()\n {\n return $this->nickname;\n }", "function getInternetName() {\n\n // get the full computer name of the current object (for instance : forge.indepnet.net)\n return self::getInternetNameFromLabelAndDomainID($this->fields[\"name\"],\n $this->fields[\"fqdns_id\"]);\n }", "public function getHost(): string\n {\n return (string) $this->host;\n }", "function getUserName() {\n return $this->userName . \".guest\";\n }", "public function getSshUsername() : string {\n return $this->sshUser;\n }", "protected function generateMachineName() {\n return $this->args['machine_name'];\n }", "public function getHost(): string {\n return $this->context->host;\n }", "public function getHost(): string\r\n {\r\n return $this->host;\r\n }", "public function getResourceMachineName();", "public function getBotName()\n {\n return $this->_botName;\n }", "public function getNickname() {\n return $this->nickname;\n }", "protected function getRemoteServerUrl(){\n return rtrim(@$this->params['server']);\n }", "final public function getHostname() {\n \t\treturn $this->host;\n }", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getHost();", "public function getRealname()\n {\n return $this->realname;\n }", "public function remoteBranch() : string\n {\n return (string) $this->getOrError('remote_branch');\n }", "function getRemoteField(){\n\t\treturn $this->remote_field;\n\t}", "protected function getCurrentOwner(): string\n {\n return $this->redis->get($this->name);\n }", "public function sshUrl() : string\n {\n return sprintf(\n '%s@%s',\n $this->projectName(),\n $this->getOrError('frb_zone')\n );\n }", "public function hostname()\n {\n return $this->globals->server()[\"SERVER_NAME\"];\n }", "public function getNickname()\n {\n return $this->_nickname;\n }", "public function getHostname()\n {\n return $this->get(self::HOSTNAME);\n }", "public function getHost() {}", "public function getHost() {}", "public static function get_hostname() {\n\t\treturn '';\n\t}", "public function getHOSTNAME()\n {\n return $this->HOSTNAME;\n }", "public function getInstanceName(): string\n {\n return $this->instanceName;\n }", "public function getName(){\n return $this->game->get_current_turn()->ReturnName();\n }", "public function gethostname()\n\t{\n\t\t// PHP appears to shell directly out to the system `hostname`\n\t\t// ...which differs in implementation between distros\n\t\t// The -f option ensures the FQDN is returned\n\t\t// NOTE: This may encounter issues with lxc when the hostname is not set properly\n\t\treturn \\trim($this->shell_exec('hostname -f'));\n\t}", "public function get_name() {\n return \\enrol_oes_string::display('sync_taskname');\n }", "public function getHost(): string {\n return $this->host;\n }", "public function getHostname()\n {\n return $this->hostname;\n }", "public function getHostname()\n {\n return $this->hostname;\n }", "public function getHostname()\n {\n return $this->hostname;\n }", "public function getPortName()\n {\n return isset($this->port_name) ? $this->port_name : '';\n }", "public function getPortName()\n {\n return isset($this->port_name) ? $this->port_name : '';\n }", "public function getname(){\n \t//return $this->msg;\n \treturn $this->phone;\n }", "public function getQueueName();", "function _gethostname($id)\n{\n\t$hostname = '';\n\t$_GET['file'] = 'server.cfg';\n\t$data = getfile($id);\n\t\n\tif ( $find = stristr($data, 'sv_hostname') )\n\t{\n\t\t$find = str_split(substr($find, 11, strlen($find) - 11) );\n\t\t$chr = '';\n\t\twhile ($chr != \"\\n\")\n\t\t{\n\t\t\tif ($chr = next($find))\n\t\t\t\t$hostname .= $chr;\n\t\t\telse\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn _getcolorname($hostname);\n}", "final public function getHost(): string {}", "function socket_human($socket, $remote = FALSE)\n {\n $host = '';\n $port = 0;\n $remote ? socket_getpeername($socket, $host, $port)\n : socket_getsockname($socket, $host, $port);\n return \"${host}:${port}\";\n }", "public function getMachineName()\n {\n return $this->machineName;\n }", "function getServerName() {\n\t\treturn $this->getParam(self::PARAM_SERVER_NAME);\n\t}", "public function getName() {\n\n list(,$name) = URLUtil::splitPath($this->principalInfo['uri']);\n return $name;\n\n }", "public function getName(): string\n {\n return session_name();\n }" ]
[ "0.63912964", "0.6318805", "0.62839437", "0.61415905", "0.60348165", "0.601217", "0.60069597", "0.5983146", "0.5963327", "0.5961428", "0.5937357", "0.5915767", "0.5899417", "0.5898476", "0.5893659", "0.5887986", "0.5887931", "0.5878322", "0.5876887", "0.5869484", "0.58655125", "0.58468276", "0.58232176", "0.5819744", "0.58188015", "0.5808551", "0.58059466", "0.5793012", "0.57902634", "0.57853514", "0.57612413", "0.5745988", "0.5738648", "0.5732611", "0.5722059", "0.5720794", "0.5708211", "0.569309", "0.5692343", "0.568359", "0.5658045", "0.565374", "0.5653384", "0.5648773", "0.5645677", "0.56316435", "0.5627263", "0.5627263", "0.5627263", "0.5627263", "0.5627263", "0.5622796", "0.56218076", "0.5621593", "0.5608836", "0.56070584", "0.56028557", "0.5594782", "0.5592063", "0.55885994", "0.5587956", "0.5586502", "0.55864805", "0.5585653", "0.5585653", "0.5585653", "0.5585653", "0.5585653", "0.5585653", "0.5581687", "0.55793375", "0.55668896", "0.55650544", "0.55619824", "0.55619526", "0.55565137", "0.555344", "0.55520535", "0.55520535", "0.55459803", "0.5534598", "0.5532237", "0.55311626", "0.5530979", "0.5526736", "0.55245805", "0.5523469", "0.5523469", "0.5523469", "0.55197316", "0.55197316", "0.55154794", "0.5513147", "0.5508673", "0.550735", "0.550348", "0.5497662", "0.5493982", "0.5492277", "0.54892117" ]
0.80864376
0
Get the remote web root path
public function remoteWebRootPath(string $path = null) : string { $root = sprintf('/srv/app/%s/htdocs', $this->projectName()); return $path ? "$root/$path" : $root; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getWebRoot() {}", "protected function getWebRoot() {}", "public function getWebRoot() {\n return $GLOBALS['registry']->config[\"siteUrl\"];\n }", "private static function getWebRoot() {\n if (file_exists(realpath(__DIR__ . '/../../../../../public_html'))) {\n return self::addlSash(\"public_html\");\n } else {\n return self::addlSash(\"web\");\n }\n }", "function sloodle_get_web_path()\n {\n // Check for the protocol\n if (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') $protocol = \"http\";\n else $protocol = \"https\";\n // Get the host name (e.g. domain)\n $host = $_SERVER['SERVER_NAME'];\n // Finally, get the script path/name\n $file = $_SERVER['SCRIPT_NAME'];\n \n return $protocol.'://'.$host.$file;\n }", "function base_path() {\n return (new Server)->get('DOCUMENT_ROOT');\n }", "public static function getSiteRoot() {\n if (strtolower($_SERVER['SERVER_NAME'])=='www.palmettonewmedia.com') {\n return Config::getHTTPS() . '://www.palmettonewmedia.com/foodfinder';\n }\n else {\n return Config::getHTTPS() . '://' . $_SERVER['SERVER_NAME'];\n }\n }", "function getBaseUrl()\n{\n $doc_root_folders = utf8_explode(\"/\", $_SERVER['DOCUMENT_ROOT']);\n $cwd__folders = utf8_explode(\"/\", getcwd());\n //the difference between those is the path from doc root to the folder where\n //all files for this URI reside\n $path_from_doc_root = implode(\"/\", array_diff($cwd__folders, $doc_root_folders));\n return $_SERVER['HTTP_HOST'].'/'.$path_from_doc_root;\n}", "public static function getCoreRoot() {\n if (strtolower($_SERVER['SERVER_NAME'])=='www.palmettonewmedia.com') {\n return Config::getHTTPS() . '//www.palmettonewmedia.com/foodfinder/core';\n }\n else {\n return Config::getHTTPS() . '://' . $_SERVER['SERVER_NAME'] . '/core';\n }\n }", "protected function getWebRoot()\n {\n return trim($this->web_root, \"/\");\n }", "public function determineBaseUrl()\n {\n // why this works at all :)\n return dirname($_SERVER['SCRIPT_NAME']);\n }", "public function baseUrl() {\n return dirname($_SERVER['PHP_SELF']) . '/';\n }", "public function getRemoteHomePath() {\n return @$this->attributes['remote_home_path'];\n }", "public function getWebroot() {\n return Yii::getAlias('@static') .DIRECTORY_SEPARATOR. 'web' .DIRECTORY_SEPARATOR.$this->module.DIRECTORY_SEPARATOR. $this->parent_id .DIRECTORY_SEPARATOR;\n }", "function get_root_url() {\n return \"http://\" . $_SERVER['HTTP_HOST'] . '/' . ROOT_PATH;\n }", "public function getWebroot() {\n return $this->webroot;\n }", "public function getWebPath()\n {\n }", "function site_url()\n {\n return getenv('ROOT');\n }", "public function getWebappPath();", "protected function getBasePath()\n {\n return $this->vfs()->url();\n }", "protected function getRootUrl()\n {\n return $this->appConfig->getRootUrl();\n }", "public function baseUrl()\n\t{\n\t\techo $_SERVER['SERVER_NAME'];\n\t}", "function getWebRoot()\n{\n $protocol = findProtocol();\n\n if (isset($_SERVER[\"HTTP_HOST\"])) {\n\n if (($_SERVER[\"HTTP_HOST\"] == \"127.0.0.1\" || $_SERVER[\"HTTP_HOST\"] == \"localhost\")) {\n $webroot = $protocol.$_SERVER['HTTP_HOST'].'/trackyourstats/';\n } else {\n $webroot = $protocol.$_SERVER['HTTP_HOST'].'/';\n }\n } else {\n $webroot = \"unknown\";\n }\n\n\n return $webroot;\n\n}", "public function root(): string\n {\n return rtrim($this->getSchemeAndHttpHost() . $this->getBaseUrl(), '/');\n }", "public function getServerRelativePath()\n {\n return $this->getProperty(\"ServerRelativePath\");\n }", "public function root()\n {\n if ($this['environment']->has('SCRIPT_FILENAME') === false) {\n throw new \\RuntimeException(\n 'The \"`\"SCRIPT_FILENAME\" server variable could not be found.\n It is required by \"Workbench::root()\".'\n );\n }\n\n return dirname($this['environment']->get('SCRIPT_FILENAME'));\n }", "function serendipity_httpCoreDir() {\n if (!empty($_SERVER['SCRIPT_FILENAME']) && substr(php_sapi_name(), 0, 3) != 'cgi') {\n return dirname($_SERVER['SCRIPT_FILENAME']) . '/';\n }\n\n if (!empty($_SERVER['ORIG_PATH_TRANSLATED'])) {\n return dirname(realpath($_SERVER['ORIG_PATH_TRANSLATED'])) . '/';\n }\n\n return $_SERVER['DOCUMENT_ROOT'] . dirname($_SERVER['PHP_SELF']) . '/';\n}", "public function getBaseURL() {\n $url = $_SERVER['SERVER_PORT'] == '443' ? 'https://' : 'http://';\n \n $url .= $_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']);\n \n return $url;\n }", "public function webPath();", "function getBaseUrl(){\n return $_SERVER['SERVER_NAME'];\n}", "static public function getRootPath() {\n\t\treturn Page::$base_path;\n\t}", "public function getPublicBasePath();", "public function getBaseUrl() {\r\n\t\treturn home_url();\r\n\t}", "function getSiteURL()\n\t{\n\t return JURI::root();\n\t}", "public static function getServiceRoot() {\n if (strtolower($_SERVER['SERVER_NAME'])=='www.palmettonewmedia.com') {\n return Config::getHTTPS() . '://www.palmettonewmedia.com/foodfinder/service';\n }\n else {\n return Config::getHTTPS() .'://' . $_SERVER['SERVER_NAME'] . '/service';\n }\n }", "public function getFolderWebRoot() : string\n {\n return $this->folderWebRoot;\n }", "public function getBaseURL(){\n\t\tif($this->htaccess){\n\t\t\treturn \"/\";\n\t\t}\n\t\treturn \"\";\n\t}", "public static function getServerDocroot() \n\t{\n\t\treturn MHTTPD::$config['Paths']['server_docroot'];\n\t}", "function getRootURI() {\n\t\treturn (implode('/', array_splice(explode('/', $_SERVER['SCRIPT_NAME']), 0, -1)) . '/');\n\t}", "public static function rootUrl() {\n\t\treturn self::$_scheme . self::$_host;\n\t}", "static function getSsoUrlRoot(){\n $url = '';\n if( \\Audit::instance()->url(self::getEnvironmentData('CCP_SSO_URL')) ){\n $url = self::getEnvironmentData('CCP_SSO_URL');\n }else{\n $error = sprintf(self::ERROR_CCP_SSO_URL, __METHOD__);\n self::getSSOLogger()->write($error);\n \\Base::instance()->error(502, $error);\n }\n\n return $url;\n }", "public static function getCoreServiceRoot() {\n if (strtolower($_SERVER['SERVER_NAME'])=='www.palmettonewmedia.com') {\n return Config::getHTTPS() . '://www.palmettonewmedia.com/foodfinder/core/service';\n }\n else {\n return Config::getHTTPS() .'://' . $_SERVER['SERVER_NAME'] . '/core/service';\n }\n }", "public function getWebPathname();", "public function get_base_url()\r\n\t\t{\r\n\t\t\t$url = \"http\";\r\n \t\t\tif ( isset( $_SERVER[ 'HTTPS' ] ) && $_SERVER[ 'HTTPS' ] == \"on\" ) $url .= \"s\";\r\n\t\t\t$url .= \"://\";\r\n \t\t\tif ( $_SERVER[ 'SERVER_PORT' ] != \"80\" )\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ]. \":\" . $_SERVER[ 'SERVER_PORT' ] . $_SERVER[ 'REQUEST_URI' ];\r\n\t\t\telse\r\n\t\t\t\t$url .= $_SERVER[ 'SERVER_NAME' ] . \"/\";\r\n\t\t\t\r\n\t\t\treturn $url . self::HOME_DIR;\r\n\t\t}", "public function getWebPath()\r\n {\r\n return null === $this->getPath() ? null : $this->getUploadDir().'/'.$this->getPath();\r\n }", "public static function getBaseUrl ()\r\n\t{\r\n\t\t# Obtain the value\r\n\t\t$baseUrl = dirname (substr ($_SERVER['SCRIPT_FILENAME'], strlen ($_SERVER['DOCUMENT_ROOT'])));\r\n\t\t\r\n\t\t# Convert backslashes to forwarded slashes if necessary\r\n\t\t$baseUrl = str_replace ('\\\\', '/', $baseUrl);\r\n\t\t\r\n\t\t# Deal with the special case of an application at top-level\r\n\t\tif ($baseUrl == '/') {$baseUrl = '';}\r\n\t\t\r\n\t\t# Return the value\r\n\t\treturn $baseUrl;\r\n\t}", "function rootSite() {\n // $dirname = preg_replace('/\\\\\\+/', '/', dirname(realpath($uri)));\n $dirname = preg_replace('/\\\\\\+/', '/', dirname($_SERVER['PHP_SELF']));\n if (substr($dirname, -1) == \"/\")\n $dirname = substr($dirname, 0, strlen($dirname) - 1); // remove / if it is there to be consistent for URL\n return $dirname;\n }", "function get_application_path()\n{\n $proto = \"http\";\n\n // Detect if we are running HTTPS or proxied HTTPS\n if (server('HTTPS') == 'on') {\n // Web server is running native HTTPS\n $proto = \"https\";\n } elseif (server('HTTP_X_FORWARDED_PROTO') == \"https\") {\n // Web server is running behind a proxy which is running HTTPS\n $proto = \"https\";\n }\n\n if( isset( $_SERVER['HTTP_X_FORWARDED_SERVER'] ))\n $path = dirname(\"$proto://\" . server('HTTP_X_FORWARDED_SERVER') . server('SCRIPT_NAME')) . \"/\";\n else\n $path = dirname(\"$proto://\" . server('HTTP_HOST') . server('SCRIPT_NAME')) . \"/\";\n\n return $path;\n}", "public function rootPath()\n {\n return public_path() . $this->helper->ds();\n }", "public function getWebappPath()\n {\n return $this->getServletConfig()\n ->getApplication()\n ->getWebappPath();\n }", "public function base_url() {\n\t\t$protocol = ( ! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? 'https' : 'http';\n\t\t$host = $_SERVER['HTTP_HOST'];\n\t\t$script = dirname($_SERVER['SCRIPT_NAME']);\n\t\treturn $protocol . '://' . $host . $script . '/';\n\t}", "private static function getCurentUrl()\r\n {\r\n return isset($_SERVER['PATH_INFO']) ? self::cleanUrl($_SERVER['PATH_INFO']) : '/';\r\n }", "public function getRootDir()\n {\n return $this->server['DOCUMENT_ROOT'];\n }", "function public_url() {\n return url(\"/\");\n }", "public static function getHostPath() {\r\n $t = explode('/', $_SERVER['SCRIPT_NAME']);\r\n array_pop($t);\r\n self::$hostPath = implode('/', $t) . '/';\r\n return self::$hostPath;\r\n }", "public function getSiteWebRoot() {\n \n return $this->siteWebRoot;\n \n }", "function baseUrl(){\n return sprintf(\n \"%s://%s\",\n isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http',\n $_SERVER['SERVER_NAME']\n );\n }", "protected function getRemoteServerUrl(){\n return rtrim(@$this->params['server']);\n }", "public static function getBaseUrl()\n {\n $baseUrl = url('/');\n return $baseUrl;\n }", "public function getWebPath()\n {\n return null === $this->path ? null : $this->getUploadDir().'/'.$this->path;\n }", "function getDocumentRoot(){\n\t\t$document_root = isset($_SERVER[\"DOCUMENT_ROOT\"]) ? $_SERVER[\"DOCUMENT_ROOT\"] : \"\";\n\t\t#get env variables under IIS\n\t\tif( !$document_root ){\n\t\t $sf = str_replace(\"\\\\\",\"/\",$_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t $sn = $_SERVER[\"SCRIPT_NAME\"];\n\t\t $document_root = str_replace( $sn, \"\", $sf );\n\t\t}\n\t\treturn $document_root;\n}", "function getWebsiteRootPath()\n {\n // Check that the absolute path to the current directory is accessible\n // (some webhosts denies access this way)\n if ( file_exists (FCPATH) ) {\n return FCPATH;\n } else {\n // Fake relative path by using subdirectory\n return 'js/../';\n }\n }", "function getBaseUrl() {\n\t$baseUrl = ($_SERVER['HTTP_HOST'] == 'development.grafikchaos.com') ? '/catchcod/' : '/';\n\treturn $baseUrl;\n}", "protected function getAbsoluteBasePath() {}", "public function getWebPath()\n {\n// ... $webPath being the full image URL, to be used in templates\n\n return $webPath;\n }", "public function getDocumentRoot()\n {\n $documentRoot = '';\n $normalized = $this->getNormalized();\n if (empty($normalized['web']['locations'])) {\n return $documentRoot;\n }\n foreach ($this->getNormalized()['web']['locations'] as $path => $location) {\n if (isset($location['root'])) {\n $documentRoot = $location['root'];\n }\n if ($path === '/') {\n break;\n }\n }\n\n return ltrim($documentRoot, '/');\n }", "public function baseUrl() \n\t{\n\t\treturn $this->baseUrl;\n\t}", "public static function baseUrl(): string\n\t{\n\t\treturn static::$baseUrl;\n\t}", "public function getBaseUrl() {\r\n\t\treturn $this->_storeManager->getStore()->getBaseUrl();\r\n\t}", "protected function rootPath()\n {\n return Pi::path('upload') . '/' . $this->getModule();\n }", "public function getHomeFolder()\n\t{\n\t\t$rootDirectory = $this->getOption('remote.root_directory');\n\t\t$rootDirectory = Str::finish($rootDirectory, '/');\n\t\t$appDirectory = $this->getOption('remote.app_directory') ?: $this->getApplicationName();\n\n\t\treturn $rootDirectory.$appDirectory;\n\t}", "function getBaseURI(){\n\t\n\treturn \"http://\" . $_SERVER[ 'HTTP_HOST' ] . dirname( $_SERVER[ 'PHP_SELF' ] );\n}", "public function getRemoteUrl();", "public function get_server_http_root()\n {\n\t\t$split = explode('.',$_SERVER['HTTP_HOST']);\n\t\t\n\t\t$root=$split[0];\n\t\t//makes it devbrad from just brad\n\t\tif( in_array($root,array('sam','ryan','brad'))) $root = \"dev\".$root;\n\t\t//else it is just stage or live, leave it alone\n\t\t\n\t\treturn \"endeavor/\".$root.\"/\";\n\t\t\n }", "public function getRootPath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_ROOT);\r\n\t}", "public function fullPath(){\n\t $this->path = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n\treturn $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n }", "public function getRoot(): string\n {\n return (string)$this->env['SCRIPT_NAME'];\n }", "public function get_root_path()\n\t{\n\t\treturn $this->ext_root_path;\n\t}", "function getBaseURL(){\n return \"http://\" . $_SERVER['HTTP_HOST'] . \"/eRevive\";\n}", "public static function getBaseUrl()\n {\n $protocol = isset($_SERVER['HTTPS']) ? 'https' : 'http';\n $url = $protocol . '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\n\n // cut at last '/' (we dont want to see index.php)\n return substr($url, 0, strrpos($url, '/'));\n }", "private function getBaseURL() {\n $pageURL = 'http';\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {\n $pageURL .= 's';\n }\n $pageURL .= '://';\n if ($_SERVER['SERVER_PORT'] !== '80') {\n $pageURL .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];\n } else {\n $pageURL .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];\n }\n $splitted = explode('?', $pageURL);\n if (substr($splitted[0], -1) === '/') {\n return $splitted[0];\n }\n\n return $splitted[0] . '/';\n }", "function webroot($path) {\n\t\tif (!$file = $this->file($path)) {\n\t\t\treturn null;\n\t\t}\n\n\t\tforeach ($this->_paths as $directory => $url) {\n\t\t\tif (strpos($file, $directory) !== false) {\n\t\t\t\tif ($url === false) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\t$path = str_replace($directory, $url, $file);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$path = str_replace('\\\\', '/', $path);\n\n\t\tif (strpos($path, '://') !== false) {\n\t\t\treturn $path;\n\t\t}\n\t\treturn $this->webroot . $path;\n\t}", "function curDirectory() {\n\t$current_dir_url = 'http';\n\tif ($_SERVER[\"HTTPS\"] == \"on\") {\n\t\t$pageURL .= \"s\";\n\t}\n\t\t$current_dir_url .= \"://\";\n\tif ($_SERVER[\"SERVER_PORT\"] != \"80\") {\n\t\t$current_dir_url .= $_SERVER[\"SERVER_NAME\"].\":\".$_SERVER[\"SERVER_PORT\"];\n\t} else {\n\t\t$current_dir_url .= $_SERVER[\"SERVER_NAME\"];\n\t}\n\t$current_dir_url .= dirname($_SERVER['PHP_SELF']);\n\treturn $current_dir_url;\n}", "public function basePath() {\n return $this\n ->getRequest()\n ->getBasePath();\n }", "public function getBasePath()\n {\n return $this->detectBasePath();\n }", "public function getAbsoluteURL(): string\n {\n return uri_join_host($this->public_path);\n }", "private function basePath(): string\n\t{\n\t\treturn rtrim((new RequestFactory)\n\t\t\t->fromGlobals()->url->basePath, '/');\n\t}", "public function getBaseUrl()\n {\n return $this->detectBaseUrl();\n }", "public static function getDocroot() \n\t{\n\t\treturn MHTTPD::$config['Paths']['docroot'];\n\t}", "public function getRootPath()\n {\n if(null === $this->_rootPath) {\n $url = parse_url(str_replace('/index.php/', '/', $this->storeManager->getStore()->getUrl($this->getRouteName(), ['_type' => \\Magento\\Framework\\UrlInterface::URL_TYPE_LINK])));\n $this->_rootPath = isset($url['path']) ? $url['path'] : '';\n }\n\n return $this->_rootPath;\n }", "function parcelcheckout_getRootPath()\n\t{\n\t\t$sRootPath = dirname(dirname(dirname(__FILE__)));\n\n\t\tif(strpos($sRootPath, '\\\\') !== false)\n\t\t{\n\t\t\t$sRootPath .= '\\\\';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sRootPath .= '/';\n\t\t}\n\n\t\treturn $sRootPath;\n\t}", "public function getRootPath()\n {\n return $this->root_path;\n }", "public static function getBaseUrl() {\n return substr($_SERVER[\"REQUEST_URI\"], 0, strrpos($_SERVER[\"REQUEST_URI\"], \"/\") + 1);\n }", "public function getBaseURL(): string {\n return $this->configVars['site']['base-url'];\n }", "public function getBaseUrl()\n\t\t{\n\t\t\treturn $this->base_url;\n\t\t}", "function this_dir_url() {\n $url = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';\n $url .= $_SERVER['SERVER_NAME'];\n $url .= $_SERVER['REQUEST_URI'];\n\n return dirname($url);\n}", "function getAppUrl() {\r\n\r\n $url = getHost() . getAppPath();\r\n\r\n return $url;\r\n\r\n }", "public static function getApplicationPath() \r\n {\r\n if (!isset(self::$appPath)) \r\n {\r\n switch ($_SERVER['HTTP_HOST']) {\r\n case 'localhost':\r\n self::$appPath = 'http://' . $_SERVER['HTTP_HOST'] . '/Progetto/';\r\n break;\r\n case 'spano.sc.unica.it':\r\n // configurazione pubblica\r\n self::$appPath = 'http://' . $_SERVER['HTTP_HOST'] . '/amm2015/meloniFabrizio/';\r\n break;\r\n default:\r\n self::$appPath = '';\r\n break;\r\n }\r\n }\r\n \r\n return self::$appPath;\r\n }", "protected function getBaseUrl()\n {\n $module_dir = '';\n if ($this->checkSecureUrl()) {\n $module_dir = _PS_BASE_URL_SSL_ ;\n } else {\n $module_dir = _PS_BASE_URL_ ;\n }\n return $module_dir;\n }", "public function getRootPath()\r\n\t{\r\n\t\treturn $this->rootPath;\r\n\t}" ]
[ "0.77411675", "0.7740465", "0.76115245", "0.7513576", "0.7496606", "0.74474025", "0.7446049", "0.7296086", "0.72723955", "0.7271457", "0.7233783", "0.7229771", "0.7198361", "0.7150619", "0.7141297", "0.7131257", "0.70751977", "0.70218146", "0.70200765", "0.7006111", "0.69904196", "0.6986049", "0.6984939", "0.6968426", "0.69667083", "0.69415426", "0.6931845", "0.6926322", "0.69126856", "0.6899767", "0.6895854", "0.6872254", "0.6866353", "0.6864314", "0.68617356", "0.6822576", "0.6818229", "0.68102527", "0.68060935", "0.6792964", "0.6782517", "0.6777937", "0.6770434", "0.676318", "0.675041", "0.6749065", "0.67476004", "0.6744762", "0.67447215", "0.6724078", "0.6722063", "0.6683183", "0.6669325", "0.6666698", "0.6662904", "0.6638702", "0.6634785", "0.66198695", "0.66114354", "0.660939", "0.6595694", "0.6586584", "0.6569677", "0.65684885", "0.65656036", "0.65639895", "0.6553592", "0.6544975", "0.65358925", "0.6533026", "0.652089", "0.6516096", "0.65124595", "0.6507985", "0.65025526", "0.6501657", "0.6494333", "0.6489132", "0.64864546", "0.6480815", "0.6476526", "0.6470448", "0.64474326", "0.64461565", "0.6443212", "0.64286494", "0.64275736", "0.64263576", "0.6423226", "0.6410278", "0.6407404", "0.6403068", "0.6402454", "0.63977903", "0.6397303", "0.63965815", "0.6393785", "0.6392394", "0.63907", "0.6387617" ]
0.6789256
40
/ | | Relation to Article |
public function article() { return $this->belongsTo('Article'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function article()\n {\n \treturn $this->belongsTo(Article::class);\n }", "public function article(){\n return $this->belongsTo('Corp\\Models\\Article');\n }", "public function article() {\n\n return $this->belongsTo('App\\Article');\n }", "public function article()\n {\n return $this->belongsTo(Article::class);\n }", "public function article()\n {\n return $this->hasMany(Article::class);\n }", "public function articles(){\n return $this->hasMany('Corp\\Models\\Article');\n }", "public function article(): BelongsTo{\n return $this->belongsTo(Article::class);\n }", "public function articles(){\n return $this->hasMany('\\App\\Article');\n }", "public function article()\n {\n return $this->belongsTo(Article::class, 'article_id');\n }", "public function getArticle()\n {\n return $this->hasOne(Article::className(), ['id'=>'article_id']);\n }", "public function article()\n {\n return $this->belongsTo('App\\Models\\Article\\Article', 'article_id');\n }", "public function articles() {\n return $this->hasMany('App\\Article');\n }", "public function articles()\n {\n return $this->hasMany('App\\Article');\n }", "public function articles(){\n return $this->hasMany(Article::class);\n }", "public function articles() {\n //hasMany representa la relacion de un a muchos\n return $this->hasMany(\"App\\Article\");\n }", "public function articles()\n {\n return $this->hasMany('App\\Article', 'author_id');\n }", "public function articles() \n {\n return $this->hasMany(Article::class);\n }", "public function articles(){ //establece la relacion entre modelos, en este caso 1 a muchos\n return $this -> hasMany('App\\Article');\n }", "abstract function relations();", "public function articles()\n {\n return $this->belongsToMany( 'App\\Article' );\n }", "public function getComment()\n{\n return $this->hasMany(Comment::className(), ['article_id' => 'id']);\n}", "public function articles()\n {\n return $this->hasMany(Article::class);\n }", "public function articles() {\n return $this->hasMany('Drstock\\Article','category_id');}", "public function executeArticleRelations()\n {\n $this->article = ArticlePeer::retrieveByPK($this->getRequestParameter('id'));\n }", "public function getTagArticles()\n{\n return $this->hasMany(\n TagArticles::className(), ['article_id' => 'id']\n );\n}", "public function articles()\n {\n return $this->hasMany('App\\Article', 'client_id', 'id');\n }", "public function author()\n {\n /// ManyToMany\n }", "public function getAuthorOfArticle() {\n // Because it infers from the METHOD NAME!\n\n return $this->belongsTo('App\\Models\\User', 'user_id');\n }", "public function articles() {\n // 1 articulo tiene muchos tag NOMBRE PLURAL\n return $this->belongsToMany('\\App\\Article')->withTimestamps();\n\n }", "public function getTags()\n{\n return $this->hasMany(Tags::className(), ['id' => 'tag_id'])\n ->viaTable('tag_articles', ['article_id' => 'id']);\n}", "public function articles()\n {\n return $this->hasMany('Article', 'category_id');\n }", "public function articles()\n\t{\n\t\treturn\t$this->belongsToMany('App\\Article')->withTimestamps();\n\t}", "protected static function _relations() {\n\n\t}", "public function getArticles();", "public function initialize() {\n $this->setSource('article');\n\n $this->belongsTo('author_id', Article::class, 'author_id', [\n 'alias' => 'author',\n 'reusable' => true,\n ]);\n\n $this->hasMany('article_id', ArticleTag::class, 'article_id', [\n 'alias' => 'tagRelation',\n ]);\n\n $this->hasMany('article_id', Comment::class, 'article_id', [\n 'alias' => 'comments',\n ]);\n }", "public function articles()\n {\n\n return $this->hasManyThrough('\\App\\Article', '\\App\\Subtopic', 'topic_id', 'subtopic_id');\n }", "function decorateWithAuthor($article) {\n global $authorArticleTable;\n\n createAuthorArticleTable();\n\n $article->authors = $authorArticleTable[$article->id];\n\n return $article;\n}", "public function article1()\n {\n return $this->hasOne('App\\ConferenceAsset', 'id', 'article1');\n }", "public function getArticles()\n\t{\n\t\treturn $this\n\t\t\t->hasMany(Article::className(), ['id'=>'article_id'])\n\t\t\t->viaTable('{{%article_article_category}}', ['article_category_id'=>'id']);\n\t}", "public function likes()\n {\n \treturn $this->hasMany(Like::class, 'article_id');\n }", "function setArticleAttribut($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n /* you can itentify the article with $object->reference->ShopId */ \n}", "public function __construct($article)\n {\n $this->article = $article;\n }", "public function index(): Relation;", "public function is_article();", "public function test_rel(){\n\t\t//$data1 = array('name'=>'jack','age'=>24);\n\t\t//$a->data($data1)->save();\n\n\t\t//$a = new article();\n\t\t//$a->data(array('title'=>'art1','content'=>'test'))->save();\n\t\t//$a = new user_article_author();\n\t\t//$a->data(array('user_id'=>1,'article_id'=>1,'status'=>'open'))->save();\n\t\t$a = new user_article_author();\n\t\t$b = $a->rel();\n\t\tdump ($b->where('user.user_id = 1')->select());\n\t\tdump($b->sql);\n\t}", "function userelation($relation) { atkuse(\"relation\" , $relation); }", "public function article2()\n {\n return $this->hasOne('App\\ConferenceAsset', 'id', 'article2');\n }", "public function executeRelateArticle()\n {\n //Get request parameters\n $first_article = $this->getRequestParameter('id');\n $second_article = $this->getRequestParameter('relate_article_select'); \n \n //Check credentials and paramters\n $this->forward404Unless($this->getRequest()->isXmlHttpRequest());\n $this->forward404Unless($this->getUser()->isAuthenticated()&&$this->getuser()->hasCredential('staff'));\n $this->forward404Unless($first_article&&$second_article); \n $user = $this->getUser()->getGuardUser()->getId();\n \n //Add relation\n ArticleArticleRelationPeer::addRelatedArticle($first_article, $second_article, $user);\n\n //Return updated relateArticles Component\n sfLoader::loadHelpers('Partial'); \n $article = ArticlePeer::retrieveByPK($first_article);\n \n return $this->renderText(get_component('articles', 'articleRelations', array('article'=> $article)));\n }", "public function updater_articles()\n {\n //return $this->hasOne('NationRegion','id','nation_region_id');\n return $this->hasMany('App\\Article','updated_user','id');\n }", "public function status()\n {\n return $this->belongsTo('App\\Models\\Article_Status');\n }", "public function getIdArticle()\n {\n return $this->idArticle;\n }", "public function users(){\n return $this->belongsToMany(User::class, 'user_article', 'article_id','user_id');\n }", "public function __construct($article)\n {\n $this->article = $article;\n }", "function getArticleObjects() \t{\n \t\treturn $this->articles;\n \t}", "public function comments(){\n return $this->hasMany('App\\Models\\Comments', 'article_id');\n }", "function getArticles() {\n global $db;\n $query = $db->query('SELECT * FROM article, auteur\n WHERE article.auteur_id = auteur.id ORDER BY article.id DESC');\n return $query->fetchAll();\n \n}", "public function getRelatedArticles(ArticleInterface $article, $locale, $limit = 6);", "public function getArticle()\n {\n return $this->belongsTo('App\\Models\\Article\\Archive','article_id')->withTrashed();\n }", "function project_project_modifier(&$node)\n {\n userelation(\"atkonetomanyrelation\");\n $node->add(new atkOneToManyRelation(\"user_stories\", \"xp.story\", \"project\", AF_HIDE_LIST), \"user_stories\");\n }", "public function setRelations() {}", "public function getIdArticle()\n {\n return $this->Id_article;\n }", "public function author() {\n return $this -> belongsToMany(Author::class);\n }", "public function author($id);", "function addContentObjectRelation( $FromObjectID, $FromObjectVersion, $ContentClassAttributeID, $ToObjectID )\n\t{\n\t\t$db =& eZDB::instance();\n\t\t\n\t\t//prevent sql injection\n $FromObjectID=(int) $FromObjectID;\n $ContentClassAttributeID=(int) $ContentClassAttributeID;\n $FromObjectVersion=(int) $FromObjectVersion;\n\t\t$ToObjectID=(int) $ToObjectID;\n\n\t\t$db->query( \"INSERT INTO ezcontentobject_link ( from_contentobject_id, from_contentobject_version, contentclassattribute_id, to_contentobject_id )\t\tVALUES ( '$FromObjectID', '$FromObjectVersion', '$ContentClassAttributeID', '$ToObjectID' )\" );\n\t}", "public function author()\n {\n return $this->belongsTo(Author::class);\n }", "public function author()\n {\n return $this->belongsTo(Author::class);\n }", "public function author()\n {\n return $this->belongsTo(Author::class);\n }", "public function articles()\n {\n return $this->morphedByMany('App\\Article', 'taggable');\n }", "public function referencedEntities();", "public function sons(): HasMany\n {\n return $this->hasMany(Article::class, 'parent_id', 'id');\n // ->with(['post'])->orderBy('pos');\n }", "function getRelatedArticle()\n\t{\n\t\t$id = $this->input->post('id');\n\t\t$keyword = $this->input->post('keyword');\n\t\t$response = $this->mapi->getRelatedArticle($id,$keyword);\n\n\t\techo json_encode($response);\n\t}", "public function article(): Response \n {\n $bdd_article = $this->getDoctrine()->getRepository(Article::class)->findAll();\n \n return $this->render('article/article.html.twig', [\n 'articles'=>$bdd_article\n ]);\n }", "public function show(article $article)\n {\n //\n }", "public function buildingArticles()\n {\n return $this->belongsTo('App\\Models\\Manage\\Content\\Building\\Service\\Articles\\TfBuildingArticles', 'articles_id', 'articles_id');\n }", "function setArticle($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "public function getArticleById($id){\n $requete_prepare = $this->connexion->prepare(\n \"SELECT *\n FROM Article\n WHERE id = :id\"\n );\n $requete_prepare->execute(array(\"id\"=>$id));\n\n $article = $requete_prepare->fetchObject(\"Article\");\n\n return $article;\n}", "public function getArticleId()\n {\n return $this->article_id;\n }", "function eZEnhancedObjectRelationType()\n {\n $this->eZDataType( EZ_DATATYPESTRING_ENHANCED_OBJECT_RELATION, ezi18n( 'kernel/classes/datatypes', \"Enhanced Object relation\", 'Datatype name' ),\n array( 'serialize_supported' => true ) );\n }", "public function author(){\n return $this->belongsTo('App\\Profile');// belogns c'est a dire contient on \n //l'a fait dans l'objet qui contient la clés etrangére\n }", "public function insert($article);", "public function author(): BelongsTo\n {\n return $this->belongsTo(Author::class);\n }", "public function associateArticle(Article $article)\n {\n return $this->model->articles()->save($article);\n }", "public function comments()\n {\n \treturn $this->hasMany(Comment::class, 'article_id');\n }", "public function Person()\n\t{\n\t\treturn $this->belongsTo('ThunderID\\Person\\Models\\Person');\n\t}", "public function __construct(Article $article)\n {\n $this->article = $article;\n }", "public function __construct(Article $article)\n {\n $this->article = $article;\n }", "public function getRelationship($name);", "public static function tableName()\n {\n return 'articles';\n }", "public function isAddToRelationship();", "public function show(Article $article)\n {\n //\n }", "public function show(Article $article)\n {\n //\n }", "public function show(Article $article)\n {\n //\n }", "public function show(Article $article)\n {\n //\n }", "public function show(Article $article)\n {\n //\n }", "public function show(Article $article)\n {\n //\n }", "public function show(Article $article)\n {\n //\n }", "public function getRelation($relation);", "abstract public function included(): ?JsonApiParser\\Collections\\Relations;", "public function isRelated();", "public function autore(){\n // indicarle anche qui, oltre che\n // nel file dei Models, di seguito\n // book_id: foreignKey di book\n // autore_id: primaryKey di autore\n\n // FK // PK\n return $this->belongsTo('App\\Models\\autore', \"book_id\", \"autore_id\");\n // return $this->belongsTo('App\\Models\\autore');\n\n }" ]
[ "0.73938817", "0.73356605", "0.7227976", "0.7196151", "0.7119786", "0.71171755", "0.7104479", "0.7098551", "0.70911497", "0.70852643", "0.7074304", "0.6968747", "0.69103146", "0.6895701", "0.6858364", "0.681196", "0.67627966", "0.67627305", "0.6736352", "0.6689714", "0.6663052", "0.6502606", "0.6496125", "0.6470255", "0.64092034", "0.6372003", "0.6354421", "0.62989104", "0.6259438", "0.6246969", "0.62219816", "0.6203631", "0.61377615", "0.6121139", "0.6120915", "0.6100144", "0.606851", "0.6047979", "0.60299313", "0.5982806", "0.5979845", "0.5972852", "0.59637696", "0.59510905", "0.58966607", "0.58702695", "0.58610004", "0.58580977", "0.5828894", "0.5825977", "0.57831603", "0.5774345", "0.57572585", "0.5752688", "0.5734109", "0.5720048", "0.57021815", "0.5695503", "0.56868076", "0.568396", "0.5674129", "0.5672523", "0.5648368", "0.5639144", "0.56388974", "0.56388974", "0.56388974", "0.5612984", "0.56108737", "0.55985117", "0.5592557", "0.5592523", "0.55924195", "0.5588907", "0.5577892", "0.55726284", "0.55615246", "0.5557273", "0.55542475", "0.55521077", "0.55329937", "0.5529495", "0.55173975", "0.5509845", "0.5506223", "0.5506223", "0.55058974", "0.54994774", "0.5498788", "0.549463", "0.549463", "0.549463", "0.549463", "0.549463", "0.549463", "0.549463", "0.5490109", "0.54886043", "0.5483994", "0.5466132" ]
0.73124534
2
/Add workout function form
public function addWorkout() { return view('admin.addworkout'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function work()\n {\n }", "function vcn_findwork() { // Callback fucntion\r\n\t//return drupal_get_form('vcn_findwork_form');\r\n\treturn theme('vcn_findwork_overview');\r\n}", "function raptor_glue_worklist_form_builder($form, &$form_state)\n{\n\n $oPI = new \\raptor\\WorklistPage();\n $form = array();\n $disabled = false;\n $myvalues = $oPI->getFieldValues();\n $buildresult = $oPI->getForm($form, $form_state, $disabled, $myvalues);\n //drupal_set_message('<h2>Done building WORKLIST page at ' . microtime(TRUE) . '</h2>');\n \n return $buildresult;\n}", "public function show(Workout $workout)\n {\n //\n }", "function addForm()\n {\n $content = '';\n $template['job_bank_add'] = $this->cObj->getSubpart($this->__getTemplateCode(),\"###ADD_JOB_PLACEHOLDER###\"); \n\n $subPartArray['###CAREERLEVEL###'] = $this->createDropDown($this->job_careerlevel);\n $subPartArray['###FORMNAMEEXTENSIONJOB###'] = $this->prefixId;\n $subPartArray['###FORMNAMEEXTENSION###'] = $this->prefixId;\n $subPartArray[\"###HELP_IMAGE###\"] = t3lib_extMgm::siteRelPath($this->extKey).'images/help.gif';\n $subPartArray['###JOB_BANK_LOCATION###'] = $this->getCountryZone();\n $subPartArray['###QUALIFICATION###'] = $this->createDropDown($this->job_qualifiacation);\n $subPartArray['###SCRIPTNAME_POPUP_HELP_JS###'] = t3lib_extMgm::siteRelPath($this->extKey).'styles/overlib.js';\n $subPartArray[\"###SPONSOR_ID###\"] = $this->sponsorId;\n $subPartArray['###STATUS###'] = $this->createDropDown($this->job_status);\n\n $content .= $this->cObj->substituteMarkerArrayCached($template['job_bank_add'],$subPartArray,array(),array());\n \n return $this->pi_wrapInBaseClass($content);\n\n }", "public function addAction()\n {\n $request = $this->getRequest();\n\n $routeMatch = $this->getEvent()->getRouteMatch();\n $id = $routeMatch->getParam('workout_id', 0);\n\n if ($id <= 0) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $workout = $this->_workout->getRow(array('workout_id' => $id));\n//\n if (!$workout) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n /**\n * Grid FORM\n */\n $form = new WorkoutExerciseGrid(\n array(\n 'view' => $this->_view,\n )\n );\n\n /**\n * BUILDING Row\n */\n $row = new WorkoutExerciseRow(\n array(\n 'model' => $this->_exercise,\n 'view' => $this->_view,\n )\n );\n\n $row->setFieldOptions('type_id', array(\n 'values' => $this->_exerciseType->getBehaviour('nestedSet')->getResultSetForSelect(),\n 'onchange' => 'exerciseType(this);',\n ));\n $row->setFieldOptions('workout_id', array(\n 'value' => $id,\n ));\n\n //\n\n\n\n //\n $row->build();\n\n //\n $form->addSubForm($row, $row->getName());\n\n //\n $this->_view->headScript()->appendScript(\n $this->_view->render(\n 'workout-exercise/add.js',\n array(\n 'currentFormType' => 0,\n 'back' => $this->url()->fromRoute(\n 'hi-training/workout-exercise/list/wildcard',\n array('workout_id' => $id)\n ),\n 'ajaxFormType' => $this->url()->fromRoute(\n 'hi-training/exercise-type/ajax-form-type/wildcard',\n array('type_id' => '')\n ),\n 'ajaxLastOfType' => $this->url()->fromRoute(\n 'hi-training/workout-exercise/ajax-last-of-type/wildcard',\n array('type_id' => '')\n ),\n )\n )\n );\n\n\n /**\n * POST\n */\n if ($this->getRequest()->isPost()) {\n\n $formData = $this->getRequest()->post()->toArray();\n\n if ($form->isValid($formData)) {\n\n// \\Zend\\Debug::dump($formData);\n\n if ( isset($formData['header']['formId'])\n && $formData['header']['formId'] == 'WorkoutExerciseGridForm') {\n\n if (isset($formData['WorkoutExerciseRow']['actions']['save'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $newRow = $this->_exercise->createRow()->populate($formData['WorkoutExerciseRow']['row']);\n $newRow->save();\n\n return $this->redirect()->toRoute('hi-training/workout-exercise/list/wildcard', array('workout_id' => $id));\n }\n\n }\n\n if (isset($formData['WorkoutExerciseRow']['actions']['saveAdd'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $newRow = $this->_exercise->createRow()->populate($formData['WorkoutExerciseRow']['row']);\n $newRow->save();\n\n return $this->redirect()->toRoute('hi-training/workout-exercise/add/wildcard', array('workout_id' => $id));\n }\n\n }\n }\n }\n }\n\n //\n return array(\n 'form' => $form,\n 'workout' => $workout,\n );\n\n }", "function show_plan_add() {\n //must check that the user has the required capability \n if (!current_user_can('manage_options')) {\n csm_error('You do not have sufficient permissions to access this page', true);\n }\n \n $CsmWorkplace = new CsmWorkplace();\n $workplaces = $CsmWorkplace->all();\n \n //Add the member\n if (isset($_POST['action']) && $_POST['action'] === 'addplan') {\n $data = $_POST;\n $Csmplan = new CsmPlan();\n try {\n $Csmplan->create($_POST);\n csm_set_update('New membership plan was added');\n hacky_redirect('csm-plans');\n } catch (\\Exception $e) {\n csm_error($e->getMessage());\n }\n }\n \n include(CSM_PLUGIN_PATH . 'app/views/plan-add.view.php');\n}", "public function edit(Workout $workout)\n {\n //\n }", "function form();", "function fantacalcio_admin_matches_calendar($form, &$form_state, $g_id = \"\") {\n \n // $form['#redirect'] = 'admin/fantacalcio/groups/' . $g_id;\n $group = Group::get($g_id);\n \n drupal_set_title(filter_xss($group->name . \" - \" . t(\"Crea calendario\")));\n \n $teams = Team::allByGroup($g_id);\n \n $i = 0;\n foreach ($teams as $t_id => $team) {\n // create a partial table row containing the data from the table\n $data = array(\n // $t_id,\n $team->name);\n \n // add our static \"row\" data into a form value\n $form['rows'][$t_id]['data'] = array('#type' => 'value', '#value' => $data);\n \n // now create the weight form element.\n // NOTE how we add the id into the element key\n $form['rows'][$t_id]['weight-' . $t_id] = array(\n '#type' => 'weight', \n '#default_value' => $i, \n '#delta' => count($teams), \n \n // add a specific class in here - we need this later\n '#attributes' => array('class' => array('weight')));\n $i++;\n }\n \n $form['turns'] = array(\n '#title' => t('Numero di turni'), \n '#type' => 'select', \n '#options' => array(\n 1 => 1, \n 2 => 2, \n 3 => 3, \n 4 => 4, \n 5 => 5, \n 6 => 6, \n 7 => 7, \n 8 => 8, \n 9 => 9, \n 10 => 10));\n\n$form['round_start'] = array(\n '#title' => t('Giornata di partenza'), \n '#type' => 'numberfield',\n '#default_value' => 1\n);\n \n $form['home_away'] = array(\n '#title' => t('Inverti squadre (andata e ritorno)'), \n '#type' => 'checkbox');\n \n $form['bonus_t1'] = array(\n '#title' => t('Bonus Squadra 1'), \n '#type' => 'textfield', \n '#size' => 3);\n \n $form['bonus_t2'] = array(\n '#title' => t('Bonus Squadra 2'), \n '#type' => 'textfield', \n '#size' => 3);\n \n $form['delete_old'] = array(\n '#title' => t('Cancella vecchio calendario'), \n '#type' => 'checkbox');\n \n $form['g_id'] = array('#type' => 'hidden', '#value' => $g_id);\n \n $form['submit'] = array('#type' => 'submit', '#value' => t('Crea Calendario'));\n \n return $form;\n}", "public function work()\n {\n }", "protected function workout(): Workout\n {\n $program = Program::create(\n 'programname',\n User::fromName(\"newuser\"),\n ...[$this->exercise('exercisename')]\n );\n return Workout::fromProgram($program);\n }", "public function __construct()\n\t{\n\t\tadd_shortcode('Opening_hours', array($this, 'Opening_hours_fct') ); // link new function to shortcode name\n\t\tadd_shortcode('Opening_hours_table', array($this, 'Opening_hours_table_fct') ); // link new function to shortcode name\n\t\tadd_shortcode('Opening_hours_alert', array($this, 'Opening_hours_alert_fct') ); // link new function to shortcode name\n\t\tadd_shortcode('Opening_hours_clock', array($this, 'Opening_hours_clock_fct') ); // link new function to shortcode name\n\t}", "function newBatchInput(){\n\tglobal $batchtypes;\t\n\n\t$ret = \"<form onsubmit=\\\"newBatch(); return false;\\\">\";\n\t$ret .= \"<table>\";\n\t$ret .= \"<tr><th>Batch Type</th><th>Name</th><th>Start date</th><th>End date</th><th>Owner</th></tr>\";\n\t$ret .= \"<tr>\";\n\t$ret .= \"<td><select id=newBatchType>\";\n\tforeach ($batchtypes as $id=>$desc){\n\t\t$ret .= \"<option value=$id>$desc</option>\";\n\t}\n\t$ret .= \"</select></td>\";\n\t$ret .= \"<td><input type=text id=newBatchName /></td>\";\n\t$ret .= \"<td><input type=text id=newBatchStartDate onfocus=\\\"showCalendarControl(this);\\\" /></td>\";\n\t$ret .= \"<td><input type=text id=newBatchEndDate onfocus=\\\"showCalendarControl(this);\\\" /></td>\";\n\t$ret .= \"<td><select id=newBatchOwner />\";\n\tglobal $owners;\n\tforeach ($owners as $o)\n\t\t$ret .= \"<option>$o</option>\";\n\t$ret .= \"</select></td>\";\n\t$ret .= \"<td><input type=submit value=Add /></td>\";\n\t$ret .= \"</tr></table></form><br />\";\n\t\n\t$ret .= \"<b>Filter</b>: show batches owned by: \";\n\t$ret .= \"<select id=filterOwner onchange=\\\"refilter();\\\">\";\n\tforeach ($owners as $o)\n\t\t$ret .= \"<option>$o</option>\";\n\t$ret .= \"</select>\";\n\t\n\t$ret .= \" <a href=barcodenew.php>Print shelf tags</a>\";\n\t\n\treturn $ret;\n}", "function tpps_details_tab($accession, $type) {\n $function = \"tpps_details_$type\";\n $state = tpps_load_submission($accession);\n print($function($state));\n}", "function add_dashboard() {\n}", "function disp_gen_meetings_cp($count){\r\n\r\n echo('<form method=\"post\" action=\"/vgdc-uci/admin/home.php?p=gen_meetings_set\">');\r\n echo('Date of First Meeting (yyyy-mm-dd): <input type=\"text\" name=\"start_date\"><br>');\r\n for( $i = 0; $i < $count; $i++ ){\r\n $value = 'General Meeting';\r\n switch($i){ //DEFAULT VALUES BY WEEK\r\n //in the event that the default setup changes, this should be updated\r\n case 0:\r\n $value = 'Project Presentations*';\r\n break;\r\n case 1:\r\n $value = 'Team Assignments**';\r\n break;\r\n case 2:\r\n $value = 'In-Person Team Setup*';\r\n break;\r\n case 4:\r\n $value = 'Game Night';\r\n break;\r\n case 6:\r\n $value = 'Playtesting';\r\n break;\r\n case 8:\r\n $value = 'Playtesting';\r\n break;\r\n case 9:\r\n $value = 'Game Night';\r\n break;\r\n }\r\n echo('Week '.($i+1).' Topic: <input type=\"text\" name=\"topic'.$i.'\" value=\"'.$value.'\"><br>');\r\n }\r\n echo('<input type=\"submit\" name=\"Update\" value=\"Apply\">');\r\n echo('</form>');\r\n}", "function submitAddStok()\n\t{\n\t\t# code...\n\t}", "abstract function form();", "function cust_lead(){\n }", "public function create()\n {\n return view('workouts.form');\n }", "public function postnewjob(){\n\t\tglobal $job_deadline;\n\t\t$this->addElement('select', 'job_deadline', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t'id' => 'job_deadline',\n\t\t\t\t\"multioptions\"=>$job_deadline,\n\t\t\t\t// 'onchange' => 'Checkoption(this)',\n\t\t\t\t\"label\" => \"When do you need the work to start\",\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n\t\t\n\t\t/*$this->addElement('textarea', 'job_deadline_other_option', array (\n\t\t\t'class' => 'form-control p_0 ',\n\t\t\t\"required\"=>true,\n\t\t\t'id' => 'job_deadline_other_option',\n\t\t\t \"rows\"=>5, \n\t\t\t'Placeholder'=> 'When would you like to schedule this for?',\n\t\t\t//\"label\" => \"When do you need the work to start\",\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Business description is required \")),\n \t\t\t\t\t\t\t\t),\n\t\t));*/\n\t\t\n\t\t$this->addElement('text', 'job_deadline_date', array (\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t\"placeholder\" => \"Select Date\",\n\t\t\t\t\"readonly\"=>\"readonly\", \n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t));\n\t\t\n\t\t$this->addElement('text', 'job_phone_client', array (\n\t\t\t'class' => 'form-control required text-center User_job_Post_Form',\n\t\t\t\"required\"=>true,\n\t\t\t'label' => 'Phone Number', \n\t\t\t'Placeholder'=> 'Phone Number with valid code (+1)',\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Business description is required \")),\n \t\t\t\t\t\t\t\t),\n\t\t));\n// zip code textbox\t\t\n\t\t$this->addElement('radio', 'job_anything_else_know', array (\n\t\t\t'class' => 'required RedioCheckboxStyle User_job_Post_Form',\n\t\t\t\"required\"=>true,\n\t\t\t'id' => 'job_anything_else_know',\n\t\t//\"onclick\"=>\"isElse()\", \n\t\t\t'multiOptions'=>array(\n\t\t\t'0' => 'Yes',\n\t\t\t'1' => 'No',\n\t\t\t),\n\t\t\t\"label\" => \"Anything else service provider should know? \",\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Please select.\")),\n\t\t\t\t\t\t\t),\n\t\t));\n\t\t\n\t\t$this->addElement('textarea', 'yes_else_know', array (\n\t\t\t'class' => 'form-control text-left p_0',\n\t\t\t\"required\"=>true,\n\t\t\t\"rows\"=>2, \n\t\t\t'id' => 'yes_else_know',\n\t\t\t'Placeholder'=> 'Write here...',\n\t\t\t//\"label\" => \"When do you need the work to start\",\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Business description is required \")),\n \t\t\t\t\t\t\t\t),\n\t\t));\n\t\t\n\t\t$this->addElement('radio', 'how_receive_quote', array (\n\t\t\t'class' => 'required RedioCheckboxStyle User_job_Post_Form',\n\t\t\t\"required\"=>true,\n\t\t\t'multiOptions'=>array(\n\t\t\t'0' => 'By email only',\n\t\t\t'1' => 'By email and text message',\n\t\t\t),\n\t\t\t\"label\" => \"How would you like to receive quotes? \",\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Please select.\")),\n\t\t\t\t\t\t\t),\n\t\t));\n\t\t\n\t\t\n\t\t//$this->how_receive_quote->removeDecorator('label')->removeDecorator('HtmlTag')->removeDecorator('Wrapper');\n\t\t\n\t\t$this->addElement('text', 'client_zip_code', array (\n\t\t\t\t'class' => 'form-control required text-center User_job_Post_Form',\n\t\t\t\t\"label\" => \"Please confirm where you need the job to be done. \" ,\n\t\t\t\t'Placeholder'=> 'Zip Code',\n\t\t\t\t/*'onchange'=> 'checkzipcode(this.value)',*/\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"zip code is required \")),\n\t\t\t\t\t\t\t\t),\n\t\t\t));\n\t\t\t\n\t\t $job_budget=array(\n\t\t\t'1' => '0-100',\n\t\t\t'2' => '100-200',\n\t\t\t'3' => '200-500',\n\t\t\t'4' => '500-700',\n\t\t\t'5' => '700-1000',\n\t\t\t'6' => '1000-1500',\n\t\t\t'7' => '1500-2000',\n\t\t\t'8' => '2000-5000',\n\t\t\t'9' => '5000-7000',\n\t\t\t'10' => 'more than 7000',\n\t\t\t\n\t\t);\n\t\t$this->addElement('select', 'posted_job_budget', array (\n\t\t\t'class' => 'form-control',\n\t\t\t\"multioptions\"=>$job_budget,\n\t\t\t'label' => 'Job Budget', \n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t));\n\t}", "public function work(): void;", "function ToonFormulierAfspraak()\n{\n\n}", "public function add()\n\t{\n\t\t$fake_id = $this->_get_id_cur();\n\t\t$form = array();\n\t\t$form['view'] = 'form';\n\t\t$form['validation']['params'] = $this->_get_params();\n\t\t$form['submit'] = function()use ($fake_id)\n\t\t{\n\t\t\t$data = $this->_get_inputs();\n\t\t\t$data['sort_order'] = $this->_model()->get_total() + 1;\n\t\t\t$id = 0;\n\t\t\t$this->_model()->create($data,$id);\n\t\t\t// Cap nhat lai table_id table file\n\t\t\tmodel('file')->update_table_id_of_mod($this->_get_mod(), $fake_id, $id);\n\t\t\tfake_id_del($this->_get_mod());\n\n\t\t\tset_message(lang('notice_add_success'));\n\t\t\t\n\t\t\treturn admin_url($this->_get_mod());\n\t\t};\n\t\t$form['form'] = function() use ($fake_id)\n\t\t{\n\t\t\t$this->_create_view_data($fake_id);\n\n\t\t\t$this->_display('form');\n\t\t};\n\t\t$this->_form($form);\n\t}", "public function addWorkoutCategory()\n {\n return view('admin.addworkoutcategory');\n }", "protected function getAddAfterFunction()\n {\n \n }", "public function run()\n {\n $station_func = array(array('station'=>'Headquarters', 'function'=>'AIM Products Management'),\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport NOF', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Nairobi Wilson Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Moi International Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Eldoret International Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Kisumu Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Malindi Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Wajir Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\tarray('station'=>'Lokochoggio Airport', 'function'=>'AIS Products Management'),\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Nairobi Wilson Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Moi International Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Eldoret International Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Kisumu Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Malindi Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Wajir Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\tarray('station'=>'Lokochoggio Airport', 'function'=>'Flight Planning Management'),\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray('station'=>'Headquarters', 'function'=>'Maps and Charts Management'),\n\t\t\t\t\t\tarray('station'=>'Headquarters', 'function'=>'Terrain and Obstacle Data Management'),\n\t\t\t\t\t\tarray('station'=>'Headquarters', 'function'=>'Instrument/Visual flight procedure design'),\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray('station'=>'Headquarters', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Jomo Kenyatta International Airport NOF', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Nairobi Wilson Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Moi International Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Eldoret International Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Kisumu Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Malindi Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Wajir Airport', 'function'=>'Technical library'),\n\t\t\t\t\t\tarray('station'=>'Lokochoggio Airport', 'function'=>'Technical library'),\n\t\t);\n\t\t\n\t\t$stations = Station::all();\n\t\t$functions = Func::all();\n\t\t\n\t\tfor($i = 0; $i < count($station_func); $i++){\n\t\t\tforeach($stations as $station){\n\t\t\t\tif($station_func[$i]['station'] == $station->name){\n\t\t\t\t\tforeach($functions as $function){\n\t\t\t\t\t\tif($station_func[$i]['function'] == $function->name){\n\t\t\t\t\t\t\t$station->func()->attach($function);\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 }", "function runkit_function_add($funcname, $arglist, $code)\n{\n}", "public static function generate_work_period_form($args = array(), $allow_remove = true){\n $default_args = array(\n 'period_id' => false,\n 'week_day' => 1,\n 'allow_remove' => true,\n 'start_time' => 480,\n 'end_time' => 1080,\n 'agent_id' => 0,\n 'location_id' => 0,\n 'service_id' => 0\n );\n $args = array_merge($default_args, $args);\n\n $period_id = (!$args['period_id']) ? 'new_'.$args['week_day'].'_'.OsUtilHelper::random_text() : $args['period_id'];\n $period_html = '<div class=\"ws-period\">';\n $period_html.= OsFormHelper::time_field('work_periods['.$period_id.'][start_time]', __('Start', 'latepoint'), $args['start_time'], true);\n $period_html.= OsFormHelper::time_field('work_periods['.$period_id.'][end_time]', __('Finish', 'latepoint'), $args['end_time'], true);\n $period_html.= OsFormHelper::hidden_field('work_periods['.$period_id.'][week_day]', $args['week_day']);\n $period_html.= OsFormHelper::hidden_field('work_periods['.$period_id.'][is_active]', self::is_period_active($args['start_time'], $args['end_time']), array('class' => 'is-active'));\n $period_html.= OsFormHelper::hidden_field('work_periods['.$period_id.'][agent_id]', $args['agent_id']);\n $period_html.= OsFormHelper::hidden_field('work_periods['.$period_id.'][location_id]', $args['location_id']);\n $period_html.= OsFormHelper::hidden_field('work_periods['.$period_id.'][service_id]', $args['service_id']);\n if(isset($args['custom_date'])) $period_html.= OsFormHelper::hidden_field('work_periods['.$period_id.'][custom_date]', $args['custom_date']);\n if($allow_remove) $period_html.= '<button class=\"ws-period-remove\"><i class=\"latepoint-icon latepoint-icon-x\"></i></button>';\n $period_html.= '</div>';\n return $period_html;\n }", "function functions() {\n \n }", "public function moe_work_plan(){\n\t\t\treturn View::make('MOE.work_plan.moe_work_plan');\n\t\t}", "function bab_pm_makeform()\n{\n global $prefs;\n\n $bab_hidden_input = '';\n $event = gps('event');\n $step = gps('step');\n\n if (!$event) {\n $event = 'postmaster';\n }\n\n if (!$step) {\n $step = 'subscribers';\n }\n\n if ($step == 'subscribers') {\n $bab_columns = array(\n 'subscriberFirstName',\n 'subscriberLastName',\n 'subscriberEmail',\n 'subscriberLists',\n );\n\n for ($i = 1; $i <= BAB_CUSTOM_FIELD_COUNT; $i++) {\n $bab_columns[] = \"subscriberCustom{$i}\";\n }\n\n $bab_submit_value = 'Add Subscriber';\n $bab_prefix = 'new';\n $subscriberToEdit = gps('subscriber');\n\n if ($subscriberToEdit) {\n $bab_hidden_input = '<input type=\"hidden\" name=\"editSubscriberId\" value=\"' . doSpecial($subscriberToEdit) . '\">';\n $bab_prefix = 'edit';\n $bab_submit_value = 'Update Subscriber Information';\n\n $row = safe_row('*', 'bab_pm_subscribers', \"subscriberID=\" . doSlash($subscriberToEdit));\n $subscriber_lists = safe_rows('*', 'bab_pm_subscribers_list', \"subscriber_id = \" . doSlash($row['subscriberID']));\n $fname = doSpecial($row['subscriberFirstName']);\n $lname = doSpecial($row['subscriberLastName']);\n echo \"<fieldset id=bab_pm_edit><legend><span class=bab_pm_underhed>Editing Subscriber: $fname $lname</span></legend>\";\n } else {\n $subscriber_lists = array();\n }\n\n $lists = safe_rows('*', 'bab_pm_list_prefs', '1=1 order by listName');\n }\n\n if ($step == 'lists') {\n $bab_columns = array('listName', 'listAdminEmail','listDescription','listUnsubscribeUrl','listEmailForm','listSubjectLine');\n $bab_submit_value = 'Add List';\n $bab_prefix = 'new';\n\n if ($listToEdit = gps('list')) {\n $bab_hidden_input = '<input type=\"hidden\" name=\"editListID\" value=\"' . $listToEdit . '\">';\n $bab_prefix = 'edit';\n $bab_submit_value = 'Update List Information';\n $bab_prefix = 'edit';\n\n $row = safe_row('*', 'bab_pm_list_prefs', \"listID=\" . doSlash($listToEdit));\n echo \"<fieldset id=bab_pm_edit><legend>Editing List: $row[listName]</legend>\";\n }\n\n $form_prefix = $prefs[_bab_prefix_key('form_select_prefix')];\n\n $forms = safe_column('name', 'txp_form',\"name LIKE '\". doSlash($form_prefix) . \"%'\");\n $form_select = selectInput($bab_prefix.ucfirst('listEmailForm'), $forms, @$row['listEmailForm']);\n // replace class\n $form_select = str_replace('class=\"list\"', 'class=\"bab_pm_input\"', $form_select);\n }\n\n // build form\n\n echo '<form method=\"POST\" id=\"subscriber_edit_form\">';\n\n foreach ($bab_columns as $column) {\n echo '<dl class=\"bab_pm_form_input\"><dt>'.bab_pm_preferences($column).'</dt><dd>';\n $bab_input_name = $bab_prefix . ucfirst($column);\n\n switch ($column) {\n case 'listEmailForm':\n echo $form_select;\n break;\n case 'listSubjectLine':\n $checkbox_text = 'Use Article Title for Subject';\n case 'listUnsubscribeUrl':\n if (empty($checkbox_text)) {\n $checkbox_text = 'Use Default';\n }\n\n $checked = empty($row[$column]) ? 'checked=\"checked\" ' : '';\n $js = <<<eojs\n<script>\n$(document).ready(function () {\n $('#{$column}_checkbox').change(function(){\n if ($(this).is(':checked')) {\n $('input[name={$bab_input_name}]').attr('disabled', true).val('');\n }\n else {\n $('input[name={$bab_input_name}]').attr('disabled', false);\n }\n });\n});\n</script>\n\neojs;\n\n echo $js . '<input id=\"'.$column.'_checkbox\" type=\"checkbox\" class=\"bab_pm_input\" ' . $checked . '/>'.$checkbox_text.'</dd><dd>' .\n '<input type=\"text\" name=\"' . $bab_input_name . '\" value=\"' . doSpecial(@$row[$column]) . '\"' .\n (!empty($checked) ? ' disabled=\"disabled\"' : '') . ' />' .\n '</dd>';\n break;\n case 'subscriberLists':\n foreach ($lists as $list) {\n $checked = '';\n\n foreach ($subscriber_lists as $slist) {\n if ($list['listID'] == $slist['list_id']) {\n $checked = 'checked=\"checked\" ';\n break;\n }\n }\n\n echo '<input type=\"checkbox\" name=\"'. $bab_input_name .'[]\" value=\"'.$list['listID'].'\"' . $checked . '/>'\n . doSpecial($list['listName']) . \"<br>\";\n }\n break;\n default:\n echo '<input type=\"text\" name=\"' . $bab_input_name . '\" value=\"' . doSpecial(@$row[$column]) . '\" class=\"bab_pm_input\">';\n break;\n }\n\n echo '</dd></dl>';\n }\n\n echo $bab_hidden_input;\n echo '<input type=\"submit\" value=\"' . doSpecial($bab_submit_value) . '\" class=\"publish\">';\n echo '</form>';\n}", "function customize_instruction_ehs() {\n\n\t\t\n\t\t\t$replace['get_satisfaction'] = $this->get_satisfaction();\n\t\t\t \n\t\t\t\n\n\t\t\t// To show the edited instruction in different color.\n\n\t\t\tif( $this->value(\"edit_instruction\") != \"1\" )\n\n\t\t\t\t$_SESSION['edit_record'] = array(); \n\n\t\t\n\n\t\t\t$replace['header'] = $this->build_template($this->get_template(\"header\"));\n\n\t\t\t$replace['sidebar'] = $this->sidebar();\n\n\t\t\t$replace['plan_id'] = $this->value('plan_id');\n\n\t\t\t$replace['plan_title'] = strtoupper($this->get_field($this->value('plan_id'), $this->config['table']['plan'], \"plan_name\"));\n\n\t\t\t$replace['customize_instruction_head'] = $this->build_template($this->get_template(\"customize_instruction_head\"));\n\n\t\t\tinclude_once(\"template/therapistEHS/therapistArray.php\");\n\n\t\t\t$this->formArray = $customizeInstructionAction;\n\n\t\t\t$query = \"select pt.plan_treatment_id,pt.treatment_order,pt.treatment_id,trt.treatment_name,\n\n\t\t\t\t\t\tpt.instruction,pt.benefit,pt.sets,pt.reps,pt.hold,pt.lrb,pt.plan_id from plan_treatment pt\n\n\t\t\t\t\t\tinner join treatment trt on pt.treatment_id = trt.treatment_id \n\n\t\t\t\t\t\twhere pt.plan_id = '{$this->value('plan_id')}' order by pt.treatment_order\";\n\n\t\t\t\t\t\t\n\n\t\t\t$result = $this->execute_query($query);\t\t\t\t\t\t\t\t \t\n\n\t\t\tif(is_resource($result)){\n\n\t\t\t\twhile($row = $this->fetch_array($result)){\n\n\t\t\t\t\t\n\n\t\t\t\t\tif( $this->value(\"edit_instruction\") == \"1\" && is_array($_SESSION['edit_record']) && in_array($row['plan_treatment_id'],$_SESSION['edit_record']) ){\n\n\t\t\t\t\t\t$row['show_selected'] = 'style=\"border-top: #090 1px solid; border-bottom: #090 1px solid; background-color: #cfc;\"';\n\n\t\t\t\t\t\t$row['style'] = \"\";\n\n\t\t\t\t\t}\n\n\t\t\t\t\telse{\n\n\t\t\t\t\t\t$row['style'] = ($c++%2)?\"line1\":\"line2\";\n\n\t\t\t\t\t\t$row['show_selected'] = \"\";\n\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\n\t\t\t\t\tif($row['treatment_name'] == \"\"){\n\n\t\t\t\t\t\t$row['treatment_name'] = \"&nbsp;\";\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($row['instruction'] == \"\"){\n\n\t\t\t\t\t\t$row['instruction'] = \"&nbsp;\";\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($row['benefit'] == \"\"){\n\n\t\t\t\t\t\t$row['benefit'] = \"&nbsp;\";\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($row['sets'] == \"\"){\n\n\t\t\t\t\t\t$row['sets'] = \"&nbsp;\";\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($row['reps'] == \"\"){\n\n\t\t\t\t\t\t$row['reps'] = \"&nbsp;\";\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($row['hold'] == \"\"){\n\n\t\t\t\t\t\t$row['hold'] = \"&nbsp;\";\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$row['lrb'] = $this->config['lrb'][$row['lrb']];\n\n\t\t\t\t\tif($row['lrb'] == \"\"){\n\n\t\t\t\t\t\t$row['lrb'] = \"None\";\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$row['actionOption'] = $this->build_select_option($this->formArray);\n\n\t\t\t\t\t$filename = $_SERVER['DOCUMENT_ROOT'].\"/asset/images/treatment/{$row['treatment_id']}/thumb.jpg\";\n if( file_exists($filename) === true ){\n $row['treatment_image'] = \"../asset/images/treatment/{$row['treatment_id']}/thumb.jpg\";\n }\n else{\n $row['treatment_image'] = \"../images/img-no-image.jpg\";\n }\n\t\t\t\n\t\t\t\t\t$replace['customize_instruction_rec'] .= \n\n\t\t\t\t\t$this->build_template($this->get_template(\"customize_instruction_rec\"),$row);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t$replace['type'] = \"\";\n\n\t\t\tif($_SESSION['type'] == \"finish\"){\n\n\t\t\t\t$replace['type'] = 'finish';\n\n\t\t\t}\n\n\t\t\telseif($_SESSION['type'] == \"treatment_plan\"){\n\n\t\t\t\t$replace['type'] = 'treatment_plan';\n\n\t\t\t}\n\n\t\t\t\t\n\n\t\t\t$replace['patient_image'] = '<img src=\"images/03_patient_gray.gif\" />';\n\n\t\t\t$replace['assign_image'] = '<img src=\"images/04_assign_gray.gif\" />';\n\n\t\t\t\n\n\t\t\t$nav_bar = array(\n\n\t\t\t\t\t\t\t\t'plan' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=createNewEhsPlan&act=plan_edit&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/01_plan_gray.gif\" /></a>':'<img src=\"images/01_plan_gray.gif\" />',\n\n\t\t\t\t\t\t\t\t'step1' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=createNewEhsPlan&act=plan_edit&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_1_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_1_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step2' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=selectEhsTreatment&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_2_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_2_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step3' => ($this->value('plan_id') != \"\")?'<img src=\"images/stepIcons_3_red_sm.gif\">':'<img src=\"images/stepIcons_3_red_sm.gif\">',\n\n\t\t\t\t\t\t\t\t'step4' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=customize_articles_ehs&plan_id='.$this->value(\"plan_id\").'&type='.$_SESSION['type'].'\"><img src=\"images/stepIcons_4_gray_sm.gif\"></a>':'<img src=\"images/stepIcons_4_gray_sm.gif\">',\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t);\n\n\t\t\tif(is_array($replace)){\n\n\t\t\t\t$replace = $replace + $nav_bar;\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t// Build Back button Url\n\n\t\t\t$replace['act'] = \"plan_edit\";\n\n\t\t\t$replace['action'] = \"selectEhsTreatment\";\n\n\t\t\t$backUrl = array('action','plan_id','type','act');\n\n\t\t\t$replace['back_url'] = $this->buildBackUrl($backUrl,$replace);\n\n\t\t\t// End of build Back button Url\n\n\t\t\t$replace['body'] = $this->build_template($this->get_template(\"customize_instruction\"),$replace);\n\n\t\t\t$replace['browser_title'] = \"Tx Xchange: Customize Instruction\";\n\t\t\t// Personalized GUI\n $LabelTitle=$_SESSION['providerLabel']['My Template Plans']!=''?$_SESSION['providerLabel']['My Template Plans']:\"MY TX PLANS\";\n $replace['path_name'] = strtoupper($LabelTitle);\n $LabelTreatmentHeading=$_SESSION['providerLabel']['Treatments in Plan']!=''?$_SESSION['providerLabel']['Treatments in Plan']:\"Treatments in Plan\";\n $replace['Treatments_in_Plan'] = $LabelTreatmentHeading;\n $LabelTreatmenttitle=$_SESSION['providerLabel']['Treatment']!=''?$_SESSION['providerLabel']['Treatment']:\"Treatment\";\n $replace['TreatmentHead'] = $LabelTreatmenttitle;\n $this->output = $this->build_template($this->get_template(\"main\"),$replace);\t\t\t\n\n\t\t}", "function create_form(){\n\t\n\t$table =\"<html>\";\n\t$table.=\"<head>\";\n\t$table.=\"\t<title>New Article Entry Page</title>\";\n\t$table.=\"</head>\";\n\t\n\t// URL for the wordpress post handling page\n\t$link_admin_post = admin_url('admin-post.php');\n\t$table.=\"<form name = 'myform' method=\\\"POST\\\" action='\" . $link_admin_post . \"' id = \\\"form1\\\">\";\n\n\t// Input for Faculty member\n\t$table.= \"\t<br>\";\n\t$table.= \" <div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Tag\\\">Faculty Member/Tag: </label></p>\";\n\t$list_of_names = wp_post_tag_names();\n\t$table.=\"\t<select name=\\\"Tag\\\">\" . $list_of_names . \"</select>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for PMID\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"PMID\\\">PMID*: </label></p>\";\n\t$table.=\"\t<input type=\\\"number\\\" name=\\\"PMID\\\" id=\\\"PMID\\\" required>\";\n\t\n\t//autofill button\n\t$table.=' <a class=\"pmid\" data-test=\"hi\"><button id=\"autofill_btn\" type=\"button\" >Auto-Fill</button></a>';\n\t$table.=\"\t</div>\";\n\t\t\n\t// Input for Journal Issue\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label style=\\\"width: 200px;\\\" for=\\\"Journal_Issue\\\">Journal Issue: </label></p>\";\n\t$table.=\"\t<input id = 'issue' type=\\\"number\\\" name=\\\"Journal_Issue\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Volume\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Volume\\\">Journal Volume: </label></p>\";\n\t$table.=\"\t<input id = 'journal_volume' type=\\\"number\\\" name=\\\"Journal_Volume\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Title\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Title\\\">Journal Title: </label></p>\";\n\t$table.=\"\t<input id = 'journal_title' type=\\\"text\\\" name=\\\"Journal_Title\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Year\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Year\\\">Journal Year: </label></p>\";\n\t$table.=\"\t<input id = 'year' value=\\\"2000\\\" type=\\\"number\\\" name=\\\"Journal_Year\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Month\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Month\\\">Journal Month: </label></p>\";\n\t$table.=\"\t<select id='journal_month' name=\\\"Journal Month\\\">\";\n\t$table.=\"\t\t<option value=\\\"01\\\">Jan</option>\";\n\t$table.=\"\t\t<option value=\\\"02\\\">Feb</option>\";\n\t$table.=\"\t\t<option value=\\\"03\\\">Mar</option>\";\n\t$table.=\"\t\t<option value=\\\"04\\\">Apr</option>\";\n\t$table.=\"\t\t<option value=\\\"05\\\">May</option>\";\n\t$table.=\"\t\t<option value=\\\"06\\\">Jun</option>\";\n\t$table.=\"\t\t<option value=\\\"07\\\">Jul</option>\";\n\t$table.=\"\t\t<option value=\\\"08\\\">Aug</option>\";\n\t$table.=\"\t\t<option value=\\\"09\\\">Sep</option>\";\n\t$table.=\"\t\t<option value=\\\"10\\\">Oct</option>\";\n\t$table.=\"\t\t<option value=\\\"11\\\">Nov</option>\";\n\t$table.=\"\t\t<option value=\\\"12\\\">Dec</option>\";\n\t$table.=\"\t</select>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Day\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Day\\\">Journal Day: </label></p>\";\n\t$table.=\"\t<input id = 'journal_day' type=\\\"text\\\" name=\\\"Journal_Day\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Date\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Date\\\">Journal Date: </label></p>\";\n\t$table.=\"\t<input id = 'journal_date' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Journal_Date\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Journal Abbreviation\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Abbreviation\\\">Journal Abbreviation: </label></p>\";\n\t$table.=\"\t<input id = 'journal_ab' type=\\\"text\\\" name=\\\"Journal_Abbreviation\\\">\";\n\t$table.=\"\t</div>\";\n\n\t// Input for Journal Citation\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Journal_Citation\\\">Journal Citation: </label></p>\";\n\t$table.=\"\t<input id = 'journal_citation' type=\\\"text\\\" name=\\\"Journal_Citation\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Title\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Title\\\">Article Title: </label></p>\";\n\t$table.=\"\t<input id=\\\"article_title\\\" type=\\\"text\\\" name=\\\"Article_Title\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for article abstract\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Abstract\\\">Article Abstract: </label></p>\";\n\t$table.=\" <textarea id='abstract' rows = '4' cols = '60' name=\\\"Article_Abstract\\\"></textarea>\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article URL\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_URL\\\">Article URL: </label></p>\";\n\t$table.=\"\t<input id = 'article_url' type=\\\"text\\\" name=\\\"Article_URL\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Pagination\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Pagination\\\">Article Pagination: </label></p>\";\n\t$table.=\"\t<input id='pages' type=\\\"text\\\" name=\\\"Article_Pagination\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Date\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Date\\\">Article Date: </label></p>\";\n\t$table.=\"\t<input id='article_date' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Article_Date\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Authors\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Authors\\\">Article Authors: </label></p>\";\n\t$table.=\"\t<input id='article_authors' type=\\\"text\\\" name=\\\"Article_Authors\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Article Affiliations\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Article_Affiliation\\\">Article Affiliation: </label></p>\";\n\t$table.=\"\t<input id = 'article_affiliation' type=\\\"text\\\" name=\\\"Article_Affiliation\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Date Created\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Created\\\">Date Created: </label></p>\";\n\t$table.=\"\t<input id='date_created' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Created\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Input for Date Completed\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Completed\\\">Date Completed: </label></p>\";\n\t$table.=\"\t<input id='date_completed' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Completed\\\">\";\n\t$table.=\"\t</div>\";\n\n\t// Input for Date Revised\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div class=\\\"input\\\">\";\n\t$table.=\"\t<p class=\\\"label\\\"><label for=\\\"Date_Revised\\\">Date Revised: </label></p>\";\n\t$table.=\"\t<input id='date_revised' placeholder=\\\"YYYY-MM-DD\\\" type=\\\"text\\\" name=\\\"Date_Revised\\\">\";\n\t$table.=\"\t</div>\";\n\t\n\t// Hidden input (for specifying hook)\n\t$table.=\"\t<input type=\\\"hidden\\\" name=\\\"action\\\" value=\\\"new_article_form\\\">\";\n\t\n\t// Submit and reset buttons\n\t$table.=\"\t<br>\";\n\t$table.=\"\t<div id=\\\"form_btns\\\">\"; \n\t$table.=\"\t<button class=\\\"form_btn\\\"><input type=\\\"reset\\\" value=\\\"Reset!\\\" onclick=\\\"window.location.reload()\\\"></button>\";\n\t$table.=\"\t<input class=\\\"form_btn\\\" type=\\\"submit\\\" value=\\\"Submit\\\">\"; \n\t$table.=\"\t</div>\";\n\t$table.=\"</form>\";\n\n\t// Styling of the form (needs to be put in a seperate stylesheet)\n\t$table.=\"<style type=\\\"text/css\\\">\";\n\t$table.=\"\t#form_btns {\";\n\t$table.=\"\t\tmargin-left: 150px;\";\n\t$table.=\"\t}\";\n\t$table.=\"\t.form_btn {\";\n\t$table.=\"\t\twidth: 80px;\";\n\t$table.=\"\t}\";\n\t$table.=\"\t.label {\";\n\t$table.=\"\t\twidth: 150px;\";\n\t$table.=\"\t\tmargin: 0;\";\n\t$table.=\"\t\tfloat: left;\";\n\t$table.=\"\t}\";\n\t$table.=\"\tinput::placeholder {\";\n\t$table.=\"\t\tcolor: #a4a4a4;\";\n\t$table.=\"\t}\";\n\t$table.=\"</style>\";\n\t\n\t$table.=\"<script type='text/javascript' src=\" . plugin_dir_url(__FILE__) . \"js/autofill_ajax.js></script>\";\n\n \techo $table;\n}", "public static function getCodeForShowingAddForm($model){\n\n $resultString='//show add form'.\"\\n\";\n $resultString.='public function showAddForm(Request $request){'.\"\\n\";\n $resultString .='return view(\"super_admin.super_admin_createapply\");'.\"\\n\";\n $resultString.='}'.\"\\n\";\n\n return $resultString;\n }", "function add() {\n }", "function workspace_page_new(){\n\t$output = \"\";\n\t$output .= '<form class=\"form-horizontal\" role=\"form\">\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<label class=\"col-sm-3 control-label no-padding-right\" for=\"form-field-1\"> Text Field </label>\n\t\t\n\t\t\t\t\t<div class=\"col-sm-9\">\n\t\t\t\t\t\t<input type=\"text\" id=\"form-field-1\" placeholder=\"Username\" class=\"col-xs-10 col-sm-5\" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<label class=\"col-sm-3 control-label no-padding-right\" for=\"form-field-2\"> Password Field </label>\n\n\t\t\t\t\t<div class=\"col-sm-9\">\n\t\t\t\t\t\t<input type=\"password\" id=\"form-field-2\" placeholder=\"Password\" class=\"col-xs-10 col-sm-5\" />\n\t\t\t\t\t\t<span class=\"help-inline col-xs-12 col-sm-7\">\n\t\t\t\t\t\t\t<span class=\"middle\">Inline help text</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t<label class=\"col-sm-3 control-label no-padding-right\" for=\"form-field-6\">Tooltip and help button</label>\n\n\t\t\t\t\t<div class=\"col-sm-9\">\n\t\t\t\t\t\t<input data-rel=\"tooltip\" type=\"text\" id=\"form-field-6\" placeholder=\"Tooltip on hover\" title=\"Hello Tooltip!\" data-placement=\"bottom\" />\n\t\t\t\t\t\t<span class=\"help-button\" data-rel=\"popover\" data-trigger=\"hover\" data-placement=\"left\" data-content=\"More details.\" title=\"Popover on hover\">?</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\n\t\t\t</form>';\n\treturn html($output);\n}", "public function operations();", "public function submissions();", "function drawOptionLeftWork() {\r\n global $saveShowWork;?>\r\n <table width=\"100%\">\r\n <tr class=\"checkboxLabel\">\r\n <td >\r\n <?php echo ucfirst(i18n(\"labelShowLeftWork\".((isNewGui()?'':'Short'))));?>\r\n </td>\r\n <td style=\"width:36px\">\r\n <div title=\"<?php echo i18n('showLeftWork')?>\" dojoType=\"dijit.form.CheckBox\" \r\n type=\"checkbox\" id=\"listShowLeftWork\" name=\"listShowLeftWork\" class=\"whiteCheck\"\r\n <?php if ($saveShowWork=='1') { echo ' checked=\"checked\" '; }?> >\r\n <script type=\"dojo/method\" event=\"onChange\" >\r\n saveUserParameter('planningShowWork',((this.checked)?'1':'0'));\r\n refreshJsonPlanning();\r\n </script>\r\n </div>&nbsp;\r\n </td>\r\n </tr>\r\n </table>\r\n<?php \r\n}", "function make_input()\n{\n global $url_plugin;\n global $section;\n global $plugin;\n // THE ENTRIES FOR THE fresnel SERVER\n $list='<div class=\"title\">Fresnel parameters</div>\n <div class=\"plugin_content\">\n <table><tbody>\n <tr>\n <td colspan=\"4\">\n <div class=\"fresnel_data\">\n <label class=\"formula btext\">Distance (km)</label>\n <input size=\"8\" type=\"text\" class=\"btext ms_float\" id=\"fresnel_distance\" name=\"fresnel_distance\" value=\"0\" maxlength=8 />\n <input type=\"button\" value=\"Calculate\" onclick=\"fresnel_calc()\" />\n </div>\n <div class=\"fresnel_data\">\n <table cellspacing=0 cellpadding=0><tbody>\n <tr>\n <td class=\"t1\">\n 2.4 Ghz\n </td>\n <td class=\"t1\">\n 5 Ghz\n </td>\n </tr>\n <tr>\n <td class=\"t2\">\n <span id=\"24b\" class=\"btext\">0 m</span>\n </td>\n <td class=\"t2\">\n <span id=\"5b\" class=\"btext\">0 m</span>\n </td>\n </tr>\n </tbody></table>\n </div>\n </td>\n <td colspan=\"4\">\n <div class=\"fresnel_images\">\n <img src=\"'.$url_plugin.'images/fresnel_help_image.png\">\n </div>\n </td>\n </tr>\n <tr>\n \n </tr>\n </tbody></table>\n ';\n $list.='</div>';\n return $list;\n}", "function add_table_function($label, $closure) {\n\t\t$key = 'table-function-'.md5($label);\n\t\t$this->tb_functions[$key] = ['label' => $label, 'key' => $key];\n\t\t\n\t\tif(isset($_GET[$key])) {\n\t\t\t$closure($this, $this->get_full_resultset());\n\t\t}\n\t}", "public function addTask()\n\t{\n\t\t// Output the HTML\n\t\t$this->editTask();\n\t}", "function displayPayement(){ \n $contents='<form method=\"post\" action=\"index.php\" name=\"payement\" id=\"payement\" onSubmit=\"return addPayementSuccess(this)\" >\n\t\t\t\t\t<fieldset>\n\t\t\t\t\t\t<legend>Payement du rendez-vous </legend>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<label for=\"nss\"> Indiquer le NSS : </label>\n\t\t\t\t\t\t<input type=\"text\" name=\"nss\" id=\"nss\" onBlur=\"checkNss(this)\" />\n\t\t\t\t\t</p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<label for=\"prix\">Prix du rendez-vous : </label>\n\t\t\t\t\t\t<input type=\"text\" name=\"prix\" id=\"prix\" onBlur=\"checkPrix(this)\" />\n\t\t\t\t\t</p>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<input type=\"submit\" value=\"Payer\" name=\"payer\"/>\n\t\t\t\t\t</p>\n\t\t\t\t\t</fieldset>\n\t\t\t\t</form>';\n\treturn $contents;\n}", "function form($instance){\r\n\t\t?>\r\n\t\t<?php\r\n\t\t\t$defaults = array( 'title'=> __( 'Share This Article' , 'crumble' ), 'code' => '<!-- AddThis Button BEGIN -->\r\n<div class=\"addthis_toolbox addthis_default_style \">\r\n<a class=\"addthis_button_preferred_1\"></a>\r\n<a class=\"addthis_button_preferred_2\"></a>\r\n<a class=\"addthis_button_preferred_3\"></a>\r\n<a class=\"addthis_button_preferred_4\"></a>\r\n<a class=\"addthis_button_compact\"></a>\r\n<a class=\"addthis_counter addthis_bubble_style\"></a>\r\n</div>\r\n<script type=\"text/javascript\" src=\"http://s7.addthis.com/js/250/addthis_widget.js#pubid=xa-500144fc331f9af5\"></script>\r\n<!-- AddThis Button END -->' \r\n\t\t\t);\r\n\t\t\t$instance = wp_parse_args((array) $instance, $defaults); \r\n\t\t?>\r\n\r\n\t\t<p>\r\n\t\t\t<label for=\"<?php echo $this->get_field_id('title'); ?>\"><?php _e( 'Title:' , 'crumble' ); ?></label>\r\n\t\t\t<input class=\"widefat\" style=\"width: 210px;\" id=\"<?php echo $this->get_field_id('title'); ?>\" name=\"<?php echo $this->get_field_name('title'); ?>\" value=\"<?php echo $instance['title']; ?>\" />\r\n\t\t</p>\r\n\t\t\r\n\t\t<p>\r\n\t\t\t<label for=\"<?php echo $this->get_field_id('code'); ?>\"><?php _e( 'Paste Your Code From https://www.addthis.com:' , 'crumble' ); ?></label>\r\n\t\t\t<textarea class=\"widefat\" style=\"width: 220px; height: 350px\" id=\"<?php echo $this->get_field_id('code'); ?>\" name=\"<?php echo $this->get_field_name('code'); ?>\"><?php echo $instance['code']; ?></textarea>\r\n\t\t</p>\r\n\t\t\r\n\t\t<?php\r\n\r\n\t}", "function calmonthly_snippet2(&$params)\n{\necho \"<textarea id='calmonthly_snippet_edit' style='display:none;'>\";\ncalendar_getDataOfCategoryLookup();\ncalendar_outputTimeFieldsEdit($_REQUEST[\"editid1\"]);\necho \"</textarea>\";\n\n\n\n;\n}", "function portfolio_work_info_custom_fields() {\n add_meta_box(\n 'portfolio_work_info_custom_fields', // $id\n 'Work info', // $title\n 'show_portfolio_work_info_custom_fields', // $callback\n 'portfolio', // $page\n 'normal', // $context\n 'high'); // $priority\n}", "function publish_new_events($status, $ckf7_key, $submitted_data){\n return 'publish';\n}", "function add_thickbox()\n {\n }", "function vistaportal_med_form_add_school_callback($form, $form_state) {\n return $form['med'];\n }", "function formGenerate($action){\n $form=\"<form class='form-group' name='formularz' action='$action' method='post'>\";\n $form.=\"<fieldset><legend>Podgląd rezerwacji</legend>\";\n $form.=\"<label class='col-form-label' for='data'>Data:</label>\";\n $form.=\"<input type='date' name='data' id='data' min='2010-01-01' max='2020-12-31' value='\".date('Y-m-d').\"' required class='form-control' onchange='show_reservations_by_color()' onclick='show_reservations_by_color()'>\";\n $form.=\"</fieldset></form>\";\n return $form;\n}", "function save_me($creation, $dwl_number, $dwl_last) {\n\n}", "public function add()\n\t{\n\t\t// Add Sidebar Box\n\t\tEvent::add('ushahidi_action.main_sidebar', array($this, 'county_sidebar'));\n\n\t\t// Only add the events if we are on that controller\n\t\tif (Router::$controller == 'main')\n\t\t{\n\t\t\t// Add County/Constituency/Polling Station Layers\n\t\t\tEvent::add('ushahidi_action.header_scripts', array($this, 'main_js'));\n\t\t}\n\n\t\tif (Router::$controller == 'reports' AND Router::$method == 'edit')\n\t\t{\n\t\t\tEvent::add('ushahidi_action.header_scripts', array($this, 'const_js'));\t\n\t\t}\n\t\t\n\t\tif (stripos(Router::$current_uri, \"admin/reports/download\") !== false)\n\t\t{\n\t\t\tEvent::add('ushahidi_filter.report_download_csv_header', array($this, 'csv_header'));\n\t\t\tEvent::add('ushahidi_filter.report_download_csv_incident', array($this, 'csv_incident'));\n\t\t\tEvent::add('ushahidi_action.reports_download_form_data', array($this, 'reports_download_form_data'));\n\t\t}\n\n\t\tplugin::add_stylesheet('iebc/views/css/iebc');\n\n\t\tEvent::add('ushahidi_action.report_form_admin_location', array($this, 'const_select'));\n\n\t\t// Add Constituency Select Parameters\n\t\tEvent::add('ushahidi_filter.fetch_incidents_set_params', array($this, 'filter'));\t\n\n\t\t// Add Sidebar Box\n\t\tEvent::add('ushahidi_action.main_sidebar', array($this, 'county_sidebar'));\n\t}", "function wpgmza_b_pro_add_poly($mid) {\n global $wpgmza_tblname_maps;\n global $wpdb;\n if ($_GET['action'] == \"add_poly\" && isset($mid)) {\n\n if( function_exists('google_maps_api_key_warning' ) ){ google_maps_api_key_warning(); }\n \n $mid = sanitize_text_field($mid);\n $res = wpgmza_get_map_data($mid);\n echo \"\n \n\n \n \n <div class='wrap'>\n <h1>WP Google Maps</h1>\n <div class='wide'>\n\n <h2>\".__(\"Add a Polygon\",\"wp-google-maps\").\"</h2>\n <form action='?page=wp-google-maps-menu&action=edit&map_id=\".esc_attr($mid).\"' method='post' id='wpgmaps_add_poly_form'>\n <input type='hidden' name='wpgmaps_map_id' id='wpgmaps_map_id' value='\".esc_attr($mid).\"' />\n \n <table class='wpgmza-listing-comp' style='width:30%;float:left; height:400px;'>\n <tr>\n <td>\".__(\"Name\",\"wp-google-maps\").\"</td><td><input type=\\\"text\\\" value=\\\"\\\" name=\\\"poly_name\\\" /></td>\n </tr>\n <tr>\n <td>\".__(\"Title\",\"wp-google-maps\").\"</td><td><input disabled type=\\\"text\\\" value=\\\"\".__(\"Pro version only\",\"wp-google-maps\").\"\\\" /><i><a href='\".wpgm_pro_link(\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=polygons\").\"' title='\".__(\"Pro Version\",\"wp-google-maps\").\"'>\".__(\"Get the Pro add-on\",\"wp-google-maps\").\"</a></i></td>\n </tr>\n <tr>\n <td>\".__(\"Link\",\"wp-google-maps\").\"</td><td><input disabled type=\\\"text\\\" value=\\\"pro version only\\\" /></td> \n </tr>\n <tr>\n <td>\".__(\"Line Color\",\"wp-google-maps\").\"</td><td><input id=\\\"poly_line\\\" name=\\\"poly_line\\\" type=\\\"text\\\" class=\\\"color\\\" value=\\\"000000\\\" /></td> \n </tr>\n <tr>\n <td>\".__(\"Line Opacity\",\"wp-google-maps\").\"</td><td><input id=\\\"poly_line_opacity\\\" name=\\\"poly_line_opacity\\\" type=\\\"text\\\" value=\\\"0.5\\\" /> (0 - 1.0) example: 0.5 for 50%</td> \n </tr>\n <tr>\n <td>\".__(\"Fill Color\",\"wp-google-maps\").\"</td><td><input id=\\\"poly_fill\\\" name=\\\"poly_fill\\\" type=\\\"text\\\" class=\\\"color\\\" value=\\\"66ff00\\\" /></td> \n </tr>\n <tr>\n <td>\".__(\"Opacity\",\"wp-google-maps\").\"</td><td><input id=\\\"poly_opacity\\\" name=\\\"poly_opacity\\\" type=\\\"text\\\" value=\\\"0.5\\\" /> (0 - 1.0) example: 0.5 for 50%</td> \n </tr>\n <tr>\n <td>\".__(\"On Hover Line Color\",\"wp-google-maps\").\"</td><td><input disabled type=\\\"text\\\" value=\\\"\".__(\"Pro version only\",\"wp-google-maps\").\"\\\"/></td> \n </tr>\n <tr>\n <td>\".__(\"On Hover Fill Color\",\"wp-google-maps\").\"</td><td><input disabled type=\\\"text\\\" value=\\\"\".__(\"Pro version only\",\"wp-google-maps\").\"\\\"/></td> \n </tr>\n <tr>\n <td>\".__(\"On Hover Opacity\",\"wp-google-maps\").\"</td><td><input disabled type=\\\"text\\\"value=\\\"\".__(\"Pro version only\",\"wp-google-maps\").\"\\\" /></td> \n </tr>\n \n </table>\n\n <div class='wpgmza_map_seventy'> \n <div id=\\\"wpgmza_map\\\">&nbsp;</div>\n \n <p>\n <ul style=\\\"list-style:initial;\\\" class='update-nag update-blue update-slim update-map-overlay'>\n\n <li style=\\\"margin-left:30px;\\\">\".__(\"Click on the map to insert a vertex.\",\"wp-google-maps\").\"</li>\n <li style=\\\"margin-left:30px;\\\">\".__(\"Click on a vertex to remove it.\",\"wp-google-maps\").\"</li>\n <li style=\\\"margin-left:30px;\\\">\".__(\"Drag a vertex to move it.\",\"wp-google-maps\").\"</li>\n </ul>\n </p>\n </div>\n\n <p style='clear: both;'>Polygon data:<br /><textarea name=\\\"wpgmza_polygon\\\" id=\\\"poly_line_list\\\" style=\\\"width:90%; height:100px; border:1px solid #ccc; background-color:#FFF; padding:5px; overflow:auto;\\\"></textarea>\n <!-- <p style='clear: both;'>Polygon data:<br /><textarea name=\\\"wpgmza_polygon_inner\\\" id=\\\"poly_line_list_inner\\\" style=\\\"width:90%; height:100px; border:1px solid #ccc; background-color:#FFF; padding:5px; overflow:auto;\\\"></textarea> -->\n <p class='submit'><a href='javascript:history.back();' class='button button-secondary' title='\".__(\"Cancel\").\"'>\".__(\"Cancel\").\"</a> <input type='submit' name='wpgmza_save_poly' class='button-primary' value='\".__(\"Save Polygon\",\"wp-google-maps\").\" &raquo;' /></p>\n\n </form>\n </div>\n </div>\n \";\n }\n}", "function guifi_radio_add_wds_form(&$form,&$form_state) {\n guifi_log(GUIFILOG_TRACE,\"function guifi_radio_add_wds_form\",$form_state['newInterface']);\n\n $form_weight = 0;\n $form_state['values']['newInterface']=$form_state['newInterface'];\n\n // store all the form_stat values\n guifi_form_hidden($form,$form_state['values'],$form_weight);\n\n // Initialize filters\n if (empty($form_state['values']['filters']))\n $form_state['values']['filters'] = $form_state['filters'];\n\n drupal_set_title(t(\n 'Choose an AP from the list to link with %ssid',\n array(\n '%ssid'=> $form_state['values']['radios']\n [$form_state['filters']['from_radio']]['ssid'])));\n\n // Filter form\n $form['filters_region'] = guifi_devices_select_filter($form_state, 'guifi_radio_add_wds_confirm_submit');\n\n $form['list-devices'] = guifi_devices_select($form_state['values']['filters'], 'guifi_radio_add_wds_confirm_submit');\n\n return FALSE;\n}", "function vistaportal_form_med_add($form, &$form_state) {\n $form_state['m_num_schools']++;\n $form_state['rebuild'] = TRUE;\n }", "public function view_adding_instruction(){\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_instructions';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Add Instructions',\n\t\t\t'courselist' => $this->setting_model->Get_All('course'),\n\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}", "public function f02()\n {\n }", "private function get_add_cashflow(){\n\t\t$a_e = new FinMathAnnuityEscalating();\n\t\t$a_i = new FinMathAnnuityIncreasing();\n\t\t$c_e = new FinMathCashflow( 0, 0, $a_e );\n\t\t$c_i = new FinMathCashflow( 0, 0, $a_i );\n\t\t$parameters = array();\n\t\t$parameters['single_payment'] = array(\n\t\t\t'name'=> 'single_payment',\n\t\t\t'label' => self::myMessage( 'fm-single_payment'),\n\t\t\t);\n\t\t$parameters_c = array_merge( $c_e->get_parameters(), $c_i->get_parameters() );\n\t\t$parameters = array_merge( $parameters, $parameters_c );\n\t\t$valid_options = array_merge( $c_e->get_valid_options(), $c_i->get_valid_options() );\n\t\t$valid_options['single_payment'] = array( 'type' => 'boolean' );\n\t\t$valid_options['consider_increasing'] = array( 'type' => 'boolean' );\n\t\t$parameters['consider_increasing'] = array(\n\t\t\t'name'=> 'consider_increasing',\n\t\t\t'label' => self::myMessage( 'fm-consider_increasing'),\n\t\t\t);\n\t\tforeach ( array('value','delta', 'escalation_delta', \"source_m\",\"source_advance\",\"source_rate\") as $p ){\n\t\t\tunset( $parameters[ $p ] );\n\t\t\tunset( $valid_options[ $p ] );\n\t\t}\n\t\t$values = array_merge( $c_e->get_values(), $c_i->get_values() );\n\t\t$form = array();\n\t\t$form['method'] = 'GET';\n\t\t$form['parameters'] = $parameters;\n\t\t$form['valid_options'] = $valid_options;\n\t\t$form['request'] = 'add_cashflow';\n\t\t$form['render'] = 'HTML';\n\t\t$form['introduction'] = self::myMessage( 'fm-add-a-cashflow') ;\n\t\t$form['submit'] = self::myMessage( 'fm-add') ;\n\t\t$form['exclude'] = array( \"i_effective\" );\n\t\t$form['values'] = $values;\n\t\t$form['hidden'] = $this->get_hidden_cashflow_fields();\n\t\treturn $form;\n\t}", "public function create()\n {\n return view('admin.workouts.create');\n }", "function add_new() {\r\n\t\techo \"<form action='warranty.php' method='post'>\r\n\t\t\t\t<input type='hidden' name='action' value='save_new'>\r\n\t\t\t\t<fieldset><legend>Add New Warranty Call:</legend>\r\n\t\t\t\t<table cellspacing=0 cellpadding=2>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Heat Call ID</th>\r\n\t\t\t\t\t\t<td><input type='text' name='heatid' size=25 autofocus></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>DCX Call Ref</th>\r\n\t\t\t\t\t\t<td><input type='text' name='dcxref' size=25></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Serial No</th>\r\n\t\t\t\t\t\t<td><input type='text' name='serial' size=25></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Model No</th>\r\n\t\t\t\t\t\t<td><input type='text' name='modelno' size=25></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>User Name</th>\r\n\t\t\t\t\t\t<td><input type='text' name='user_name' size=25></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>User Location</th>\r\n\t\t\t\t\t\t<td><input type='text' name='userlocation' size=25></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>User Department</th>\r\n\t\t\t\t\t\t<td><input type='text' name='userdept' size=25></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Fault Description</th>\r\n\t\t\t\t\t\t<td><textarea name='f_desc' cols='30' rows='4'></textarea></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Call Status</th>\r\n\t\t\t\t\t\t<td><select name='f_stat'><option value='Call logged'>Call logged<option value='Awaiting parts'>Awaiting parts<option value='Repaired'>Repaired</select></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=2 align='center'><input type='submit' value='Save'></td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\r\n\t\t\t\t</fieldset>\r\n\t\t\t</form>\r\n\r\n\t\t\t<table>\r\n\t\t\t\t<tr><td><form action='index.php' method='post'><input type='submit' value='HOME'></form></td>\r\n\t\t\t\t<td><form action='warranty.php' method='post'><input type='hidden' name='action' value='showopen'><input type='submit' value='Show Open'></form></td>\r\n\t\t\t\t<td><form action='warranty.php' method='post'><input type='hidden' name='action' value='showall'><input type='submit' value='Show All'></form></tr>\r\n\t\t\t</table>\";\r\n\t}", "function display_add() {\n $this->_addform->display();\n }", "function recommends_req_wizard_next_submit($form, &$form_state) {\n\n $current_step = &$form_state['step'];\n $form_state['step_information'][$current_step]['stored_values'] = $form_state['values'];\n \n/////////////// \nif ($form_state['step'] == 1) {\n \n $format = variable_get('date_format_long', 'l, F j, Y - H:i');\n date_default_timezone_set('America/New_York');\n $date = date(\"c\") ;\n $timestamp = substr($date,0,19); \n \n $form_state['prefix'] = $form_state['values']['prefix'];\n $form_state['firstname'] = $form_state['values']['first_name'] ;\n $form_state['lastname'] = $form_state['values']['last_name'];\n $form_state['initial'] = $form_state['values']['initial'];\n $form_state['suffix'] = $form_state['values']['suffix'] ;\n $form_state['s_email'] = $form_state['values']['email'];\n $form_state['s_school'] = \"Clayton\";\n $form_state['s_req_date'] = $timestamp;\n $form_state['s_master_doc'] = $form_state['values']['reqby'] ;\n $form_state['s_comments'] = $form_state['values']['comments'] ;\n $form_state['s_timestamp'] = $timestamp;\n }\n \n if ($form_state['step'] == 2) {\n \n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n \n \t\t$form_state['schoolname'][$i] = $form_state['values']['schname'][$i]['schoolname'];\n \t\t$form_state['schoolprogram'][$i] = $form_state['values']['schname'][$i]['schoolprogram'];\n \t\t\n \t\t$form_state['r_school_contact_email'][$i] = $form_state['values']['schname'][$i]['school_contact_email'];\n \t\t$form_state['r_school_contact_postal'][$i] = $form_state['values']['schname'][$i]['school_contact_postal'];\n \t\t\n \t\t$form_state['r_date_due'][$i]['month'] = $form_state['values']['schname'][$i]['r_date_due']['month'];\n \t\t\n \t\t$form_state['r_date_due'][$i]['day'] = $form_state['values']['schname'][$i]['r_date_due']['day'];\n \t\t$form_state['r_date_due'][$i]['year'] = $form_state['values']['schname'][$i]['r_date_due']['year'];\n \t\t\n \t\t\n };\n }\n \n if ($form_state['step'] == 3) {\n if ($form_state['num_courses'] == 0) {\n drupal_goto('recommends_req/wizard/intro');\n }\n \n for ($i = 1; $i <= $form_state['num_courses']; $i++) {\n \t\t$pid = $form_state['step_information'][3]['stored_values']['crsname'][$i]['i_pid'];\n \t\t\n \t\n \t\t\n \t\tif (in_array($pid, $form_state['entries'])) {\n \t\t\n \t\t\n \t\t $form_state['coursenum'][$i] = $form_state['entries'][$pid]->i_course;\n \t\t $form_state['coursesemester'][$i] = $form_state['entries'][$pid]->i_semester;\n \t\t $form_state['courseyear'][$i] = $form_state['entries'][$pid]->i_year;\n \t\t $form_state['courseother'][$i] = \" \";\n \t\t} else\n \t\t{\n \t\t $form_state['coursenum'][$i] = $form_state['complete form']['crsname'][1]['i_pid']['#options'][$pid];\n \t\t $form_state['coursesemester'][$i] = \"NA\";\n \t\t $form_state['courseyear'][$i] = \"NA\";\n \t\t $form_state['courseother'][$i] = $form_state['step_information'][3]['stored_values']['crsname'][$i]['i_other']; \n \t\t}\n \t\t\n \t\t\n };\n }\n \n if ($current_step < count($form_state['step_information'])) {\n $current_step++;\n if (!empty($form_state['step_information'][$current_step]['stored_values'])) {\n $form_state['values'] = $form_state['step_information'][$current_step]['stored_values'];\n }\n else {\n $form_state['values'] = array();\n }\n $form_state['rebuild'] = TRUE; // Force rebuild with next step.\n return;\n }\n}", "function createCtfEstimateForm($extra=false) {\n\t// check if coming directly from a session\n\t$expId = $_GET['expId'];\n\tif ($expId) {\n\t\t$sessionId=$expId;\n\t\t$formAction=$_SERVER['PHP_SELF'].\"?expId=$expId\";\n\t}\n\telse {\n\t\t$sessionId=$_POST['sessionId'];\n\t\t$formAction=$_SERVER['PHP_SELF'];\t\n\t}\n\t$projectId=getProjectId();\n\n\t// check if running ctffind or ctftilt\n\t$progname = \"Xmipp CTF Estimator\";\n\t$runbase = \"xmippctf\";\n\n\t$presetval = ($_POST['preset']) ? $_POST['preset'] : 'en';\n\t$javafunctions = \"\";\n\t$javafunctions .= writeJavaPopupFunctions('appion');\n\tprocessing_header(\"$progname Launcher\", \"$progname\", $javafunctions);\n\n\tif ($extra) {\n\t\techo \"<font color='#cc3333' size='+2'>$extra</font>\\n<hr/>\\n\";\n\t}\n\n\techo\"\n\t<form name='viewerform' method='POST' action='$formAction'>\\n\";\n\t$sessiondata=getSessionList($projectId,$expId);\n\t$sessioninfo=$sessiondata['info'];\n\t$presets=$sessiondata['presets'];\n\tif (!empty($sessioninfo)) {\n\t\t$sessionpath=getBaseAppionPath($sessioninfo).'/ctf/';\n\t}\n\t$ctf = new particledata();\n\t$lastrunnumber = $ctf->getLastRunNumberForType($sessionId,'ApAceRunData','name'); \n\twhile (file_exists($sessionpath.$runbase.'run'.($lastrunnumber+1)))\n\t\t$lastrunnumber += 1;\n\t$defrunname = ($_POST['runname']) ? $_POST['runname'] : $runbase.'run'.($lastrunnumber+1);\n\n\t// set defaults and check posted values\n\t$form_fieldsz = ($_POST['fieldsize']) ? $_POST['fieldsize'] : 512;\n\t$form_resmin = ($_POST['resmin']) ? $_POST['resmin'] : '100';\n\t$form_resmax = ($_POST['resmax']) ? $_POST['resmax'] : '10';\n\n\techo\"\n\t<TABLE BORDER=0 CLASS=tableborder CELLPADDING=15>\n\t<TR>\n\t <TD VALIGN='TOP'>\";\n\n\tcreateAppionLoopTable($sessiondata, $defrunname, \"ctf\");\n\techo\"\n\t </TD>\n\t <TD CLASS='tablebg'>\";\n\n\techo \"<b>$progname Values</b><br/>\\n\";\n\techo \"<INPUT TYPE='text' NAME='fieldsize' VALUE='$form_fieldsz' size='6'>\\n\";\n\techo docpop('field','Field Size');\n\techo \"<br />\\n\";\n\techo \"<input type='text' name='resmin' value='$form_resmin' size='6'>\\n\";\n\techo docpop('resmin','Minimum Resolution');\n\techo \" (&Aring;ngstroms)<br />\\n\";\n\techo \"<input type='text' name='resmax' value='$form_resmax' size='6'>\\n\";\n\techo docpop('resmax','Maximum Resolution');\n\techo \" (&Aring;ngstroms)<br />\\n\";\n\techo \"<br />\\n\";\n\n\techo\"\n\t </TD>\n\t</tr>\n\t<TR>\n\t <TD COLSPAN='2' ALIGN='CENTER'>\\n<hr />\";\n\techo getSubmitForm(\"Run $progname\");\n\techo \"\n\t </td>\n\t</tr>\n\t</table>\n\t</form>\\n\";\n\n\techo referenceBox(\"Fast, robust, and accurate determination of transmission electron microscopy contrast transfer function.\", 2007, \"Sorzano CO, Jonic S, Núñez-Ramírez R, Boisset N, Carazo JM.\", \"J Struct Biol.\", 160, 2, 17911028, false, false, \"img/xmipp_logo.png\");\n\n\tprocessing_footer();\n}", "public static function workflowFeatures();", "function pickup_submit()\n\t{\n\t\t$year = $this->name . '_year';\n\t\t$month = $this->name . '_month';\n\t\t$day = $this->name . '_day';\n\t\tglobal $$year, $$month, $$day;\n\n\t\t$this->value = $$year . \".\" . $$month . \".\" . $$day;\n\t}", "public function add_question_form()\n\t{\t\n\t\t$CI =& get_instance();\n\t\t$CI->auth->check_operator_auth();\n\t\t$CI->load->library('loquestion');\n\t\t\n $content = $CI->loquestion->question_add_form();\n \n $sub_menu = array(\n\t\t\t\tarray('label'=> display('manage_question'), 'url' => 'operator/Oquestion'),\n\t\t\t\tarray('label'=> display('add_question'), 'url' => 'operator/Oquestion/add_question_form','class' =>'active')\n\t\t\t);\n\t\t$this->template->full_operator_html_view($content,$sub_menu);\n\t}", "function BuildStartForm($legend) {\n $fv = new filterVars;\n $phpSelf = $fv->phpSelf(); \n echo \"<fieldset>\";\n echo \"<legend>\";\n echo $this->homeButton(); \n echo \" $legend\"; \n echo \"</legend>\";\n echo \"<form action='$phpSelf?' method='get' enctype='text/plain' target='_parent'>\\n\"; \n }", "function weldata_form_weld_cost_estimator_node_form_alter(&$form, &$form_state){\n//TODO: Use ajax in this function to alter field_suffix\n$form['actions']['preview']['#value'] = \"Calculate\";\n$node = $form_state['node'];\n if(isset($node->nid)){\n $unit = field_get_items('node', $node, 'field_unit')[0]['value'];\n if($unit == 'metric'){\n $form['field_weld_length'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_leg_size'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_leg_size_2'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_slot_length'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_slot_width'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_top_length'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_bottom_length'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_top_width'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_bottom_width'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_height_of_patch'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_thickness'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_thickness_bottom'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n\n $form['field_cap_height'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_cap_height_bottom'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_extension'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_extension_thickness'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_throat'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_clad_length'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_clad_thickness'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_root_gap'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_radius'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_diameter'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_land_thickness'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n //Filler\n $form['field_filler_density'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'g/cc';\n $form['field_wire_diameter'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm';\n $form['field_wire_feed_speed'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'mm/min';\n $form['field_gas_flow'][LANGUAGE_NONE][0]['value']['#field_suffix'] = 'CMH';\n }\n }\n}", "function getToolDisplay($organism_version,$annotations,$query,$query_type){\n global $queryTypes; if(empty($query))$query=\"2:105509053-105543317\";\n $data='<div id=\"tool-main\"><div class=\"tool\" style=\"z-index=0;\"><table><tr>';\n //<td rowspan=\"2\" width=\"70\"> \n $options='<select name=\"queryType\" id=\"anotselect\" onchange=\"updateToolDoc();populateOrganismList();\">';\n foreach ($queryTypes as $key=> $value){\n if($key==\"$query_type\")$options.=\"<option value='$key' selected>$value</option>\";\n else $options.=\"<option value='$key'>$value </option>\";\n }\n $options.='</select><br/><br/>'; \n $data.='<td style=\"padding-left:3em;padding-top:2em;padding-bottom:1em;\">\n <span><h3>Enter A Genomic region of interest Or a Term\n <a name=\"qhint\" class=\"qhint\" onmouseover=\"javascript:document.getElementById(\\'qhint\\').style.display=\\'block\\';\" \n onmouseout=\"document.getElementById(\\'qhint\\').style.display=\\'none\\';\"> (?) </a></h3></span><br/>\n <div id=\"qhint\"><h4>You can query using the following terms:</h4>\n <span><b>A gene symbol or id: </b> (pax6,Cnksr3,ENSMUSG00000015202,MGI:3801900,...)</span>\n <br/><span><b>A trancript symbol or id :</b> (ENSMUST00000144335, ...) </span>\n <br/><span> <b>Genomic range (bp or Mbp) :</b>\n 10: 3134304 - 3227479 OR 10: 3.1 - 3.2</span>\n \n </div>';\n $data.=\"<input type=\\\"txt\\\" name=\\\"q\\\" id=\\\"q\\\" size=\\\"50\\\" value=\\\"$query\\\"\";\n $data.='onclick=\\'this.value=\"\";\\'/><br/><br/>\n <h2>Or</h2><label for=\"file\"><h3>upload a file Containing genomic cordinates:</h3></label><br/>\n <input type=\"file\" name=\"file\" id=\"file\">\n </td>';\n $data.=\"<td>$options\";\n $data.='<select name=\"org\" id=\"organism\" onchange=\"updateAnnotList();\">';\n $data.='<option value=\"0\" selected=\"selected\">Select The Reference Organism Version</option>';\n $datas.=displayOrganismList($query_type); \n $organisms=split(\",\",$datas);\n foreach($organisms as $organismdata){\n list($u_oversion,$org,$db)=split(\":\",$organismdata);\n if($db==\"$organism_version\")\n $data.=\"<option value=\\\"$db\\\" selected>$org &nbsp;($db )</option>\";\n else $data.=\"<option value=\\\"$db\\\">$org &nbsp; ($db)</option>\";\n }\n $data.=\"</select><br/><br/>\";\n $data.='<input type=\"submit\" class=\"sb\" name=\"submit\" value=\"submit\" onclick=\"validate();getFile();\">\n <input type=\"reset\" name=\"reset\" class=\"sb\"></div></td></tr>';\n $data.='<tr><td colspan=\"2\"><div id=\"filter\">';\n $data.='</div></td></tr></table></div>';\n return $data;\n}", "function formHolidays() {\n\t\t$output = $formField = $deductionBox = \"\"; $status = 1;\n\t\t$this->schema = Info::DB_NAME;\n\t\t$getPopupValue[] = $fieldValue[] = \"\";\n\t\tif($this->popupFormID){\n\t\t\t$getPopupValue = $this->getValueDB([\"table\"=>$this->Params['table'],\"id\"=>$this->popupFormID]);\n\t\t\t$status = $getPopupValue['status'];\n\t\t}\n\t\t$varLists = ['holiday_type','set_date','title','description'];\n\t\tforeach($varLists as $var){\n\t\t\t$fieldValue[$var] = (isset($getPopupValue[$var]) && $this->popupFormID) ? $getPopupValue[$var] : \"\";\n\t\t}\n\t\t$holiday_type = $this->inputGroup(['label'=>'Type','type'=>'select','id'=>'holiday_type','name'=>'holiday_type','meta_key'=>'holiday_type','meta'=>'codebook','placeholder'=>'Type of Holiday','value'=>$fieldValue['holiday_type']]);\n\t\t$title = $this->inputGroup(['label'=>'Title','type'=>'text','id'=>'title','name'=>'title','placeholder'=>'Title/Name','value'=>$fieldValue['title']]);//$this->Params['first_name']\n\t\t$set_date = $this->inputGroup(['label'=>'Date','type'=>'date','id'=>'set_date','name'=>'','placeholder'=>'Date of Holiday','value'=>$fieldValue['set_date']]);//$this->Params['middle_name']\n\t\t$description = $this->inputGroup(['label'=>'Description','type'=>'text','id'=>'description','name'=>'description','title'=>'Description','placeholder'=>'Description/Notes','value'=>$fieldValue['description']]);//$getValue[0]['address']\n\t\t$popUpTitle = str_replace(\"_\",\" \",$this->Params['table']);\n\t\t$formField .= \"<div class='x_panel no-padding'><div class='box_title'><h2 class='left capitalize'>{$popUpTitle} Information Details</h2></div><div class='x_content no-padding'>\";\n\t\t$formField .= \"\n\t\t\t<div class=''>\n\t\t\t\t<div class='form-group no-padding item'>\n\t\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$holiday_type}</div>\n\t\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$set_date}</div>\n\t\t\t\t</div>\n\t\t\t\t<div class='form-group no-padding item'>\n\t\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$title}</div>\n\t\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$description}</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t</div>\n\t\t\";\n\t\t$output .= \"\n <form id='createRecords' data-toggle='validator' name='{$this->Params['meta']}' class='form-label-left input_mask' novalidate>\n\t\t\t\t<input type='hidden' name='action' id='action' value='createRecords' />\n\t\t\t\t<input type='hidden' name='table' id='table' value='{$this->Params['table']}' />\n\t\t\t\t<input type='hidden' name='set_date' id='this_date' value='{$fieldValue['set_date']}' />\n\t\t\t\t<input type='hidden' name='theID' id='theID' value='{$this->Params['value']}' />\n\t\t\t\t{$formField}\n\t\t\t</form>\n \";\n\t\t$output .= \"<script>\n\t\t\t$(document).ready(function() {\n\t\t\t\twebshims.setOptions('forms-ext', {replaceUI: 'auto', types: 'number'});webshims.polyfill('forms forms-ext');\n\t\t\t\t$('.select2_single').each(function() {\n\t\t\t\t\t$(this).select2({\n\t\t\t\t\t\tplaceholder: $(this).attr('placeholder'),\n\t\t\t\t\t\tallowClear: false\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\t$(':input').inputmask();\n\t\t\t\t$('input#set_date.date-picker').val(moment($('input#set_date.date-picker').val(),'YYYY/MM/DD').format('MMMM D'));\n\t\t\t});\n\t\t\t\n\t\t\t$('input#set_date.date-picker').daterangepicker({\n\t\t\t\tsingleDatePicker: true,\n\t\t\t\topens: 'right',\n\t\t\t\tcalender_style: 'picker_4',\n\t\t\t\tautoUpdateInput: false,\n\t\t\t\tlocale: {\n\t\t\t\t\tformat: 'MMMM D'\n\t\t\t\t}\n\t\t\t}, function (start, end, label) {\n\t\t\t\t$('input[name=set_date]').val(moment(end,'MMMM D').format('YYYY/MM/DD'));\n\t\t\t\tconsole.log(start.toISOString(), end.toISOString(), label);\n\t\t\t});\n\t\t\t\n\t\t\t$('input#set_date').on('apply.daterangepicker', function(ev, picker) {\n\t\t\t\t$(this).val(picker.startDate.format('MMMM D'));\n\t\t\t\t$('input[name=set_date]').val(picker.startDate.format('YYYY/MM/DD'));\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t</script>\";\n\t\treturn $output;\n\t}", "function createForm($extra=false, $title='PDB to EM', $heading='PDB to EM Density') {\n\t$expId=$_GET['expId'];\n\n\t$projectId=getProjectId();\n\t$formAction=$_SERVER['PHP_SELF'].\"?expId=$expId\";\n \n\t$javafunctions = writeJavaPopupFunctions('appion');\n\t$particle = new particledata();\n\n\tprocessing_header($title,$heading,$javafunctions,True);\n\t// write out errors, if any came up:\n\tif ($extra) {\n\t\techo \"<font color='#cc3333' size='+2'>$extra</font>\\n<hr/>\\n\";\n\t}\n \n\techo\"<FORM NAME='viewerform' method='POST' ACTION='$formAction'>\\n\";\n\t$sessiondata=getSessionList($projectId,$expId);\n\t$sessioninfo=$sessiondata['info'];\n\t\n\tif (!empty($sessioninfo)) {\n\t\t$outdir=getBaseAppionPath($sessioninfo).'/models';\n\t\t$outdir=$outdir.\"/pdb\";\n\t\t$sessionname=$sessioninfo['Name'];\n\t\techo \"<input type='hidden' name='sessionname' value='$sessionname'>\\n\";\n\t\techo \"<input type='hidden' name='outdir' value='$outdir'>\\n\";\n\t}\n \n\t// Set any existing parameters in form\n\t$lowpass = ($_POST['lowpass']) ? $_POST['lowpass'] : '';\n\t$symm = ($_POST['symm']) ? $_POST['symm'] : '';\n\t$runtime = ($_POST['runtime']) ? $_POST['runtime'] : getTimestring();\n\t$apix = ($_POST['apix']) ? $_POST['apix'] : '';\n\t$pdbid = ($_POST['pdbid']) ? $_POST['pdbid'] : '';\n\t$box = ($_POST['box']) ? $_POST['box'] : '';\n\t$bunitcheck = ($_POST['bunit'] == 'on') ? 'checked' : '';\n\n\techo \"<table class=tablebubble cellspacing='8'>\";\n\n\techo \"<tr><td valign='top'>\\n\";\n\n\techo docpop('pdbid', '<b>PDB ID:</b>');\n\techo \"<input type='text' name='pdbid' value='$pdbid' size='5'><br />\\n\";\n\techo \"<input type='hidden' name='runtime' value='$runtime'>\\n\";\n\n\techo \"</td></tr>\\n\";\n\techo \"<tr><td valign='top'>\\n\";\n\n\techo \"<input type='checkbox' name='bunit' $bunitcheck>\\n\";\n\techo \"Use the \";\n\techo docpop('biolunit', \"biological unit\");\n\n\techo \"</td></tr>\\n\";\n\techo \"<tr><td valign='top'>\\n\";\n\n\techo docpop('outdir', 'Output directory').\"<br/>\\n\";\n\techo \"<input type='text' name='outdir' value='$outdir' size='40'>\\n\";\n\n\techo \"</td></tr>\\n\";\n\techo \"<tr><td valign='top' class='tablebg'>\\n\";\n\n\techo \"<input type='text' name='lowpass' value='$lowpass' size='5'>\\n\";\n\techo \"&nbsp;Low pass filter\\n\";\n\n\techo \"</td></tr>\\n\";\n\techo \"<tr><td valign='top' class='tablebg'>\\n\";\n\n\t$syms = $particle->getSymmetries();\n echo \"<select name='symm'>\\n\";\n echo \"<option value=''>select one...</option>\\n\";\n\tforeach ($syms as $sym) {\n\t\techo \"<option value='$sym[DEF_id]'\";\n\t\tif ($sym['DEF_id']==$_POST['symm'])\n\t\t\techo \" selected\";\n\t\techo \">$sym[symmetry]\";\n\t\tif ($sym['symmetry']=='C1')\n\t\t\techo \" (no symmetry)\";\n\t\techo \"</option>\\n\";\n\t}\n\techo \"</select>\\n\";\n\techo \"&nbsp;Symmetry group <i>e.g.</i> c1\\n\";\n\n\techo \"</td></tr>\\n\";\n\techo \"<tr><td valign='top' class='tablebg'>\\n\";\n\n echo \"<select name='method'>\\n\";\n\t echo \"<option value='eman'\";\n\t\tif ($_POST['method']=='eman')\n\t\t\techo \" selected\";\n\t echo \">EMAN: pdb2mrc</option>\\n\";\n\n\t echo \"<option value='spider'\";\n\t\tif ($_POST['method']=='spider')\n\t\t\techo \" selected\";\n\t echo \">SPIDER: CP FROM PDB</option>\\n\";\n\techo \"</select>\\n\";\n\techo \"&nbsp;Program to convert PDB\\n\";\n\n\techo \"</td></tr>\\n\";\n\techo \"<tr><td valign='top' class='tablebg'>\\n\";\n\n\techo docpop('apix', 'Pixel size').\"<br/>\\n\";\n\techo \"<input type='text' name='apix' value='$apix' size='5'>\\n\";\n\techo \"&nbsp;<font size='-2'>(in &Aring;ngstroms)</font>\\n\";\n\n\techo \"</td></tr>\\n\";\n\techo \"<tr><td valign='top' class='tablebg'>\\n\";\n\n\techo docpop('boxsize', 'Box size').\"<br/>\\n\";\n\techo \"<input type='text' name='box' value='$box' size='5'>\\n\";\n\techo \"&nbsp;<font size='-2'>(default provided)</font>\\n\";\n\n\techo \"</td></tr>\\n\";\n\techo \"<tr><td valign='top' class='tablebg'>\\n\";\n\n\techo \"<input type='checkbox' name='viper2eman' $viper2eman>\\n\";\n\techo docpop('viper2eman', \"convert VIPER to EMAN orientation\");\n\n\techo \"</td></tr>\\n\";\n\techo \"<tr><td align='center'>\\n\";\n\n\techo \"<hr>\";\n\techo getSubmitForm(\"Create Model\");\n\n\techo \"</td></tr>\\n\";\n\techo \"</table>\\n\";\n\techo \"</form>\\n\";\n\n\techo initModelRef();\n\n\tprocessing_footer();\n\texit;\n}", "function process_form()\n {\n }", "function get_inspection_history_callback($form, &$form_state) {\n return $form['main_box'];\n}", "function getSaddleCost (&$labor, &$rawCost, $quantity) {\nif ($_POST[\"saddle\"] == \"saddle\") {\n\t$saddleLabor = (($quantity/SADDLEPERHOUR) * HOUR);\n\t$saddleCost = ($quantity * STAPLE);\n\t}\nelse {\n\t$saddleLabor = 0;\n\t$saddleCost = 0;\n\t}\n$labor += $saddleLabor;\n$rawCost += $saddleCost;\n}", "public function run() {\n Workplace::factory(10)->create()->each(function ($workplace) {\n WorkFunction::factory(5)->make()->each(function ($workFunction) use ($workplace) {\n $workplace->workFunctions()->save($workFunction);\n });\n });\n }", "public function listAction()\n {\n//\n $request = $this->getRequest();\n\n $routeMatch = $this->getEvent()->getRouteMatch();\n $id = $routeMatch->getParam('workout_id', 0);\n\n if ($id <= 0) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n /**\n * Grid FORM\n */\n $form = new WorkoutExerciseGrid(\n array(\n 'view' => $this->_view,\n )\n );\n\n /**\n * BUILDING LIST\n */\n $list = new WorkoutExerciseResultSet(\n array(\n 'model' => $this->_exercise,\n 'view' => $this->_view,\n )\n );\n\n $list->setFieldOptions('type_id', array(\n 'values' => $types = $this->_exerciseType->getBehaviour('nestedSet')->getResultSetForText(),\n ));\n\n $typesTemp = $this->_exerciseType->getResultSet()->toArray();\n $types = array();\n foreach ( $typesTemp as $key => $type) {\n $types[$type['type_id']] = $type;\n }\n\n\n $list->addField(\n 'results',\n 'custom',\n array(\n 'label' => 'results',\n 'sortable' => false,\n 'values' => $types,\n 'viewScript' => 'workout-exercise/_field_result.phtml',\n )\n );\n\n $list->setDbWhere('workout_id = ' . (int)$id);\n\n //\n $list->processRequest($this->getRequest());\n\n //\n $list->build();\n\n //\n $form->addSubForm($list, $list->getName());\n\n// //\n $this->_view->headScript()->appendScript(\n $this->_view->render(\n 'workout-exercise/list.js',\n array(\n 'back' => $this->url()->fromRoute('hi-training/workout/list'),\n 'delete' => $this->url()->fromRoute('hi-training/workout-exercise/delete/wildcard', array('exercise_id' => '')),\n 'edit' => $this->url()->fromRoute('hi-training/workout-exercise/edit/wildcard', array('exercise_id' => '')),\n 'add' => $this->url()->fromRoute('hi-training/workout-exercise/add/wildcard', array('workout_id' => $id)),\n )\n )\n );\n\n /**\n * POST\n */\n if ($this->getRequest()->isPost()) {\n\n $formData = $this->getRequest()->post()->toArray();\n\n\n if ($form->isValid($formData)) {\n \\Zend\\Debug::dump($formData);\n if ( isset($formData['header']['formId'])\n && $formData['header']['formId'] == 'WorkoutExerciseGridForm') {\n\n if (isset($formData['WorkoutExerciseResultSet']['actions']['saveSelected'])) {\n $allBox = $formData['WorkoutExerciseResultSet']['header']['all'];\n $rows = $formData['WorkoutExerciseResultSet']['rows'];\n\n foreach ($rows as $key => $row) {\n if ($row['id'] || $allBox) {\n $exercise = $this->_exercise->getRow(array('exercise_id' => $key));\n $exercise->populate($row['row']);\n $exercise->save();\n\n }\n }\n\n return $this->redirect()->toRoute('hi-training/workout-exercise/list/wildcard', array('workout_id' => $id));\n }\n\n if (isset($formData['WorkoutExerciseResultSet']['actions']['deleteSelected'])) {\n\n $allBox = $formData['WorkoutExerciseResultSet']['header']['all'];\n $rows = $formData['WorkoutExerciseResultSet']['rows'];\n\n foreach ($rows as $key => $row) {\n if ($row['id'] || $allBox) {\n\n $exercise = $this->_exercise->getRow(array('exercise_id' => $key));\n $exercise->delete();\n\n }\n }\n\n return $this->redirect()->toRoute('hi-training/workout-exercise/list/wildcard', array('workout_id' => $id));\n//\n }\n }\n }\n }\n\n return array(\n 'form' => $form,\n 'workout' => $this->_workout->getRow(array('workout_id'=>$id)),\n );\n\n }", "public function run() {\n\n $workSchedules = [\n // Morning Shift Variants\n [\"code\" => \"MFMS1\", \"display_name\" => \"Monday - Friday, Morning Shift 1\"],\n [\"code\" => \"MFMS2\", \"display_name\" => \"Monday - Friday, Morning Shift 2\"],\n [\"code\" => \"MFMS3\", \"display_name\" => \"Monday - Friday, Morning Shift 3\"],\n [\"code\" => \"MFMS4\", \"display_name\" => \"Monday - Friday, Morning Shift 4\"],\n // Mid Shift Variants\n [\"code\" => \"MFMDS1\", \"display_name\" => \"Monday - Friday, Mid Shift 1\"],\n [\"code\" => \"MFMDS2\", \"display_name\" => \"Monday - Friday, Mid Shift 2\"],\n [\"code\" => \"MFMDS3\", \"display_name\" => \"Monday - Friday, Mid Shift 3\"],\n [\"code\" => \"MFMDS4\", \"display_name\" => \"Monday - Friday, Mid Shift 4\"],\n // Night Shift Variants\n [\"code\" => \"MFNS1\", \"display_name\" => \"Monday - Friday, Night Shift 1\"],\n [\"code\" => \"MFNS2\", \"display_name\" => \"Monday - Friday, Night Shift 2\"],\n [\"code\" => \"MFNS3\", \"display_name\" => \"Monday - Friday, Night Shift 3\"],\n [\"code\" => \"MFNS4\", \"display_name\" => \"Monday - Friday, Night Shift 4\"],\n ];\n\n WorkSchedule::insert($workSchedules);\n\n $workScheduleShifts = [\n // MFMS1\n [\"work_schedule_code\" => \"MFMS1\", \"shift_code\" => \"DO\", \"week_day\" => 1],\n [\"work_schedule_code\" => \"MFMS1\", \"shift_code\" => \"MS1\", \"week_day\" => 2],\n [\"work_schedule_code\" => \"MFMS1\", \"shift_code\" => \"MS1\", \"week_day\" => 3],\n [\"work_schedule_code\" => \"MFMS1\", \"shift_code\" => \"MS1\", \"week_day\" => 4],\n [\"work_schedule_code\" => \"MFMS1\", \"shift_code\" => \"MS1\", \"week_day\" => 5],\n [\"work_schedule_code\" => \"MFMS1\", \"shift_code\" => \"MS1\", \"week_day\" => 6],\n [\"work_schedule_code\" => \"MFMS1\", \"shift_code\" => \"DO\", \"week_day\" => 7],\n // MFMS2\n [\"work_schedule_code\" => \"MFMS2\", \"shift_code\" => \"DO\", \"week_day\" => 1],\n [\"work_schedule_code\" => \"MFMS2\", \"shift_code\" => \"MS2\", \"week_day\" => 2],\n [\"work_schedule_code\" => \"MFMS2\", \"shift_code\" => \"MS2\", \"week_day\" => 3],\n [\"work_schedule_code\" => \"MFMS2\", \"shift_code\" => \"MS2\", \"week_day\" => 4],\n [\"work_schedule_code\" => \"MFMS2\", \"shift_code\" => \"MS2\", \"week_day\" => 5],\n [\"work_schedule_code\" => \"MFMS2\", \"shift_code\" => \"MS2\", \"week_day\" => 6],\n [\"work_schedule_code\" => \"MFMS2\", \"shift_code\" => \"DO\", \"week_day\" => 7],\n // MFMS3\n [\"work_schedule_code\" => \"MFMS3\", \"shift_code\" => \"DO\", \"week_day\" => 1],\n [\"work_schedule_code\" => \"MFMS3\", \"shift_code\" => \"MS3\", \"week_day\" => 2],\n [\"work_schedule_code\" => \"MFMS3\", \"shift_code\" => \"MS3\", \"week_day\" => 3],\n [\"work_schedule_code\" => \"MFMS3\", \"shift_code\" => \"MS3\", \"week_day\" => 4],\n [\"work_schedule_code\" => \"MFMS3\", \"shift_code\" => \"MS3\", \"week_day\" => 5],\n [\"work_schedule_code\" => \"MFMS3\", \"shift_code\" => \"MS3\", \"week_day\" => 6],\n [\"work_schedule_code\" => \"MFMS3\", \"shift_code\" => \"DO\", \"week_day\" => 7],\n // MFMS4\n [\"work_schedule_code\" => \"MFMS4\", \"shift_code\" => \"DO\", \"week_day\" => 1],\n [\"work_schedule_code\" => \"MFMS4\", \"shift_code\" => \"MS4\", \"week_day\" => 2],\n [\"work_schedule_code\" => \"MFMS4\", \"shift_code\" => \"MS4\", \"week_day\" => 3],\n [\"work_schedule_code\" => \"MFMS4\", \"shift_code\" => \"MS4\", \"week_day\" => 4],\n [\"work_schedule_code\" => \"MFMS4\", \"shift_code\" => \"MS4\", \"week_day\" => 5],\n [\"work_schedule_code\" => \"MFMS4\", \"shift_code\" => \"MS4\", \"week_day\" => 6],\n [\"work_schedule_code\" => \"MFMS4\", \"shift_code\" => \"DO\", \"week_day\" => 7],\n // MFMDS1\n [\"work_schedule_code\" => \"MFMDS1\", \"shift_code\" => \"DO\", \"week_day\" => 1],\n [\"work_schedule_code\" => \"MFMDS1\", \"shift_code\" => \"MDS1\", \"week_day\" => 2],\n [\"work_schedule_code\" => \"MFMDS1\", \"shift_code\" => \"MDS1\", \"week_day\" => 3],\n [\"work_schedule_code\" => \"MFMDS1\", \"shift_code\" => \"MDS1\", \"week_day\" => 4],\n [\"work_schedule_code\" => \"MFMDS1\", \"shift_code\" => \"MDS1\", \"week_day\" => 5],\n [\"work_schedule_code\" => \"MFMDS1\", \"shift_code\" => \"MDS1\", \"week_day\" => 6],\n [\"work_schedule_code\" => \"MFMDS1\", \"shift_code\" => \"DO\", \"week_day\" => 7],\n // MFMDS2\n [\"work_schedule_code\" => \"MFMDS2\", \"shift_code\" => \"DO\", \"week_day\" => 1],\n [\"work_schedule_code\" => \"MFMDS2\", \"shift_code\" => \"MDS2\", \"week_day\" => 2],\n [\"work_schedule_code\" => \"MFMDS2\", \"shift_code\" => \"MDS2\", \"week_day\" => 3],\n [\"work_schedule_code\" => \"MFMDS2\", \"shift_code\" => \"MDS2\", \"week_day\" => 4],\n [\"work_schedule_code\" => \"MFMDS2\", \"shift_code\" => \"MDS2\", \"week_day\" => 5],\n [\"work_schedule_code\" => \"MFMDS2\", \"shift_code\" => \"MDS2\", \"week_day\" => 6],\n [\"work_schedule_code\" => \"MFMDS2\", \"shift_code\" => \"DO\", \"week_day\" => 7],\n // MFMDS3\n [\"work_schedule_code\" => \"MFMDS3\", \"shift_code\" => \"DO\", \"week_day\" => 1],\n [\"work_schedule_code\" => \"MFMDS3\", \"shift_code\" => \"MDS3\", \"week_day\" => 2],\n [\"work_schedule_code\" => \"MFMDS3\", \"shift_code\" => \"MDS3\", \"week_day\" => 3],\n [\"work_schedule_code\" => \"MFMDS3\", \"shift_code\" => \"MDS3\", \"week_day\" => 4],\n [\"work_schedule_code\" => \"MFMDS3\", \"shift_code\" => \"MDS3\", \"week_day\" => 5],\n [\"work_schedule_code\" => \"MFMDS3\", \"shift_code\" => \"MDS3\", \"week_day\" => 6],\n [\"work_schedule_code\" => \"MFMDS3\", \"shift_code\" => \"DO\", \"week_day\" => 7],\n // MFMDS4\n [\"work_schedule_code\" => \"MFMDS4\", \"shift_code\" => \"DO\", \"week_day\" => 1],\n [\"work_schedule_code\" => \"MFMDS4\", \"shift_code\" => \"MDS4\", \"week_day\" => 2],\n [\"work_schedule_code\" => \"MFMDS4\", \"shift_code\" => \"MDS4\", \"week_day\" => 3],\n [\"work_schedule_code\" => \"MFMDS4\", \"shift_code\" => \"MDS4\", \"week_day\" => 4],\n [\"work_schedule_code\" => \"MFMDS4\", \"shift_code\" => \"MDS4\", \"week_day\" => 5],\n [\"work_schedule_code\" => \"MFMDS4\", \"shift_code\" => \"MDS4\", \"week_day\" => 6],\n [\"work_schedule_code\" => \"MFMDS4\", \"shift_code\" => \"DO\", \"week_day\" => 7],\n // MFNS1\n [\"work_schedule_code\" => \"MFNS1\", \"shift_code\" => \"DO\", \"week_day\" => 1],\n [\"work_schedule_code\" => \"MFNS1\", \"shift_code\" => \"NS1\", \"week_day\" => 2],\n [\"work_schedule_code\" => \"MFNS1\", \"shift_code\" => \"NS1\", \"week_day\" => 3],\n [\"work_schedule_code\" => \"MFNS1\", \"shift_code\" => \"NS1\", \"week_day\" => 4],\n [\"work_schedule_code\" => \"MFNS1\", \"shift_code\" => \"NS1\", \"week_day\" => 5],\n [\"work_schedule_code\" => \"MFNS1\", \"shift_code\" => \"NS1\", \"week_day\" => 6],\n [\"work_schedule_code\" => \"MFNS1\", \"shift_code\" => \"DO\", \"week_day\" => 7],\n // MFNS2\n [\"work_schedule_code\" => \"MFNS2\", \"shift_code\" => \"DO\", \"week_day\" => 1],\n [\"work_schedule_code\" => \"MFNS2\", \"shift_code\" => \"NS2\", \"week_day\" => 2],\n [\"work_schedule_code\" => \"MFNS2\", \"shift_code\" => \"NS2\", \"week_day\" => 3],\n [\"work_schedule_code\" => \"MFNS2\", \"shift_code\" => \"NS2\", \"week_day\" => 4],\n [\"work_schedule_code\" => \"MFNS2\", \"shift_code\" => \"NS2\", \"week_day\" => 5],\n [\"work_schedule_code\" => \"MFNS2\", \"shift_code\" => \"NS2\", \"week_day\" => 6],\n [\"work_schedule_code\" => \"MFNS2\", \"shift_code\" => \"DO\", \"week_day\" => 7],\n // MFNS3\n [\"work_schedule_code\" => \"MFNS3\", \"shift_code\" => \"DO\", \"week_day\" => 1],\n [\"work_schedule_code\" => \"MFNS3\", \"shift_code\" => \"NS3\", \"week_day\" => 2],\n [\"work_schedule_code\" => \"MFNS3\", \"shift_code\" => \"NS3\", \"week_day\" => 3],\n [\"work_schedule_code\" => \"MFNS3\", \"shift_code\" => \"NS3\", \"week_day\" => 4],\n [\"work_schedule_code\" => \"MFNS3\", \"shift_code\" => \"NS3\", \"week_day\" => 5],\n [\"work_schedule_code\" => \"MFNS3\", \"shift_code\" => \"NS3\", \"week_day\" => 6],\n [\"work_schedule_code\" => \"MFNS3\", \"shift_code\" => \"DO\", \"week_day\" => 7],\n // MFNS4\n [\"work_schedule_code\" => \"MFNS4\", \"shift_code\" => \"DO\", \"week_day\" => 1],\n [\"work_schedule_code\" => \"MFNS4\", \"shift_code\" => \"NS4\", \"week_day\" => 2],\n [\"work_schedule_code\" => \"MFNS4\", \"shift_code\" => \"NS4\", \"week_day\" => 3],\n [\"work_schedule_code\" => \"MFNS4\", \"shift_code\" => \"NS4\", \"week_day\" => 4],\n [\"work_schedule_code\" => \"MFNS4\", \"shift_code\" => \"NS4\", \"week_day\" => 5],\n [\"work_schedule_code\" => \"MFNS4\", \"shift_code\" => \"NS4\", \"week_day\" => 6],\n [\"work_schedule_code\" => \"MFNS4\", \"shift_code\" => \"DO\", \"week_day\" => 7],\n ];\n\n WorkScheduleShift::insert($workScheduleShifts);\n }", "function projectMetricsProgram($ProjectName,$currbilling,$nop=\"\",$not=\"\"){\n\n\t$projectName=$ProjectName;\n\t$currentBilling =$currbilling;\n\techo \"<SCRIPT LANGUAGE=\\\"Javascript\\\" SRC=\\\"./includes/FusionCharts.js\\\"></SCRIPT>\";\n\t//\tif(empty($nop))\n\t//\t$nop=\"No of Pages\";\n\t//\tif(empty($not))\n\t//\t$not=\"No of Tasks\";\n\techo \"<br><br><br>\";\n\t$sql=\" SELECT Distinct (b.`BillingcutoffDate`), SUM(WorkingHours)as Billing_Hours, (SELECT fte FROM pmdb_fte_metrics where ProjectName Like \\\"$projectName\\\" AND b.`BillingcutoffDate`= pmdb_fte_metrics.BillingcutoffDate)as FTE,\n\t\t\t\t\t\t\tSUM(b.`Workinghours`)* (SELECT fte FROM pmdb_fte_metrics where ProjectName Like \\\"$projectName\\\" AND b.`BillingcutoffDate`= pmdb_fte_metrics.BillingcutoffDate)+.1*SUM(b.`Workinghours`)* (SELECT fte FROM pmdb_fte_metrics where ProjectName Like \\\"$projectName\\\" AND b.`BillingcutoffDate`= pmdb_fte_metrics.BillingcutoffDate)as Demand_hrs,\n\t\t\t\t\t\t\t(SELECT SUM(p.`Actual_Hrs`+ p.`Illustration_Hrs`) from `$projectName` p where b.`BillingcutoffDate`= p.Billing_Cutoff_dt AND tech_gate NOT Like \\\"Rejected\\\")as Actual_hrs\n\t\t\t\t\t\t\tFROM billing b\n\t\t\t\t\t\t\tgroup by b.`BillingcutoffDate`\n\t\t\t\t\t\t\torder by b.`BillingcutoffDate`;\";\n\t$result = dbi_query($sql);\n\t$i=0;\n\twhile($row = dbi_fetch_row($result))\n\t{\n\t\t$billingcutoffdates[$i]= $row[0];\n\t\tif($billingcutoffdates[$i]==$currentBilling)\n\t\t$j=$i;\n\t\t$billingDt[$i]=date(\"d-M-Y\", strtotime(\"$billingcutoffdates[$i]\"));\n\t\t$billingDates[$i]=date(\"m:F(d-M-y)\", strtotime(\"$billingcutoffdates[$i]\"));\n\t\t$billingMonth[$i]=date(\"M-Y\", strtotime(\"$billingcutoffdates[$i]\"));\n\t\t$standardHours[$i]=$row[1];\n\t\t$goalFte[$i]=$row[2];\n\t\tif(!empty($row[3]))\n\t\t$demandHours[$i]=$row[3];\n\t\telse\n\t\t$demandHours[$i]=0;\n\t\tif(!empty($row[4]))\n\t\t$actualHours[$i]=$row[4];\n\t\telse\n\t\t$actualHours[$i]=0;\n\t\t$i++;\n\t}\n\tdbi_free_result ( $result );\n\t$sql=\" SELECT Program_name, COUNT(No_of_Pages)as Docs,SUM(No_of_Pages) as Pages\n\t\t\t\t\t\t\t FROM `$projectName` p \n\t\t\t\t\t\t\t Where DATE_FORMAT(Billing_Cutoff_dt,'%Y') = '2010' AND `Tech_gate` not like \\\"Rejected\\\"\n\t\t\t\t\t\t\t Group by Program_name\n\t\t\t\t\t\t\t order by Program_name DESC\";\n\t$result = dbi_query($sql);\n\t$i=0;\n\twhile($row = dbi_fetch_row($result))\n\t{\n\t\t$programs[$i]=$row[0];\n\t\t$noOfPages[$i]=$row[2];\n\t\t$noOfTasks[$i]=$row[1];\n\t\t$i++;\n\t}\n\tfor($k=0;$k<$j;$k++){\n\t\t$s=\"Select SUM(`sapprojectwise`.hours)as Hours from `sapprojectwise`\n\t\t\t\t\t\t\t \t\t\tinner join pmdb_project_mapping ON `sapprojectwise`.level2WBSdescription = `pmdb_project_mapping`.level2WBSdescription\n\t\t\t\t\t\t\t \t\t\t\twhere `pmdb_project_mapping`.projectname Like '$projectName' \";\n\t\t\t\n\t\tif($k==0)\n\t\t$s.=\"AND `sapprojectwise`.`date` BETWEEN '2010-01-04' AND '2010-01-17'\";\n\t\telse{\n\t\t\t$l=$k-1;\n\t\t\t$s.=\"AND `sapprojectwise`.`date` BETWEEN ADDDATE('$billingcutoffdates[$l]',1) AND ADDDATE('$billingcutoffdates[$k]',1)\";\n\t\t}\n\t\t\t\n\t\t$res = dbi_query($s);\n\t\twhile($row = dbi_fetch_row($res))\t{\n\t\t\tif(!empty($row[0]))\n\t\t\t$actualHrs[$k]=$row[0];\n\t\t\telse\n\t\t\t$actualHrs[$k]=0;\n\t\t}\n\n\n\t}\n\t// getting the dollar vale from a variable in init.php\n\n\t// XML For Project Metrics Chart\n\n\t$srtrXML = \"\";\n\t$srtrXML .= \"<chart labelDisplay='ROTATE' adjustDiv='1' plotGradientColor='000222' placeValuesInside='1' rotateValues='1' numberprtrendline = '50' zeroPlaneAlpha='5' slantLabels='1' SYAxisName='$nop' PYAxisName='$not' caption='$projectName Metrics' bgColor='d9e1e4' xAxisName='Billing cutoff Dates' showValues='$chartValues' formatNumberScale='0' showBorder='1'\";\n\t$srtrXML .= \"exportEnabled='1' exportAtClient='0' exportAction='download' exportHandler='http://ie11dt7twqr1s.global.ds.honeywell.com/pmdb/includes/PHP/FCExporter.php' exportFileName='MyFileName'>\";\n\t$srtrXML .= \"<categories>\";\n\tFor($i=0;$i<Count($programs);$i++)\n\t$srtrXML .= \"<category label='$programs[$i]' />\";\n\t$srtrXML .= \"</categories>\";\n\n\t$srtrXML .= \"<dataset seriesName='$nop' parentYAxis='S'>\";\n\tFor($i=0;$i<$j;$i++)\n\t$srtrXML .= \"<set value='$noOfPages[$i]' />\";\n\t$srtrXML .= \"</dataset>\";\n\n\t$srtrXML .= \"<dataset seriesName='$not' >\";\n\tFor($i=0;$i<$j;$i++)\n\t$srtrXML .= \"<set value='$noOfTasks[$i]' />\";\n\t$srtrXML .= \"</dataset>\";\n\t$srtrXML .= \"</chart>\";\n\n\n\n\t// This is for BA chart\n\t$srtXML = \"\";\n\t$srtXML .= \"<chart labelDisplay='ROTATE' adjustDiv='1' plotGradientColor='000000' placeValuesInside='1' rotateValues='1' numberprtrendline = '50' zeroPlaneAlpha='5' slantLabels='1' PYAxisName='Hours' SYAxisName='FTE' caption='$projectName Budget Vs Actual Chart' bgColor='d9e1e4' xAxisName='Billing cutoff Dates' showValues='$chartValues' formatNumberScale='0' showBorder='1'\";\n\t$srtXML .= \"exportEnabled='1' exportAtClient='0' exportAction='download' exportHandler='http://ie11dt7twqr1s.global.ds.honeywell.com/pmdb/includes/PHP/FCExporter.php' exportFileName='MyFileName'>\";\n\t$srtXML .= \"<categories>\";\n\tFor($i=0;$i<$j;$i++)\n\t$srtXML .= \"<category label='$billingMonth[$i]' />\";\n\t$srtXML .= \"</categories>\";\n\n\t$srtXML .= \"<dataset seriesName='Demand Hours' >\";\n\tFor($i=0;$i<$j;$i++){\n\t\t$srtXML .= \"<set value='$demandHours[$i]' />\";\n\t}\n\t$srtXML .= \"</dataset>\";\n\n\n\t$srtXML .= \"<dataset seriesName='SAP Charged Hours'>\";\n\tFor($i=0;$i<$j;$i++){\n\t\t//\n\t\t$srtXML .= \"<set value='$actualHrs[$i]' />\";\n\t\t//\n\t}\n\t$srtXML .= \"</dataset>\";\n\n\n\t$srtXML .= \"<dataset seriesName='Actual FTE' parentYAxis='S'>\";\n\tFor($i=0;$i<$j;$i++){\n\t\t$actualFte[$i]=($actualHrs[$i]*$goalFte[$i])/$demandHours[$i];\n\t\t$actualFte[$i]=ROUND($actualFte[$i],2);\n\t\t$srtXML .= \"<set value='$actualFte[$i]' />\";\n\t}\n\t$srtXML .= \"</dataset>\";\n\n\t$srtXML .= \"<dataset seriesName='Goal FTE' parentYAxis='S'>\";\n\tFor($i=0;$i<$j;$i++){\n\t\t$srtXML .= \"<set value='$goalFte[$i]' />\";\n\t}\n\t$srtXML .= \"</dataset>\";\n\n\t$srtXML .= \"</chart>\";\n\n\t// Create the chart - Column 3D Chart with data from strXML variable using dataXML method\n\techo \"<div id=\\\"Multiple\\\" >\";\n\techo \"<div id=\\\"Left\\\" >\";\n\tif(($ProjectName!=\"AeroPDM_Activity\")||($ProjectName!=\"AVEL_MRO_DOC\"))\n\techo renderChart(\"./Charts/MSCombiDY2D.swf\", \"\", $srtrXML, \"myNext1\",600, 400, 0, 0);\n\techo \"</div>\";\n\techo \"<div id=\\\"Left\\\" >\";\n\n\techo renderChart(\"./Charts/MSCombiDY2D.swf\", \"\", $srtXML, \"myNext\",600, 400, 0, 0);\n\techo \"</div>\";\n\techo \"</div>\";\n}", "function vistaportal_premed_form_add_school_callback($form, $form_state) {\n return $form['premed'];\n }", "function training_rules_callback() {\n rules_invoke_event('training_event');\n $output = 'Do event!';\n\n return array(\n array(\n '#type' => 'markup',\n '#markup' => $output,\n ),\n );\n}", "function weldata_form_alter(&$form, &$form_state){\n\n}", "function ipal_make_instructor_form(){\r\nglobal $ipal;\r\n$myform=\"<form action=\\\"?\".$_SERVER['QUERY_STRING'].\"\\\" method=\\\"post\\\">\\n\";\r\n\t$myform .= \"\\n\";\r\n\t\tforeach(ipal_get_questions() as $items){\r\n$myform .= \"<input type=\\\"radio\\\" name=\\\"question\\\" value=\\\"\".$items['id'].\"\\\" />\";\r\n\r\n$myform .=\"<a href=\\\"show_question.php?qid=\".$items['id'].\"&id=\".$ipal->id.\"\\\" target=\\\"_blank\\\">[question]</a>\";\r\n$myform .= \"<a href=\\\"standalone_graph.php?id=\".$items['id'].\"&ipalid=\".$ipal->id.\"\\\" target=\\\"_blank\\\">[graph]</a>\".$items['question'].\"<br /><br />\\n\";\r\n\t\t}\r\nif(ipal_check_active_question()){\r\n\t$myform .= \"<input type=\\\"submit\\\" value=\\\"Send Question\\\" />\\n</form>\\n\";\r\n}else{\r\n$myform .= \"<input type=\\\"submit\\\" value=\\\"Start Polling\\\" />\\n</form>\\n\";}\r\n\r\n\treturn($myform);\r\n}", "function ipal_display_instructor_interface($cmid){\r\nglobal $DB;\r\n\tglobal $ipal;\r\n\r\n if(isset($_POST['clearQuestion'])){\r\n ipal_clear_question();\r\n }\r\n if(isset($_POST['question'])){\r\n ipal_send_question();\r\n }\r\n\r\n\t$state=$DB->get_record('ipal',array('id'=>$ipal->id));\r\n\tif($_POST['ipal_view']==\"changeState\"){\r\n if($state->preferredbehaviour == \"Graph\"){\r\n $result=$DB->set_field('ipal', 'preferredbehaviour', 'Grid',array('id'=>$ipal->id));\r\n\t\t\t $newstate = 'Histogram';\r\n }else{\r\n $result=$DB->set_field('ipal', 'preferredbehaviour','Graph',array('id'=>$ipal->id));\r\n\t\t\t $newstate = 'Spreadsheet';\r\n }\r\n\t}\r\n\telse\r\n\t{\r\n if($state->preferredbehaviour == \"Graph\"){$newstate = 'Spreadsheet';}\r\n\t\t else{$newstate = 'Histogram';}\r\n\t}\r\n if(($newstate == 'Histogram') and (ipal_get_qtype(ipal_show_current_question_id()) == 'essay')){\r\n\t $newstate = 'Responses';\r\n\t}\r\n\r\n ipal_java_graphupdate();\r\n\r\necho \"<table><tr><td>\".instructor_buttons().\"</td><td>\".ipal_show_compadre($cmid).\"</td><td>\".ipal_toggle_view($newstate).\"<td></tr></table>\";\r\necho ipal_make_instructor_form();\r\necho \"<br><br>\";\r\n$state=$DB->get_record('ipal',array('id'=>$ipal->id));\r\nif($state->preferredbehaviour ==\"Graph\"){\r\n\tif(ipal_show_current_question()==1){\r\necho \"<br>\";\r\necho \"<br>\";\r\necho \"<iframe id= \\\"graphIframe\\\" src=\\\"graphics.php?ipalid=\".$ipal->id.\"\\\" height=\\\"535\\\" width=\\\"723\\\"></iframe>\";\r\necho \"<br><br><a onclick=\\\"window.open('popupgraph.php?ipalid=\".$ipal->id.\"', '',\r\n 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes');\r\n return false;\\\"\r\n href=\\\"popupgraph.php?ipalid=\".$ipal->id.\"\\\" target=\\\"_blank\\\">Open a new window for the graph.</a>\";}\r\n}else{\r\necho \"<br>\";\r\necho \"<br>\";\r\necho \"<iframe id= \\\"graphIframe\\\" src=\\\"gridview.php?id=\".$ipal->id.\"\\\" height=\\\"535\\\" width=\\\"723\\\"></iframe>\";\r\n//echo \"<br><br><a href=\\\"gridview.php?refresh=true&id=\".$ipal->id.\"\\\" target=\\\"_blank\\\">Open a new window for the graph.</a>\";\r\necho \"<br><br><a onclick=\\\"window.open('popupgraph.php?id=\".$ipal->id.\"', '',\r\n 'width=620,height=450,toolbar=no,location=no,menubar=no,copyhistory=no,status=no,directories=no,scrollbars=yes,resizable=yes');\r\n return false;\\\"\r\n href=\\\"popupgraph.php?ipalid=\".$ipal->id.\"\\\" target=\\\"_blank\\\">Open a new window for the graph.</a>\";\r\n\r\n//ipal_grid_view();\t\r\n}}", "function settings_html() {\n ?>\n <tr>\n <td><?php _e( 'Ranges', 'fwp' ); ?>:</td>\n <td>\n <div class=\"facet-range-list\"></div>\n <input type=\"button\"\n class=\"facet-range-list-add button button-small\"\n style=\"width: 200px;\"\n value=\"<?php esc_attr_e( 'Add Range', 'fwp' ); ?>\"/>\n </td>\n </tr>\n <?php\n }", "function worker_inventory()\n {\n ?> \n <p> Worker Webpage </p>\n\t\t<button type=\"button\"> Add Item </button>\n\t\t<button type=\"button\"> Remove Item </button>\n\t\t<button type=\"button\"> Request Item </button>\n\t\t<p> Inventory </p>\n <?php\n }", "public function addNewJobOpo()\n {\n }", "function lendingform_listing($op) {\r\n $output = '';\r\n \r\n // No access for subdomain\r\n if (lendingform_siemens_is_subdomain()) {\r\n return drupal_not_found();\r\n }\r\n \r\n // Default: List of lendingforms\r\n if (empty($op)) {\r\n $op = 'list';\r\n // Link to add new lendingform\r\n if (!lendingform_siemens_is_subdomain()) {\r\n $output .= '<ul class=\"action-links\"><li>';\r\n $output .= l(t('Create New Project'), 'lendingforms/create');\r\n $output .= '</li></ul>';\r\n }\r\n // Project List block\r\n $block = block_load('views', 'lendingforms-block');\r\n $block = _block_get_renderable_array(_block_render_blocks(array($block)));\r\n $output .= drupal_render($block);\r\n }\r\n else {\r\n // check what to do\r\n switch ($op) {\r\n case 'create' :\r\n drupal_set_title(t('Create Project'));\r\n $output = drupal_get_form('lendingform_form');\r\n break;\r\n }\r\n }\r\n\r\n return $output;\r\n}", "function formSalary_set() {\n\t\t$output = $formField = $deductionBox = \"\"; $status = 0;\n\t\t$this->schema = Info::DB_NAME;\n\t\t$getPopupValue[] = $fieldValue[] = \"\";\n\t\tif($this->popupFormID){\n\t\t\t$getPopupValue = $this->getValueDB([\"table\"=>$this->Params['table'],\"id\"=>$this->popupFormID]);\n\t\t\t$status = $getPopupValue['status'];\n\t\t}\n\t\t$varLists = ['salary_type','alias','title','amount','description'];\n\t\tforeach($varLists as $var){\n\t\t\t$fieldValue[$var] = (isset($getPopupValue[$var]) && $this->popupFormID) ? $getPopupValue[$var] : \"\";\n\t\t}\n\t\t$salary_type = $this->inputGroup(['label'=>'Salary Type','type'=>'select','id'=>'salary_type','name'=>'salary_type','meta_key'=>'salary_type','meta'=>'codebook','placeholder'=>'Salary Type','value'=>$fieldValue['salary_type']]);\n\t\t$title = $this->inputGroup(['label'=>'Title','type'=>'text','id'=>'title','name'=>'title','placeholder'=>'Title/Name','value'=>$fieldValue['title']]);//$this->Params['first_name']\n\t\t$alias = $this->inputGroup(['label'=>'Alias','type'=>'text','id'=>'alias','name'=>'alias','placeholder'=>'Alias','value'=>$fieldValue['alias']]);//$this->Params['middle_name']\n\t\t$amount = $this->inputGroup(['label'=>'Amount','type'=>'amount','id'=>'amount','name'=>'amount','placeholder'=>'Salary Amount','value'=>$fieldValue['amount']]);//$this->Params['middle_name']\n\t\t$description = $this->inputGroup(['label'=>'Description','type'=>'textarea','id'=>'description','name'=>'description','title'=>'Description','placeholder'=>'Description/Notes','value'=>$fieldValue['description']]);//$getValue[0]['address']\n\t\t$popUpTitle = str_replace(\"_\",\" \",$this->Params['table']);\n\t\t$formField .= \"<div class='x_panel no-padding'><div class='box_title'><h2 class='left capitalize'>{$popUpTitle} Information Details</h2></div><div class='x_content no-padding'>\";\n\t\t$formField .= \"\n\t\t\t<div class=''>\n\t\t\t\t<div class='form-group no-padding item'>\n\t\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$salary_type}</div>\n\t\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$title}</div>\n\t\t\t\t</div>\n\t\t\t\t<div class='form-group no-padding item'>\n\t\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$alias}</div>\n\t\t\t\t\t<div class='col-md-6 col-sm-6 col-xs-12 no-padding'>{$amount}</div>\n\t\t\t\t</div>\n\t\t\t\t<div class='form-group no-padding item col-4'>{$description}</div>\n\t\t\t</div>\n\t\t</div>\n\t\t</div>\n\t\t\";\n\t\t$output .= \"\n <form id='createRecords' data-toggle='validator' name='{$this->Params['meta']}' class='form-label-left input_mask' novalidate>\n\t\t\t\t<input type='hidden' name='action' id='action' value='createRecords' />\n\t\t\t\t<input type='hidden' name='table' id='table' value='{$this->Params['table']}' />\n\t\t\t\t<input type='hidden' name='theID' id='theID' value='{$this->Params['value']}' />\n\t\t\t\t{$formField}\n\t\t\t</form>\n \";\n\t\t$output .= \"<script>\n\t\t\t$(document).ready(function() {\n\t\t\t\twebshims.setOptions('forms-ext', {replaceUI: 'auto', types: 'number'});webshims.polyfill('forms forms-ext');\n\t\t\t\t$('.select2_single').each(function() {\n\t\t\t\t\t$(this).select2({\n\t\t\t\t\t\tplaceholder: $(this).attr('placeholder'),\n\t\t\t\t\t\tallowClear: false\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\t$(':input').inputmask();\n\t\t\t});\n\n\t\t</script>\";\n\t\treturn $output;\n\t}", "function pickup_submit()\n\t{\n\t\t$name = '_f_'.$this->name;\n\t\t$this->value = $GLOBALS[$name];\n\t}", "public function getAddForm();", "public function run()\n {\n\n $wd_open = new Shift();\n $wd_open->name = 'weekday_opening';\n $wd_open->startTime = '083000';\n $wd_open->endTime = '173000';\n $wd_open->paidHours = 8;\n $wd_open->isActive = true;\n $wd_open->sortOrder = 1;\n $wd_open->save();\n\n $wd_close = new Shift();\n $wd_close->name = 'weekday_closing';\n $wd_close->startTime = '123000';\n $wd_close->endTime = '213000';\n $wd_close->paidHours = 8;\n $wd_close->isActive = true;\n $wd_close->sortOrder = 3;\n $wd_close->save();\n\n $wd_midshift = new Shift();\n $wd_midshift->name = 'weekday_midshift';\n $wd_midshift->startTime = '103000';\n $wd_midshift->endTime = '193000';\n $wd_midshift->paidHours = 8;\n $wd_midshift->isActive = true;\n $wd_midshift->sortOrder = 2;\n $wd_midshift->save();\n\n }", "public function chooseFunction(){\n if (isset($this->provided['postLabel'])) {\n echo \"You called the function <b> \".$this->provided['postLabel'].\" </b> if you need to know what this shit does follow it for yourself\n in kikundi/controller/PostController.php <br>\";\n switch($this->provided['postLabel']){\n case 'createProjectPool':\n ProjectController::addProjectPool($this->provided['sessionID'], $this->provided['name'], $this->provided['adminName']);\n setcookie('newCook', '69', 2019-9-11, '/');\n break;\n case 'registerMember':\n $this->joinProjectPool();\n break;\n case 'createProject':\n $this->createProject();\n break;\n case 'addTag':\n TagController::saveTagInDb($this->provided['tag']);\n break;\n case 'checkTag':\n echo \"<h2>All the Tags starting with \".$this->provided['tag'].\"</h2>\";\n var_dump(TagController::searchInDb($this->provided['tag']));\n break;\n case 'joinProjectPool':\n break;\n case 'likeProject':\n $this->likeProject();\n break;\n case 'approve':\n break;\n default:\n echo \"no post with that label found!\";\n }\n } else {\n echo \"You should not be here!\";\n }\n\n }", "public function add()\n {\n echo '客户需求添加一个新需求' . PHP_EOL;\n }", "public function create()\n {\n $data = $this->dispatch(new WorkFormFieldModel());\n\n return view('admin.works.create', $data);\n }", "function add() {\n if (isset($_POST) && count($_POST) > 0) {\n $params = array(\n 'workname' => $this->input->post('workname'),\n 'description' => $this->input->post('description'),\n );\n\n $jcline_id = $this->Jcline_model->add_jcline($params);\n redirect('jcline/index');\n } else {\n $data['_view'] = 'jcline/add';\n $this->load->view('layouts/main', $data);\n }\n }", "function cnew_custom_metabox_add() {\r\n add_meta_box(\r\n 'cnew_custom_metabox_workshop', \r\n __( 'Informações da Oficina', 'cnew' ), \r\n 'cnew_workshop_custom_metabox_callback', \r\n 'cnew_workshop', \r\n 'normal',\r\n 'high'\r\n );\r\n\r\n add_meta_box(\r\n 'cnew_custom_metabox_registration', \r\n __( 'Formulário de Inscrição', 'cnew' ), \r\n 'cnew_registration_custom_metabox_callback', \r\n 'cnew_registration', \r\n 'normal',\r\n 'high'\r\n );\r\n }", "function logger_sensor_form_submit($form, &$form_state) {\n\n global $user;\n\n $function = $form_state['values']['function'];\n $type = $form_state['values']['type'];\n $price = isset($form_state['values']['price']) ? $form_state['values']['price'] : 0;\n\n //If edition\n if (isset($form_state['values']['meter'])) {\n\n $meter = $form_state['values']['meter'];\n $fields = array('function' => $function, 'type' => $type);\n\n if ($price > 0) {\n $fields['price'] = $price;\n }\n\n $forecast = isset($form_state['values']['forecast']) ? $form_state['values']['forecast'][1] : 0;\n $latitude = isset($_REQUEST['coordinates_latitude']) ? $_REQUEST['coordinates_latitude'] : 0;\n $longitude = isset($_REQUEST['coordinates_longitude']) ? $_REQUEST['coordinates_longitude'] : 0;\n\n $fields['forecast'] = $forecast;\n $fields['latitude'] = $latitude;\n $fields['longitude'] = $longitude;\n\n db_update('logger_meters')\n ->fields($fields)\n ->condition('meter', $meter)\n ->execute();\n }\n //If creation\n else {\n $meter = md5(uniqid(rand(), TRUE));\n $token = md5(uniqid(rand(), TRUE));\n $device = $form_state['values']['device'];\n $forecast = isset($form_state['values']['forecast']) ? $form_state['values']['forecast'][1] : 0;\n $latitude = isset($_REQUEST['coordinates_latitude']) ? $_REQUEST['coordinates_latitude'] : 0;\n $longitude = isset($_REQUEST['coordinates_longitude']) ? $_REQUEST['coordinates_longitude'] : 0;\n\n logger_sensor_add($meter, $user->uid, $device, time(), $token, 62, $function, $type, 1, $forecast, $latitude, $longitude, $price);\n }\n\n if (isset($form_state['values']['aggregated_meters'])) {\n\n $aggregated_meters = get_selected_combobox_options($form_state['values']['aggregated_meters']);\n logger_set_virtual_sensor_aggregations($meter, $aggregated_meters);\n }\n\n if (isset($form_state['values']['prev_forecast'])) {\n\n $prev_forecast = $form_state['values']['prev_forecast'];\n\n if ($prev_forecast == 1 && $forecast == 0) {\n pvcast_delete_plant($meter);\n }\n elseif ($prev_forecast == 0 && $forecast == 1) {\n pvcast_create_plant($meter, $latitude, $longitude);\n }\n elseif ($prev_forecast == 1 && $forecast == 1) {\n pvcast_update_plant($meter, $latitude, $longitude);\n }\n }\n\n $form_state['redirect'] = \"sensor/mylist\";\n}", "public function addstepsAction(){\n\n\t echo $this->ModelObj->addstepandgetnewrow($this->Request); exit;\n\n\t}" ]
[ "0.5877085", "0.57135993", "0.56200004", "0.55651164", "0.54190516", "0.5377406", "0.53698415", "0.53543234", "0.5306199", "0.52983457", "0.527685", "0.5251136", "0.52413756", "0.52306867", "0.5230611", "0.52254736", "0.51927763", "0.51724637", "0.51587814", "0.5121457", "0.5113276", "0.50909424", "0.5087837", "0.50854915", "0.50802577", "0.5077977", "0.50745326", "0.50679386", "0.50454503", "0.5029787", "0.5026023", "0.501843", "0.500623", "0.5002783", "0.49998933", "0.4992339", "0.49918523", "0.49867797", "0.4985111", "0.4984942", "0.4979392", "0.49775267", "0.49758193", "0.49732956", "0.4961404", "0.49603063", "0.4950582", "0.49494722", "0.4947257", "0.49397913", "0.49354443", "0.49347502", "0.49326536", "0.4930229", "0.4930199", "0.49147993", "0.49124193", "0.49121484", "0.4910245", "0.48945704", "0.4894006", "0.48886067", "0.48848855", "0.4884114", "0.48764542", "0.48763388", "0.48709628", "0.48662382", "0.48637515", "0.4861862", "0.48610845", "0.48595905", "0.48520616", "0.48501316", "0.48449588", "0.48418242", "0.48416123", "0.4840484", "0.4822148", "0.4820741", "0.48121974", "0.48107", "0.4801625", "0.47977713", "0.47958314", "0.47920388", "0.479037", "0.4788935", "0.4787554", "0.47841445", "0.47839135", "0.4783268", "0.47831145", "0.47771156", "0.47762653", "0.47746927", "0.4773685", "0.47721836", "0.4771955", "0.4761817" ]
0.627421
0
/store workout function data form
public function storeWorkout(Request $request) { $this->validate($request,array( 'name' => 'required', 'details' => 'required', 'set1' => 'required', 'set3' => 'required', 'set2' => 'required', 'image' => 'required|mimes:jpg,jpeg,png' )); /* |/^[a-zA-Z ]+$/ |unique:users' */ $workout = new Workout; $workout->title = $request->name; $workout->description = $request->details; $workout->category = $request->category; $workout->set1 = $request->set1; $workout->set2 = $request->set2; $workout->set3 = $request->set3; //$workout->image = $request->project_title; if ($request->hasFile('image')) { $file = $request->file('image'); $filename = time().'.'.$file[0]->getClientOriginalName(); /*$location = public_path('file/'.$filename); Storage::put($filename,file_get_contents($file));*/ $location = public_path('file/'.$filename); Storage::disk('file')->put($filename, file_get_contents($file[0])); //Storage::disk('public')->put($filename, file_get_contents($file)); $workout->image = $filename; } //file add /* $filer = $request->file('image'); foreach ($filer as $key => $value) { $filename = time().'.'.$filer[$key]->getClientOriginalName(); $location = public_path('file/'.$filename); Storage::disk('file')->put($filename, file_get_contents($file[$key])); if($key == 1){ $workout->image2 = $filename; } if($key == 2){ $workout->image3 = $filename; } } */ $workout->save(); if($workout->save()){ return redirect()->back()->with('success','Workout saved successfully.'); } else{ return redirect()->back()->with('denger-success','Workout is not saved.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save_me($creation, $dwl_number, $dwl_last) {\n\n}", "public function saveData()\r\n {\r\n \r\n }", "function work()\n {\n }", "function store_data($data, $data_name)\n{\n /* @todo store the PUA data in its own table */\n update_option($data_name, serialize($data));\n}", "function save(ezcWorlflow $workflow) {\n\t\t\n\t}", "public function saveDataToFile()\n {\n\n }", "function storeParameters()\n {\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function stores();", "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}", "function saveData() {\n\n\t\t$this->getMapper()->saveData();\t\n\t\t\n\t\t\n\t}", "public function store();", "public function store();", "public function store();", "public function store()\n\t {\n\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.57572794", "0.5677746", "0.5620407", "0.5493032", "0.5484715", "0.54090065", "0.5356681", "0.53514814", "0.5326266", "0.53082156", "0.53082156", "0.53082156", "0.53037655", "0.5296332", "0.5296332", "0.5296332", "0.52831775", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849", "0.5280849" ]
0.0
-1
/Add Videos function form
public function addVideo() { $getAllVideoCategory = VideoCategory::all(); return view('admin.addvideo')->with('videoCategory',$getAllVideoCategory); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function type_url_form_video()\n {\n }", "public function addVideo(){\n if (isset($_POST[\"add_video\"])) {\n $movie = $this->model('Movie');\n $system = $this->model('System');\n\n $video_name = $_POST[\"video_title\"];\n $video_url = $_POST[\"video_url\"];\n $video_category = $_POST[\"selected_category\"];\n $video_description = $_POST[\"video_description\"];\n $video_sef_url = $system->seflink($video_name);\n\n $movie->addVideo($video_name,$video_url,$video_category,$video_description,$video_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/videos');\n }", "public function add_video(){\n\t\t$this->load->view('admin/video_gallery/add_video');\n\t}", "public function create()\n {\n return view('Admin.Videos.add');\n }", "function media_upload_video()\n {\n }", "function add_videos_meta_box() {\n \tadd_meta_box(\n \t\t'y_link', // $id\n \t\t'ID Video', // $title\n \t\t'display_video_fields_meta_box', // $callback\n \t\t'videos', // $screen\n \t\t'normal', // $context\n \t\t'high' // $priority\n \t);\n }", "public function addVideoAction(){\n $data = $this->getRequestData();\n if(isset($data['video']['name']) && isset($data['video']['content'])){\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Asset_Folder::getByPath('/video/operation/'.$user->getKey().'-video');\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-video\");\n $folder->setParentId(6);\n $folder->save();\n }\n\n $asset = new Asset_Video();\n $asset->setCreationDate(time());\n $asset->setUserOwner(1);\n $asset->setUserModification(1);\n $asset->setParentId($folder->getId());\n $asset->setFilename(Pimcore_File::getValidFilename($data['name'] . \"-\" . time()));\n $asset->setData(base64_decode($data['content']));\n if(!$asset->save()){\n $this->setErrorResponse('cannot save video!');\n }\n } else {\n $this->setErrorResponse('video is mandatory for this request!');\n }\n\n $this->_helper->json(array('video' => $asset->getId()));\n }", "public function create_video() {\n $args = array (\n 'labels' => array(\n 'name' => __( 'Videos' ),\n 'singular_name' => __( 'Videos' ),\n 'add_new' => __( 'Add Video' ),\n 'add_new_item' => __( 'Add New Video' ),\n 'edit_item' => __( 'Edit Video' ),\n 'new_item' => __( 'Add New Video' ),\n 'view_item' => __( 'View Video' ),\n 'search_items' => __( 'Search Videos' ),\n 'not_found' => __( 'No Videos Found' ),\n 'not_found_in_trash' => __( 'No Videos found in trash. ' )\n\t ),\n 'has_archive' => true,\n 'menu_icon' => 'dashicons-format-video',\n 'public' => true,\n 'show_ui' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'rewrite' => true,\n 'menu_position' => 20,\n 'supports' => array('title', 'thumbnail', 'editor'),\n );\n register_post_type('video', $args);\n }", "public function addVideo(VideoMedia $video);", "public function create()\n {\n return view('admin.videos.create');\n }", "public function add_video_glance() {\n\t\t/* How many videos are published. */\n\t\t$video_count = wp_count_posts( 'video' )->publish;\n\t\t\n\t\t/* Get the correct label (video, videos) depending on the count. */\n\t\t$video_type = get_post_type_object( 'video' );\n\t\t$video_text = _n( $video_type->labels->singular_name, $video_type->labels->name, intval( $video_count ), 'makigas-videoman' );\n\t\t\n\t\t/* Render HTML code. */\n\t\techo '<li class=\"page-count video-count\">';\n\t\techo '<a href=\"edit.php?post_type=video\">' . $video_count . ' ' . strtolower( $video_text ) . '</a>';\n\t\techo '</li>';\n\t\t\n\t\t/* TODO: content: \"\\f236\"; in CSS: */\n\t}", "public function video_add($id)\n {\n $data['content'] = Content::findorfail($id);\n\n $data['page_title'] = 'Content Add';\n return view('client.content.video_add', $data);\n }", "public function addVideo($title, $vID, $sID=\"vimSID\", $hdID=\"hdID\", $sdID=\"sdID\", $mobileID=\"mobileID\", $type=\"Generic\", $thumb=\"tn\", $frame=\"fr-img\", $ro_dir=\"Director\", $ro_dp=\"DP\", $ro_cam=\"Camera\", $ro_ed=\"Editor\", $desc=\"Long description\"){\n $this->videoList[] = new cShowcaseVideo($title, $vID, $sID, $hdID, $sdID, $mobileID, $type, $thumb, $frame, $ro_dir, $ro_dp, $ro_cam, $ro_ed, $desc);\n }", "public function createVideo();", "public function add() {\n if ($this->GdataAuth->isAuthorized()) {\n if (!empty($this->data)) {\n $this->YouTubeVideo->set($this->data);\n if ($this->YouTubeVideo->validates() && $this->YouTubeVideo->save($this->data)) {\n $this->Session->setFlash('It worked!');\n $this->redirect(array());\n }\n }\n // Set official you tube categories and access control options to populate\n // form fields\n $this->set('categories', $this->YouTubeVideo->categories());\n foreach ($this->YouTubeVideo->accessControls as $accessControl => $options) {\n $this->set(Inflector::pluralize($accessControl), array_combine($options, $options));\n }\n }\n }", "public function uploadAction() {\n if (isset($_GET['ul']) || isset($_FILES['Filedata']))\n return $this->_forwardCustom('upload-video', null, null, array('format' => 'json'));\n\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n $this->view->form = $form = new Sitereview_Form_Reviewvideo();\n\n if (!$this->getRequest()->isPost()) {\n if (null !== ($video_id = $this->_getParam('video_id'))) {\n $form->populate(array(\n 'video' => $video_id\n ));\n }\n return;\n }\n\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n $video = $form->saveValues();\n }", "public function store()\n {\n // Validate input\n $this->validate($this->request, [\n 'title' => 'required',\n 'description' => 'required',\n 'order_number' => 'required|integer|unique:videos',\n 'embed_code' => 'required',\n 'access_name' => 'required',\n ]);\n\n $this->video->create([\n 'title' => $this->request->input('title'),\n 'description' => $this->request->input('description'),\n 'order_number' => $this->request->input('order_number'),\n 'embed_code' => $this->request->input('embed_code'),\n 'slug' => str_slug($this->request->input('title'), '-'),\n 'access_name' => $this->request->input('access_name')\n ]);\n\n return redirect('videos/all')->withSuccessMessage('Video added');\n }", "function add_videos_metaboxes() {\n\tadd_meta_box('wpt_yt_link', 'You Tube Link', 'wpt_yt_link', 'videos', 'normal', 'default');\n\tadd_meta_box('wpt_featured_vid', 'Featured Video', 'wpt_featured_vid', 'videos', 'normal', 'default');\n \n}", "public function postVideo(){\r\n if(!$this->hasLoginCheck())\r\n return;\r\n $blogItem = new BlogItemModel();\r\n $video_url=$_POST['video_url'];\r\n $video_img_path=$_POST['video_img_path'];\r\n $title=$_POST['video_title'];\r\n $desc=$_POST['content'];\r\n $embed_value=$_POST['video_embed_value'];\r\n $tag=$_POST['tag'];\r\n $blogItem->addVideo($video_url,$video_img_path,$title,$desc,$tag,$embed_value);\r\n echo json_encode(array('status'=>'true'));\r\n }", "public function create()\n {\n return view('admin/videos/create');\n }", "public function video(){\n\t\t$data=array();\n\t\t$this->load->view('administrador/admin_video',$data);\n\t}", "public function create()\n {\n return view('admin.video.create');\n }", "function add()\n {\n $this->load->library('form_validation');\n $this->load->helper('form');\n \n //neu ma co du lieu post len thi kiem tra\n if($this->input->post())\n {\n $this->form_validation->set_rules('name', 'Tên video', 'required');\n $this->form_validation->set_rules('link', 'Link video', 'required');\n \n if($this->form_validation->run())\n {\n \n //lay ten file anh minh hoa duoc update len\n $this->load->library('upload_library');\n $upload_path = './upload/video';\n $upload_data = $this->upload_library->upload($upload_path, 'image'); \n $images = '';\n if(isset($upload_data['file_name']))\n {\n $images = $upload_data['file_name'];\n }\n \n //luu du lieu can them\n $data = array(\n 'name' => $this->input->post('name'),\n 'images' => $images,\n 'link' => $this->input->post('link'),\n ); \n //them moi vao csdl\n if($this->video_model->create($data))\n {\n $this->session->set_flashdata('message', 'Thêm thành công');\n }else{\n $this->session->set_flashdata('message', 'Không thêm được');\n }\n redirect(admin_url('video'));\n }\n }\n \n \n //load view\n $this->data['temp'] = 'admin/video/add';\n $this->load->view('admin/main', $this->data);\n }", "public function create()\n {\n return view('admin.videos.create');\n }", "public function create()\n {\n return view('admin.videos.create');\n }", "public function create()\n {\n return view('admin.videos.create');\n }", "public function create()\n {\n return view('admin.videos.create');\n }", "public function Videos(){\n if(!isset($_SESSION[\"oturum\"])){\n header(\"location: \" . URL . \"login\" );\n }\n\n //Model Connections\n $movies = $this->model('Movie');\n $categories = $this->model('Categories');\n\n //Load data from model to views.\n $getVideos = $movies->getAllVideos();\n $getCategories = $categories->getAllCat();\n\n //Load views\n require VIEW_PATH . \"templates/header-yonetim.php\";\n require VIEW_PATH . \"videos/index.php\";\n require VIEW_PATH . \"templates/footer-yonetim.php\";\n }", "public function actionCreate()\n {\n $form = new VideoForm();\n if(\\Yii::$app->request->isPost)\n {\n $form->load(Yii::$app->request->post());\n\n $form->file = UploadedFile::getInstance($form,'file');\n\n if($form->file && $form->validate())\n {\n $new_name = date('YmdHis', time()) . rand(0, 999). '.' . $form->file->getExtension();\n $new_path = 'static/upload/video/' . $new_name;\n if ($form->file->saveAs($new_path)) {\n $model = new Video();\n $model->attributes = [\n 'name' => $new_name,\n 'file' => $new_path,\n 'size' => $form->file->size,\n 'type' => $form->file->type,\n 'created_at' => $form->created_at,\n 'author' => $form->author,\n 'description' => $form->description,\n ];\n\n if ($model->save()) {\n return $this->redirect(['index']);\n } else {\n unlink($new_path);\n }\n }\n }\n }\n\n return $this->render('create', [\n 'model' => $form,\n ]);\n }", "public function create()\n {\n //\n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = UserMoodle::where('id', $user_id)->first();\n\n $videos = Video::all();\n $users = UserMoodle::all();\n $competitor_types = CompetitorType::where('status', 1)->get();\n $video_types = VideoType::where('status', 1)->get();\n\n return view('admin.videos.create', compact('videos', 'usuario', 'users', 'video_types', 'competitor_types'));\n }", "public function executeEditVideo(sfWebRequest $request)\n {\n // Shut off Chrome's poorly designed XSS filtering that clobbers perfectly legitimate iframe embed submissions\n // http://code.google.com/p/chromium/issues/detail?id=98787\n $this->getResponse()->setHttpHeader('X-XSS-Protection', '0');\n $this->forward404Unless(aMediaTools::userHasUploadPrivilege());\n $item = null;\n $this->slug = false;\n $this->popularTags = PluginTagTable::getPopulars(null, array('sort_by_popularity' => true), false, 10);\n if (sfConfig::get('app_a_all_tags', true))\n {\n $this->allTags = PluginTagTable::getAllTagNameWithCount();\n }\n else\n {\n $this->allTags = array();\n }\n if ($request->hasParameter('slug'))\n {\n $item = $this->getItem();\n $this->slug = $item->getSlug();\n }\n if ($item)\n {\n $this->forward404Unless($item->userHasPrivilege('edit'));\n }\n $this->item = $item;\n $embed = false;\n $parameters = $request->getParameter('a_media_item');\n \n if ($parameters)\n {\n $files = $request->getFiles('a_media_item');\n \n $this->form = new aMediaVideoForm($item);\n \n if (isset($parameters['embed']))\n {\n // We need to do some prevalidation of the embed code so we can prestuff the\n // file, title, tags and description widgets\n $result = $this->form->classifyEmbed($parameters['embed']);\n if (isset($result['thumbnail']))\n {\n $thumbnail = $result['thumbnail'];\n if ((!isset($parameters['title'])) && (!isset($parameters['tags'])) && (!isset($parameters['description'])) && (!isset($parameters['credit'])))\n {\n $parameters['title'] = $result['serviceInfo']['title'];\n // We want tags to be lower case, and slashes break routes in most server configs. \n $parameters['tags'] = str_replace('/', '-', aString::strtolower($result['serviceInfo']['tags']));\n $parameters['description'] = aHtml::textToHtml($result['serviceInfo']['description']);\n $parameters['credit'] = $result['serviceInfo']['credit'];\n }\n }\n }\n\n // On the first pass with a youtube video we just make the service's thumbnail the\n // default thumbnail. We don't force them to use it. This allows more code reuse\n // (Moving this after the bind is necessary to keep it from being overwritten) \n if (isset($thumbnail))\n {\n $this->convertServiceThumbnailToFileUpload($thumbnail, $parameters);\n }\n \n $this->form->bind($parameters, $files);\n \n do\n {\n // first_pass forces the user to interact with the form\n // at least once. Used when we're coming from a\n // YouTube search and we already technically have a\n // valid form but want the user to think about whether\n // the title is adequate and perhaps add a description,\n // tags, etc.\n if (($this->hasRequestParameter('first_pass')) ||\n (!$this->form->isValid()))\n {\n break;\n }\n $thumbnail = $this->form->getValue('file');\n // The base implementation for saving files gets confused when \n // $file is not set, a situation that our code tolerates as useful \n // because if you're updating a record containing an image you \n // often don't need to submit a new one.\n unset($this->form['file']);\n $object = $this->form->getObject();\n if ($thumbnail)\n {\n $object->preSaveFile($thumbnail->getTempName());\n }\n $this->form->save();\n \n if ($thumbnail)\n {\n $object->saveFile($thumbnail->getTempName());\n }\n \n if (aMediaTools::isSelecting())\n {\n return $this->redirect('aMedia/multipleAdd?id=' . $object->id);\n }\n\n return $this->redirect(\"aMedia/resumeWithPage\");\n } while (false);\n }\n return $this->renderTemplate();\n }", "function linkVideo(){\n \n $vid = uniqid();\n $ar = array('id' => $vid, 'web_id' => WEB_ID, 'video_url' => $_POST['vurl'], 'video_name' => $_POST['name'], 'video_disc' => $_POST['disc'], 'type' => 'YouTube', 'category'=>$_POST['cats']);\n \n $this->db->insert('video_library', $ar);\n \n \n }", "public function actionVideo()\n {\n $title = '微站设置/视频设置';\n //title of webpage,you can find title in /web/pub/top.php eg:wechat demo\n $keywords = 'wechat demo';\n //title of webpage,you can find title in /web/pub/top.php eg:''\n $description = '';\n return $this -> render('video',[\n 'title' => $title,//title of webpage,you can find title in the head of /web/pub/top.php\n 'keywords' => $keywords,//keywords of webpage,you can find keywords in the head of /web/pub/top.php\n 'description' => $description//description of webpage,you can find description in the head of /web/pub/top.php\n ]);\n }", "public function create()\n\t{\n\t\tBreadcrumbs::addCrumb('Manage Teams and Videos', 'teacher');\n\t\tBreadcrumbs::addCrumb('Add Video', 'teacher/videos/create');\n\n // Get the most recent competition year with video divisisons\n\t $comp_year = CompYear::orderBy('year', 'desc')\n\t ->with([ 'vid_divisions' => function($q) {\n\t\t\t\t\t\t\t\t\t\treturn $q->orderby('display_order');\n\t\t\t\t\t\t\t\t\t}])\n\t\t\t\t\t\t\t->first();\n\n\t\t$invoice = Invoices::where('year', $comp_year->year)\n\t ->where('user_id', Auth::user()->ID)\n\t ->with('school')\n\t ->first();\n\n\t $school = $invoice->school;\n\n $division_list = [ 0 => \"- Select Division -\" ] + $comp_year->vid_divisions->lists('name', 'id');\n\n\t\t// Student Setup\n\t\t$ethnicity_list = [ 0 => \"- Select Ethnicity -\" ] + Ethnicity::all()->lists('name','id');\n\n\t\tView::share('title', 'Create Video');\n\t\treturn View::make('teacher.videos.create',compact('division_list', 'ethnicity_list'));\n\t}", "public function create()\n\t{\n return View::make('videos.create');\n\t}", "public function createAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n // Upload video\n if (isset($_GET['ul']) || (isset($_FILES['Filedata']) && !empty($_FILES['Filedata']['name']))) {\n return $this->_forwardCustom('upload-review-video', null, null, array('format' => 'json'));\n }\n\n //GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitereview_main');\n }\n //GET LISTING ID\n $this->view->listing_id = $listing_id = $this->_getParam('listing_id');\n $this->view->listing_singular_uc = ucfirst($this->_listingType->title_singular);\n\n $this->view->listingtype_id = $listingtype_id = $this->_listingType->listingtype_id;\n\n //ACTIVE TAB\n $this->view->TabActive = \"video\";\n\n //GET CONTENT ID\n $this->view->content_id = $content_id = $this->_getParam('content_id');\n\n $sitereviewModHostName = str_replace('www.', '', strtolower($_SERVER['HTTP_HOST']));\n\n //GET SITEREVIEW OBJECT\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n\n //GET VIEWER INFO\n $viewer = Engine_Api::_()->user()->getViewer();\n\n $videos = array();\n $type_video = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereview.show.video');\n if (Engine_Api::_()->sitereview()->enableVideoPlugin() && !empty($type_video)) {\n $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 1);\n } elseif (empty($type_video)) {\n $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 0);\n }\n\n $this->view->allowed_upload_video = Engine_Api::_()->sitereview()->allowVideo($sitereview, $viewer, count($videos));\n if (empty($this->view->allowed_upload_video)) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n $viewer_id = $viewer->getIdentity();\n\n //VIDEO UPLOAD PROCESS\n $this->view->imageUpload = Engine_Api::_()->sitereview()->isUpload();\n\n $this->view->can_edit = $canEdit = $sitereview->authorization()->isAllowed($viewer, \"edit_listtype_$sitereview->listingtype_id\");\n\n //FORM GENERATON\n $this->view->form = $form = new Sitereview_Form_Video();\n if ($this->_getParam('type', false))\n $form->getElement('type')->setValue($this->_getParam('type'));\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n if (!$form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues('url');\n return;\n }\n $insert_action = false;\n Engine_Api::_()->getApi('settings', 'core')->setSetting('sitereview.video.utility.type', convert_uuencode($sitereviewModHostName));\n\n //GET FORM VALUES\n $values = $form->getValues();\n$this->view->clear_cache = true;\n $values['owner_id'] = $viewer_id;\n\n //VIDEO CREATION PROCESS\n $videoTable = Engine_Api::_()->getDbtable('videos', 'sitereview');\n\n $db = $videoTable->getAdapter();\n $db->beginTransaction();\n try {\n \n if ($values['type'] == 3) {\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $sitereview_video = Engine_Api::_()->getItem('sitereview_video', $this->_getParam('id'));\n } else {\n// if (empty($values['Filename'])) {\n// $this->view->status = false;\n// $this->view->error = Zend_Registry::get('Zend_Translate')->_('No file');\n// return;\n// }\n if ((!isset($_FILES['Filedata']) && !empty($_FILES['Filedata']['name']))) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid Upload') . print_r($_FILES, true);\n return;\n }\n\n if (!isset($_FILES['Filedata']) || !is_uploaded_file($_FILES['Filedata']['tmp_name'])) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid Upload') . print_r($_FILES, true);\n return;\n }\n\n $illegal_extensions = array('php', 'pl', 'cgi', 'html', 'htm', 'txt');\n if (in_array(pathinfo($_FILES['Filedata']['name'], PATHINFO_EXTENSION), $illegal_extensions)) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid Upload');\n return;\n }\n $viewer = Engine_Api::_()->user()->getViewer();\n $values['owner_id'] = $viewer->getIdentity();\n\n $params = array(\n 'owner_type' => 'user',\n 'owner_id' => $viewer->getIdentity()\n );\n $sitereview_video = Engine_Api::_()->sitereview()->createSitereviewvideo($params, $_FILES['Filedata'], $values);\n $sitereview_video->owner_id = $viewer->getIdentity();\n $sitereview_video->save();\n $this->view->status = true;\n $this->view->name = $_FILES['Filedata']['name'];\n $this->view->code = $sitereview_video->code;\n $this->view->video_id = $sitereview_video->getIdentity();\n\n $sitereview_video->save();\n }\n } else {\n $sitereview_video = $videoTable->createRow();\n }\n\n $sitereview_video->setFromArray($values);\n $sitereview_video->listing_id = $this->_getParam('listing_id');\n $sitereview_video->save();\n\n $params = $sitereview->main_video;\n\n //THUMBNAIL CREATION\n $thumbnail = $this->handleThumbnail($sitereview_video->type, $sitereview_video->code);\n $ext = ltrim(strrchr($thumbnail, '.'), '.');\n $thumbnail_parsed = @parse_url($thumbnail);\n\n if (@GetImageSize($thumbnail)) {\n $valid_thumb = true;\n } else {\n $valid_thumb = false;\n }\n\n if ($valid_thumb && $thumbnail && $ext && $thumbnail_parsed && in_array($ext, array('jpg', 'jpeg', 'gif', 'png'))) {\n $tmp_file = APPLICATION_PATH . '/temporary/link_' . md5($thumbnail) . '.' . $ext;\n $thumb_file = APPLICATION_PATH . '/temporary/link_thumb_' . md5($thumbnail) . '.' . $ext;\n $src_fh = fopen($thumbnail, 'r');\n $tmp_fh = fopen($tmp_file, 'w');\n stream_copy_to_stream($src_fh, $tmp_fh, 1024 * 1024 * 2);\n $image = Engine_Image::factory();\n $image->open($tmp_file)\n ->resize(120, 240)\n ->write($thumb_file)\n ->destroy();\n\n try {\n $thumbFileRow = Engine_Api::_()->storage()->create($thumb_file, array(\n 'parent_type' => $sitereview_video->getType(),\n 'parent_id' => $sitereview_video->getIdentity()\n ));\n\n //REMOVE TEMP FILES\n @unlink($thumb_file);\n @unlink($tmp_file);\n } catch (Exception $e) {\n \n }\n $information = $this->handleInformation($sitereview_video->type, $sitereview_video->code);\n $sitereview_video->duration = $information['duration'];\n $sitereview_video->photo_id = $thumbFileRow->file_id;\n $sitereview_video->status = 1;\n $sitereview_video->save();\n\n //INSERT NEW ACTION ITEM\n $insert_action = true;\n }\n\n if ($values['ignore'] == true) {\n $sitereview_video->status = 1;\n $sitereview_video->save();\n $insert_action = true;\n }\n\n //COMMENT PRIVACY\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'everyone');\n $auth_comment = \"everyone\";\n $commentMax = array_search($auth_comment, $roles);\n foreach ($roles as $i => $role) {\n $auth->setAllowed($sitereview_video, $role, 'comment', ($i <= $commentMax));\n }\n\n //TAG WORK\n if (!empty($values['tags'])) {\n $tags = preg_split('/[,]+/', $values['tags']);\n $sitereview_video->tags()->addTagMaps($viewer, $tags);\n }\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n $db->beginTransaction();\n try {\n if ($insert_action && $sitereview_video->search == 1 && time() >= strtotime($sitereview->creation_date)) {\n $owner = $sitereview_video->getOwner();\n $actionTable = Engine_Api::_()->getDbtable('actions', 'activity');\n $action = $actionTable->addActivity($owner, $sitereview, 'sitereview_video_new_listtype_' . $sitereview->listingtype_id);\n if ($action != null) {\n $actionTable->attachActivity($action, $sitereview_video);\n }\n }\n\n $actionTable = Engine_Api::_()->getDbtable('actions', 'activity');\n foreach ($actionTable->getActionsByObject($sitereview_video) as $action) {\n $actionTable->resetActivityBindings($action);\n }\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n if ($canEdit) {\n return $this->_gotoRouteCustom(array('action' => 'edit', 'listing_id' => $sitereview->listing_id), \"sitereview_videospecific_listtype_$listingtype_id\", true);\n } else {\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview->getSlug(), 'tab' => $content_id), \"sitereview_entry_view_listtype_$listingtype_id\", true);\n }\n } else {\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview->getSlug(), 'tab' => $content_id), \"sitereview_entry_view_listtype_$listingtype_id\", true);\n }\n }", "public function create()\n {\n return view('videos.create');\n }", "public function create()\n {\n return view('admin.videoGallery.create');\n }", "protected function _prepareForm()\n {\n $global_helper = $this->helper('drecomm_productvideo/global');\n $videoModel = Mage::getModel('drecomm_productvideo/video');\n $productModel = Mage::getModel('catalog/product')->load($this->getRequest()->getParam('productid'));\n $productName = $productModel->getName();\n $videoModel->load($this->_videoId);\n $videoUrl = $videoModel->getUrl();\n $videoFormat = $global_helper->getVideoFormat($videoUrl);\n $videoFormat == 'youtube' ?\n $embedded = '<iframe width=\"460\" height=\"215\"\n src=\"http://www.youtube.com/embed/'.str_replace(\" [uploaded]\",\"\",$global_helper->getYoutubeVideoId($videoUrl)).'\"\n frameborder=\"0\" allowfullscreen>\n </iframe>'\n :\n $embedded = '<iframe width=\"500\" height=\"281\"\n src=\"http://player.vimeo.com/video/'.$global_helper->getVimeoVideoId($videoUrl).'\"\n frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen>\n </iframe>';\n\n if ($this->getRequest()->getParam('upload'))\n {\n $apiUrls = $global_helper->createApiFormUrls($productName);\n $status = $_GET['status'];\n $code = $_GET['code'];\n $id = $_GET['id'];\n\n if(isset($status))\n {\n $code = $code;\n $id = $id;\n }\n $uploadResponse = $global_helper->uploadResponse($status,$code,$id);\n $postUrl = $apiUrls['postUrl'];\n $tokenValue = $apiUrls['token'];\n $nextUrl = Mage::helper(\"adminhtml\")->getUrl(\"*/video/new/\", array(\n 'productid' => $this->_productId , \"upload\" => \"true\"));\n $uploadStatus = isset($_GET['status']) ? $_GET['status'] : null ;\n\n $form = new Varien_Data_Form(array(\n 'id' => 'edit_form',\n 'action' => $postUrl.'?nexturl='.$nextUrl,\n 'method' => 'post',\n 'enctype' => 'multipart/form-data'\n ));\n $fieldset = $form->addFieldset('base_fieldset', array(\n 'legend' => Mage::helper('checkout')->__('Video Information'),\n 'class' => 'fieldset-wide',\n ));\n\n if ($videoModel->getId())\n {\n $fieldset->addField('videoid', 'hidden', array(\n 'name' => 'videoid',\n ));\n }\n $fieldset->addField('productId', 'hidden', array(\n 'name' => 'productId',\n ));\n $fieldset->addField('url', 'hidden', array(\n 'name' => 'url',\n ));\n\n $fieldset->addField('file', 'file', array(\n 'name' => 'file',\n 'label' => Mage::helper('checkout')->__('Video file'),\n 'title' => Mage::helper('checkout')->__('Video Url'),\n 'required' => false,\n 'onchange' => \"onChange(document.getElementById('file').value)\",\n 'after_element_html' => '\n <input name=\"token\" type=\"hidden\" value=\"'.$tokenValue.'\"/>\n <button id=\"uploadButton\"\n title=\"Save Video\" type=\"button\"\n class=\"scalable save\"\n onclick=\"changeDivVisibility();submit();\"\n style=\"\"><span><span><span>upload</span></span></span>\n </button>\n <p id=\"uploadStatus\" style=\"display:none\">'.$uploadStatus.'</p>\n <script>setUrl();</script>\n <div id=\"uploading\" style=\"display:none\">\n <p class=\"loader\" id=\"loading_mask_loader\">\n <img src=\"'.$this->getSkinUrl('images/ajax-loader-tr.gif') .'\" alt=\"'.Mage::helper('adminhtml')->__('Loading...').'\"/>\n <br/>'.Mage::helper('adminhtml')->__('Uploading, please wait...').'</p>\n </div>'\n ,\n ));\n\n if(isset($_GET['id']))\n {\n $fieldset->addField('saveupload', 'hidden', array(\n 'name' => 'saveupload',\n 'after_element_html' =>'\n <script>window.location=\"'.$this->getUrl('*/video/save', array\n (\n 'form_key' => Mage::getSingleton('core/session')->getFormKey(),\n 'videoid' => $this->_videoId,\n 'productid' => $this->_productId,\n 'url' => $_GET['id'],\n 'upload' => 'true',)\n ).'\";$j(\"#uploading\").css(\"display\", \"block\");</script>\n '\n ));\n }\n $form->setValues($videoModel->getData());\n $form->setUseContainer(true);\n $this->setForm($form);\n }\n else\n {\n $form = new Varien_Data_Form(array(\n 'id' => 'edit_form',\n 'action' => $this->getUrl('*/*/save',\n array(\n 'videoid' => $this->_videoId,\n 'productid' => $this->_productId\n )),\n 'method' => 'post',\n 'enctype' => 'multipart/form-data'\n ));\n $fieldset = $form->addFieldset('base_fieldset', array(\n 'legend' => Mage::helper('checkout')->__('Url'),\n 'class' => 'fieldset-wide',\n ));\n\n if ($videoModel->getId())\n {\n $fieldset->addField('videoid', 'hidden', array(\n 'name' => 'videoid',\n ));\n }\n\n $fieldset->addField('productId', 'hidden', array(\n ));\n\n $fieldset->addField('url', 'text', array(\n 'name' => 'url',\n 'label' => Mage::helper('checkout')->__('Video Url'),\n 'title' => Mage::helper('checkout')->__('Video Url'),\n 'required' => false,\n 'after_element_html' => '\n </br><small> use a valid vimeo or youtube url</small>\n <div id=\"loading-mask\" style=\"display:none\">\n <p class=\"loader\" id=\"loading_mask_loader\">\n <img src=\"'.$this->getSkinUrl('images/ajax-loader-tr.gif') .'\" alt=\"'.Mage::helper('adminhtml')->__('Loading...').'\"/>\n <br/>'.Mage::helper('adminhtml')->__('Please wait...').'</p>\n </div>\n ',\n ));\n\n if ($videoModel->getId())\n {\n $fieldset->addField('embed', 'hidden', array(\n 'name' => 'embed',\n 'after_element_html' => '<br><br>'.$embedded\n ));\n }\n\n $form->setValues($videoModel->getData());\n $form->setUseContainer(true);\n $this->setForm($form);\n }\n\n return parent::_prepareForm();\n }", "public function actionVideo()\n {\n\n $arrParams = Yii::$app->request->queryParams;\n $arrParams['ArticleSearch']['category_id'] = Article::CAT_VIDEO;\n $searchModel = new ArticleSearch();\n $dataProvider = $searchModel->search($arrParams);\n $dataProvider->sort = [\n 'defaultOrder'=>['published_at'=>SORT_DESC]\n ];\n\n return $this->render('index_video', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ]);\n }", "public function addVideo($title,$videoID,$streamID=\"vimeoSID\", $hdID=\"hdID\", $sdID=\"sdID\", $mobileID=\"mobileID\", $thumb=\"thumbnail\", $frame=\"image-frame\"){\n $this->videoList[] = new cVideo($title,$videoID,$streamID,$hdID,$sdID,$mobileID,$thumb,$frame);\n }", "public function postCreate()\n\t{\n // Declare the rules for the form validation\n $rules = array(\n 'user' => 'required|min:5',\n 'link' => 'required|min:10',\n 'description' => 'required|min:10'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Create a new video \n $user = Auth::user();\n\n // Update the video data\n $this->video->link = Input::get('link');\n $this->video->description = Input::get('description');\n $this->video->user = Input::get('user');\n\n // Was the video created?\n if($this->video->save())\n {\n // Redirect to the new video page\n return Redirect::to('admin/videos/' . $this->video->id . '/edit')->with('success', Lang::get('admin/videos/messages.create.success'));\n }\n\n // Redirect to the video video create page\n return Redirect::to('admin/videos/create')->with('error', Lang::get('admin/videos/messages.create.error'));\n }\n\n // Form validation failed\n return Redirect::to('admin/videos/create')->withInput()->withErrors($validator);\n\t}", "protected function form()\n {\n $form = new Form(new video());\n\n $form->text('video_title', __('标题'))->attribute('autocomplete', 'off')->required()->rules('required|max:100');\n\n $form->checkbox('tags','标签')->options(Tag::all()->where('tag_status', Tag::STATUS_TRUE)->pluck('tag_name', 'id'));\n\n $form->textarea('video_describe', __('视频简介'));\n\n $form->image('video_img','封面图')->required()->removable();\n\n $form->chunk_file('video_link', '所属视频')->attribute('accept', 'video/*')->rules('required');\n\n $form->number('video_click', __('点击量'))->rules('required')->default(0);\n\n $form->switch('video_show', __('是否显示'))->states(config('system.show'))->default(1);\n\n $form->switch('video_recommend', __('是否推荐'))->states(config('system.recommend'))->default(1);\n\n $form->number('video_sort', __('admin.sort'))->rules('required')->default(100);\n\n //保存后回调\n $form->saved(function (Form $form) {\n\n });\n return $form;\n }", "public function create()\n {\n return view('admin.datavideo.create');\n }", "public function getCreate2()\n\t{\n // Title\n $title = 'Добавление видео';\n\n // Show the page\n return View::make('site/video/create', compact('title'));\n\t}", "public function create()\n {\n //\n return view('video.create');\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'video' => 'required',\n ]);\n\n $input['video'] = time() . '.' . $request->video->getClientOriginalExtension();\n $request->video->move(public_path('videos-gallery'), $input['video']);\n\n if (Auth::check()) {\n $input['name'] = $request->name;\n $input['public'] = 1;\n $input['fk_owner'] = Auth::id();\n $input['author'] = Auth::user()->name;\n\n Video::create($input);\n\n return redirect()->route('videos.index')->with('success', 'Video created successfully.');\n }\n\n return redirect()->route('videos.index')->with('warning', 'You must be connected.');\n }", "public function actionCreate()\n\t{\n\t\t$model=new Video;\n\n $this->performAjaxValidation($model, 'video-form');\n\n\t\tif(isset($_POST['Video']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Video'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n return view('videos.create');\n }", "public function process()\n\t{\n\t\tPhpfox::isUser(true);\n\t\tPhpfox::getUserParam('video.can_upload_videos', true);\n\t\t\n\t\tif (Phpfox::getParam('video.convert_servers_enable'))\n\t\t{\n\t\t\t$this->template()->assign('sCustomVideoHash', Phpfox::getService('video')->addCustomHash());\n\t\t}\n\n\t\tif (defined('PHPFOX_IS_HOSTED_SCRIPT'))\n\t\t{\n\t\t\tif (Phpfox::getService('video')->getOnCloudLimit())\n\t\t\t{\n\t\t\t\treturn Phpfox_Error::display('Monthly video limit reached.');\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_1')){eval($sPlugin);if (isset($mReturnFromPlugin)){return $mReturnFromPlugin;}}\n\t\t\n\t\t$sModule = $this->request()->get('module', false);\n\t\t$iItem = $this->request()->getInt('item', false);\t\t\n\t\t\n\t\t$aCallback = false;\n\t\tif ($sModule !== false && $iItem !== false && Phpfox::hasCallback($sModule, 'getVideoDetails'))\n\t\t{\t\t\t\n\t\t\tif ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_2')){eval($sPlugin);if (isset($mReturnFromPlugin)){return $mReturnFromPlugin;}}\n\t\t\tif (($aCallback = Phpfox::callback($sModule . '.getVideoDetails', array('item_id' => $iItem))))\n\t\t\t{\t\t\t\n\t\t\t\t$this->template()->setBreadcrumb($aCallback['breadcrumb_title'], $aCallback['breadcrumb_home']);\n\t\t\t\t$this->template()->setBreadcrumb($aCallback['title'], $aCallback['url_home']);\t\n\t\t\t\tif ($sModule == 'pages' && !Phpfox::getService('pages')->hasPerm($iItem, 'video.share_videos'))\n\t\t\t\t{\n\t\t\t\t\t$sPhrase = Phpfox::getPhrase('video.unable_to_view_this_item_due_to_privacy_settings');\n\t\t\t\t\tif ( ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_sphrase'))){ eval($sPlugin); }\n\t\t\t\t\treturn Phpfox_Error::display($sPhrase);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sPhrase = '';\n\t\t\t\t\tif ( ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_sphrase_2'))){ eval($sPlugin); }\n\t\t\t\t\tif (!empty($sPhrase))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn Phpfox_Error::display($sPhrase);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\tif (($aVals = $this->request()->get('val')))\n\t\t{\n\t\t\tif ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_3')){eval($sPlugin);if (isset($mReturnFromPlugin)){return $mReturnFromPlugin;}}\n\t\t\tif (($iFlood = Phpfox::getUserParam('video.flood_control_videos')) !== 0)\n\t\t\t{\n\t\t\t\t$aFlood = array(\n\t\t\t\t\t'action' => 'last_post', // The SPAM action\n\t\t\t\t\t'params' => array(\n\t\t\t\t\t\t'field' => 'time_stamp', // The time stamp field\n\t\t\t\t\t\t'table' => Phpfox::getT('video'), // Database table we plan to check\n\t\t\t\t\t\t'condition' => 'user_id = ' . Phpfox::getUserId(), // Database WHERE query\n\t\t\t\t\t\t'time_stamp' => $iFlood * 60 // Seconds);\t\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\t\t\t \t\t\t\n\t\t\t\t// actually check if flooding\n\t\t\t\tif (Phpfox::getLib('spam')->check($aFlood))\n\t\t\t\t{\n\t\t\t\t\tPhpfox_Error::set(Phpfox::getPhrase('video.you_are_sharing_a_video_a_little_too_soon') . ' ' . Phpfox::getLib('spam')->getWaitTime());\t\n\t\t\t\t}\n\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\tif (Phpfox_Error::isPassed())\n\t\t\t{\t\t\t\n\t\t\t\tif ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_4')){eval($sPlugin);if (isset($mReturnFromPlugin)){return $mReturnFromPlugin;}}\n\t\t\t\tif (Phpfox::getService('video.grab')->get($aVals['url']))\n\t\t\t\t{\t\t\t\n\t\t\t\t\tif ($iId = Phpfox::getService('video.process')->addShareVideo($aVals))\n\t\t\t\t\t{\n\t\t\t\t\t\t$aVideo = Phpfox::getService('video')->getForEdit($iId);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Phpfox::getService('video.grab')->hasImage())\n\t\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t\tif (isset($aVals['module']) && isset($aVals['item']) && Phpfox::hasCallback($aVals['module'], 'uploadVideo'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$aCallback = Phpfox::callback($aVals['module'] . '.uploadVideo', $aVals['item']);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($aCallback !== false)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->url()->send($aCallback['url_home'], array('video', $sTitle), Phpfox::getPhrase('video.video_successfully_added'));\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\n\t\t\t\t\t\t\t$this->url()->permalink('video', $aVideo['video_id'], $aVideo['title'], true, Phpfox::getPhrase('video.video_successfully_added'));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->url()->send('video.edit.photo', array('id' => $aVideo['video_id']), Phpfox::getPhrase('video.video_successfull_added_however_you_will_have_to_manually_upload_a_photo_for_it'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sModule = (isset($aVals['module']) ? $aVals['module'] : false);\n\t\t\t$iItem = (isset($aVals['item']) ? $aVals['item'] : false);\n\t\t}\n\t\t\n\t\t$sMethod = Phpfox::getParam('video.video_enable_mass_uploader') && $this->request()->get('method','') != 'simple' ? 'massuploader' : 'simple';\n\t\t$sMethodUrl = str_replace(array('method_simple/','method_massuploader/'), '',$this->url()->getFullUrl()) . 'method_' . ($sMethod == 'simple' ? 'massuploader' : 'simple') . '/';\t\t\t\t\n\t\n\t\tif (Phpfox::isMobile())\n\t\t{\n\t\t\t$sMethod = 'simple';\n\t\t}\n\t\t\n\t\tif (Phpfox::getParam('video.convert_servers_enable'))\n\t\t{\n\t\t\t$aVideoServers = Phpfox::getParam('video.convert_servers');\n\t\t\t$sCustomServerUrl = $aVideoServers[rand(0, (count($aVideoServers) - 1))];\n\t\t\t$this->template()->assign('sVideoServerUrl', $sCustomServerUrl);\n\t\t}\t\t\n\t\t\n\t\tif ($sMethod == 'massuploader')\n\t\t{\n\t\t\t$iMaxFileSize = (Phpfox::getUserParam('video.video_file_size_limit') === 0 ? null : ((Phpfox::getUserParam('video.video_file_size_limit') / 1) * 1048576));\n\t\t\tif (Phpfox::isModule('photo'))\n\t\t\t{\n\t\t\t\t$this->template()->setPhrase(array('photo.you_can_upload_a_jpg_gif_or_png_file'));\n\t\t\t}\n\n\t\t\t// video.video_array_support\n\t\t\t$sVideoFormats = '*.mpg; *.mpeg; *.wmv; *.avi; *.mov; *.flv';\n\t\t\t$sVideoNames = 'Video files (mpg, mpeg, wmv, avi, mov or flv)';\n\t\t\tif (Phpfox::getParam('video.upload_for_html5'))\n\t\t\t{\n\t\t\t\t$sVideoFormats = '';\n\t\t\t\tforeach ((array) Phpfox::getParam('video.video_array_support') as $sFormat => $sType)\n\t\t\t\t{\n\t\t\t\t\t$sVideoFormats .= '*.' . $sFormat . '; ';\n\t\t\t\t}\n\t\t\t\t$sVideoFormats = trim(trim($sVideoFormats), ';');\n\t\t\t\t$sVideoNames = $sVideoFormats;\n\t\t\t}\n\n\t\t\t$this->template()->setPhrase(array(\t\t\t\t\t\t\t\n\t\t\t\t\t\t'core.name',\n\t\t\t\t\t\t'core.status',\n\t\t\t\t\t\t'core.in_queue',\n\t\t\t\t\t\t'core.upload_failed_your_file_size_is_larger_then_our_limit_file_size',\n\t\t\t\t\t\t'core.more_queued_than_allowed'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t->setHeader(array(\n\t\t\t\t'massuploader/swfupload.js' => 'static_script',\n\t\t\t\t'massuploader/upload.js' => 'static_script',\n\t\t\t\t'<script type=\"text/javascript\">\n\t\t\t\t\t// document.domain = \"\";\n\t\t\t\t\t$oSWF_settings =\n\t\t\t\t\t{\n\t\t\t\t\t\tobject_holder: function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn \\'swf_video_upload_button_holder\\';\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\n\t\t\t\t\t\tdiv_holder: function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn \\'swf_video_upload_button\\';\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\n\t\t\t\t\t\tget_settings: function()\n\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\tswfu.setUploadURL(\"' . (isset($sCustomServerUrl) ? $sCustomServerUrl : $this->url()->makeUrl('video.frame')) . '\");\n\t\t\t\t\t\t\tswfu.setFileSizeLimit(\"'.$iMaxFileSize .' B\");\n\t\t\t\t\t\t\tswfu.setFileUploadLimit(1);\n\t\t\t\t\t\t\tswfu.setFileQueueLimit(1);\n\t\t\t\t\t\t\tswfu.customSettings.flash_user_id = '.Phpfox::getUserId() .';\n\t\t\t\t\t\t\tswfu.customSettings.sHash = \"'.Phpfox::getService('core')->getHashForUpload().'\";\n\t\t\t\t\t\t\tswfu.setFileTypes(\"' . $sVideoFormats . '\",\"' . $sVideoNames . '\");\n\t\t\t\t\t\t\tswfu.atFileQueue = function()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(\\'#js_upload_actual_inner_form\\').slideUp();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$(\\'#js_video_form :input\\').each(function(iKey, oObject)\n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tswfu.addPostParam($(oObject).attr(\\'name\\'), $(oObject).val());\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\t)\n\t\t\t);\t\t\t\n\t\t}\t\t\n\t\t\n\t\t$aMenus = array();\t\t\n\t\tif (Phpfox::getParam('video.allow_video_uploading') || Phpfox::getParam('video.vidly_support'))\n\t\t{\n\t\t\t$aMenus[$this->url()->makeUrl('video.add')] = Phpfox::getPhrase('video.file_upload');\n\t\t}\n\t\t$aMenus[$this->url()->makeUrl('video.add.url')] = Phpfox::getPhrase('video.paste_url');\n\t\t\n\t\tif (!empty($sModule))\n\t\t{\n\t\t\tforeach ($aMenus as $sUrl => $sPhrase)\n\t\t\t{\n\t\t\t\tunset($aMenus[$sUrl]);\n\t\t\t\t\n\t\t\t\t$aMenus[$sUrl . 'module_' . $sModule . '/item_' . $iItem . '/'] = $sPhrase;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$bIsVideoUploading = false;\n\t\tif ((Phpfox::getParam('video.allow_video_uploading') || Phpfox::getParam('video.vidly_support')) && $this->request()->get('req3') != 'url')\n\t\t{\n\t\t\t$bIsVideoUploading = true;\n\t\t}\n\t\t\n\t\t$this->template()->buildPageMenu('js_upload_video', $aMenus, null, true);\n\t\t\n\t\tif (Phpfox::getParam('video.video_upload_service'))\n\t\t{\n\t\t\tPhpfox::getService('video.process')->createVidlyToken();\n\t\t\t$aVidlyParams = array(\n\t\t\t\t'phrases' => array(\n\t\t\t\t\t'select_video' => Phpfox::getPhrase('video.select_video')\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->template()->assign('sVidlyParams', urlencode(json_encode($aVidlyParams)));\n\t\t\t$this->template()->setHeader('<script type=\"text/javascript\">$Behavior.checkOnVideo = function(){setInterval(\"$(\\'#js_video_form\\').ajaxCall(\\'video.checkOnVideo\\');\", 5000);}</script>');\n\t\t}\n\n\t\tif (Phpfox::getParam('video.convert_servers_enable'))\n\t\t{\n\t\t\t$this->template()->setHeader('<script type=\"text/javascript\">document.domain = \"' . Phpfox::getParam('video.convert_js_parent') . '\";</script>');\n\t\t}\n\t\t\n\t\t$this->template()->setTitle(Phpfox::getPhrase('video.upload_share_a_video'))\n\t\t\t->setBreadcrumb(Phpfox::getPhrase('video.video'), ($aCallback === false ? $this->url()->makeUrl('video') : $aCallback['url_home_photo']))\n\t\t\t->setBreadcrumb(Phpfox::getPhrase('video.upload_share_a_video'), ($aCallback === false ? $this->url()->makeUrl('video.add') : $this->url()->makeUrl('video.add', array('module' => $sModule, 'item' => $iItem))), true)\n\t\t\t->setFullSite()\t\t\t\n\t\t\t->assign(array(\n\t\t\t\t\t'sModule' => $sModule,\n\t\t\t\t\t'iItem' => $iItem,\t\t\t\t\n\t\t\t\t\t'sMethod' => $sMethod,\n\t\t\t\t\t'sMethodUrl' => $sMethodUrl,\n\t\t\t\t\t'bIsVideoUploading' => $bIsVideoUploading\t\n\t\t\t\t)\n\t\t\t)\n\t\t\t->setHeader('cache', array(\n\t\t\t\t\t'upload.js' => 'module_video',\n\t\t\t\t\t'video.js' => 'module_video'\n\t\t\t\t)\n\t\t\t);\n\t}", "public function create()\n {\n $categories = Category::where('status',1)->orderBy('name')->get();\n //dd($categories->toArray());\n return view('adminCMS.videos.addVideo',compact('categories'));\n }", "function savevideos($task)\n\t{\n\t\tglobal $option,$mainframe;\n\t\t$db = JFactory::getDBO();\n\t\t$userTypeRedirect = (JRequest::getVar('user', '', 'get') == 'admin') ? \"&user=\" . JRequest::getVar('user', '', 'get') : \"\";\n\t\t## To get an instance of the adminvideos table object\n\t\t$rs_saveupload = JTable::getInstance('adminvideos', 'Table');\n\t\t$arrCatId = JRequest::getVar('cid', array(0), '', 'array');\n\t\t$strCatId = $arrCatId[0];\n\t\t$rs_saveupload->load($strCatId);\n $createddate = date(\"Y-m-d h:m:s\");\n\n\t\t## variable initialization\n\t\t$arrFormData = JRequest::get('post');\n $embedcode = JRequest::getVar('embedcode', '', 'post', 'string', JREQUEST_ALLOWRAW);\n\t\t$arrFormData['embedcode']=$embedcode;\n\t\t$fileoption = $arrFormData['fileoption'];\n\t\t$seoTitle = trim($arrFormData['title']);\n $titlequery = \"SELECT count(id) FROM #__hdflv_upload where title='$seoTitle'\";\n $db->setQuery($titlequery);\n $total_title = $db->loadResult();\n if(!empty($total_title) || $total_title>0){\n $seoTitle = $seoTitle.rand();\n }\n $seoTitle = str_replace(\"+\",\"\",$seoTitle);\n $seoTitle = stripslashes($seoTitle);\n $seoTitle = strtolower($seoTitle);\n\t\t$seoTitle = preg_replace('/[&:\\s]+/i', '-', $seoTitle);\n\t\t$arrFormData['seotitle'] = preg_replace('/[#!@$%^.,:;\\/&*(){}\\\"\\'\\[\\]<>|?]+/i', '', $seoTitle);\n\t\t$arrFormData['seotitle'] = preg_replace('/---|--+/i', '-', $arrFormData['seotitle']);\n\t\t$description = JRequest::getVar('description', '', 'post', 'string', JREQUEST_ALLOWRAW);\n\t\t$arrFormData['description'] = $description;\n\n\t\t## object to bind to the instance\n\t\tif (!$rs_saveupload->bind($arrFormData))\n\t\t{\n\t\t\tJError::raiseWarning( 500, $rs_saveupload->getError() );\n\t\t}\n\n\t\t## get and assign video url\n\t\tif (isset($rs_saveupload->videourl))\n\t\t{\n\t\t\tif ($rs_saveupload->videourl != \"\")\n\t\t\t{\n\t\t\t\t$rs_saveupload->videourl = trim($rs_saveupload->videourl);\n\t\t\t}\n\t\t}\n\n\t\t## Inserts a new row if id is zero or updates an existing row in the hdflv_upload table\n\t\tif (!$rs_saveupload->store())\n\t\t{\n\t\t\tJError::raiseWarning( 500, $rs_saveupload->getError() );\n\t\t}\n\n\t\t## check in the item\n\t\t$rs_saveupload->checkin();\n\t\t$idval = $rs_saveupload->id;\n\n\t\t## uploading videos type : URL\n\t\tif ($fileoption == 'Url'){\n\t\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadurl.php');\n\t\t\tuploadUrlHelper::uploadUrl($arrFormData,$idval);\n\t\t}\n\n\t\t## uploading videos type : YOUTUBE\n\t\tif ($fileoption == \"Youtube\"){\n\t\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadyoutube.php');\n\t\t\tuploadYouTubeHelper::uploadYouTube($arrFormData,$idval);\n\t\t}\n\t\t## uploading videos type : Embed\n\t\tif ($fileoption == \"Embed\"){\n\t\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadembed.php');\n\t\t\tuploadEmbedHelper::uploadEmbed($arrFormData,$idval);\n\t\t}\n\n\t\t/**\n\t\t * uploading videos\n\t\t * type : FILE\n\t\t */\n\n\t\tif ($arrFormData['fileoption'] == \"File\"){\n\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadfile.php');\n\t\tuploadFileHelper::uploadFile($arrFormData,$idval);\n\t\t}\n\n\t\t## uploading videos type : FFMPEG\n\t\tif ($fileoption == \"FFmpeg\"){\n\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadffmpeg.php');\n\t\tuploadFfmpegHelper::uploadFfmpeg($arrFormData,$idval);\n\t\t}\n\t\t$catid = JRequest::getVar('playlistid');\n ## query to update created date\n $query = \"UPDATE #__hdflv_upload SET created_date='$createddate' where id=$idval\";\n $db->setQuery($query);\n $db->query();\n ## query to find the existing of category for video\n $query = \"SELECT count(vid) FROM #__hdflv_video_category where vid=$idval\";\n $db->setQuery($query);\n $total = $db->loadResult();\n if ($total != 0) {\n $query = \"UPDATE #__hdflv_video_category SET catid= '$catid' WHERE vid=$idval\";\n } else {\n $query = \"INSERT INTO #__hdflv_video_category values ('$idval','$catid')\";\n }\n\n $db->setQuery($query);\n $db->query();\n switch ($task) {\n case 'applyvideos':\n $link = 'index.php?option=' . $option . '&layout=adminvideos&task=editvideos' . $userTypeRedirect . '&cid[]=' . $rs_saveupload->id;\n break;\n case 'savevideoupload':\n default:\n $link = 'index.php?option=' . $option . '&layout=adminvideos' . $userTypeRedirect;\n break;\n }\n $msg = 'Saved Successfully';\n ## set to redirect\n $mainframe->redirect($link, $msg);\n\t}", "public function mostrarVideoVistaController()\n {\n //llamando al modelo\n $respuesta = @GestorVideosModel::mostrarVideoVistaModel(\"videos\");\n\n foreach ($respuesta as $dato) {\n echo '<li id=\"' . $dato['id'] . '\" ruta=\"' . $dato['ruta'] . '\" class=\"bloqueVideo\">\n <span class=\"fa fa-times eliminarVideo\"></span>\n <video controls class=\"handleVideo\">\n <source src=\"' . substr($dato['ruta'], 6) . '\" type=\"video/mp4\">\n </video>\n </li>';\n }\n\n }", "public function addslider()\n {\n //\n $channels = Channel::pluck('title','id');\n $videos = Video::pluck('title','id');\n // dd($videos);\n return view('Push::videos.addslider', compact(['channels','videos']));\n }", "public function addVideo(Request $request)\n {\n try{\n if (!empty($request)) {\n $validateData = Validator::make($request->all(),[\n 'title' => 'required',\n 'asset_type' => 'required',\n 'slug' => 'required',\n 'short_description' => 'required|max:520',\n 'description' => 'required',\n 'content_type' => 'required'\n ]);\n\n if ($validateData->fails()) {\n $messages = $validateData->errors()->all();\n return APIResponse('201', 'Validation errors.', $messages);\n }\n\n $video_data = VideoContent::where('title', '=', $request->get('title'))->first();\n \n if ($video_data) {\n return APIResponse('201', 'Data already present in the database.');\n }\n\n $photoURL = '';\n if ($request->hasFile('thumbnail_image')) {\n $file = $request->file('thumbnail_image');\n $folderpath = 'bcci/videos/';\n $result = uploadFileToS3($file, $folderpath, '');\n $photoURL = $result['ObjectURL'] ?? '';\n }\n \n $videoUrl = '';\n if ($request->hasFile('video_url')) {\n $file = $request->file('video_url');\n $folderpath = 'Input/';\n $result = uploadFileToS3($file, $folderpath, 'video');\n $videoUrl = $result['ObjectURL'] ?? '';\n }\n \n $videoCount = AssetsCount::all();\n if (isset($videoCount)) {\n $videosCount = $videoCount[0]['video_count'] + 1;\n }\n\n $videoContent = new VideoContent();\n $videoContent->ID = $videosCount;\n $videoContent->title = $request->get('title');\n $videoContent->short_description = $request->get('short_description'); \n $videoContent->description = $request->get('description');\n $videoContent->video_duration = $request->get('video_duration'); // duration and video-duration is same \n $videoContent->match_id = $request->get('match_id');\n $videoContent->content_type = $request->get('content_type'); //type and content-type is same\n $videoContent->video_scope = $request->get('video_scope');\n $videoContent->video_url = $videoUrl; \n $videoContent->match_formats = $request->get('match_formats');\n $videoContent->keywords = $request->get('keywords'); \n $videoContent->created_date = $request->get('created_date');\n $videoContent->publish_date = $request->get('publish_date');\n $videoContent->publish_by = $request->get('publish_by'); // publishFrom and publish by is same\n $videoContent->meta_languages = $request->get('meta_languages');\n $videoContent->langauge = $request->get('langauge');\n $videoContent->asset_type = $request->get('asset_type');\n $videoContent->expiry_date = $request->get('expiry_date'); \n $videoContent->total_viewcount = $request->get('total_viewcount'); \n $videoContent->titleslug = $request->get('titleslug');\n $videoContent->varients = $request->get('varients'); \n $videoContent->views_count = $request->get('views_count'); \n $videoContent->comments = $request->get('comments'); //comments and commentson is same\n $videoContent->platform = $request->get('platform'); \n $videoContent->current_status = $request->get('current_status');\n $videoContent->lastModified = $request->get('lastModified');\n $videoContent->thumbnail_image= $photoURL; // thumbnail image nad thumbnail is same\n $videoContent->video_status = 'pending';\n $videoContent->location = $request->get('location');\n $videoContent->titleUrlSegment = $request->get('titleUrlSegment');\n $videoContent->subtitle = $request->get('subtitle');\n $videoContent->titleTranslations = $request->get('titleTranslations');\n $videoContent->coordinates = $request->get('coordinates');\n $videoContent->lastModified = $request->get('lastModified');\n $videoContent->publishTo = $request->get('publishTo');\n $videoContent->mediaId = $request->get('mediaId');\n $videoContent->references = $request->get('references');\n $videoContent->closedCaptioned = $request->get('closedCaptioned');\n $videoContent->status = true;\n $videoContent->save();\n\n $totalCount = AssetsCount::where('ID', 1)->update(['video_count' => $videosCount]);\n if ($videoContent) {\n $response = APIResponse('200', 'Data has been added successfully.');\n } else {\n $response = APIResponse('201', 'Something went wrong, please try again.'); \n }\n \n } else {\n $response = APIResponse('201', 'Something went wrong, please try again.');\n } \n } catch (\\Throwable $e) {\n $response = APIResponse('201', $e->getMessage());\n }\n\n return $response;\n }", "public function store(VideoRequest $request)\n {\n $request->validated();\n\n parse_str( parse_url( $request->url, PHP_URL_QUERY ), $array_param_video );\n if (empty($array_param_video)) {\n\n return redirect()->back()->with('error', 'URL digitada não é válida!');\n\n }else{\n $video = new Videos;\n $video->titulo = $request->titulo;\n $video->descricao = $request->descricao;\n $video->url = $array_param_video['v'];\n $video->save();\n return redirect()->back()->with('message', 'Cadastro efetuado com sucesso!');\n\n }\n }", "public function create()\n {\n return view('admin.video_gallery.create');\n }", "public function actionIndex()\n {\n if ($_SERVER['REQUEST_METHOD'] == 'POST') \n {\n VideoLibrary::update_db($_POST['video_url'], $_POST['title'], $_POST['description'], $_POST['image']); \n $this->redirect('index.php?r=video/library');\n }\n else\n {\n $this->render('addVideo');\n }\n }", "function showvideosmodel() {\n\t\tglobal $option, $mainframe, $db;\n\t\t$rs_showupload = '';\n\t\t$strVideoCount = 0;\n\t\t## To store and retrieve filter variables that are stored with the session\n\t\t$filter_order = $mainframe->getUserStateFromRequest($option . 'filter_order_adminvideos', 'filter_order', 'ordering', 'cmd');\n\t\t$filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'filter_order_Dir_adminvideos', 'filter_order_Dir', 'asc', 'word');\n\t\t$search = $mainframe->getUserStateFromRequest($option . 'search', 'search', '', 'string');\n $search1 = $search;\n\t\t$state_filter = $mainframe->getUserStateFromRequest($option . 'filter_state', 'filter_state', '', 'int');\n\t\t$featured_filter = $mainframe->getUserStateFromRequest($option . 'filter_featured', 'filter_featured', '', 'string');\n\t\t$category_filter = $mainframe->getUserStateFromRequest($option . 'filter_category', 'filter_category', '', '');\n\t\t## page navigation\n\t\t## Default List Limit\n\t\t$limit = $mainframe->getUserStateFromRequest($option . '.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');\n\t\t$limitstart = $mainframe->getUserStateFromRequest($option . '.limitstart', 'limitstart', 0, 'int');\n\n\t\t## set user = admin for admin videos\n\t\t$strAdmin = (JRequest::getVar('user', '', 'get')) ? JRequest::getVar('user', '', 'get') : '';\n\t\t## get logged user\n\t\t$user = JFactory::getUser();\n\t\t$userid = $user->get('id');\n\t\t## get user groups from joomla version above 1.6.0\n\t\tif(version_compare(JVERSION,'1.6.0','ge'))\n\t\t{\n\t\t\t## query items are returned as an associative array\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select('g.id AS group_id')\n\t\t\t\t ->from('#__usergroups AS g')\n\t\t\t\t ->leftJoin('#__user_usergroup_map AS map ON map.group_id = g.id')\n\t\t\t\t ->where('map.user_id = ' . (int) $userid);\n\t\t\t$db->setQuery($query);\n\t\t\t$arrUserGroup = $db->loadObject();\n\n\t\t\t/**\n\t\t\t * User group\n\t\t\t * 6 - Manager\n\t\t\t * 7 - Administrator\n\t\t\t * 8 - Super Users\n\t\t\t */\n\n\t\t\t## for videos added by admin\n\t\t\tif($strAdmin == 'admin') {\n\t\t\t\tif ($arrUserGroup->group_id == '8')\n\t\t\t\t$where = \"WHERE a.usergroupid IN (6,7,8)\";\n\t\t\t\telse\n\t\t\t\t$where = \"WHERE a.usergroupid='$arrUserGroup->group_id' AND a.memberid = $userid\";\n\t\t\t\t## for videos added by member\n\t\t\t} else {\n\t\t\t\t$where = \"WHERE a.usergroupid NOT IN (6,7,8) AND a.memberid != '$userid'\";\n\t\t\t}\n\t\t}\n\t\t## get user groups from joomla version below 1.6.0\n\t\telse\n\t\t{\n\t\t\t$query = 'SELECT gid from #__users\n WHERE id = ' . (int) $userid;\n\t\t\t$db->setQuery($query);\n\t\t\t$arrUserGroup = $db->loadObject();\n\t\t\t## for videos added by admin\n\t\t\tif($strAdmin == 'admin')\n\t\t\t{\n\t\t\t\tif ($arrUserGroup->gid == 25)\n\t\t\t\t{\n\t\t\t\t\t$where = \"WHERE c.gid='25'\";\n\t\t\t\t}\n\t\t\t\telse if($arrUserGroup->gid == 24)\n\t\t\t\t{\n\t\t\t\t\t$where = \"WHERE c.gid='24'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t## for videos added by member\n\t\t\telse\n\t\t\t{\n\t\t\t\t$where = \"WHERE c.gid NOT IN (24,25)\";\n\t\t\t}\n\t\t}\n\t\t$query = \"SELECT `id`,`member_id`,`category`,`seo_category`,`parent_id`,`ordering`,`published`\n \t\t FROM #__hdflv_category where published=1\";\n\t\t$db->setQuery($query);\n\t\t$rs_showplaylistname = $db->loadObjectList();\n\n\t\t/**\n\t\t * select videos details\n\t\t * for filter by order,title,category,viewed,video link,thumb link,order,featured,id\n\t\t * initially filter by order\n\t\t */\n\t\tif ($filter_order)\n\t\t{\n\t\t\t## for select videos details\n\t\t\t$strMainQuery = \"SELECT distinct(d.videoid) as cvid,a.`id`, a.`memberid`, a.`published`, a.`title`, a.`seotitle`,\n\t\t\t\t\t\t\t a.`featured`, a.`type`, a.`rate`, a.`ratecount`, a.`times_viewed`, a.`videos`, a.`filepath`,\n\t\t\t\t\t\t\t a.`videourl`, a.`thumburl`, a.`previewurl`, a.`hdurl`, a.`home`, a.`playlistid`, a.`duration`,\n\t\t\t\t\t\t\t a.`ordering`, a.`streamerpath`, a.`streameroption`, a.`postrollads`, a.`prerollads`, a.`midrollads`, a.`imaads`, a.`embedcode`,\n\t\t\t\t\t\t\t a.`description`, a.`targeturl`, a.`download`, a.`prerollid`, a.`postrollid`, a.`created_date`,\n\t\t\t\t\t\t\t a.`addedon`, a.`usergroupid`, a.`tags`, a.`useraccess`,b.category,c.username\n\t\t \t\t\t FROM #__hdflv_upload a\n\t\t \t INNER JOIN `#__users` c\";\n\n\t\t\t## for select user group id\n\t\t\tif(version_compare(JVERSION,'1.6.0','ge'))\n\t\t\t{\n\t\t\t\t$strMainQuery = \"$strMainQuery ON c.id = a.memberid\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$strMainQuery = \"$strMainQuery ON c.id = a.memberid\";\n\t\t\t}\n\n\t\t\t## for select video category and comments\n\t\t\t$strMainQuery = \"$strMainQuery\n\t\t\t\t\t\t\t LEFT JOIN #__hdflv_category b ON a.playlistid=b.id\n \t\t LEFT JOIN #__hdflv_comments d ON d.videoid=a.id\n \t\t $where\";\n\n\t\t}\n\t\t## assign filter variables\n\t\t$lists['order_Dir'] = $filter_order_Dir;\n\t\t$lists['order'] = $filter_order;\n $search = $this->phpSlashes($search);\n\t\t## filtering based on search keyword\n\t\tif ($search)\n\t\t{\n\t\t\t$strMainQuery .= \" AND a.title LIKE '%$search%'\";\n\t\t\t$lists['search'] = $search1;\n\t\t}\n\t\t## filtering based on status\n\t\tif($state_filter) {\n\t\t\tif($state_filter == 1) {\n\t\t\t\t$state_filterval = 1;\n\t\t\t}elseif ($state_filter == 2) {\n\t\t\t\t$state_filterval = 0;\n\t\t\t}else {\n\t\t\t\t$state_filterval = -2;\n\t\t\t}\n\t\t\t$strMainQuery .= \" AND a.published = $state_filterval\";\n\t\t\t$lists['state_filter'] = $state_filter;\n\t\t} else {\n\t\t\t$strMainQuery .= \" AND a.published != -2\";\n\t\t}\n\t\t## filtering based on featured status\n\t\tif($featured_filter) {\n\t\t\t$featured_filterval = ($featured_filter == '1')?'1':'0';\n\t\t\t$strMainQuery .= \" AND a.featured = $featured_filterval\";\n\t\t\t$lists['featured_filter'] = $featured_filter;\n\t\t}\n\t\tif($category_filter) {\n\t\t\t$strMainQuery .= \" AND a.playlistid = $category_filter\";\n\t\t\t$lists['category_filter'] = $category_filter;\n\t\t}\n\t\t\t$strMainQuery .= \" ORDER BY $filter_order $filter_order_Dir\";\n\n\t\t\t$db->setQuery($strMainQuery);\n\t\t\t$arrVideoList = $db->loadObjectList();\n\t\t\t$strTotalVideos = count($arrVideoList);\n\n\t\t\t## set pagination\n\n\t\t\t$pageNav = new JPagination($strTotalVideos, $limitstart, $limit);\n\n\t\t\t$strMainQuery .= \" LIMIT $pageNav->limitstart,$pageNav->limit\";\n\t\t\t$db->setQuery($strMainQuery);\n\t\t\t$arrVideoList = $db->loadObjectList();\n\n\t\t/**\n\t\t * get the most recent database error code\n\t\t * display the last database error message in a standard format\n\t\t *\n\t\t */\n\t\tif ($db->getErrorNum())\n\t\t{\n\t\t\tJError::raiseWarning($db->getErrorNum(), $db->stderr());\n\t\t}\n\n\t\treturn array('pageNav' => $pageNav, 'limitstart' => $limitstart,'lists' => $lists, 'rs_showupload' => $arrVideoList, 'rs_showplaylistname' => $rs_showplaylistname);\n\t}", "public function create()\n {\n $categories = Category::all()->pluck('name','id');\n \n return view('admin.video.create', compact('categories'));\n }", "public function createApiFormUrls($title)\n {\n $developerKey = Mage::getStoreConfig('productvideo_youtube_api/youtube_api/productvideo_gmail_developerkey');\n $applicationId = 'Video uploader v2';\n $authenticationURL= 'https://www.google.com/accounts/ClientLogin';\n try{\n $httpClient = Zend_Gdata_ClientLogin::getHttpClient(\n $username = Mage::getStoreConfig('productvideo_youtube_api/youtube_api/productvideo_gmail_email'),\n $password = Mage::getStoreConfig('productvideo_youtube_api/youtube_api/productvideo_gmail_password'),\n $service = 'youtube',\n $client = null,\n $source = 'store', // a short string identifying your application\n $loginToken = null,\n $loginCaptcha = null,\n $authenticationURL);\n }\n catch(exception $e){\n print 'You cannot be authenticated, please provide valid Gmail account information in System->Configuration->Youtube Api';\n die();\n }\n $httpClient->setHeaders('X-GData-Key', 'key='. $developerKey);\n $videoTitle = $title;\n $videoDescription= $title;\n $videoCategory= 'Howto';\n\n $youTubeService = new Zend_Gdata_YouTube($httpClient);\n $newVideoEntry = new Zend_Gdata_YouTube_VideoEntry();\n\n $newVideoEntry->setVideoTitle($videoTitle);\n $newVideoEntry->setVideoDescription($videoDescription);\n\n //make sure first character in category is capitalized\n $videoCategory = strtoupper(substr($videoCategory, 0, 1))\n . substr($videoCategory, 1);\n $newVideoEntry->setVideoCategory($videoCategory);\n\n // uncomment to add video tags to a video\n //$videoTagsArray = explode(' ', trim($videoTags));\n //$newVideoEntry->setVideoTags(implode(', ', $videoTagsArray));\n\n $tokenHandlerUrl = 'https://gdata.youtube.com/action/GetUploadToken';\n try {\n $tokenArray = $youTubeService->getFormUploadToken($newVideoEntry, $tokenHandlerUrl);\n } catch (Zend_Gdata_App_HttpException $httpException) {\n print 'ERROR ' . $httpException->getMessage()\n . ' HTTP details<br /><textarea cols=\"100\" rows=\"20\">'\n . $httpException->getRawResponseBody()\n . '</textarea><br />';\n return;\n } catch (Zend_Gdata_App_Exception $e) {\n $e->getMessage();\n return;\n }\n $tokenValue = $tokenArray['token'];\n $postUrl = $tokenArray['url'];\n $urls = array(\"postUrl\" => $postUrl , \"token\" => $tokenValue);\n\n return $urls;\n }", "public function create()\n {\n return view('admin.videos.create')->with([\n 'title' => 'Ավելացնել',\n ]);\n }", "public function metaform()\n {\n $validation = $this->getValidationData();\n $validation['extension'] = array(\n 'args' => array(\n 'extension',\n '3gp|aaf|asf|avchd|avi|cam|dat|dsh|fla|flr|flv|m1v|m2v|m4v|mng|mp4|mxf|nsv|ogg|rm|roq|smi|sol|svi|swf|wmv|wrap|mkv|mov|mpe|mpeg|mpg',\n ),\n 'message' => __( 'You can add only video.', 'wpv-views' ),\n );\n $this->setValidationData($validation);\n return parent::metaform(); \n }", "public function addEdit(){\n\t\tif (isset($this->session->userdata['logged_in'])){\n\t\t\t$video_id = $this->uri->segment(4);// get id form url\n\t\t\tif($video_id==''){\n\t\t\t\t$data['title'] = \"Add Video\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$data['title'] = \"Edit Video\";\n\t\t\t}\n\t\t\t$data['content'] = 'admin/addeditvideo';\n\t\t\t$data['getVideo'] = $this->VideoModel->getVideoById($video_id); //retrive all category By Id\n\t\t\t//print_r($data['getVideo']); die;\n\t\t\t$this->load->view('admin/layout/adminmaster',$data);\n\t\t}else{\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "public function create()\n {\n //\n\n $categories = DB::table('categories')->Select('categoryID', 'categoryName')->paginate();\n\n return view('video.addVideo', compact('categories'));\n }", "function manageVideoPopPlusFiles() {\r\n\t\t// Get List\r\n\t\tif (isset($_GET['get_list'])) {\r\n\t\t\t$start = 0;\r\n\t\t\tif (isset($_GET['start']) && is_numeric($_GET['start']))\r\n\t\t\t\t$start = $_GET['start'];\r\n\r\n\t\t\t// Open file and fill array with unserialized data\r\n\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t$this->vids = $this->_loadDataText();\r\n\r\n\t\t\t$out .= $this->_videoLists($_GET['get_list'], $this->vids, $start, ($_GET['get_list']=='1' ? $this->options['manage_list_max'] : $this->options['post_list_max']));\r\n\t\t\techo $out;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Check write permissions\r\n\t\tif($this->_checkDir()) {\r\n\r\n\t\t\t// IF Video is uploaded\r\n\t\t\tif ( current_user_can( $this->options['user_lvl'] ) ) {\r\n\t\t\t\tif(isset($_POST['lynkvp_upload']) && $this->_valInput()) {\r\n\t\t\t\t\t// defaults\r\n\t\t\t\t\t$vid_url = '';\r\n\t\t\t\t\t$vid_file = '';\r\n\t\t\t\t\t$vid_id = time(); // use timestamp for unique id\r\n\t\t\t\t\t$vid_image_file = '';\r\n\t\t\t\t\t$vid_image_url = '';\r\n\r\n\t\t\t\t\t// Save file\r\n\t\t\t\t\tif(is_uploaded_file($_FILES['lynkvp_file']['tmp_name'])) {\r\n\t\t\t\t\t\t$vid_file = $vid_id.'.'.$_POST['lynkvp_type']; // filename+extension\r\n\t\t\t\t\t\tif(!move_uploaded_file($_FILES['lynkvp_file']['tmp_name'], $this->data_dir . $vid_file))\r\n\t\t\t\t\t\t\t$this->note .= __(\"The file couldn't be saved on your server\", $this->textdomain_name);\r\n\t\t\t\t\t} elseif(!empty($_POST['lynkvp_url'])) {\r\n\t\t\t\t\t\t$vid_url = ltrim($_POST['lynkvp_url'],'http://');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Save Thumbnail file\r\n\t\t\t\t\tif(is_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'])) {\r\n\t\t\t\t\t\t$vid_image_file = $vid_id.'.thum.'.preg_replace('/^.*\\.(gif|jpe?g|png|bmp)$/i', '$1', $_FILES['lynkvp_image_file']['name']); // filename+extension\r\n\t\t\t\t\t\tif(file_exists($this->data_dir . $vid_image_file)) @unlink($this->data_dir . $vid_image_file);\r\n\t\t\t\t\t\tif(move_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'], $this->data_dir . $vid_image_file)) {\r\n\t\t\t\t\t\t\t$vid_image_url = ltrim($this->data_url . $vid_image_file, 'http://');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->note .= __(\"The file couldn't be saved on your server\", $this->textdomain_name);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} elseif(!empty($_POST['lynkvp_image_url'])) {\r\n\t\t\t\t\t\t$vid_image_url = ltrim($_POST['lynkvp_image_url'],'http://');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t\t\t$this->vids = $this->_loadDataText();\r\n\r\n\t\t\t\t\t// Add data to array\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_id'] = $vid_id;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_filename'] = $vid_file;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_url'] = $vid_url;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_type'] = $_POST['lynkvp_type'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_size'] = $_POST['lynkvp_size'];\r\n\t\t\t\t\tif (isset($this->videosizes[$_POST['lynkvp_size']])) {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $this->videosizes[$_POST['lynkvp_size']]['width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $this->videosizes[$_POST['lynkvp_size']]['height'];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $_POST['lynkvp_width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $_POST['lynkvp_height'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_name'] = $_POST['lynkvp_name'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_caption'] = $_POST['lynkvp_caption'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image'] = $vid_image_url;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image_filename'] = $vid_image_file;\r\n\r\n\t\t\t\t\t// Save ser. array\r\n\t\t\t\t\t$this->_saveDataText($this->vids);\r\n\r\n\t\t\t\t\t$this->note .= __('<strong>Done!</strong>', $this->textdomain_name);\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t} elseif(isset($_POST['lynkvp_edit2']) && $this->_valInput2()) {\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids)) {$this->vids = $this->_loadDataText();}\r\n\t\t\t\t\t$vid_id = $_POST['lynkvp_editid'];\r\n\t\t\t\t\t$vid_image_file = '';\r\n\t\t\t\t\t$vid_image_url = '';\r\n\r\n\t\t\t\t\t// Save Thumbnail file\r\n\t\t\t\t\tif(is_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'])) {\r\n\t\t\t\t\t\t$vid_image_file = $vid_id.'.thum.'.preg_replace('/^.*\\.(gif|jpe?g|png|bmp)$/i', '$1', $_FILES['lynkvp_image_file']['name']); // filename+extension\r\n\t\t\t\t\t\tif(file_exists($this->data_dir . $vid_image_file)) @unlink($this->data_dir . $vid_image_file);\r\n\t\t\t\t\t\tif(move_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'], $this->data_dir . $vid_image_file))\r\n\t\t\t\t\t\t\t$vid_image_url = ltrim($this->data_url . $vid_image_file, 'http://');\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$this->note .= __(\"The file couldn't be saved on your server\", $this->textdomain_name);\r\n\r\n\t\t\t\t\t} elseif(!empty($_POST['lynkvp_image_url'])) {\r\n\t\t\t\t\t\t$vid_image_url = ltrim($_POST['lynkvp_image_url'],'http://');\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$vid_image_url = $this->vids[$vid_id]['lynkvp_image'];\r\n\t\t\t\t\t\t$vid_image_file = $this->vids[$vid_id]['lynkvp_image_filename'];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Add data to array\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_id'] = $vid_id;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_filename'] = $_POST['lynkvp_filename'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_url'] = $_POST['lynkvp_url'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_type'] = $_POST['lynkvp_type'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_size'] = $_POST['lynkvp_size'];\r\n\t\t\t\t\tif (isset($this->videosizes[$_POST['lynkvp_size']])) {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $this->videosizes[$_POST['lynkvp_size']]['width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $this->videosizes[$_POST['lynkvp_size']]['height'];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $_POST['lynkvp_width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $_POST['lynkvp_height'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_name'] = $_POST['lynkvp_name'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_caption'] = $_POST['lynkvp_caption'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image'] = $vid_image_url;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image_filename'] = $vid_image_file;\r\n\r\n\t\t\t\t\t// Save ser. array\r\n\t\t\t\t\t$this->_saveDataText($this->vids);\r\n\r\n\t\t\t\t\t$this->note .= __('<strong>Done!</strong>', $this->textdomain_name);\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t} elseif(isset($_POST['lynkvp_del'])) {\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t\t\t$this->vids = $this->_loadDataText();\r\n\t\t\t\t\t$a_id = array_flip($_POST['lynkvp_del']);\r\n\r\n\t\t\t\t\t// Remove Video\r\n\t\t\t\t\tif(file_exists($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_filename']))\r\n\t\t\t\t\t\t@unlink($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_filename']);\r\n\t\t\t\t\tif(file_exists($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_image_filename']))\r\n\t\t\t\t\t\t@unlink($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_image_filename']);\r\n\r\n\t\t\t\t\tforeach($this->vids as $key=>$value) {\r\n\t\t\t\t\t\tif($key != $a_id[__('delete', $this->textdomain_name)])\r\n\t\t\t\t\t\t\t$a_vids2[$key] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->vids = $a_vids2;\r\n\t\t\t\t\tunset($a_vids2);\r\n\r\n\t\t\t\t\t// Save ser. images\r\n\t\t\t\t\t$this->_saveDataText($this->vids);\r\n\r\n\t\t\t\t\t$this->note .= __('<strong>Done!</strong>', $this->textdomain_name);\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// IF edit\r\n\t\t\tif ( current_user_can( $this->options['user_lvl'] ) ) {\r\n\t\t\t\tif ( isset($_POST['lynkvp_edit']) ) {\r\n\t\t\t\t\t// Video ID\r\n\t\t\t\t\t$a_id = array_flip($_POST['lynkvp_edit']);\r\n\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t\t\t$this->vids = $this->_loadDataText();\r\n\r\n\t\t\t\t\t// Populate POST & strip slashes array\r\n\t\t\t\t\t$_POST = $this->stripArray($this->vids[$a_id[__('edit', $this->textdomain_name)]]);\r\n\r\n\t\t\t\t\t$out .= \"<div class=\\\"wrap\\\" style=\\\"text-align:left;\\\">\\n\";\r\n\t\t\t\t\t$out .= \"<h2>\".__('Video Edit', $this->textdomain_name).\"</h2>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<form method=\\\"post\\\" action=\\\"\".$this->admin_manage.\"\\\" enctype=\\\"multipart/form-data\\\">\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"hidden\\\" name=\\\"lynkvp_type\\\" value=\\\"\".$_POST['lynkvp_type'].\"\\\" />\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<table border=\\\"0\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\">\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Name','videopop_plus').\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_name\\\" value=\\\"\".$_POST['lynkvp_name'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Caption','videopop_plus').\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_caption\\\" value=\\\"\".$_POST['lynkvp_caption'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\tif(!empty($_POST['lynkvp_url'])) {\r\n\t\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>\".__('URL', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>http://<input type=\\\"text\\\" name=\\\"lynkvp_url\\\" value=\\\"\".$_POST['lynkvp_url'].\"\\\" style=\\\"width:400px;\\\" /></td>\\n\";\r\n\t\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t\t$out .= $this->_getTypeSelect().\"\\n\";\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>\".__('Video type', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>\".$_POST['lynkvp_type'].\"</td>\\n\";\r\n\t\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td><span style=\\\"display:\".($_POST['lynkvp_type']!='flv'?'none':'block').\"\\\">\";\r\n\t\t\t\t\t\t$out .= __('Thumbnail', $this->textdomain_name).\":\";\r\n\t\t\t\t\t\t$out .= \"</span></td>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td><span style=\\\"display:\".($_POST['lynkvp_type']!='flv'?'none':'block').\"\\\">\";\r\n\t\t\t\t\t\t$out .= \"<input type=\\\"file\\\" name=\\\"lynkvp_image_file\\\" />&nbsp;&nbsp;&nbsp;\\n\";\r\n\t\t\t\t\t\t$out .= __('<strong>or</strong>', $this->textdomain_name).' &nbsp;&nbsp;';\r\n\t\t\t\t\t\t$out .= __('URL', $this->textdomain_name).\":&nbsp;&nbsp;\";\r\n\t\t\t\t\t\t$out .= \"http:// <input type=\\\"text\\\" name=\\\"lynkvp_image_url\\\" style=\\\"width:400px;\\\" value=\\\"\".$_POST['lynkvp_image'].\"\\\" />\";\r\n\t\t\t\t\t\t$out .= \"</span></td>\\n\";\r\n\t\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Size', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\\n\";\r\n\t\t\t\t\t$out .= \"<select name=\\\"lynkvp_size\\\" onchange=\\\"javascript:\";\r\n\t\t\t\t\t$out .= \"document.getElementById('input_size').style.display=(this.value==999?'inline':'none');\";\r\n\t\t\t\t\t$out .= \"\\\">\";\r\n\t\t\t\t\t$out .= \"<option value=\\\"0\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],'0').\">\".__('Select size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"<!-- Video sizes, one each line -->\\n\";\r\n\t\t\t\t\tforeach($this->videosizes as $key=>$value) {\r\n\t\t\t\t\t\t$out .= \"<option value=\\\"\".$key.\"\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],$key).\">\".$value['width'].\" x \".$value['height'].$value['note'].\"</option>\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$out .= \"<option value=\\\"999\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'], '999').\">\".__('Free Size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"</select>&nbsp;&nbsp;&nbsp;\\n\";\r\n\t\t\t\t\t$out .= \"<span id=\\\"input_size\\\" style=\\\"display:\".($_POST['lynkvp_size']!=999?'none':'inline').\"\\\">\\n\";\r\n\t\t\t\t\t$out .= __('Width').\": <input type=\\\"text\\\" name=\\\"lynkvp_width\\\" value=\\\"\".$_POST['lynkvp_width'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"&nbsp;x&nbsp;\";\r\n\t\t\t\t\t$out .= __('Height').\": <input type=\\\"text\\\" name=\\\"lynkvp_height\\\" value=\\\"\".$_POST['lynkvp_height'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</span>\\n\";\r\n\t\t\t\t\t$out .= \"</td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"</table>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<br />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"hidden\\\" name=\\\"lynkvp_editid\\\" value=\\\"\".$_POST['lynkvp_id'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"hidden\\\" name=\\\"lynkvp_filename\\\" value=\\\"\".$_POST['lynkvp_filename'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"submit\\\" name=\\\"lynkvp_edit2\\\" class=\\\"button\\\" value=\\\"\".__('Upload', $this->textdomain_name).\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</form>\\n\";\r\n\t\t\t\t\t$out .= \"</div>\\n\";\r\n\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// strip slashes array\r\n\t\t\t\t\t$_POST = $this->stripArray($_POST);\r\n\r\n\t\t\t\t\t// BLOCK Upload\r\n\t\t\t\t\t$out .= \"<div class=\\\"wrap\\\" style=\\\"text-align:left;\\\">\\n\";\r\n\t\t\t\t\t$out .= \"<h2>\".__('Video Upload', $this->textdomain_name).\"</h2>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<form method=\\\"post\\\" action=\\\"\".$this->admin_manage.\"\\\" enctype=\\\"multipart/form-data\\\">\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<table border=\\\"0\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\">\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Name', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_name\\\" value=\\\"\".$_POST['lynkvp_name'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Caption', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_caption\\\" value=\\\"\".$_POST['lynkvp_caption'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Choose video', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"file\\\" name=\\\"lynkvp_file\\\" />&nbsp;&nbsp;&nbsp;\\n\";\r\n\t\t\t\t\t$out .= __('<strong>or</strong>', $this->textdomain_name).\" &nbsp;&nbsp;\";\r\n\t\t\t\t\t$out .= __('URL', $this->textdomain_name).\":&nbsp;&nbsp;http://<input type=\\\"text\\\" name=\\\"lynkvp_url\\\" style=\\\"width:400px;\\\" value=\\\"\".$_POST['lynkvp_url'].\"\\\" />\";\r\n\t\t\t\t\t$out .= \"</td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= $this->_getTypeSelect().\"\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Size', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\\n\";\r\n\t\t\t\t\t$out .= \"<select name=\\\"lynkvp_size\\\" onchange=\\\"javascript:\";\r\n\t\t\t\t\t$out .= \"document.getElementById('input_size').style.display=(this.value==999?'inline':'none');\";\r\n\t\t\t\t\t$out .= \"\\\">\";\r\n\t\t\t\t\t$out .= \"<option value=\\\"0\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],'0').\">\".__('Select size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"<!-- Video sizes, one each line -->\\n\";\r\n\t\t\t\t\tforeach($this->videosizes as $key=>$value) {\r\n\t\t\t\t\t\t$out .= \"<option value=\\\"\".$key.\"\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],$key).\">\".$value['width'].\" x \".$value['height'].$value['note'].\"</option>\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$out .= \"<option value=\\\"999\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'], \"999\").\">\".__('Free Size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"</select>&nbsp;&nbsp;&nbsp;\\n\";\r\n\t\t\t\t\t$out .= \"<span id=\\\"input_size\\\" style=\\\"display:\".(!isset($this->videosizes[$_POST['lynkvp_size']]) ? 'none' : 'inline').\"\\\">\\n\";\r\n\t\t\t\t\t$out .= __('Width').\": <input type=\\\"text\\\" name=\\\"lynkvp_width\\\" value=\\\"\".$_POST['lynkvp_width'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"&nbsp;x&nbsp;\";\r\n\t\t\t\t\t$out .= __('Height').\": <input type=\\\"text\\\" name=\\\"lynkvp_height\\\" value=\\\"\".$_POST['lynkvp_height'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</span>\\n\";\r\n\t\t\t\t\t$out .= \"</td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"</table>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<br />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"submit\\\" name=\\\"lynkvp_upload\\\" class=\\\"button\\\" value=\\\"\".__('Upload', $this->textdomain_name).\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</form>\\n\";\r\n\t\t\t\t\t$out .= \"</div>\\n\";\r\n\t\t\t\t\tunset($_POST);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// ---------\r\n\t\t\t// ALWAYS DISPLAYED\r\n\r\n\t\t\t// BLOCK Your Videos\r\n\t\t\t$out .= \"<div class=\\\"wrap\\\" style=\\\"text-align:left;padding-bottom:3em;margin-top:2em;\\\">\\n\";\r\n\t\t\t$out .= \"<h2>\".__('My Videos', $this->textdomain_name).\"</h2>\\n\";\r\n\r\n\t\t\t// Open file and fill array with unserialized data\r\n\t\t\tif (!is_array($this->vids)) {$this->vids = $this->_loadDataText();}\r\n\r\n\t\t\t// If any vids uploaded\r\n\t\t\tif(is_array($this->vids)) {\r\n\t\t\t\t// add JS to manage page;\r\n\t\t\t\t$this->_adminHead();\r\n\t\t\t\t$out .= $this->_videoLists('1', $this->vids, 0, $this->options['manage_list_max']);\r\n\t\t\t}\r\n\r\n\t\t\t$out .= \"</div>\\n\";\r\n\t\t}\r\n\r\n\t\t// Output\r\n\t\techo (!empty($this->note) ? \"<div id=\\\"message\\\" class=\\\"updated fade\\\"><p>{$this->note}</p></div>\\n\" : '' ).\"\\n\";\r\n\t\techo ($this->error > 0 ? '' : $out).\"\\n\";\r\n\t}", "function show_metabox_post_video($post) {\r\n\t\t$id_vimeo = get_post_meta($post->ID, 'id_vimeo', true);\r\n\t\t$id_youtube = get_post_meta($post->ID, 'id_youtube', true);\r\n\t\t$embed_generico = get_post_meta($post->ID, 'embed_generico', true);\r\n\t\twp_nonce_field(__FILE__, '_articulo_videos_nonce');\r\n\t\techo <<< HTML\r\n\r\n\t\t\t<label for=\"id_vimeo\">ID de Vimeo</label>\r\n\t\t\t<input type=\"text\" name=\"id_vimeo\" id=\"id_vimeo\" value=\"$id_vimeo\" class=\"widefat\">\r\n\t\t\t<p class=\"howto\" style=\"font-size:11px; margin: 0.2em 0 1.5em 0;\">https://vimeo.com/<strong>45118430</strong></p>\r\n\r\n\t\t\t<label for=\"id_youtube\">ID de Youtube</label>\r\n\t\t\t<input type=\"text\" name=\"id_youtube\" id=\"id_youtube\" value=\"$id_youtube\" class=\"widefat\">\r\n\t\t\t<p class=\"howto\" style=\"font-size:11px; margin: 0.2em 0 1.5em 0;\">https://www.youtube.com/watch?v=<strong>rT_OmTMwvZI</strong></p>\r\n\r\n\t\t\t<label for='embed_generico'>Embed (otra fuente)</label>\r\n\t\t\t<input type='text' name='embed_generico' id='embed_generico' value='$embed_generico' class='widefat'>\r\n\t\t\t<p class='howto' style='font-size:11px; margin: 0.2em 0 1.5em 0;'>< iframe src='//player...</p>\r\n\r\nHTML;\r\n\t}", "function video() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id'];\n if ($id > 0) {\n $query = \"select * from videos where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $query = \"update videos set views = views + 1 where id =$id;\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }", "public function store(Request $request)\n { \n\n $request->validate([\n 'name' => 'required'\n ]);\n\n $url_video = $request->url_video;\n\n $url_video_array = explode(\"/\", $url_video);\n\n if(Str::contains($url_video, 'youtube')) {\n $url_video_id = $url_video_array[4];\n $url_thumbail = 'https://img.youtube.com/vi/'.$url_video_id.'/0.jpg';\n } \n\n if(Str::contains($url_video, 'vimeo')) {\n $url_video_id = $url_video_array[4];\n $hash = unserialize(file_get_contents(\"https://vimeo.com/api/v2/video/\".$url_video_id.\".php\"));\n $url_thumbail_preview = $hash[0]['thumbnail_large'];\n $url_thumbail = substr_replace( $url_thumbail_preview, \"480x360\", -3);\n } \n\n $video = Video::create([\n\n 'name' => $request->name,\n 'date_public' => $request->date_public,\n 'status' => $request->status,\n 'category_id' => $request->category_id,\n 'url_video' => $url_video,\n 'url_thumbail' => $url_thumbail\n ]);\n\n return redirect()->route('admin.videos.edit', $video)->with('info', 'El video se creó con éxito');\n }", "public function post_addvideo()\r\n\t\t{\r\n\t\t\t$retArr = array();\r\n\t\t\t// Scaffolding Code For Single:\r\n\t\t\t$retArr = $this->obj->getBasics();\r\n\r\n\t\t\treturn $retArr;\r\n\t\t}", "public function create()\n {\n $package = CoursePackage::all();\n return view('admin.video.create')->with('pk' , $package);\n }", "public function create()\n {\n return view('videos.uploader');\n }", "function __construct()\n\t{\n\t\t// vars\n\t\t$this->name = 'video';\n\t\t$this->label = __('Video');\n\t\t$this->category = __(\"Content\",'acf'); // Basic, Content, Choice, etc\n\t\t$this->defaults = array(\n\t\t\t// add default here to merge into your field. \n\t\t\t// This makes life easy when creating the field options as you don't need to use any if( isset('') ) logic. eg:\n\t\t\t//'preview_size' => 'thumbnail'\n\t\t);\n\t\t\n\t\t\n\t\t// do not delete!\n \tparent::__construct();\n \t\n \t\n \t// settings\n\t\t$this->settings = array(\n\t\t\t'path' => apply_filters('acf/helpers/get_path', __FILE__),\n\t\t\t'dir' => apply_filters('acf/helpers/get_dir', __FILE__),\n\t\t\t'version' => '1.0.0'\n\t\t);\n\n\t}", "public function index()\n \t{\n \t\t$videos=Video::orderBy('listing_order','desc')\n ->orderBy('updated_at','desc')->get();\n\n \t\treturn view('admin.video.manage',compact('videos'));\n \t}", "public function store(VideoFormRequest $request)\n {\n $dataForm = $request->all();\n\n if(valid_file($request))\n {\n $upload = upload_file($request, 'videos');\n\n if($upload){\n $dataForm['file'] = $upload;\n }\n }\n\n $video = $this->video->create($dataForm)->id;\n\n if(!$video) return redirect('/admin/videos')->with('fail', 'Falha ao salvar o vídeo!');\n\n return redirect('/admin/videos')->with('success', 'Vídeo criado com sucesso!');\n }", "public function edit(Video $video)\n {\n //\n }", "public function edit(Video $video)\n {\n //\n }", "public function create()\n {\n $edit = false;\n return view('admin.videos.show', compact(['edit']));\n }", "public function postCreate2()\n\t{\n // Declare the rules for the form validation\n $rules = array(\n 'user' => 'required|min:5',\n 'link' => 'required|min:10',\n 'description' => 'required|min:10'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Create a new video \n $user = Auth::user();\n\n // Update the video data\n $this->video->link = Input::get('link');\n $this->video->description = Input::get('description');\n $this->video->user = Input::get('user');\n\n // Was the video created?\n if($this->video->save())\n {\n // Redirect to the new video page\n return Redirect::to('videos/v')->with('success', Lang::get('user/user.user_video_created'));\n }\n\n // Redirect to the video video create page\n return Redirect::to('admin/videos/create')->with('error', Lang::get('admin/videos/messages.create.error'));\n }\n\n // Form validation failed\n return Redirect::to('admin/videos/create')->withInput()->withErrors($validator);\n\t}", "public function newAction()\n {\n $galleryvideo = new GalleryVideo();\n $form = $this->createForm(GalleryVideoType::class, $galleryvideo);\n\n return $this->render('AdminBundle:galleryvideo:new.html.twig', array(\n 'video' => $galleryvideo,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data = ['title' => $this->title, 'subtitle' => 'Adicionar notícia'];\n\n return view('admin.videos.form')->with($data);\n }", "public function _construct()\n {\n $this->_init('videos/videos', 'videos_id');\n }", "public function indexAction() {\n\t\t$viewer = Engine_Api::_()->user()->getViewer();\n\t\tif (!Engine_Api::_()->core()->hasSubject()) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\t\t\n\t\t// Get subject and check auth\n\t\t$subject = Engine_Api::_()->core()->getSubject('event');\n\t\tif (!$subject->authorization()->isAllowed($viewer, 'view')) {\n\t\t\treturn $this->setNoRender();\n\t\t}\n\t\t\n\t\t// Prepare data\n\t\t$this->view->event = $event = $subject;\n\t\t\t\n\t //Get viewer, event, search form\n\t \t$viewer = Engine_Api::_() -> user() -> getViewer();\n\t \t$this -> view -> event = $event = Engine_Api::_() -> core() -> getSubject();\n\t\t$this -> view -> form = $form = new Ynevent_Form_Video_Search;\n\t\n\t\tif ( !$event->authorization()->isAllowed($viewer, 'view') ) { return; }\n\t \n\t // Check create video authorization\n\t\t$canCreate = $event -> authorization() -> isAllowed($viewer, 'video');\n\t\t$levelCreate = Engine_Api::_() -> authorization() -> getAdapter('levels') -> getAllowed('event', $viewer, 'video');\n\n\t\t//print_r($canCreate); exit;\n\t\t\n\t\tif ($canCreate && $levelCreate) {\n\t\t\t$this -> view -> canCreate = true;\n\t\t} else {\n\t\t\t$this -> view -> canCreate = false;\n\t\t}\n\t\n\t //Prepare data filer\n\t $params = array();\n\t $params = $this->_getAllParams();\n\t $params['title'] = '';\n\t $params['parent_type'] = 'event';\n\t $params['parent_id'] = $event->getIdentity();\n\t $params['search'] = 1;\n\t $params['limit'] = 12;\n\t $form->populate($params);\n\t $this->view->formValues = $form->getValues();\n\t //Get data\n\t //print_r($params); exit;\n\t $this -> view -> paginator = $paginator = Engine_Api::_() -> ynvideo() -> getVideosPaginator($params);\n\t if(!empty($params['orderby'])){\n\t switch($params['orderby']){\n\t case 'most_liked':\n\t $this->view->infoCol = 'like';\n\t break;\n\t case 'most_commented':\n\t $this->view->infoCol = 'comment';\n\t break;\n\t default:\n\t $this->view->infoCol = 'view';\n\t break;\n\t }\n\t }\n\t \n\t\t// Add count to title if configured\n\t if( $this->_getParam('titleCount', false) && $paginator->getTotalItemCount() > 0 ) {\n\t $this->_childCount = $paginator->getTotalItemCount();\n\t }\n\t}", "public function process() {\n // Add oembed streams to video file types.\n $video = file_type_load('video');\n $video->mimetypes[] = 'video/oembed';\n $video->streams[] = 'oembed';\n file_type_save($video);\n\n // Oembed specific display settings for videos.\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '560',\n 'height' => '340',\n 'wmode' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '180',\n 'height' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__preview__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__teaser__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n }", "public function create()\n {\n return view('reg/video');\n }", "public function lecteurVideoAction($ListeDesVideos){\n\t\n\t\t$html ='<script>\n\t\t\t\t var tab = [];\n\t\t </script>';\n\t\t$i = 0;\n\t\tforeach ($ListeDesVideos as $Liste) {\n\t\t\t\t\n\t\t\tif($Liste['format'] == \"video/mp4\" || $Liste['format'] == \"video/m4v\") {\n\t\t\t\t$html .='<script>\n \t\t tab['.$i++.'] = {\n\t \"title\":\"'. $Liste['titre'] .' <span class=\\'supprimerVideoIns'.$i.'\\' > </span>\",\n\t\t \"m4v\":\"/simens/public/videos/'. $Liste['nom'] .'\",\n\t\t };\n\t\n\t\t setTimeout(function() {\n\t $(function () {\n\t\t $(\".supprimerVideoIns'.$i.'\").click(function () { return false; });\n\t\t $(\".supprimerVideoIns'.$i.'\").dblclick(function () { supprimerVideo('.$Liste['id'].'); return false; });\n\t });\n }, 1000);\n \t\t </script>';\n\t\t\t}\n\t\t\telse\n\t\t\tif($Liste['format'] == \"video/webm\") {\n\t\t\t\t$html .='<script>\n \t\t tab['.$i++.'] = {\n\t \"title\":\"'. $Liste['titre'] .'<span class=\\'supprimerVideoIns'.$i.'\\' > </span>\",\n\t\t \"webmv\":\"/simens/public/videos/'. $Liste['nom'] .'\",\n\t\t };\n\t\t \n\t\t setTimeout(function() {\n\t $(function () {\n\t\t $(\".supprimerVideoIns'.$i.'\").click(function () { return false; });\n\t\t $(\".supprimerVideoIns'.$i.'\").dblclick(function () { supprimerVideo('.$Liste['id'].'); return false; });\n\t });\n }, 1000);\n \t\t </script>';\n\t\t\t}\n\t\t}\n\t\n\t\t$html .='<script>\n\t\t\t\t $(document).ready(function(){\n\t\n\t new jPlayerPlaylist({\n\t\t jPlayer: \"#jquery_jplayer_1\",\n\t\t cssSelectorAncestor: \"#jp_container_1\"\n\t },\n\t\t\t\t tab\n\t\t\t\t ,{\n\t\t swfPath: \"../../dist/jplayer\",\n\t\t supplied: \"webmv, ogv, m4v\",\n\t\t useStateClassSkin: true,\n\t\t autoBlur: false,\n\t\t smoothPlayBar: true,\n\t\t keyEnabled: true\n\t });\n\t\n });\n\t\n\t\t\t\tscriptAjoutVideo();\n\t\t </script>';\n\t\t\t\n\t\t$html .='\n\t\n\t\t<form id=\"my_form_video\" method=\"post\" action=\"/simens/public/consultation/ajouter-video\" enctype=\"multipart/form-data\">\n\t\t<div id=\"jp_container_1\" class=\"jp-video jp-video-270p\" role=\"application\" aria-label=\"media player\" style=\"margin: auto;\">\n\t <div class=\"jp-type-playlist\">\n\t\t<div id=\"jquery_jplayer_1\" class=\"jp-jplayer\"></div>\n\t\t<div class=\"jp-gui\">\n\t\t\t<div class=\"jp-video-play\">\n\t\t\t\t<button class=\"jp-video-play-icon\" role=\"button\" tabindex=\"0\">play</button>\n\t\t\t</div>\n\t\t\t<div class=\"jp-interface\">\n\t\t\t\t<div class=\"jp-progress\">\n\t\t\t\t\t<div class=\"jp-seek-bar\">\n\t\t\t\t\t\t<div class=\"jp-play-bar\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"jp-current-time\" role=\"timer\" aria-label=\"time\">&nbsp;</div>\n\t\t\t\t<div class=\"jp-duration\" role=\"timer\" aria-label=\"duration\">&nbsp;</div>\n\t\t\t\t<div class=\"jp-controls-holder\">\n\t\t\t\t\t<div class=\"jp-controls\">\n\t\t\t\t\t\t<button class=\"jp-previous\" role=\"button\" tabindex=\"0\">previous</button>\n\t\t\t\t\t\t<button class=\"jp-play\" role=\"button\" tabindex=\"0\">play</button>\n\t\t\t\t\t\t<button class=\"jp-next\" role=\"button\" tabindex=\"0\">next</button>\n\t\t\t\t\t\t<button class=\"jp-stop\" role=\"button\" tabindex=\"0\">stop</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"jp-volume-controls\">\n\t\t\t\t\t\t<button class=\"jp-mute\" role=\"button\" tabindex=\"0\">mute</button>\n\t\t\t\t\t\t<button class=\"jp-volume-max\" role=\"button\" tabindex=\"0\">max volume</button>\n\t\t\t\t\t\t<div class=\"jp-volume-bar\">\n\t\t\t\t\t\t\t<div class=\"jp-volume-bar-value\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"jp-toggles\">\n\t\t\t\t\t\t<button class=\"jp-full-screen\" role=\"button\" tabindex=\"0\">full screen</button>\n\t\t\t\t\t</div>\n\t\n\t\t\t\t <div class=\"jp-toggles2\" id=\"jp-toggles-video\" >\n\t\t\t\t <div class=\"jp-ajouter-video\">\n\t\t\t\t <input type=\"file\" name=\"fichier-video\" id=\"fichier-video\">\n\t\t\t\t </div>\n\t\t\t\t\t</div>\n\t\n\t\t\t\t</div>\n\t\t\t\t<div class=\"jp-details\">\n\t\t\t\t\t<div class=\"jp-title\" aria-label=\"title\">&nbsp;</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"jp-playlist\">\n\t\t\t<ul>\n\t\t\t\t<li>&nbsp;</li>\n\t\t\t</ul>\n\t\t</div>\n\t </div>\n </div>\n\t\t</form>';\n\t\treturn $html;\n\t}", "function video_post() {\n\n\t\t\t//only if missing\n\t\t\tif (post_type_exists('video')) return;\n\n\t\t\t$labels = array(\n\t\t\t\t'name' => _x( 'Videos', 'Post Type General Name', 'text_domain' ),\n\t\t\t\t'singular_name' => _x( 'Video', 'Post Type Singular Name', 'text_domain' ),\n\t\t\t\t'menu_name' => __( 'Videos', 'text_domain' ),\n\t\t\t\t'parent_item_colon' => __( 'Parent Video:', 'text_domain' ),\n\t\t\t\t'all_items' => __( 'All Videos', 'text_domain' ),\n\t\t\t\t'view_item' => __( 'View Video', 'text_domain' ),\n\t\t\t\t'add_new_item' => __( 'Add New Video', 'text_domain' ),\n\t\t\t\t'add_new' => __( 'New Video', 'text_domain' ),\n\t\t\t\t'edit_item' => __( 'Edit Video', 'text_domain' ),\n\t\t\t\t'update_item' => __( 'Update Video', 'text_domain' ),\n\t\t\t\t'search_items' => __( 'Search Videos', 'text_domain' ),\n\t\t\t\t'not_found' => __( 'No Videos found', 'text_domain' ),\n\t\t\t\t'not_found_in_trash' => __( 'No Videos found in Trash', 'text_domain' ),\n\t\t\t);\n\n\t\t\t$args = array(\n\t\t\t\t'label' => __( 'video', 'text_domain' ),\n\t\t\t\t'description' => __( 'Video Videos', 'text_domain' ),\n\t\t\t\t'labels' => $labels,\n\t\t\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'comments', 'custom-fields', 'page-attributes', ),\n\t\t\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'public' => true,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_in_menu' => true,\n\t\t\t\t'show_in_nav_menus' => true,\n\t\t\t\t'show_in_admin_bar' => true,\n\t\t\t\t'menu_position' => 5,\n\t\t\t\t'can_export' => true,\n\t\t\t\t'has_playlist' => true,\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t'capability_type' => 'post',\n\t\t\t);\n\n\t\t\tregister_post_type( 'video', $args );\n\n\t\t\t// Add new taxonomy, make it hierarchical (like categories)\n\t\t\t$labels = array(\n\t\t\t\t'name' => _x( 'Playlists', 'taxonomy general name' ),\n\t\t\t\t'singular_name' => _x( 'Playlist', 'taxonomy singular name' ),\n\t\t\t\t'search_items' => __( 'Search Playlists' ),\n\t\t\t\t'all_items' => __( 'All Playlists' ),\n\t\t\t\t'parent_item' => __( 'Parent Playlist' ),\n\t\t\t\t'parent_item_colon' => __( 'Parent Playlist:' ),\n\t\t\t\t'edit_item' => __( 'Edit Playlist' ),\n\t\t\t\t'update_item' => __( 'Update Playlist' ),\n\t\t\t\t'add_new_item' => __( 'Add New Playlist' ),\n\t\t\t\t'new_item_name' => __( 'New Playlist Name' ),\n\t\t\t\t'menu_name' => __( 'Playlists' ),\n\t\t\t);\n\n\t\t\t$args = array(\n\t\t\t\t'hierarchical' => true,\n\t\t\t\t'labels' => $labels,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_admin_column' => true,\n\t\t\t\t'update_count_callback' => '_update_post_term_count',\n\t\t\t\t'query_var' => true,\n\t\t\t\t'rewrite' => array( 'slug' => 'playlist' ),\n\t\t\t);\n\n\t\t\tregister_taxonomy( 'playlist', array( 'video' ), $args );\n\n\t\t\tflush_rewrite_rules();\n\t\t}", "public function show(UploadVideo $uploadVideo)\n {\n //\n }", "function display_playlist_form($video = '') {\r\n// It is very similar to the category form.\r\n// This form can be used for inserting or editing books.\r\n// To insert, don't pass any parameters. This will set $edit\r\n// to false, and the form will go to insert_book.php.\r\n// To update, pass an array containing a book. The\r\n// form will be displayed with the old data and point to update_book.php.\r\n// It will also add a \"Delete book\" button.\r\n\r\n\r\n // if passed an existing book, proceed in \"edit mode\"\r\n $edit = is_array($video);\r\n \r\n $ShowDate = strtotime('next Friday');\r\n $date = date(\"F j, Y\", $ShowDate); // F = Month j = day without leading Zero Y = year 4 digit Page 470 for full list\r\n $year = date(\"Y\", $ShowDate);\r\n // most of the form is in plain HTML with some\r\n // optional PHP bits throughout\r\n?>\r\n\r\n <form method=\"post\"\r\n action=\"<?php echo $edit ? 'edit_playlist.php' : 'insert_playlist_entry.php';?>\">\r\n <table border=\"0\">\r\n <tr class=\"NotVisible\">\r\n <td>PlaylistID:</td>\r\n <td><input type=\"text\" name=\"PlaylistID\"\r\n value=\"<?php echo $edit ? $video['PlaylistID'] : ''; ?>\" readonly/></td>\r\n </tr>\r\n <tr>\r\n <td>Title:</td>\r\n <td><input type=\"text\" name=\"Title\" size=\"40\"\r\n value=\"<?php echo $edit ? $video['Title'] : 'Spring # '.$year; ?>\" /></td>\r\n </tr>\r\n <tr>\r\n <td>Date:</td>\r\n <td><input type=\"text\" name=\"Date\"\r\n value=\"<?php echo $edit ? $video['PlaylistDate'] : $date; ?>\" /></td>\r\n </tr>\r\n <tr>\r\n <td>Playlist:</td>\r\n <td><textarea id=\"Blog\" wrap=\"virtual\" cols=\"60\" rows=\"15\" name=\"Playlist\"><?php echo $edit ? $video['Playlist'] : ''; ?></textarea></td>\r\n </tr>\r\n <tr>\r\n <td <?php if (!$edit) { echo \"colspan=2\"; }?> align=\"center\">\r\n <?php\r\n if ($edit)\r\n // we need the old isbn to find book in database\r\n // if the isbn is being updated\r\n echo \"<input type=\\\"hidden\\\" name=\\\"PlaylistID\\\"\r\n value=\\\"\".$video['PlaylistID'].\"\\\" />\";\r\n ?>\r\n <input type=\"submit\"\r\n value=\"<?php echo $edit ? 'Update' : 'Insert'; ?> Playlist\" />\r\n </form></td>\r\n <?php\r\n if ($edit) {\r\n echo \"<td>\r\n <form method=\\\"post\\\" action=\\\"delete_playlist.php\\\">\r\n <input type=\\\"hidden\\\" name=\\\"PlaylistID\\\"\r\n value=\\\"\".$video['PlaylistID'].\"\\\" />\r\n <input type=\\\"submit\\\" value=\\\"Delete Playlist\\\"/>\r\n </form></td>\";\r\n }\r\n ?>\r\n </td>\r\n </tr>\r\n </table>\r\n </form>\r\n\r\n<?php\r\n}", "public function actionCreate()\n {\n $model = new Video();\n \n $post = Yii::$app->request->post();\n if ($post) { \n// $file = UploadedFile::getInstance($model, 'file'); \n// $path = Yii::$app->basePath. \"/../frontend/web/\";\n// $filePath = Yii::$app->basePath. \"/../frontend/web/videos/\";\n \n// if ($file) {\n// $filename = \"videos/\" . time() . rand(1,1000) . '.' . $file->getExtension();\n// $path = $path . $filename;\n \n// if(!file_exists($filePath)){\n// mkdir($filePath);\n// }\n// $file->saveAs($path);\n $url = $path = Yii::$app->params['uploadsUrl'].$post['Video']['video'];\n $header_array = get_headers($url, true);\n $size = $header_array['Content-Length']; \n \n $post['Video']['video'] = $post['Video']['video'];\n $post['Video']['filesize'] = $size;\n $post['Video']['ext'] = explode('.', basename($post['Video']['video']))[1];\n $post['Video']['is_complete'] = '1';\n $post['Video']['product_id'] = empty($post['Video']['product_id']) ? '' : join(',', $post['Video']['product_id']);\n// }\n\n if ($model->load($post) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function createVideo($data)\n {\n return $this->performRequest('POST','/videos', $data);\n }", "public function uploadVideo(){\n\t\t$this->log('<videos.uploadVideo>', 'debug');\n\t\t\n\t\tif(!$this->request->is('post')){\n\t\t\t$this->log('wrong HTML form method ...', 'debug');\n\t\t\treturn;\n\t\t}\n\t\t//HTML Form method is valid\n\t\t$error = '';\n\t\t$video_id = '';\n\t\t$message = '';\n\t\t\n\t\t$db = $this->Video->getDataSource();\n\t\t$db->begin();\n\t\ttry{\n\t\t\t//Checking resource video object ...\n\t\t\n\t\t\tif(!isset($this->request->data['Video']['video'])){\n\t\t\t\t$error = __('No video resource found in request');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\t$errorFlag = $this->request->data['Video']['video']['error'];\n\t\t\tif($errorFlag){\n\t\t\t\t$error = __('Upload failed due to internal Server error');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\t$name = $this->request->data['Video']['video']['name'];\n\t\t\t$size = $this->request->data['Video']['video']['size'];\n\t\t\t$tmp_name = $this->request->data['Video']['video']['tmp_name'];\n\t\t\n\t\t\t$this->loadModel('Video');\n\t\t\n\t\t\t$this->Video->create();\n\t\t\n\t\t\tif(!file_exists($tmp_name)){\n\t\t\t\t$error = __('Invalid tmp file');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\tif($size > 3145728){//size > 3MB\n\t\t\t\t$error = __('Video file is too large');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\t$im = file_get_contents($tmp_name);\n \t\t\t$imdata = base64_encode($im);\n\t\t\tif(!$imdata){\n\t\t\t\t$error = __('Unable to encode the uploaded file ');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\t\t\t\t\n\t\t\t$this->Video->data['Video']['vid_name'] = $name;\n\t\t\t$codec = $this->Video->getVideoCodec($tmp_name);\n\t\t\t$this->Video->data['Video']['vid_mime_type'] = $codec;\n\t\t\t$this->Video->data['Video']['vid_data'] = $imdata;\n\t\t\t$date = new DateTime();\n\t\t\t$now = $date->getTimestamp();\n\t\t\t$this->Video->data['Video']['vid_created'] = $now;\n\t\t\t\n\t\t\tif(!$this->Video->save($this->Video->data)){\n\t\t\t\t$error = __(\"Unable to save the video data\");\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\t$video_id = $this->Video->id;\n\t\t\t$message = __('Video has been successfully uploaded');\n\t\t\t$message = htmlentities($message, ENT_QUOTES);\n\t\t\t$db->commit();\n\t\t}catch(Exception $e){\n\t\t\t$db->rollback();\n\t\t\t$this->log($e->getMessage());\n\t\t\tif(!$error)\n\t\t\t\t$error = __(AppModel::$DEFAULT_ERROR_MESSAGE);\n\t\t}\n\t\t\t\n\t\t$this->set('error', $error);\n\t\t$this->set('video_id', $video_id);\n\t\t$this->set('message', $message);\n\t\t$this->layout = 'empty';\n\t\t\n\t\t\n\t\t$this->log('</videos.uploadVideo>', 'debug');\n\t}", "public function create()\n {\n $bussines=Bussine::lists('slug','id');\n return view('backend.videos.create')->with('bussines',$bussines);\n }", "public function create()\n { \n\n $categories = Category::pluck('name', 'id');\n\n return view('admin.videos.create', compact('categories'));\n }", "public function embedAction() {\n\n //GET SUBJECT (EITHER VIDEO TYPE OR SITEREVIEW_VIDEO TYPE)\n $this->view->video = $video = Engine_Api::_()->core()->getSubject();\n\n //CHECK THAT EMBEDDING IS ALLOWED OR NOT\n if (!Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereview_video.embeds', 1)) {\n $this->view->error = 1;\n return;\n } else if (isset($video->allow_embed) && !$video->allow_embed) {\n $this->view->error = 2;\n return;\n }\n\n //GET EMBED CODE\n $this->view->embedCode = $video->getEmbedCode();\n }", "public function run()\n {\n $video = [\n [\n 'id' => 1,\n 'source' => 'youtube',\n 'code' => 'zvziUZQCd-I',\n 'title' => 'iPhone 12中國銷量佳!華為出新機迎戰 躲禁令傳囤大量台積電晶片|非凡財經新聞|20201023',\n ],\n [\n 'id' => 2,\n 'source' => 'youtube',\n 'code' => 'A70caQprTO4',\n 'title' => '顧客轉買低價NB 英特爾Q3營收年減4% 盤後股價大跌近1成|非凡財經新聞|20201023',\n ],\n ];\n\n Video::insert($video);\n }", "public function videoposts(){\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n\t\t\t$browseUserid = $this->input->post(\"browseuser\");\n\t\t\t$result = array();\n\t\t\t$result = $this->post->videos($browseUserid,'studio');\n\t\t\techo json_encode($result);\n\t\t}\n\t\telse{\n\t\t\tredirect('error');\n\t\t}\n\t}", "public function buildVideos($docs = FALSE);", "function signage_panes_video_edit_form_submit($form, &$form_state) {\n foreach (array_keys($form_state['plugin']['defaults']) as $key) {\n if (isset($form_state['values'][$key])) {\n // Restrict embed code to iframe, object, param and embed tags only.\n if ($key == 'video_embed_code') {\n $form_state['values'][$key] = strip_tags($form_state['values']['video_embed_code'], '<iframe><object><param><embed>');\n }\n $form_state['conf'][$key] = $form_state['values'][$key];\n }\n }\n}", "public function getCreate()\n\t{\n // Title\n $title = Lang::get('admin/videos/title.create_a_new_video');\n\n // Show the page\n return View::make('admin/videos/create_edit', compact('title'));\n\t}" ]
[ "0.7222171", "0.7221824", "0.7197456", "0.7158118", "0.707608", "0.69955194", "0.6994782", "0.6960696", "0.68676054", "0.682706", "0.6780851", "0.6778015", "0.6708987", "0.6708768", "0.6694012", "0.66828114", "0.6677637", "0.66739845", "0.66585106", "0.6653615", "0.6645424", "0.6614074", "0.6581383", "0.6571251", "0.6571251", "0.6571251", "0.6571251", "0.65656406", "0.652512", "0.650824", "0.6502992", "0.64901984", "0.6473738", "0.64723027", "0.6463693", "0.646014", "0.64290786", "0.6400419", "0.6394554", "0.6388585", "0.63840604", "0.63828313", "0.63728", "0.63595515", "0.6349012", "0.6325168", "0.6320948", "0.6302425", "0.6301011", "0.6299016", "0.62884116", "0.62697035", "0.626432", "0.6250858", "0.6244356", "0.6235086", "0.62206906", "0.6209673", "0.620679", "0.6206345", "0.6197909", "0.6194078", "0.6189873", "0.6186263", "0.6179366", "0.6178267", "0.61728084", "0.6171654", "0.61639524", "0.6156455", "0.61552465", "0.61490536", "0.61480206", "0.6146571", "0.6133144", "0.6132692", "0.6132692", "0.61305547", "0.6124248", "0.61210144", "0.61204547", "0.6103691", "0.6096144", "0.6094586", "0.60907775", "0.6083377", "0.60828155", "0.60803866", "0.6075462", "0.60748905", "0.6072582", "0.60465354", "0.6042868", "0.60397714", "0.60379916", "0.6037833", "0.603326", "0.60318494", "0.6022434", "0.60144126" ]
0.6997794
5
/Store videos data function form
public function storeVideo(Request $request) { $this->validate($request,array( 'title' => 'required', 'video_category_id' => 'required', 'video' => 'required|mimes:mp4' )); $video = new Video; $video->title = $request->title; $video->video_category_id = $request->video_category_id; if ($request->hasFile('video')) { $file = $request->file('video'); $filename = time().'.'.$file->getClientOriginalName(); /*$location = public_path('file/'.$filename); Storage::put($filename,file_get_contents($file));*/ $location = public_path('file/'.$filename); Storage::disk('file')->put($filename, file_get_contents($file)); //Storage::disk('public')->put($filename, file_get_contents($file)); $video->video = $filename; } $video->save(); if($video->save()){ return redirect()->back()->with('success','Video saved successfully.'); } else{ return redirect()->back()->with('denger-success','Video is not saved.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\n {\n // Validate input\n $this->validate($this->request, [\n 'title' => 'required',\n 'description' => 'required',\n 'order_number' => 'required|integer|unique:videos',\n 'embed_code' => 'required',\n 'access_name' => 'required',\n ]);\n\n $this->video->create([\n 'title' => $this->request->input('title'),\n 'description' => $this->request->input('description'),\n 'order_number' => $this->request->input('order_number'),\n 'embed_code' => $this->request->input('embed_code'),\n 'slug' => str_slug($this->request->input('title'), '-'),\n 'access_name' => $this->request->input('access_name')\n ]);\n\n return redirect('videos/all')->withSuccessMessage('Video added');\n }", "public function get_content_file_video(){\r\n\t\t$path = storage_path().'/data_video/';\r\n\t\t$dir = scandir($path);\r\n\t\tforeach ($dir as $key => $value) {\r\n\t\t\tif(preg_match(\"/\\.json$/\",$value)){\r\n\t\t\t\t$data = (json_decode(file_get_contents($path.$value)));\r\n\t\t\t\tforeach ($data as $key2 => $value2) {\r\n\t\t\t\t\tforeach ($value2->items as $key3 => $value3) {\r\n\t\t\t\t\t\t$params[$key3][\"videoId\"] = $value3->snippet->resourceId->videoId;\r\n\t\t\t\t\t\t$params[$key3][\"title\"] = $value3->snippet->title;\r\n\t\t\t\t\t\t$params[$key3][\"description\"] = $value3->snippet->description;\r\n\t\t\t\t\t\t$params[\"keywords\"] = str_replace(\".json\", \"\", $value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->save_video_by_array($params);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function media_upload_video()\n {\n }", "public function process() {\n // Add oembed streams to video file types.\n $video = file_type_load('video');\n $video->mimetypes[] = 'video/oembed';\n $video->streams[] = 'oembed';\n file_type_save($video);\n\n // Oembed specific display settings for videos.\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '560',\n 'height' => '340',\n 'wmode' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '180',\n 'height' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__preview__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__teaser__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n }", "function mars_video_meta() {}", "public function createVideo();", "public function saveVideoTypeWebm($filesDataArray, $id) {\n try {\n /**\n * Storing webm uploaded video\n */\n $videoId = $id;\n if (empty ( $videoId )) {\n /**\n * if the video is\n * empty\n * \n * @var unknown\n */\n /**\n * load the upload video collection\n * store in an array\n * \n * @var unknown\n */\n $collectionForCount = Mage::getModel ( 'airhotels/uploadvideo' )->getCollection ()->setOrder ( 'id', 'DESC' )->getFirstItem ();\n /**\n * inc the video upload id\n * \n * @var unknown\n */\n $videoId = $collectionForCount->getId () + 1;\n }\n /**\n * Path to save the webm video\n */\n $path = Mage::getBaseDir ( 'media' ) . DS . 'airhotels' . DS . 'video' . DS . 'webm' . DS;\n /**\n * set tghe video url name\n * \n * @var unknown\n */\n $videoUrlName = 'video_url_webm';\n /**\n * set the video path for upload\n * \n * @var unknown\n */\n $videoPathWEBM = Mage::helper ( 'airhotels/url' )->uploadVideoWebm ( $filesDataArray, $videoUrlName, $path, $videoId );\n if (! empty ( $videoPathWEBM )) {\n /**\n * check if its not empty\n */\n /**\n * Upload video.\n */\n /**\n * move the uploaded file\n */\n move_uploaded_file ( $filesDataArray [\"video_url_webm\"] [\"tmp_name\"], \"airhotels/video/webm\" . $filesDataArray [\"video_url_webm\"] [\"name\"] );\n }\n /**\n * return the video path\n */\n return $videoPathWEBM;\n } catch ( Exception $e ) {\n /**\n * Set error message.\n */\n Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );\n $this->_redirect ( '*/*/edit', array (\n 'id' => $id \n ) );\n return;\n }\n }", "function storeYoutube()\n {\n }", "function manageVideoPopPlusFiles() {\r\n\t\t// Get List\r\n\t\tif (isset($_GET['get_list'])) {\r\n\t\t\t$start = 0;\r\n\t\t\tif (isset($_GET['start']) && is_numeric($_GET['start']))\r\n\t\t\t\t$start = $_GET['start'];\r\n\r\n\t\t\t// Open file and fill array with unserialized data\r\n\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t$this->vids = $this->_loadDataText();\r\n\r\n\t\t\t$out .= $this->_videoLists($_GET['get_list'], $this->vids, $start, ($_GET['get_list']=='1' ? $this->options['manage_list_max'] : $this->options['post_list_max']));\r\n\t\t\techo $out;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Check write permissions\r\n\t\tif($this->_checkDir()) {\r\n\r\n\t\t\t// IF Video is uploaded\r\n\t\t\tif ( current_user_can( $this->options['user_lvl'] ) ) {\r\n\t\t\t\tif(isset($_POST['lynkvp_upload']) && $this->_valInput()) {\r\n\t\t\t\t\t// defaults\r\n\t\t\t\t\t$vid_url = '';\r\n\t\t\t\t\t$vid_file = '';\r\n\t\t\t\t\t$vid_id = time(); // use timestamp for unique id\r\n\t\t\t\t\t$vid_image_file = '';\r\n\t\t\t\t\t$vid_image_url = '';\r\n\r\n\t\t\t\t\t// Save file\r\n\t\t\t\t\tif(is_uploaded_file($_FILES['lynkvp_file']['tmp_name'])) {\r\n\t\t\t\t\t\t$vid_file = $vid_id.'.'.$_POST['lynkvp_type']; // filename+extension\r\n\t\t\t\t\t\tif(!move_uploaded_file($_FILES['lynkvp_file']['tmp_name'], $this->data_dir . $vid_file))\r\n\t\t\t\t\t\t\t$this->note .= __(\"The file couldn't be saved on your server\", $this->textdomain_name);\r\n\t\t\t\t\t} elseif(!empty($_POST['lynkvp_url'])) {\r\n\t\t\t\t\t\t$vid_url = ltrim($_POST['lynkvp_url'],'http://');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Save Thumbnail file\r\n\t\t\t\t\tif(is_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'])) {\r\n\t\t\t\t\t\t$vid_image_file = $vid_id.'.thum.'.preg_replace('/^.*\\.(gif|jpe?g|png|bmp)$/i', '$1', $_FILES['lynkvp_image_file']['name']); // filename+extension\r\n\t\t\t\t\t\tif(file_exists($this->data_dir . $vid_image_file)) @unlink($this->data_dir . $vid_image_file);\r\n\t\t\t\t\t\tif(move_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'], $this->data_dir . $vid_image_file)) {\r\n\t\t\t\t\t\t\t$vid_image_url = ltrim($this->data_url . $vid_image_file, 'http://');\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t$this->note .= __(\"The file couldn't be saved on your server\", $this->textdomain_name);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} elseif(!empty($_POST['lynkvp_image_url'])) {\r\n\t\t\t\t\t\t$vid_image_url = ltrim($_POST['lynkvp_image_url'],'http://');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t\t\t$this->vids = $this->_loadDataText();\r\n\r\n\t\t\t\t\t// Add data to array\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_id'] = $vid_id;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_filename'] = $vid_file;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_url'] = $vid_url;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_type'] = $_POST['lynkvp_type'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_size'] = $_POST['lynkvp_size'];\r\n\t\t\t\t\tif (isset($this->videosizes[$_POST['lynkvp_size']])) {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $this->videosizes[$_POST['lynkvp_size']]['width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $this->videosizes[$_POST['lynkvp_size']]['height'];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $_POST['lynkvp_width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $_POST['lynkvp_height'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_name'] = $_POST['lynkvp_name'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_caption'] = $_POST['lynkvp_caption'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image'] = $vid_image_url;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image_filename'] = $vid_image_file;\r\n\r\n\t\t\t\t\t// Save ser. array\r\n\t\t\t\t\t$this->_saveDataText($this->vids);\r\n\r\n\t\t\t\t\t$this->note .= __('<strong>Done!</strong>', $this->textdomain_name);\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t} elseif(isset($_POST['lynkvp_edit2']) && $this->_valInput2()) {\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids)) {$this->vids = $this->_loadDataText();}\r\n\t\t\t\t\t$vid_id = $_POST['lynkvp_editid'];\r\n\t\t\t\t\t$vid_image_file = '';\r\n\t\t\t\t\t$vid_image_url = '';\r\n\r\n\t\t\t\t\t// Save Thumbnail file\r\n\t\t\t\t\tif(is_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'])) {\r\n\t\t\t\t\t\t$vid_image_file = $vid_id.'.thum.'.preg_replace('/^.*\\.(gif|jpe?g|png|bmp)$/i', '$1', $_FILES['lynkvp_image_file']['name']); // filename+extension\r\n\t\t\t\t\t\tif(file_exists($this->data_dir . $vid_image_file)) @unlink($this->data_dir . $vid_image_file);\r\n\t\t\t\t\t\tif(move_uploaded_file($_FILES['lynkvp_image_file']['tmp_name'], $this->data_dir . $vid_image_file))\r\n\t\t\t\t\t\t\t$vid_image_url = ltrim($this->data_url . $vid_image_file, 'http://');\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$this->note .= __(\"The file couldn't be saved on your server\", $this->textdomain_name);\r\n\r\n\t\t\t\t\t} elseif(!empty($_POST['lynkvp_image_url'])) {\r\n\t\t\t\t\t\t$vid_image_url = ltrim($_POST['lynkvp_image_url'],'http://');\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$vid_image_url = $this->vids[$vid_id]['lynkvp_image'];\r\n\t\t\t\t\t\t$vid_image_file = $this->vids[$vid_id]['lynkvp_image_filename'];\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Add data to array\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_id'] = $vid_id;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_filename'] = $_POST['lynkvp_filename'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_url'] = $_POST['lynkvp_url'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_type'] = $_POST['lynkvp_type'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_size'] = $_POST['lynkvp_size'];\r\n\t\t\t\t\tif (isset($this->videosizes[$_POST['lynkvp_size']])) {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $this->videosizes[$_POST['lynkvp_size']]['width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $this->videosizes[$_POST['lynkvp_size']]['height'];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_width'] = $_POST['lynkvp_width'];\r\n\t\t\t\t\t\t$this->vids[$vid_id]['lynkvp_height'] = $_POST['lynkvp_height'];\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_name'] = $_POST['lynkvp_name'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_caption'] = $_POST['lynkvp_caption'];\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image'] = $vid_image_url;\r\n\t\t\t\t\t$this->vids[$vid_id]['lynkvp_image_filename'] = $vid_image_file;\r\n\r\n\t\t\t\t\t// Save ser. array\r\n\t\t\t\t\t$this->_saveDataText($this->vids);\r\n\r\n\t\t\t\t\t$this->note .= __('<strong>Done!</strong>', $this->textdomain_name);\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t} elseif(isset($_POST['lynkvp_del'])) {\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t\t\t$this->vids = $this->_loadDataText();\r\n\t\t\t\t\t$a_id = array_flip($_POST['lynkvp_del']);\r\n\r\n\t\t\t\t\t// Remove Video\r\n\t\t\t\t\tif(file_exists($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_filename']))\r\n\t\t\t\t\t\t@unlink($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_filename']);\r\n\t\t\t\t\tif(file_exists($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_image_filename']))\r\n\t\t\t\t\t\t@unlink($this->data_dir . $this->vids[$a_id[__('delete', $this->textdomain_name)]]['lynkvp_image_filename']);\r\n\r\n\t\t\t\t\tforeach($this->vids as $key=>$value) {\r\n\t\t\t\t\t\tif($key != $a_id[__('delete', $this->textdomain_name)])\r\n\t\t\t\t\t\t\t$a_vids2[$key] = $value;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->vids = $a_vids2;\r\n\t\t\t\t\tunset($a_vids2);\r\n\r\n\t\t\t\t\t// Save ser. images\r\n\t\t\t\t\t$this->_saveDataText($this->vids);\r\n\r\n\t\t\t\t\t$this->note .= __('<strong>Done!</strong>', $this->textdomain_name);\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// IF edit\r\n\t\t\tif ( current_user_can( $this->options['user_lvl'] ) ) {\r\n\t\t\t\tif ( isset($_POST['lynkvp_edit']) ) {\r\n\t\t\t\t\t// Video ID\r\n\t\t\t\t\t$a_id = array_flip($_POST['lynkvp_edit']);\r\n\r\n\t\t\t\t\t// Open file and fill array with unserialized data\r\n\t\t\t\t\tif (!is_array($this->vids))\r\n\t\t\t\t\t\t$this->vids = $this->_loadDataText();\r\n\r\n\t\t\t\t\t// Populate POST & strip slashes array\r\n\t\t\t\t\t$_POST = $this->stripArray($this->vids[$a_id[__('edit', $this->textdomain_name)]]);\r\n\r\n\t\t\t\t\t$out .= \"<div class=\\\"wrap\\\" style=\\\"text-align:left;\\\">\\n\";\r\n\t\t\t\t\t$out .= \"<h2>\".__('Video Edit', $this->textdomain_name).\"</h2>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<form method=\\\"post\\\" action=\\\"\".$this->admin_manage.\"\\\" enctype=\\\"multipart/form-data\\\">\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"hidden\\\" name=\\\"lynkvp_type\\\" value=\\\"\".$_POST['lynkvp_type'].\"\\\" />\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<table border=\\\"0\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\">\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Name','videopop_plus').\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_name\\\" value=\\\"\".$_POST['lynkvp_name'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Caption','videopop_plus').\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_caption\\\" value=\\\"\".$_POST['lynkvp_caption'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\tif(!empty($_POST['lynkvp_url'])) {\r\n\t\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>\".__('URL', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>http://<input type=\\\"text\\\" name=\\\"lynkvp_url\\\" value=\\\"\".$_POST['lynkvp_url'].\"\\\" style=\\\"width:400px;\\\" /></td>\\n\";\r\n\t\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t\t$out .= $this->_getTypeSelect().\"\\n\";\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>\".__('Video type', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td>\".$_POST['lynkvp_type'].\"</td>\\n\";\r\n\t\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td><span style=\\\"display:\".($_POST['lynkvp_type']!='flv'?'none':'block').\"\\\">\";\r\n\t\t\t\t\t\t$out .= __('Thumbnail', $this->textdomain_name).\":\";\r\n\t\t\t\t\t\t$out .= \"</span></td>\\n\";\r\n\t\t\t\t\t\t$out .= \"<td><span style=\\\"display:\".($_POST['lynkvp_type']!='flv'?'none':'block').\"\\\">\";\r\n\t\t\t\t\t\t$out .= \"<input type=\\\"file\\\" name=\\\"lynkvp_image_file\\\" />&nbsp;&nbsp;&nbsp;\\n\";\r\n\t\t\t\t\t\t$out .= __('<strong>or</strong>', $this->textdomain_name).' &nbsp;&nbsp;';\r\n\t\t\t\t\t\t$out .= __('URL', $this->textdomain_name).\":&nbsp;&nbsp;\";\r\n\t\t\t\t\t\t$out .= \"http:// <input type=\\\"text\\\" name=\\\"lynkvp_image_url\\\" style=\\\"width:400px;\\\" value=\\\"\".$_POST['lynkvp_image'].\"\\\" />\";\r\n\t\t\t\t\t\t$out .= \"</span></td>\\n\";\r\n\t\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Size', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\\n\";\r\n\t\t\t\t\t$out .= \"<select name=\\\"lynkvp_size\\\" onchange=\\\"javascript:\";\r\n\t\t\t\t\t$out .= \"document.getElementById('input_size').style.display=(this.value==999?'inline':'none');\";\r\n\t\t\t\t\t$out .= \"\\\">\";\r\n\t\t\t\t\t$out .= \"<option value=\\\"0\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],'0').\">\".__('Select size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"<!-- Video sizes, one each line -->\\n\";\r\n\t\t\t\t\tforeach($this->videosizes as $key=>$value) {\r\n\t\t\t\t\t\t$out .= \"<option value=\\\"\".$key.\"\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],$key).\">\".$value['width'].\" x \".$value['height'].$value['note'].\"</option>\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$out .= \"<option value=\\\"999\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'], '999').\">\".__('Free Size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"</select>&nbsp;&nbsp;&nbsp;\\n\";\r\n\t\t\t\t\t$out .= \"<span id=\\\"input_size\\\" style=\\\"display:\".($_POST['lynkvp_size']!=999?'none':'inline').\"\\\">\\n\";\r\n\t\t\t\t\t$out .= __('Width').\": <input type=\\\"text\\\" name=\\\"lynkvp_width\\\" value=\\\"\".$_POST['lynkvp_width'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"&nbsp;x&nbsp;\";\r\n\t\t\t\t\t$out .= __('Height').\": <input type=\\\"text\\\" name=\\\"lynkvp_height\\\" value=\\\"\".$_POST['lynkvp_height'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</span>\\n\";\r\n\t\t\t\t\t$out .= \"</td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"</table>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<br />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"hidden\\\" name=\\\"lynkvp_editid\\\" value=\\\"\".$_POST['lynkvp_id'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"hidden\\\" name=\\\"lynkvp_filename\\\" value=\\\"\".$_POST['lynkvp_filename'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"submit\\\" name=\\\"lynkvp_edit2\\\" class=\\\"button\\\" value=\\\"\".__('Upload', $this->textdomain_name).\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</form>\\n\";\r\n\t\t\t\t\t$out .= \"</div>\\n\";\r\n\r\n\t\t\t\t\tunset($_POST);\r\n\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// strip slashes array\r\n\t\t\t\t\t$_POST = $this->stripArray($_POST);\r\n\r\n\t\t\t\t\t// BLOCK Upload\r\n\t\t\t\t\t$out .= \"<div class=\\\"wrap\\\" style=\\\"text-align:left;\\\">\\n\";\r\n\t\t\t\t\t$out .= \"<h2>\".__('Video Upload', $this->textdomain_name).\"</h2>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<form method=\\\"post\\\" action=\\\"\".$this->admin_manage.\"\\\" enctype=\\\"multipart/form-data\\\">\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<table border=\\\"0\\\" cellpadding=\\\"2\\\" cellspacing=\\\"0\\\">\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Name', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_name\\\" value=\\\"\".$_POST['lynkvp_name'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Caption', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td><input type=\\\"text\\\" name=\\\"lynkvp_caption\\\" value=\\\"\".$_POST['lynkvp_caption'].\"\\\" /></td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Choose video', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"file\\\" name=\\\"lynkvp_file\\\" />&nbsp;&nbsp;&nbsp;\\n\";\r\n\t\t\t\t\t$out .= __('<strong>or</strong>', $this->textdomain_name).\" &nbsp;&nbsp;\";\r\n\t\t\t\t\t$out .= __('URL', $this->textdomain_name).\":&nbsp;&nbsp;http://<input type=\\\"text\\\" name=\\\"lynkvp_url\\\" style=\\\"width:400px;\\\" value=\\\"\".$_POST['lynkvp_url'].\"\\\" />\";\r\n\t\t\t\t\t$out .= \"</td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= $this->_getTypeSelect().\"\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<tr>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\".__('Size', $this->textdomain_name).\":</td>\\n\";\r\n\t\t\t\t\t$out .= \"<td>\\n\";\r\n\t\t\t\t\t$out .= \"<select name=\\\"lynkvp_size\\\" onchange=\\\"javascript:\";\r\n\t\t\t\t\t$out .= \"document.getElementById('input_size').style.display=(this.value==999?'inline':'none');\";\r\n\t\t\t\t\t$out .= \"\\\">\";\r\n\t\t\t\t\t$out .= \"<option value=\\\"0\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],'0').\">\".__('Select size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"<!-- Video sizes, one each line -->\\n\";\r\n\t\t\t\t\tforeach($this->videosizes as $key=>$value) {\r\n\t\t\t\t\t\t$out .= \"<option value=\\\"\".$key.\"\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'],$key).\">\".$value['width'].\" x \".$value['height'].$value['note'].\"</option>\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$out .= \"<option value=\\\"999\\\"\".$this->_setOptionSelected($_POST['lynkvp_size'], \"999\").\">\".__('Free Size', $this->textdomain_name).\"</option>\\n\";\r\n\t\t\t\t\t$out .= \"</select>&nbsp;&nbsp;&nbsp;\\n\";\r\n\t\t\t\t\t$out .= \"<span id=\\\"input_size\\\" style=\\\"display:\".(!isset($this->videosizes[$_POST['lynkvp_size']]) ? 'none' : 'inline').\"\\\">\\n\";\r\n\t\t\t\t\t$out .= __('Width').\": <input type=\\\"text\\\" name=\\\"lynkvp_width\\\" value=\\\"\".$_POST['lynkvp_width'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"&nbsp;x&nbsp;\";\r\n\t\t\t\t\t$out .= __('Height').\": <input type=\\\"text\\\" name=\\\"lynkvp_height\\\" value=\\\"\".$_POST['lynkvp_height'].\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</span>\\n\";\r\n\t\t\t\t\t$out .= \"</td>\\n\";\r\n\t\t\t\t\t$out .= \"</tr>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"</table>\\n\";\r\n\r\n\t\t\t\t\t$out .= \"<br />\\n\";\r\n\t\t\t\t\t$out .= \"<input type=\\\"submit\\\" name=\\\"lynkvp_upload\\\" class=\\\"button\\\" value=\\\"\".__('Upload', $this->textdomain_name).\"\\\" />\\n\";\r\n\t\t\t\t\t$out .= \"</form>\\n\";\r\n\t\t\t\t\t$out .= \"</div>\\n\";\r\n\t\t\t\t\tunset($_POST);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// ---------\r\n\t\t\t// ALWAYS DISPLAYED\r\n\r\n\t\t\t// BLOCK Your Videos\r\n\t\t\t$out .= \"<div class=\\\"wrap\\\" style=\\\"text-align:left;padding-bottom:3em;margin-top:2em;\\\">\\n\";\r\n\t\t\t$out .= \"<h2>\".__('My Videos', $this->textdomain_name).\"</h2>\\n\";\r\n\r\n\t\t\t// Open file and fill array with unserialized data\r\n\t\t\tif (!is_array($this->vids)) {$this->vids = $this->_loadDataText();}\r\n\r\n\t\t\t// If any vids uploaded\r\n\t\t\tif(is_array($this->vids)) {\r\n\t\t\t\t// add JS to manage page;\r\n\t\t\t\t$this->_adminHead();\r\n\t\t\t\t$out .= $this->_videoLists('1', $this->vids, 0, $this->options['manage_list_max']);\r\n\t\t\t}\r\n\r\n\t\t\t$out .= \"</div>\\n\";\r\n\t\t}\r\n\r\n\t\t// Output\r\n\t\techo (!empty($this->note) ? \"<div id=\\\"message\\\" class=\\\"updated fade\\\"><p>{$this->note}</p></div>\\n\" : '' ).\"\\n\";\r\n\t\techo ($this->error > 0 ? '' : $out).\"\\n\";\r\n\t}", "public function video(){\n\t\t$data=array();\n\t\t$this->load->view('administrador/admin_video',$data);\n\t}", "function type_url_form_video()\n {\n }", "public function materiVideoStore()\n {\n // $dataEnd = end($dataExplode);\n $this->validate(request(), [\n 'nama' => 'required',\n 'deskripsi' => 'required',\n 'link' => 'required'\n ]);\n\n // Materi::create([\n // 'user_id' => request('user_id'),\n // 'kelas_id' => request('kelas_id'),\n // 'nama' => request('nama'),\n // 'jenis' => request('jenis'),\n // 'status' => request('status'),\n // 'deskripsi' => request('deskripsi'),\n // 'link' => $dataEnd\n // ]);\n\n Materi::createMateriVideo();\n\n return back()->with('success');\n }", "public function post_addvideo()\r\n\t\t{\r\n\t\t\t$retArr = array();\r\n\t\t\t// Scaffolding Code For Single:\r\n\t\t\t$retArr = $this->obj->getBasics();\r\n\r\n\t\t\treturn $retArr;\r\n\t\t}", "public function run()\n {\n $video = [\n [\n 'id' => 1,\n 'source' => 'youtube',\n 'code' => 'zvziUZQCd-I',\n 'title' => 'iPhone 12中國銷量佳!華為出新機迎戰 躲禁令傳囤大量台積電晶片|非凡財經新聞|20201023',\n ],\n [\n 'id' => 2,\n 'source' => 'youtube',\n 'code' => 'A70caQprTO4',\n 'title' => '顧客轉買低價NB 英特爾Q3營收年減4% 盤後股價大跌近1成|非凡財經新聞|20201023',\n ],\n ];\n\n Video::insert($video);\n }", "public function video($model){\n $info = [];\n foreach ($model as $key => $value) {\n $value->page_view++;\n\n $index = intval($value->courseware_id);\n $info[$index]['video_id'] = $value->courseware_id;\n $info[$index]['title'] = $value->title;\n $info[$index]['body'] = $value->body;\n $info[$index]['tags'] = $value['tags'];\n $info[$index]['page_view']= $value['page_view'];\n $info[$index]['banner_src'] = '';\n $info[$index]['video_src'] = '';\n $info[$index]['attachment'] =[];\n\n //var_dump($value->toFile); // ->getToFile()->getFileStorageItem()\n foreach ($value->toFile as $k => $v) {\n $v->fileStorageItem->page_view ++;\n \n //var_dump($v->fileStorageItem->type);\n \n if(empty($info[$index]['banner_src']) && in_array($v->fileStorageItem->type,['image/jpeg','image/png'])){\n $info[$index]['banner_src'] = $v->fileStorageItem->url.$v->fileStorageItem->file_name;\n }\n\n if(empty($info[$index]['video_src']) && in_array($v->fileStorageItem->type,['video/ogg','video/mp4'])){\n $info[$index]['video_src'] = $v->fileStorageItem->url.$v->fileStorageItem->file_name;\n }\n\n $info[$index]['attachment'][$k]=[\n [\n 'sort:'.$v->sort.'- ID:'.$v->courseware_to_file_id,\n $v->fileStorageItem->type,\n $v->fileStorageItem->url.$v->fileStorageItem->file_name\n ]\n ];\n\n $v->fileStorageItem->save();\n\n }\n\n $value->save(false);\n }\n\n return $info;\n }", "public function createVideo($data)\n {\n return $this->performRequest('POST','/videos', $data);\n }", "public function insert_video($arr_data){\n\n\t\treturn $this->db->insert($this->_table,$arr_data);\n\n\t}", "public function saveVideoTypeMp4($filesDataArray, $id) {\n try {\n /**\n * Storing mp4 uploaded video\n */\n $videoId = $id;\n if (empty ( $videoId )) {\n $collectionForCount = Mage::getModel ( 'airhotels/uploadvideo' )->getCollection ()->setOrder ( 'id', 'DESC' )->getFirstItem ();\n $videoId = $collectionForCount->getId () + 1;\n }\n /**\n * Path to save the mp4 video\n */\n $path = Mage::getBaseDir ( 'media' ) . DS . 'airhotels' . DS . 'video' . DS . 'mp4' . DS;\n $videoUrlName = 'video_url_mp4';\n $videoPathMP4 = Mage::helper ( 'airhotels/url' )->uploadVideoMp ( $filesDataArray, $videoUrlName, $path, $videoId );\n if (! empty ( $videoPathMP4 )) {\n move_uploaded_file ( $filesDataArray [\"video_url_mp4\"] [\"tmp_name\"], \"airhotels/video/mp4\" . $filesDataArray [\"video_url_mp4\"] [\"name\"] );\n }\n return $videoPathMP4;\n } catch ( Exception $e ) {\n /**\n * Set error message.\n */\n Mage::getSingleton ( 'adminhtml/session' )->addError ( $e->getMessage () );\n $this->_redirect ( '*/*/edit', array (\n 'id' => $id \n ) );\n return;\n }\n }", "function savevideos($task)\n\t{\n\t\tglobal $option,$mainframe;\n\t\t$db = JFactory::getDBO();\n\t\t$userTypeRedirect = (JRequest::getVar('user', '', 'get') == 'admin') ? \"&user=\" . JRequest::getVar('user', '', 'get') : \"\";\n\t\t## To get an instance of the adminvideos table object\n\t\t$rs_saveupload = JTable::getInstance('adminvideos', 'Table');\n\t\t$arrCatId = JRequest::getVar('cid', array(0), '', 'array');\n\t\t$strCatId = $arrCatId[0];\n\t\t$rs_saveupload->load($strCatId);\n $createddate = date(\"Y-m-d h:m:s\");\n\n\t\t## variable initialization\n\t\t$arrFormData = JRequest::get('post');\n $embedcode = JRequest::getVar('embedcode', '', 'post', 'string', JREQUEST_ALLOWRAW);\n\t\t$arrFormData['embedcode']=$embedcode;\n\t\t$fileoption = $arrFormData['fileoption'];\n\t\t$seoTitle = trim($arrFormData['title']);\n $titlequery = \"SELECT count(id) FROM #__hdflv_upload where title='$seoTitle'\";\n $db->setQuery($titlequery);\n $total_title = $db->loadResult();\n if(!empty($total_title) || $total_title>0){\n $seoTitle = $seoTitle.rand();\n }\n $seoTitle = str_replace(\"+\",\"\",$seoTitle);\n $seoTitle = stripslashes($seoTitle);\n $seoTitle = strtolower($seoTitle);\n\t\t$seoTitle = preg_replace('/[&:\\s]+/i', '-', $seoTitle);\n\t\t$arrFormData['seotitle'] = preg_replace('/[#!@$%^.,:;\\/&*(){}\\\"\\'\\[\\]<>|?]+/i', '', $seoTitle);\n\t\t$arrFormData['seotitle'] = preg_replace('/---|--+/i', '-', $arrFormData['seotitle']);\n\t\t$description = JRequest::getVar('description', '', 'post', 'string', JREQUEST_ALLOWRAW);\n\t\t$arrFormData['description'] = $description;\n\n\t\t## object to bind to the instance\n\t\tif (!$rs_saveupload->bind($arrFormData))\n\t\t{\n\t\t\tJError::raiseWarning( 500, $rs_saveupload->getError() );\n\t\t}\n\n\t\t## get and assign video url\n\t\tif (isset($rs_saveupload->videourl))\n\t\t{\n\t\t\tif ($rs_saveupload->videourl != \"\")\n\t\t\t{\n\t\t\t\t$rs_saveupload->videourl = trim($rs_saveupload->videourl);\n\t\t\t}\n\t\t}\n\n\t\t## Inserts a new row if id is zero or updates an existing row in the hdflv_upload table\n\t\tif (!$rs_saveupload->store())\n\t\t{\n\t\t\tJError::raiseWarning( 500, $rs_saveupload->getError() );\n\t\t}\n\n\t\t## check in the item\n\t\t$rs_saveupload->checkin();\n\t\t$idval = $rs_saveupload->id;\n\n\t\t## uploading videos type : URL\n\t\tif ($fileoption == 'Url'){\n\t\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadurl.php');\n\t\t\tuploadUrlHelper::uploadUrl($arrFormData,$idval);\n\t\t}\n\n\t\t## uploading videos type : YOUTUBE\n\t\tif ($fileoption == \"Youtube\"){\n\t\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadyoutube.php');\n\t\t\tuploadYouTubeHelper::uploadYouTube($arrFormData,$idval);\n\t\t}\n\t\t## uploading videos type : Embed\n\t\tif ($fileoption == \"Embed\"){\n\t\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadembed.php');\n\t\t\tuploadEmbedHelper::uploadEmbed($arrFormData,$idval);\n\t\t}\n\n\t\t/**\n\t\t * uploading videos\n\t\t * type : FILE\n\t\t */\n\n\t\tif ($arrFormData['fileoption'] == \"File\"){\n\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadfile.php');\n\t\tuploadFileHelper::uploadFile($arrFormData,$idval);\n\t\t}\n\n\t\t## uploading videos type : FFMPEG\n\t\tif ($fileoption == \"FFmpeg\"){\n\t\trequire_once(FVPATH.DS.'helpers'.DS.'uploadffmpeg.php');\n\t\tuploadFfmpegHelper::uploadFfmpeg($arrFormData,$idval);\n\t\t}\n\t\t$catid = JRequest::getVar('playlistid');\n ## query to update created date\n $query = \"UPDATE #__hdflv_upload SET created_date='$createddate' where id=$idval\";\n $db->setQuery($query);\n $db->query();\n ## query to find the existing of category for video\n $query = \"SELECT count(vid) FROM #__hdflv_video_category where vid=$idval\";\n $db->setQuery($query);\n $total = $db->loadResult();\n if ($total != 0) {\n $query = \"UPDATE #__hdflv_video_category SET catid= '$catid' WHERE vid=$idval\";\n } else {\n $query = \"INSERT INTO #__hdflv_video_category values ('$idval','$catid')\";\n }\n\n $db->setQuery($query);\n $db->query();\n switch ($task) {\n case 'applyvideos':\n $link = 'index.php?option=' . $option . '&layout=adminvideos&task=editvideos' . $userTypeRedirect . '&cid[]=' . $rs_saveupload->id;\n break;\n case 'savevideoupload':\n default:\n $link = 'index.php?option=' . $option . '&layout=adminvideos' . $userTypeRedirect;\n break;\n }\n $msg = 'Saved Successfully';\n ## set to redirect\n $mainframe->redirect($link, $msg);\n\t}", "public function save_video( $post_id ) {\n if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n /*\n If autosaving, do nothing\n */\n return;\n }\n if( !isset( $_POST['videoid'] ) || !isset ( $_POST['provider']) || !wp_verify_nonce( $_REQUEST['video_meta_box'], 'video_meta_save' ) ) {\n /*\n If the video ID and provider isn't selected, or the wp_kses is faked, get out\n */\n return;\n }\n if( !current_user_can( 'edit_post' ) ) {\n /*\n If you can't edit a post, get the hell out\n */\n return;\n }\n\n /*\n Update video ID\n */\n $videoid = wp_kses( $_POST['videoid'], '');\n update_post_meta( $post_id, 'videoid', $videoid, '' );\n\n /*\n Update video provider\n */\n $provider = wp_kses ($_POST['provider'], '');\n update_post_meta( $post_id, 'provider', $provider, '');\n\n /*\n Season and Episode database insertion\n */\n $season = wp_kses($_POST['season'], '');\n update_post_meta($post_id, 'season', $season, '');\n\n $episode = wp_kses($_POST['episode'], '');\n update_post_meta($post_id, 'episode', $episode, '');\n /*\n Define Video type name to be inserted into database\n */\n $video_category = wp_kses($_POST['video_category'], '');\n $term = get_term_by('name', $video_category, 'video_category');\n\n if( !empty($term) && !is_wp_error( $term ) ) {\n wp_set_object_terms( $post_id, $term->term_id, 'video_category', false);\n }\n\n /*\n If there is no Featured Image, grab it from youtube\n */\n if( !has_post_thumbnail($post_id)) {\n if($provider == 'youtube') {\n $this->Generate_Featured_Image( $this->fetch_youtube_thumbnail($videoid), $post_id );\n }\n if($provider == 'vimeo') {\n $this->Generate_Featured_Image( $this->fetch_vimeo_thumbnail($videoid), $post_id );\n }\n }\n }", "public function process()\n\t{\n\t\tPhpfox::isUser(true);\n\t\tPhpfox::getUserParam('video.can_upload_videos', true);\n\t\t\n\t\tif (Phpfox::getParam('video.convert_servers_enable'))\n\t\t{\n\t\t\t$this->template()->assign('sCustomVideoHash', Phpfox::getService('video')->addCustomHash());\n\t\t}\n\n\t\tif (defined('PHPFOX_IS_HOSTED_SCRIPT'))\n\t\t{\n\t\t\tif (Phpfox::getService('video')->getOnCloudLimit())\n\t\t\t{\n\t\t\t\treturn Phpfox_Error::display('Monthly video limit reached.');\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_1')){eval($sPlugin);if (isset($mReturnFromPlugin)){return $mReturnFromPlugin;}}\n\t\t\n\t\t$sModule = $this->request()->get('module', false);\n\t\t$iItem = $this->request()->getInt('item', false);\t\t\n\t\t\n\t\t$aCallback = false;\n\t\tif ($sModule !== false && $iItem !== false && Phpfox::hasCallback($sModule, 'getVideoDetails'))\n\t\t{\t\t\t\n\t\t\tif ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_2')){eval($sPlugin);if (isset($mReturnFromPlugin)){return $mReturnFromPlugin;}}\n\t\t\tif (($aCallback = Phpfox::callback($sModule . '.getVideoDetails', array('item_id' => $iItem))))\n\t\t\t{\t\t\t\n\t\t\t\t$this->template()->setBreadcrumb($aCallback['breadcrumb_title'], $aCallback['breadcrumb_home']);\n\t\t\t\t$this->template()->setBreadcrumb($aCallback['title'], $aCallback['url_home']);\t\n\t\t\t\tif ($sModule == 'pages' && !Phpfox::getService('pages')->hasPerm($iItem, 'video.share_videos'))\n\t\t\t\t{\n\t\t\t\t\t$sPhrase = Phpfox::getPhrase('video.unable_to_view_this_item_due_to_privacy_settings');\n\t\t\t\t\tif ( ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_sphrase'))){ eval($sPlugin); }\n\t\t\t\t\treturn Phpfox_Error::display($sPhrase);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$sPhrase = '';\n\t\t\t\t\tif ( ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_sphrase_2'))){ eval($sPlugin); }\n\t\t\t\t\tif (!empty($sPhrase))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn Phpfox_Error::display($sPhrase);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\tif (($aVals = $this->request()->get('val')))\n\t\t{\n\t\t\tif ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_3')){eval($sPlugin);if (isset($mReturnFromPlugin)){return $mReturnFromPlugin;}}\n\t\t\tif (($iFlood = Phpfox::getUserParam('video.flood_control_videos')) !== 0)\n\t\t\t{\n\t\t\t\t$aFlood = array(\n\t\t\t\t\t'action' => 'last_post', // The SPAM action\n\t\t\t\t\t'params' => array(\n\t\t\t\t\t\t'field' => 'time_stamp', // The time stamp field\n\t\t\t\t\t\t'table' => Phpfox::getT('video'), // Database table we plan to check\n\t\t\t\t\t\t'condition' => 'user_id = ' . Phpfox::getUserId(), // Database WHERE query\n\t\t\t\t\t\t'time_stamp' => $iFlood * 60 // Seconds);\t\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\t\t\t \t\t\t\n\t\t\t\t// actually check if flooding\n\t\t\t\tif (Phpfox::getLib('spam')->check($aFlood))\n\t\t\t\t{\n\t\t\t\t\tPhpfox_Error::set(Phpfox::getPhrase('video.you_are_sharing_a_video_a_little_too_soon') . ' ' . Phpfox::getLib('spam')->getWaitTime());\t\n\t\t\t\t}\n\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\tif (Phpfox_Error::isPassed())\n\t\t\t{\t\t\t\n\t\t\t\tif ($sPlugin = Phpfox_Plugin::get('video.component_controller_add_4')){eval($sPlugin);if (isset($mReturnFromPlugin)){return $mReturnFromPlugin;}}\n\t\t\t\tif (Phpfox::getService('video.grab')->get($aVals['url']))\n\t\t\t\t{\t\t\t\n\t\t\t\t\tif ($iId = Phpfox::getService('video.process')->addShareVideo($aVals))\n\t\t\t\t\t{\n\t\t\t\t\t\t$aVideo = Phpfox::getService('video')->getForEdit($iId);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Phpfox::getService('video.grab')->hasImage())\n\t\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t\tif (isset($aVals['module']) && isset($aVals['item']) && Phpfox::hasCallback($aVals['module'], 'uploadVideo'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$aCallback = Phpfox::callback($aVals['module'] . '.uploadVideo', $aVals['item']);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\tif ($aCallback !== false)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->url()->send($aCallback['url_home'], array('video', $sTitle), Phpfox::getPhrase('video.video_successfully_added'));\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\n\t\t\t\t\t\t\t$this->url()->permalink('video', $aVideo['video_id'], $aVideo['title'], true, Phpfox::getPhrase('video.video_successfully_added'));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->url()->send('video.edit.photo', array('id' => $aVideo['video_id']), Phpfox::getPhrase('video.video_successfull_added_however_you_will_have_to_manually_upload_a_photo_for_it'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sModule = (isset($aVals['module']) ? $aVals['module'] : false);\n\t\t\t$iItem = (isset($aVals['item']) ? $aVals['item'] : false);\n\t\t}\n\t\t\n\t\t$sMethod = Phpfox::getParam('video.video_enable_mass_uploader') && $this->request()->get('method','') != 'simple' ? 'massuploader' : 'simple';\n\t\t$sMethodUrl = str_replace(array('method_simple/','method_massuploader/'), '',$this->url()->getFullUrl()) . 'method_' . ($sMethod == 'simple' ? 'massuploader' : 'simple') . '/';\t\t\t\t\n\t\n\t\tif (Phpfox::isMobile())\n\t\t{\n\t\t\t$sMethod = 'simple';\n\t\t}\n\t\t\n\t\tif (Phpfox::getParam('video.convert_servers_enable'))\n\t\t{\n\t\t\t$aVideoServers = Phpfox::getParam('video.convert_servers');\n\t\t\t$sCustomServerUrl = $aVideoServers[rand(0, (count($aVideoServers) - 1))];\n\t\t\t$this->template()->assign('sVideoServerUrl', $sCustomServerUrl);\n\t\t}\t\t\n\t\t\n\t\tif ($sMethod == 'massuploader')\n\t\t{\n\t\t\t$iMaxFileSize = (Phpfox::getUserParam('video.video_file_size_limit') === 0 ? null : ((Phpfox::getUserParam('video.video_file_size_limit') / 1) * 1048576));\n\t\t\tif (Phpfox::isModule('photo'))\n\t\t\t{\n\t\t\t\t$this->template()->setPhrase(array('photo.you_can_upload_a_jpg_gif_or_png_file'));\n\t\t\t}\n\n\t\t\t// video.video_array_support\n\t\t\t$sVideoFormats = '*.mpg; *.mpeg; *.wmv; *.avi; *.mov; *.flv';\n\t\t\t$sVideoNames = 'Video files (mpg, mpeg, wmv, avi, mov or flv)';\n\t\t\tif (Phpfox::getParam('video.upload_for_html5'))\n\t\t\t{\n\t\t\t\t$sVideoFormats = '';\n\t\t\t\tforeach ((array) Phpfox::getParam('video.video_array_support') as $sFormat => $sType)\n\t\t\t\t{\n\t\t\t\t\t$sVideoFormats .= '*.' . $sFormat . '; ';\n\t\t\t\t}\n\t\t\t\t$sVideoFormats = trim(trim($sVideoFormats), ';');\n\t\t\t\t$sVideoNames = $sVideoFormats;\n\t\t\t}\n\n\t\t\t$this->template()->setPhrase(array(\t\t\t\t\t\t\t\n\t\t\t\t\t\t'core.name',\n\t\t\t\t\t\t'core.status',\n\t\t\t\t\t\t'core.in_queue',\n\t\t\t\t\t\t'core.upload_failed_your_file_size_is_larger_then_our_limit_file_size',\n\t\t\t\t\t\t'core.more_queued_than_allowed'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t->setHeader(array(\n\t\t\t\t'massuploader/swfupload.js' => 'static_script',\n\t\t\t\t'massuploader/upload.js' => 'static_script',\n\t\t\t\t'<script type=\"text/javascript\">\n\t\t\t\t\t// document.domain = \"\";\n\t\t\t\t\t$oSWF_settings =\n\t\t\t\t\t{\n\t\t\t\t\t\tobject_holder: function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn \\'swf_video_upload_button_holder\\';\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\n\t\t\t\t\t\tdiv_holder: function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn \\'swf_video_upload_button\\';\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\n\t\t\t\t\t\tget_settings: function()\n\t\t\t\t\t\t{\t\t\n\t\t\t\t\t\t\tswfu.setUploadURL(\"' . (isset($sCustomServerUrl) ? $sCustomServerUrl : $this->url()->makeUrl('video.frame')) . '\");\n\t\t\t\t\t\t\tswfu.setFileSizeLimit(\"'.$iMaxFileSize .' B\");\n\t\t\t\t\t\t\tswfu.setFileUploadLimit(1);\n\t\t\t\t\t\t\tswfu.setFileQueueLimit(1);\n\t\t\t\t\t\t\tswfu.customSettings.flash_user_id = '.Phpfox::getUserId() .';\n\t\t\t\t\t\t\tswfu.customSettings.sHash = \"'.Phpfox::getService('core')->getHashForUpload().'\";\n\t\t\t\t\t\t\tswfu.setFileTypes(\"' . $sVideoFormats . '\",\"' . $sVideoNames . '\");\n\t\t\t\t\t\t\tswfu.atFileQueue = function()\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$(\\'#js_upload_actual_inner_form\\').slideUp();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$(\\'#js_video_form :input\\').each(function(iKey, oObject)\n\t\t\t\t\t\t\t\t{\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tswfu.addPostParam($(oObject).attr(\\'name\\'), $(oObject).val());\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\t)\n\t\t\t);\t\t\t\n\t\t}\t\t\n\t\t\n\t\t$aMenus = array();\t\t\n\t\tif (Phpfox::getParam('video.allow_video_uploading') || Phpfox::getParam('video.vidly_support'))\n\t\t{\n\t\t\t$aMenus[$this->url()->makeUrl('video.add')] = Phpfox::getPhrase('video.file_upload');\n\t\t}\n\t\t$aMenus[$this->url()->makeUrl('video.add.url')] = Phpfox::getPhrase('video.paste_url');\n\t\t\n\t\tif (!empty($sModule))\n\t\t{\n\t\t\tforeach ($aMenus as $sUrl => $sPhrase)\n\t\t\t{\n\t\t\t\tunset($aMenus[$sUrl]);\n\t\t\t\t\n\t\t\t\t$aMenus[$sUrl . 'module_' . $sModule . '/item_' . $iItem . '/'] = $sPhrase;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$bIsVideoUploading = false;\n\t\tif ((Phpfox::getParam('video.allow_video_uploading') || Phpfox::getParam('video.vidly_support')) && $this->request()->get('req3') != 'url')\n\t\t{\n\t\t\t$bIsVideoUploading = true;\n\t\t}\n\t\t\n\t\t$this->template()->buildPageMenu('js_upload_video', $aMenus, null, true);\n\t\t\n\t\tif (Phpfox::getParam('video.video_upload_service'))\n\t\t{\n\t\t\tPhpfox::getService('video.process')->createVidlyToken();\n\t\t\t$aVidlyParams = array(\n\t\t\t\t'phrases' => array(\n\t\t\t\t\t'select_video' => Phpfox::getPhrase('video.select_video')\n\t\t\t\t)\n\t\t\t);\n\t\t\t$this->template()->assign('sVidlyParams', urlencode(json_encode($aVidlyParams)));\n\t\t\t$this->template()->setHeader('<script type=\"text/javascript\">$Behavior.checkOnVideo = function(){setInterval(\"$(\\'#js_video_form\\').ajaxCall(\\'video.checkOnVideo\\');\", 5000);}</script>');\n\t\t}\n\n\t\tif (Phpfox::getParam('video.convert_servers_enable'))\n\t\t{\n\t\t\t$this->template()->setHeader('<script type=\"text/javascript\">document.domain = \"' . Phpfox::getParam('video.convert_js_parent') . '\";</script>');\n\t\t}\n\t\t\n\t\t$this->template()->setTitle(Phpfox::getPhrase('video.upload_share_a_video'))\n\t\t\t->setBreadcrumb(Phpfox::getPhrase('video.video'), ($aCallback === false ? $this->url()->makeUrl('video') : $aCallback['url_home_photo']))\n\t\t\t->setBreadcrumb(Phpfox::getPhrase('video.upload_share_a_video'), ($aCallback === false ? $this->url()->makeUrl('video.add') : $this->url()->makeUrl('video.add', array('module' => $sModule, 'item' => $iItem))), true)\n\t\t\t->setFullSite()\t\t\t\n\t\t\t->assign(array(\n\t\t\t\t\t'sModule' => $sModule,\n\t\t\t\t\t'iItem' => $iItem,\t\t\t\t\n\t\t\t\t\t'sMethod' => $sMethod,\n\t\t\t\t\t'sMethodUrl' => $sMethodUrl,\n\t\t\t\t\t'bIsVideoUploading' => $bIsVideoUploading\t\n\t\t\t\t)\n\t\t\t)\n\t\t\t->setHeader('cache', array(\n\t\t\t\t\t'upload.js' => 'module_video',\n\t\t\t\t\t'video.js' => 'module_video'\n\t\t\t\t)\n\t\t\t);\n\t}", "function linkVideo(){\n \n $vid = uniqid();\n $ar = array('id' => $vid, 'web_id' => WEB_ID, 'video_url' => $_POST['vurl'], 'video_name' => $_POST['name'], 'video_disc' => $_POST['disc'], 'type' => 'YouTube', 'category'=>$_POST['cats']);\n \n $this->db->insert('video_library', $ar);\n \n \n }", "public function create_video( $data ) {\r\n\t\t// Get a new video object.\r\n\t\tif ( 'default' === $data['video_type'] ) {\r\n\t\t\t$video_id = $this->default_video( $data );\r\n\t\t} else {\r\n\t\t\t$video_id = $this->custom_video( $data );\r\n\t\t}\r\n\r\n\t\t// Queue playlists.\r\n\t\t$this->link_playlists( $data, $video_id );\r\n\r\n\t\t/**\r\n\t\t * Action hook to fire after default video is imported.\r\n\t\t *\r\n\t\t * @param int $video_id Video ID.\r\n\t\t * @param array $data Video data.\r\n\t\t *\r\n\t\t * @since 1.8.1\r\n\t\t */\r\n\t\tdo_action( 'wpmudev_vids_after_import_video', $video_id, $data );\r\n\t}", "public function run()\n {\n \\DB::table('videos')->insert(array(\n 'name' => \"Video 1\",\n 'url' => \"http://localhost/geometryapi/public/files/Credenciales Digitales Geometry Global Colombia.mp4\",\n ));\n \\DB::table('videos')->insert(array(\n 'name' => \"Video 2\",\n 'url' => \"http://localhost/geometryapi/public/files/Credenciales Geometry Global Colombia 2017.mp4\",\n ));\n \\DB::table('videos')->insert(array(\n 'name' => \"Video 3\",\n 'url' => \"http://localhost/geometryapi/public/files/Credenciales Geometry Global Colombia.mp4\",\n ));\n \\DB::table('videos')->insert(array(\n 'name' => \"Video 4\",\n 'url' => \"http://localhost/geometryapi/public/files/Presidente de Geometry Global destaca perfil de los publicistas internacionales de La Sergio.mp4\",\n ));\n \\DB::table('videos')->insert(array(\n 'name' => \"Video 5\",\n 'url' => \"http://localhost/geometryapi/public/files/SEX GUARDIÁN realizado por Geometry Global.mp4\",\n ));\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'judul_video' => 'required',\n 'status' => 'required',\n 'foto_iklan' => 'image|mimes:mp4,mov,ogg,3gp,avi,wmv|max:1000',\n ]);\n if($request->hasFile('video')){\n // Get filename with the extension\n $filenameWithExt = $request->file('video')->getClientOriginalName();\n // Get just filename\n $filename = pathinfo($filenameWithExt, PATHINFO_FILENAME);\n // Get just ext\n $extension = $request->file('video')->getClientOriginalExtension();\n // Filename to store\n $fileNameToStore= $filename.'_'.time().'.'.$extension;\n // Upload Image\n $path = $request->file('video')->storeAs('public/video', $fileNameToStore);\n } else {\n $fileNameToStore = 'novideo.mp4';\n }\n\n $ivideo = new Iklanvideo;\n $ivideo->judul_video = $request->judul_video;\n $ivideo->status = $request->status;\n $ivideo->video = $fileNameToStore;\n $ivideo->save();\n Session::flash(\"flash_notification\", [\n \"level\" => \"success\",\n \"message\" => \"Successfully added data\"\n ]);\n return redirect()->route('datavideo.index');\n }", "public function postVideo(){\r\n if(!$this->hasLoginCheck())\r\n return;\r\n $blogItem = new BlogItemModel();\r\n $video_url=$_POST['video_url'];\r\n $video_img_path=$_POST['video_img_path'];\r\n $title=$_POST['video_title'];\r\n $desc=$_POST['content'];\r\n $embed_value=$_POST['video_embed_value'];\r\n $tag=$_POST['tag'];\r\n $blogItem->addVideo($video_url,$video_img_path,$title,$desc,$tag,$embed_value);\r\n echo json_encode(array('status'=>'true'));\r\n }", "function meta_box_video_save( $post_id ) {\n\tif ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;\n\t// if our nonce isn't there, or we can't verify it, bail\n\tif ( !isset( $_POST[ 'meta_box_nonce' ] ) || !wp_verify_nonce( $_POST[ 'meta_box_nonce' ], 'my_meta_box_nonce' ) ) return;\n\t// if our current user can't edit this post, bail\n\tif ( !current_user_can( 'edit_post' ) ) return;\n\t// now we can actually save the data\n\t$allowed = array(\n\t\t'a' => array( // on allow a tags\n\t\t\t'href' => array() // and those anchords can only have href attribute\n\t\t)\n\t);\n\tif ( isset( $_POST[ 'meta_box_video_embed' ] ) )\n\t\tupdate_post_meta( $post_id, 'meta_box_video_embed', $_POST[ 'meta_box_video_embed' ] );\n}", "public function uploadAction() {\n if (isset($_GET['ul']) || isset($_FILES['Filedata']))\n return $this->_forwardCustom('upload-video', null, null, array('format' => 'json'));\n\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n $this->view->form = $form = new Sitereview_Form_Reviewvideo();\n\n if (!$this->getRequest()->isPost()) {\n if (null !== ($video_id = $this->_getParam('video_id'))) {\n $form->populate(array(\n 'video' => $video_id\n ));\n }\n return;\n }\n\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n $video = $form->saveValues();\n }", "public function store(Request $request)\n {\n //\n $request->validate([\n 'title' => 'required'\n ]);\n\n $video = new Video();\n $video->title = $request->get('title');\n \n /*\n $file = $request->file('video');\n $name = $file->getClientOriginalName();\n while( file_exists(\"uploaded_videos/\".$name) )\n {\n $name = $name.str_random(6);\n }\n $file->move('uploaded_videos', $name);\n\n $video->path = $name;\n */\n $path = Storage::disk('public')->put(self::VIDEO, $request->file('video'));\n $video->path = $path;\n\n $video->save();\n\n return redirect()->route('list');\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'video' => 'required',\n ]);\n\n $input['video'] = time() . '.' . $request->video->getClientOriginalExtension();\n $request->video->move(public_path('videos-gallery'), $input['video']);\n\n if (Auth::check()) {\n $input['name'] = $request->name;\n $input['public'] = 1;\n $input['fk_owner'] = Auth::id();\n $input['author'] = Auth::user()->name;\n\n Video::create($input);\n\n return redirect()->route('videos.index')->with('success', 'Video created successfully.');\n }\n\n return redirect()->route('videos.index')->with('warning', 'You must be connected.');\n }", "public function save($data = null, $validate = true, $fieldList = array()) {\n\n // Create the XML containing the meta data about the video\n $doc = new DOMDocument('1.0', 'utf-8');\n $entry = $doc->createElementNS('http://www.w3.org/2005/Atom', 'entry');\n $entry->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:media', 'http://search.yahoo.com/mrss/');\n $entry->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:yt', 'http://gdata.youtube.com/schemas/2007');\n $doc->appendChild($entry);\n $media = $doc->createElementNS('http://search.yahoo.com/mrss/', 'media:group');\n $entry->appendChild($media);\n\n if (!empty($data[$this->alias]['title'])) {\n $title = $doc->createElementNS('http://search.yahoo.com/mrss/', 'media:title', $data[$this->alias]['title']);\n $title->setAttribute('type', 'plain');\n $media->appendChild($title);\n }\n\n if (!empty($data[$this->alias]['description'])) {\n $description = $doc->createElementNS('http://search.yahoo.com/mrss/', 'media:description', $data[$this->alias]['description']);\n $description->setAttribute('type', 'plain');\n $media->appendChild($description);\n }\n\n if (!empty($data[$this->alias]['category'])) {\n $category = $doc->createElementNS('http://search.yahoo.com/mrss/', 'media:category', $data[$this->alias]['category']);\n $category->setAttribute('scheme', 'http://gdata.youtube.com/schemas/2007/categories.cat');\n $media->appendChild($category);\n }\n\n if (!empty($data[$this->alias]['developertag'])) {\n $category = $doc->createElementNS('http://search.yahoo.com/mrss/', 'media:category', $data[$this->alias]['developertag']);\n $category->setAttribute('scheme', 'http://gdata.youtube.com/schemas/2007/developertags.cat');\n $media->appendChild($category);\n }\n\n if (!empty($data[$this->alias]['keywords'])) {\n $keywords = $doc->createElementNS('http://search.yahoo.com/mrss/', 'media:keywords', $data[$this->alias]['keywords']);\n $media->appendChild($keywords);\n }\n\n foreach ($this->accessControls as $action => $permissions) {\n if (empty($data[$this->alias][$action])) {\n continue;\n }\n $accessControl = $doc->createElementNS('http://gdata.youtube.com/schemas/2007', 'yt:accessControl');\n $accessControl->setAttribute('action', $action);\n $accessControl->setAttribute('permission', $data[$this->alias][$action]);\n $entry->appendChild($accessControl);\n }\n\n if (!empty($data[$this->alias]['private'])) {\n $private = $doc->createElementNS('http://gdata.youtube.com/schemas/2007', 'yt:private');\n $media->appendChild($private);\n }\n\n // The boundary string is used to identify the different parts of a\n // multipart http request\n $boundaryString = 'Next_Part_' . String::uuid();\n\n // Build the multipart body of the http request\n $body = \"--$boundaryString\\r\\n\";\n $body.= \"Content-Type: application/atom+xml; charset=UTF-8\\r\\n\";\n $body.= \"\\r\\n\";\n $body.= $doc->saveXML().\"\\r\\n\";\n $body.= \"--$boundaryString\\r\\n\";\n $body.= \"Content-Type: {$data[$this->alias]['file']['type']}\\r\\n\";\n $body.= \"Content-Transfer-Encoding: binary\\r\\n\";\n $body.= \"\\r\\n\";\n $body.= file_get_contents($data[$this->alias]['file']['tmp_name']).\"\\r\\n\";\n $body.= \"--$boundaryString--\\r\\n\";\n\n $this->request = array(\n 'uri' => array(\n 'host' => 'uploads.gdata.youtube.com',\n 'path' => '/feeds/api/users/default/uploads',\n ),\n 'header' => array(\n 'Content-Type' => 'multipart/related; boundary=\"' . $boundaryString . '\"',\n 'Slug' => $data[$this->alias]['file']['name']\n ),\n 'auth' => array(\n 'method' => 'OAuth',\n ),\n 'body' => $body,\n );\n\n return parent::save($data, $validate, $fieldList);\n\n }", "public function video()\n {\n /***** Checks Video for UPLOAD *****/\n if(!empty($_FILES['video']['name']))\n {\n $video = array\n (\n 'upload_path' => 'uploads/videos',\n 'allowed_types' => 'mp4|avi|wmv|mov|mpg|mpeg|3gp',\n 'max_size' => '10000',\n 'file_name' => $_FILES['video']['name']\n );\n $this->load->library('upload',$video);\n $this->upload->initialize($video);\n\n if($this->upload->do_upload('video'))\n {\n $uploadData = $this->upload->data();\n $uploaded_video = $uploadData['file_name'];\n }else{\n $Response = array('message' => $this->upload->display_errors(), 'status' => false);\n echo json_encode($Response);\n }\n }else{\n //$uploaded_video = '';\n $Response = array('message' => 'Choose a Video to upload', 'status' => false);\n echo json_encode($Response);\n }\n // prepare video array for insert\n $dataVideo = array\n (\n 'complaint_type_id' => $this->input->post('complaint_type_id'),\n 'signup_id' => $this->input->post('signup_id'),\n 'complaints_status_id'=> 2,\n 'latitude' => $this->input->post('latitude'),\n 'longitude' => $this->input->post('longitude'),\n 'description' => $this->input->post('description'),\n 'video' => $uploaded_video,\n 'dated' => date('Y-m-d')\n );\n if(isset($uploaded_video))\n {\n $insert = $this->Complaintsmodel->InsertDB($dataVideo);\n if($insert)\n {\n $Response = array('message' => 'Complaint is done!', 'status' => true, 'data'=>$insert); \n echo json_encode($Response);\n }\n else\n {\n $Response = array('message' => 'Sorry, Try again!', 'status' => false);\n echo json_encode($Response);\n }\n }\n }", "static function get_video_info_data ($array_param){\r\n\r\n $list_to_parse = $array_param[0];\r\n\r\n $data_from_db = $array_param[1];\r\n\r\n $video_provider = $array_param[2];\r\n\r\n $buffy = array();\r\n\r\n //get the info data for videos\r\n //foreach($list_to_parse as $array_id_video) {\r\n\r\n foreach($list_to_parse as $id_video) {\r\n\r\n $id_video = trim($id_video);//possible to have spaces\r\n\r\n if(!empty($data_from_db[$video_provider][$id_video])) {\r\n $buffy[$id_video] = $data_from_db[$video_provider][$id_video];\r\n\r\n } else {\r\n\r\n //get the info data for video\r\n switch ($video_provider) {\r\n case 'youtube_ids':\r\n $response = file_get_contents('http://gdata.youtube.com/feeds/api/videos/' . $id_video . '?format=5&alt=json');\r\n $obj = json_decode($response, true);\r\n\r\n $buffy[$id_video]['thumb'] = 'http://img.youtube.com/vi/' . $id_video . '/default.jpg';\r\n $buffy[$id_video]['title'] = htmlentities($obj['entry']['media$group']['media$title']['$t'], ENT_QUOTES);\r\n $buffy[$id_video]['time'] = gmdate(\"H:i:s\", intval($obj['entry']['media$group']['yt$duration']['seconds']));\r\n break;\r\n\r\n case 'vimeo_ids':\r\n $html_returned = unserialize(file_get_contents('http://vimeo.com/api/v2/video/' . $id_video . '.php'));\r\n\r\n $buffy[$id_video]['thumb'] = $html_returned[0]['thumbnail_small'];\r\n $buffy[$id_video]['title'] = htmlentities($html_returned[0]['title'], ENT_QUOTES);\r\n $buffy[$id_video]['time'] = gmdate(\"H:i:s\", intval($html_returned[0]['duration']));\r\n break;\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n //}\r\n\r\n\r\n if(!empty($buffy)) {\r\n return $buffy;\r\n } else {\r\n return;\r\n }\r\n }", "public function addVideoAction(){\n $data = $this->getRequestData();\n if(isset($data['video']['name']) && isset($data['video']['content'])){\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Asset_Folder::getByPath('/video/operation/'.$user->getKey().'-video');\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-video\");\n $folder->setParentId(6);\n $folder->save();\n }\n\n $asset = new Asset_Video();\n $asset->setCreationDate(time());\n $asset->setUserOwner(1);\n $asset->setUserModification(1);\n $asset->setParentId($folder->getId());\n $asset->setFilename(Pimcore_File::getValidFilename($data['name'] . \"-\" . time()));\n $asset->setData(base64_decode($data['content']));\n if(!$asset->save()){\n $this->setErrorResponse('cannot save video!');\n }\n } else {\n $this->setErrorResponse('video is mandatory for this request!');\n }\n\n $this->_helper->json(array('video' => $asset->getId()));\n }", "public function uploadVideo(){\n\t\t$this->log('<videos.uploadVideo>', 'debug');\n\t\t\n\t\tif(!$this->request->is('post')){\n\t\t\t$this->log('wrong HTML form method ...', 'debug');\n\t\t\treturn;\n\t\t}\n\t\t//HTML Form method is valid\n\t\t$error = '';\n\t\t$video_id = '';\n\t\t$message = '';\n\t\t\n\t\t$db = $this->Video->getDataSource();\n\t\t$db->begin();\n\t\ttry{\n\t\t\t//Checking resource video object ...\n\t\t\n\t\t\tif(!isset($this->request->data['Video']['video'])){\n\t\t\t\t$error = __('No video resource found in request');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\t$errorFlag = $this->request->data['Video']['video']['error'];\n\t\t\tif($errorFlag){\n\t\t\t\t$error = __('Upload failed due to internal Server error');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\t$name = $this->request->data['Video']['video']['name'];\n\t\t\t$size = $this->request->data['Video']['video']['size'];\n\t\t\t$tmp_name = $this->request->data['Video']['video']['tmp_name'];\n\t\t\n\t\t\t$this->loadModel('Video');\n\t\t\n\t\t\t$this->Video->create();\n\t\t\n\t\t\tif(!file_exists($tmp_name)){\n\t\t\t\t$error = __('Invalid tmp file');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\tif($size > 3145728){//size > 3MB\n\t\t\t\t$error = __('Video file is too large');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\t$im = file_get_contents($tmp_name);\n \t\t\t$imdata = base64_encode($im);\n\t\t\tif(!$imdata){\n\t\t\t\t$error = __('Unable to encode the uploaded file ');\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\t\t\t\t\n\t\t\t$this->Video->data['Video']['vid_name'] = $name;\n\t\t\t$codec = $this->Video->getVideoCodec($tmp_name);\n\t\t\t$this->Video->data['Video']['vid_mime_type'] = $codec;\n\t\t\t$this->Video->data['Video']['vid_data'] = $imdata;\n\t\t\t$date = new DateTime();\n\t\t\t$now = $date->getTimestamp();\n\t\t\t$this->Video->data['Video']['vid_created'] = $now;\n\t\t\t\n\t\t\tif(!$this->Video->save($this->Video->data)){\n\t\t\t\t$error = __(\"Unable to save the video data\");\n\t\t\t\tthrow new Exception($error);\n\t\t\t}\n\t\t\t$video_id = $this->Video->id;\n\t\t\t$message = __('Video has been successfully uploaded');\n\t\t\t$message = htmlentities($message, ENT_QUOTES);\n\t\t\t$db->commit();\n\t\t}catch(Exception $e){\n\t\t\t$db->rollback();\n\t\t\t$this->log($e->getMessage());\n\t\t\tif(!$error)\n\t\t\t\t$error = __(AppModel::$DEFAULT_ERROR_MESSAGE);\n\t\t}\n\t\t\t\n\t\t$this->set('error', $error);\n\t\t$this->set('video_id', $video_id);\n\t\t$this->set('message', $message);\n\t\t$this->layout = 'empty';\n\t\t\n\t\t\n\t\t$this->log('</videos.uploadVideo>', 'debug');\n\t}", "static function save_playlist_hook($post_id){\r\n\r\n $td_playlist_video = array();\r\n\r\n //check for saved playlists in post meta\r\n $td_playlist_video_db = get_post_meta($post_id, self::$td_playlist_video_key, true);\r\n\r\n if(!empty($_POST['post_content'])) {\r\n $post_content = $_POST['post_content'];\r\n\r\n\r\n //HANDLE YOUTUBE\r\n $youtube_regular_expresion = '/\\[td_video_youtube(.*?)\\]/i';\r\n\r\n if (preg_match($youtube_regular_expresion, $post_content)) {\r\n\r\n //get youtube playlist's (shortcode)\r\n preg_match_all($youtube_regular_expresion, $post_content, $matches_youtube);\r\n\r\n //split the array to get the string of id's\r\n $xplode_matches_for_ids = explode('playlist_yt', $matches_youtube[0][0]);\r\n $xplode_matches_remove_quotes = explode('\\\"', $xplode_matches_for_ids[1]);\r\n\r\n //get an array of youtube list; array_filter = remove empty arrays\r\n $youtube_id_array = array_filter(self::get_ids_from_list($xplode_matches_remove_quotes[1]));\r\n\r\n if(!empty($youtube_id_array)) {\r\n\r\n //get the info for the videos\r\n $td_playlist_video['youtube_ids'] = self::get_video_info_data(array($youtube_id_array, $td_playlist_video_db, 'youtube_ids'));\r\n\r\n //save title\r\n if(strpos($matches_youtube[0][0], 'playlist_title')) {\r\n $title_for_save_youtube = self::get_title($matches_youtube[0][0]);\r\n if(!empty($title_for_save_youtube)) {\r\n $td_playlist_video['youtube_title'] = $title_for_save_youtube;\r\n }\r\n }\r\n\r\n //save autoplay\r\n $autoplay_youtube = self::get_autoplay($matches_youtube[0][0]);\r\n if($autoplay_youtube > 0) {\r\n $td_playlist_video['youtube_auto_play'] = 1;\r\n }\r\n\r\n }\r\n }\r\n\r\n\r\n //HANDLE VIMEO\r\n $vimeo_regular_expresion = '/\\[td_video_vimeo(.*?)\\]/i';\r\n\r\n if (preg_match($vimeo_regular_expresion, $post_content)) {\r\n\r\n //get vimeo playlist's (shortcode)\r\n preg_match_all($vimeo_regular_expresion, $post_content, $matches_vimeo);\r\n\r\n //split the array to get the string of id's\r\n $xplode_matches_for_ids = explode('playlist_v', $matches_vimeo[0][0]);\r\n $xplode_matches_remove_quotes = explode('\\\"', $xplode_matches_for_ids[1]);\r\n\r\n //get an array of vimeo list; array_filter = remove empty arrays\r\n $vimeo_id_array = array_filter(self::get_ids_from_list($xplode_matches_remove_quotes[1]));\r\n\r\n if(!empty($vimeo_id_array)) {\r\n\r\n //get the info for the videos\r\n $td_playlist_video['vimeo_ids'] = self::get_video_info_data(array($vimeo_id_array, $td_playlist_video_db, 'vimeo_ids'));\r\n\r\n //save title\r\n if(strpos($matches_vimeo[0][0], 'playlist_title')) {\r\n $title_for_save_vimeo = self::get_title($matches_vimeo[0][0]);\r\n if(!empty($title_for_save_vimeo)) {\r\n $td_playlist_video['vimeo_title'] = $title_for_save_vimeo;\r\n }\r\n }\r\n\r\n //save autoplay\r\n $autoplay_vimeo = self::get_autoplay($matches_vimeo[0][0]);\r\n if($autoplay_vimeo > 0) {\r\n $td_playlist_video['vimeo_auto_play'] = 1;\r\n }\r\n\r\n }\r\n }\r\n\r\n }\r\n\r\n //add or edit the video playlist for this post\r\n if(!empty($td_playlist_video) or !empty($td_playlist_video_db)){\r\n\r\n update_post_meta($post_id, self::$td_playlist_video_key, $td_playlist_video);\r\n }\r\n\r\n //self::write_output_data($td_playlist_video);\r\n\r\n }", "function video() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id'];\n if ($id > 0) {\n $query = \"select * from videos where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $query = \"update videos set views = views + 1 where id =$id;\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }", "public function videoMap($rows)\n\t{\n\t\tforeach($rows as $row)\n\t\t{\n\t\t\t\t$item = new VideoSimpleSchema();\n\t\t\t\t\t\n\t\t\t\t$item->id = $row->id;\n\t\t\t\t$item->title = $row->title;\n\t\t\t\t$item->description = $row->description;\n\t\t\t\t$item->user_id = $row->user_id;\n\t\t\t\t$item->uid = $row->uid;\n\t\t\t\t$item->type = $row->type;\n\t\t\t\t$item->created = $row->created;\n\t\t\t\t$item->state = $row->state;\n\t\t\t\t$item->featured = $row->featured;\n\t\t\t\t$item->category_id = $row->category_id;\n\t\t\t\t$item->hits = $row->hits;\n\t\t\t\t$item->duration = $row->duration;\n\t\t\t\t$item->size = $row->size;\n\t\t\t\t$item->params = $row->params;\n\t\t\t\t$item->storage = $row->storage;\n\t\t\t\t$item->path = $row->path;\n\t\t\t\t$item->original = $row->original;\n\t\t\t\t$item->file_title = $row->file_title;\n\t\t\t\t$item->source = $row->source;\t\n\t\t\t\t$item->thumbnail = $row->thumbnail;\n\t\t\t\t$item->message = \"Video uploaded successfully\";\t\n\t\t\n\t\t\t\t$result[] = $item;\t\n\t\t\t\treturn $result;\n\t\t}\n\t}", "function save() {\n \n\t if ($this->id == NULL) {\n\t \t\n\t\t mysql_query(\"INSERT INTO `videothumbs` ( `videoid`, `url`) VALUES ( '\".$this->videoid.\"', '\".$this->url.\"');\") or die(\"Query failed with error: \".mysql_error());\n\t\t $this->id = mysql_insert_id();\n\t \n\t } else {\n\t\t\t\t\n\t\t mysql_query(\"UPDATE `videothumbs` SET `videoid` = '\".$this->videoid.\"', `url` = '\".$this->url.\"' WHERE `id` = \".$this->id.\";\") or die(\"Query failed with error: \".mysql_error());\n\t }\n\t \n }", "function video() {\n echo json_encode(array('element' => '<video controls autoplay> <source src=\"skysignagelight.1564484463.mp4\" type=\"video/mp4\"></video>'));\n exit;\n }", "function add_videos_meta_box() {\n \tadd_meta_box(\n \t\t'y_link', // $id\n \t\t'ID Video', // $title\n \t\t'display_video_fields_meta_box', // $callback\n \t\t'videos', // $screen\n \t\t'normal', // $context\n \t\t'high' // $priority\n \t);\n }", "function getVideo($root_dir)\n{\n $vid_fileName = $_FILES['vid_file']['name']; //name of the file\n $vid_fileTmpName = $_FILES['vid_file']['tmp_name']; //create tmp of the file\n $vid_fileSize = $_FILES['vid_file']['size'];\n $vid_fileError = $_FILES['vid_file']['error'];\n $vid_fileType = $_FILES['vid_file']['type'];\n $fileExt = explode('.', $vid_fileName);\n $vidName = $fileExt[0];\n $fileActualExt = strtolower(end($fileExt)); //make all ext be lowercase\n $allowd = array('mp4');\n if (in_array($fileActualExt, $allowd)) {\n if ($vid_fileError === 0) {\n if ($vid_fileSize < 10000000000) {\n $fileNameNew = $vidName . \".\" . $fileActualExt; //unique name\n $fileNameNew = str_replace(\" \", \"_\", $fileNameNew);\n $fileDestination = $root_dir . 'videos/' . $fileNameNew;\n //Add image\n move_uploaded_file($vid_fileTmpName, $fileDestination);\n return $fileNameNew;\n } else {\n echo \"Your file is too big.\";\n }\n } else {\n echo \"Upload file error! Code: \" . $vid_fileError;\n }\n } else {\n echo \"Video type is invalid.\";\n }\n}", "public function store(VideoRequest $request)\n {\n $request->validated();\n\n parse_str( parse_url( $request->url, PHP_URL_QUERY ), $array_param_video );\n if (empty($array_param_video)) {\n\n return redirect()->back()->with('error', 'URL digitada não é válida!');\n\n }else{\n $video = new Videos;\n $video->titulo = $request->titulo;\n $video->descricao = $request->descricao;\n $video->url = $array_param_video['v'];\n $video->save();\n return redirect()->back()->with('message', 'Cadastro efetuado com sucesso!');\n\n }\n }", "protected function getVideo()\n {\n $names = $this->generateVideoName();\n $command = implode(' ', [\n $this->getVideoServiceConfig('video_app'),\n '-i ' . $this->getVideoServiceConfig('video_source'),\n '-c copy',\n '-f mp4',\n '-t ' . $this->getVideoServiceConfig('video_length'),\n $names['file'],\n '1> ' . $names['log'],\n '2>&1',\n ]);\n\n if (0 === stripos(PHP_OS, 'WIN')) {\n pclose(popen('start /B ' . $command, 'r'));\n } else {\n pclose(popen($command . ' &', 'r'));\n }\n\n $this->createNewRecording($names['file']);\n if ($this->checkLog($names['log'])) {\n $this->getVideo();\n }\n }", "function videoPlayed($IDcurso, $IDtema, $IDvideo, $IDusuario, $duracion, $segundo) {\n\tglobal $dbAn;\n\n\t//$dbAn->exec('INSERT INTO analytics (IDcurso, IDtema, IDvideo, IDusuario) VALUES ('.decrypt($IDcurso).','.decrypt($IDtema).','.decrypt($IDvideo).','.$IDusuario.')');\n\t$visto = 0;\n\tif ($duracion == $segundo) {\n\t\t$visto = 1;\n\t}\n\n\t$dbAn->exec('INSERT INTO analytics (IDcurso, IDtema, IDvideo, IDusuario, duracion, segundo, visto) VALUES ('.decrypt($IDcurso).','.decrypt($IDtema).','.decrypt($IDvideo).','.$IDusuario.', '.$duracion.', '.$segundo.', '.$visto.')');\n}", "function videos() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['user_id'];\n if ($id > 0) {\n $query = \"select * from videos where user_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n\n $this->response(json_encode($result), 200); \n } else {\n $this->response('',204);\n }\n } else {\n $this->response('', 400);\n }\n }", "public function Videos(){\n if(!isset($_SESSION[\"oturum\"])){\n header(\"location: \" . URL . \"login\" );\n }\n\n //Model Connections\n $movies = $this->model('Movie');\n $categories = $this->model('Categories');\n\n //Load data from model to views.\n $getVideos = $movies->getAllVideos();\n $getCategories = $categories->getAllCat();\n\n //Load views\n require VIEW_PATH . \"templates/header-yonetim.php\";\n require VIEW_PATH . \"videos/index.php\";\n require VIEW_PATH . \"templates/footer-yonetim.php\";\n }", "public function uploadVideoFromMine(){\n header(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n header(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n header(\"Cache-Control: no-store, no-cache, must-revalidate\");\n header(\"Cache-Control: post-check=0, pre-check=0\", false);\n header(\"Pragma: no-cache\");\n session_start();\n // Support CORS\n // header(\"Access-Control-Allow-Origin: *\");\n // other CORS headers if any...\n if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {\n exit; // finish preflight CORS requests here\n }\n if ( !empty($_REQUEST[ 'debug' ]) ) {\n $random = rand(0, intval($_REQUEST[ 'debug' ]) );\n if ( $random === 0 ) {\n header(\"HTTP/1.0 500 Internal Server Error\");\n exit;\n }\n }\n // header(\"HTTP/1.0 500 Internal Server Error\");\n // exit;\n // 5 minutes execution time\n @set_time_limit(5 * 60);\n // Uncomment this one to fake upload time\n // usleep(5000);\n // Settings\n // $targetDir = ini_get(\"upload_tmp_dir\") . DIRECTORY_SEPARATOR . \"plupload\";\n $targetDir = ROOT_PATH.'public'.DS.'uploads'.DS.'video'.DS.'tmp';\n $uploadDir = ROOT_PATH.'public'.DS.'uploads'.DS.'video';\n $cleanupTargetDir = true; // Remove old files\n $maxFileAge = 5 * 3600; // Temp file age in seconds\n // Create target dir\n Log::record('Create target temp dir');\n if (!file_exists($targetDir)) {\n @mkdir($targetDir, 0777, true);\n }\n Log::record('Create target upload dir');\n // Create target dir\n if (!file_exists($uploadDir)) {\n @mkdir($uploadDir, 0777, true);\n }\n // 写入分片\n if(!isset($_POST['status'])){\n if(isset($_SESSION['chunkName'])){\n $fileName = $_SESSION['chunkName'];\n } else {\n $fileName = uniqid(\"file_\");\n }\n\n Log::record('Create file name use uniqid '.$fileName);\n $filePath = $targetDir . DS . $fileName;\n $uploadPath = $uploadDir . DS . $fileName;\n // Chunking might be enabled\n// $chunk = isset($_REQUEST[\"chunk\"]) ? intval($_REQUEST[\"chunk\"]) : 0;\n// $chunks = isset($_REQUEST[\"chunks\"]) ? intval($_REQUEST[\"chunks\"]) : 1;\n $chunk = 0;\n $chunks = 1;\n Log::record('check chunk:'.$chunk.' and chunks:'.$chunks);\n // Remove old temp files\n if ($cleanupTargetDir) {\n Log::record('remove old temp files');\n if (!is_dir($targetDir) || !$dir = opendir($targetDir)) {\n Log::record('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 100, \"message\": \"Failed to open temp directory.\"}, \"id\" : \"id\"}');\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 100, \"message\": \"Failed to open temp directory.\"}, \"id\" : \"id\"}');\n }\n while (($file = readdir($dir)) !== false) {\n $tmpfilePath = $targetDir . DIRECTORY_SEPARATOR . $file;\n // If temp file is current file proceed to the next\n if ($tmpfilePath == \"{$filePath}_{$chunk}.part\" || $tmpfilePath == \"{$filePath}_{$chunk}.parttmp\") {\n Log::record('If temp file is current file proceed to the next');\n continue;\n }\n // Remove temp file if it is older than the max age and is not the current file\n if (preg_match('/\\.(part|parttmp)$/', $file) && (@filemtime($tmpfilePath) < time() - $maxFileAge)) {\n Log::record('Remove temp file if it is older than the max age and is not the current file');\n @unlink($tmpfilePath);\n }\n }\n closedir($dir);\n }\n // Open temp file\n if (!$out = @fopen(\"{$filePath}_{$chunk}.parttmp\", \"wb\")) {\n Log::record('open temp file');\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 102, \"message\": \"Failed to open output stream.\"}, \"id\" : \"id\"}');\n }\n// $writ_point = 0;\n if (!empty($_FILES)) {\n Log::record('_files is true::'. $_FILES[\"file\"][\"size\"].$_FILES['file']['name']. $_FILES[\"file\"][\"error\"]);\n $_SESSION['file_name'] = $_FILES['file']['name'];\n if ($_FILES[\"file\"][\"error\"] || !is_uploaded_file($_FILES[\"file\"][\"tmp_name\"])) {\n Log::record('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 103, \"message\": \"Failed to move uploaded file.\"}, \"id\" : \"id\"}');\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 103, \"message\": \"Failed to move uploaded file.\"}, \"id\" : \"id\"}');\n }\n // Read binary input stream and append it to temp file\n Log::record('Read binary input stream and append it to temp file'.$_FILES[\"file\"][\"tmp_name\"]);\n if (!$in = @fopen($_FILES[\"file\"][\"tmp_name\"], \"rb\")) {\n Log::record('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\n }\n } else {\n Log::record('php://input is true');\n if (!$in = @fopen(\"php://input\", \"rb\")) {\n Log::record('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 101, \"message\": \"Failed to open input stream.\"}, \"id\" : \"id\"}');\n }\n// $writ_point = strlen(file_get_contents(\"php://input\")) - $_SESSION['chunk_size'];\n// $writ_point = $writ_point > 0? $writ_point: 0;\n Log::record('file size:'.'ppppppp');\n\n }\n Log::record('write file data '.$_SESSION['chunk_size']);\n// fseek($in, $writ_point);\n Log::record(\"{$filePath}_{$chunk}:\");\n while ($buff = fread($in, 4096)) {\n fwrite($out, $buff);\n }\n @fclose($out);\n @fclose($in);\n Log::record('rename for write file');\n rename(\"{$filePath}_{$chunk}.parttmp\", \"{$filePath}_{$chunk}.part\");\n $index = 0;\n $done = true; //判断上传分片是否成功\n Log::record('判断上传分片是否成功');\n for( $index = 0; $index < $chunks; $index++ ) {\n Log::record('file name::'.\"{$filePath}_{$index}.part\");\n if ( !file_exists(\"{$filePath}_{$index}.part\") ) {\n $done = false;\n Log::record('判断上传分片失败');\n break;\n }\n }\n if ( $done ) {\n Log::record('判断上传分片成功');\n if (!$out = @fopen($uploadPath, \"wb\")) {\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 102, \"message\": \"Failed to open output stream.\"}, \"id\" : \"id\"}');\n }\n if ( flock($out, LOCK_EX) ) {\n Log::record('锁定文件,写入');\n for( $index = 0; $index < $chunks; $index++ ) {\n if (!$in = @fopen(\"{$filePath}_{$index}.part\", \"rb\")) {\n break;\n }\n while ($buff = fread($in, 4096)) {\n fwrite($out, $buff);\n }\n @fclose($in);\n @unlink(\"{$filePath}_{$index}.part\");\n }\n flock($out, LOCK_UN);\n Log::record('解锁');\n }\n @fclose($out);\n }\n // Return Success JSON-RPC response\n Log::record('Return Success JSON-RPC response');\n die('{\"jsonrpc\" : \"2.0\", \"result\" : null, \"id\" : \"id\"}');\n }\n if ($_POST['status'] == 'md5Check'){ //文件校验,避免重复上传,秒传\n Log::record('post status:: md5Check');\n //todo 查询数据库,获取文件名和md5校验名\n $dataArr = array('b0201e4d41b2eeefc7d3d355a44c6f5a' => 'kazaff2.jpg');\n //todo 对比上传文件是否已经上传过\n if(isset($dataArr[$_POST['md5']])){\n die('{\"jsonrpc\" : \"2.0\", \"result\" : null, \"id\" : \"id\", \"exist\": 1}');\n// return json(['ifExist'=>1, 'path'=>$dataArr[$_POST['md5']]]);\n } else {\n die('{\"exist\": 0}');\n// return json(['ifExist'=>0]);\n }\n } elseif($_POST['status'] == 'chunkCheck'){ //分片校验,用于断点续传,验证指定分块是否已经存在,避免重复上传\n Log::record('post status:: chunkCheck');\n $target = $uploadDir.DS.$_POST['name'].'_'.$_POST['chunkIndex'];\n $_SESSION['file_length_from_header'] = isset($_SERVER['content-length'])? intval($_SERVER['content-length']):0;\n $_SESSION['chunk_size'] = $_POST['size'];\n Log::record('file length from header:'.$_SESSION['file_length_from_header'].' chunk size:'.$_SESSION['chunk_size']);\n if(file_exists($target) && filesize($target) == $_POST['size']){\n Log::record('chunkCheck:: file is exited, need not upload');\n die('{\"jsonrpc\" : \"2.0\", \"result\" : null, \"id\" : \"id\", \"exist\": 1}');\n// return json(['ifExist' => 1]);\n } else {\n Log::record('chunkCheck:: file is not exited, this is new chunk and need upload');\n $_SESSION['chunkName'] = $_REQUEST[\"name\"].'_'.$_REQUEST['chunkIndex'];\n die('{\"exist\": 0}');\n// return json(['ifExist' => 0]);\n }\n } elseif ($_POST['status'] == 'chunksMerge'){//合并分片\n Log::record('post status:: chunksMerge');\n //todo 合并分片\n $file_name = $_SESSION['file_name'];\n $file_tmp_name = $_REQUEST['name'];\n $file_md5_name = $_REQUEST['md5'];\n $file_ext = $_REQUEST['ext'];\n $file_chunks = $_REQUEST['chunks'];\n $uploadPath = $uploadDir.DS.$file_md5_name.'.'.$file_ext;\n $uploadedFiles = $uploadDir.DS.$file_tmp_name;\n Log::record('file name:'.$file_name.'::file tmp name:'.$file_tmp_name.'::file md5 name:'.$file_md5_name.'::file ext:'.$file_ext);\n if (!$out = @fopen($uploadPath, \"wb\")) {\n die('{\"jsonrpc\" : \"2.0\", \"error\" : {\"code\": 102, \"message\": \"Failed to open output stream.\"}, \"id\" : \"id\"}');\n }\n if ( flock($out, LOCK_EX) ) {\n Log::record('锁定文件,写入');\n for( $index = 0; $index < $file_chunks; $index++ ) {\n if (!$in = @fopen(\"{$uploadedFiles}_{$index}\", \"rb\")) {\n break;\n }\n while ($buff = fread($in, 4096)) {\n fwrite($out, $buff);\n }\n @fclose($in);\n @unlink(\"{$uploadedFiles}_{$index}\");\n }\n flock($out, LOCK_UN);\n Log::record('解锁');\n\n $vm = new VideoManagement();\n\n if($vm->insertNewVideo('uploads'.DS.'video'.DS.$file_md5_name.'.'.$file_ext, $_POST['detail'], substr($file_name, 0, (strlen($file_name)-strlen($file_ext)-1)))){\n die('{\"flag\":\"S\", \"msg\":\"视频上传成功\"}');\n } else {\n die('{\"flag\": \"F\", \"msg\":\"视频上传失败\"}');\n }\n } else {\n die('{\"flag\": \"F\", \"msg\":\"视频上传失败\"}');\n }\n @fclose($out);\n session_destroy();\n }\n }", "function wp_embed_handler_video($matches, $attr, $url, $rawattr)\n {\n }", "public function run()\n {\n $variabel = json_decode(file_get_contents(public_path() .'/video.json'));\n \n foreach ($variabel as $item) {\n $response = TransformerVideo::makeSeed($item->judul, $item->link);\n Video::create($response);\n }\n \n }", "public function addVideo(Request $request)\n {\n try{\n if (!empty($request)) {\n $validateData = Validator::make($request->all(),[\n 'title' => 'required',\n 'asset_type' => 'required',\n 'slug' => 'required',\n 'short_description' => 'required|max:520',\n 'description' => 'required',\n 'content_type' => 'required'\n ]);\n\n if ($validateData->fails()) {\n $messages = $validateData->errors()->all();\n return APIResponse('201', 'Validation errors.', $messages);\n }\n\n $video_data = VideoContent::where('title', '=', $request->get('title'))->first();\n \n if ($video_data) {\n return APIResponse('201', 'Data already present in the database.');\n }\n\n $photoURL = '';\n if ($request->hasFile('thumbnail_image')) {\n $file = $request->file('thumbnail_image');\n $folderpath = 'bcci/videos/';\n $result = uploadFileToS3($file, $folderpath, '');\n $photoURL = $result['ObjectURL'] ?? '';\n }\n \n $videoUrl = '';\n if ($request->hasFile('video_url')) {\n $file = $request->file('video_url');\n $folderpath = 'Input/';\n $result = uploadFileToS3($file, $folderpath, 'video');\n $videoUrl = $result['ObjectURL'] ?? '';\n }\n \n $videoCount = AssetsCount::all();\n if (isset($videoCount)) {\n $videosCount = $videoCount[0]['video_count'] + 1;\n }\n\n $videoContent = new VideoContent();\n $videoContent->ID = $videosCount;\n $videoContent->title = $request->get('title');\n $videoContent->short_description = $request->get('short_description'); \n $videoContent->description = $request->get('description');\n $videoContent->video_duration = $request->get('video_duration'); // duration and video-duration is same \n $videoContent->match_id = $request->get('match_id');\n $videoContent->content_type = $request->get('content_type'); //type and content-type is same\n $videoContent->video_scope = $request->get('video_scope');\n $videoContent->video_url = $videoUrl; \n $videoContent->match_formats = $request->get('match_formats');\n $videoContent->keywords = $request->get('keywords'); \n $videoContent->created_date = $request->get('created_date');\n $videoContent->publish_date = $request->get('publish_date');\n $videoContent->publish_by = $request->get('publish_by'); // publishFrom and publish by is same\n $videoContent->meta_languages = $request->get('meta_languages');\n $videoContent->langauge = $request->get('langauge');\n $videoContent->asset_type = $request->get('asset_type');\n $videoContent->expiry_date = $request->get('expiry_date'); \n $videoContent->total_viewcount = $request->get('total_viewcount'); \n $videoContent->titleslug = $request->get('titleslug');\n $videoContent->varients = $request->get('varients'); \n $videoContent->views_count = $request->get('views_count'); \n $videoContent->comments = $request->get('comments'); //comments and commentson is same\n $videoContent->platform = $request->get('platform'); \n $videoContent->current_status = $request->get('current_status');\n $videoContent->lastModified = $request->get('lastModified');\n $videoContent->thumbnail_image= $photoURL; // thumbnail image nad thumbnail is same\n $videoContent->video_status = 'pending';\n $videoContent->location = $request->get('location');\n $videoContent->titleUrlSegment = $request->get('titleUrlSegment');\n $videoContent->subtitle = $request->get('subtitle');\n $videoContent->titleTranslations = $request->get('titleTranslations');\n $videoContent->coordinates = $request->get('coordinates');\n $videoContent->lastModified = $request->get('lastModified');\n $videoContent->publishTo = $request->get('publishTo');\n $videoContent->mediaId = $request->get('mediaId');\n $videoContent->references = $request->get('references');\n $videoContent->closedCaptioned = $request->get('closedCaptioned');\n $videoContent->status = true;\n $videoContent->save();\n\n $totalCount = AssetsCount::where('ID', 1)->update(['video_count' => $videosCount]);\n if ($videoContent) {\n $response = APIResponse('200', 'Data has been added successfully.');\n } else {\n $response = APIResponse('201', 'Something went wrong, please try again.'); \n }\n \n } else {\n $response = APIResponse('201', 'Something went wrong, please try again.');\n } \n } catch (\\Throwable $e) {\n $response = APIResponse('201', $e->getMessage());\n }\n\n return $response;\n }", "public function store(Request $request)\n {\n \n \n\n $scort = Scort::find($request->scort_id);\n\n //contamos numero de videos \n $num_videos = Video::where('scort_id',$request->scort_id)->count();\n \n $carga = false;\n\n switch ($scort->package->id) {\n case 1:\n //1 video\n if($num_videos<2){\n $carga = true;\n }\n break;\n case 2:\n //ningun video\n $carga = false;\n \n break;\n \n }\n \n if($carga){\n $file = $request->file('video');\n \n if(!empty($file))\n {\n \n //foreach ($files as $file) {\n \n $video = $file->store('videos');\n \n $result= Video::create([\n 'scort_id' => $request->scort_id,\n 'path' => $video,\n \n ]);\n //}\n \n }\n }else{\n return redirect()->route('mivideo.index')\n ->with('info','No tiene permitido cargar mas videos'); \n }\n return redirect()->route('mivideo.index')\n ->with('info','El video se ha cargado con exito'); \n\n\n }", "public function store(Request $request)\n {\n\n $user = Auth::guard('api')->user();\n\n $user_id = $request->get('user');\n if (!$user){\n return $this->handleError('Must be logged in to view videos', 401);\n }\n if ($user->id != $user_id){\n return $this->handleError('Must be logged in to view videos not matched', 401);\n }\n\n\n $user_file = $request->file('video');\n\n $path = $request->file('video')->store('public/video');\n\n $db_file = new Video(\n [\n 'user' => $user_id,\n 'name' => $user_file->getClientOriginalName(),\n 'file' => $path,\n ]\n );\n\n $db_file->save();\n\n return response()->json($db_file);\n //return response()->json(array(\"status\"=>\"successful\", \"file\" => $file_contents));\n }", "public function store(StoreVideoRequest $request)\n {\n //Input received from the request\n $data=$request->all();\n $rules=[\n 'video' =>'mimes:mpeg,ogg,mp4,webm,3gp,mov,flv,avi,wmv,ts|max:100040|required'];\n $validator = Validator($data,$rules);\n\n\n $row = new Video;\n $input = $request->all();\n\n $file = $request->file('file');\n\n $attr = array(\n 'file' => 'File',\n\n );\n $rules = array(\n 'file' => 'required|mimes:mpeg,ogg,mp4,webm,3gp,mov,flv,avi,wmv,ts|max:100040',\n );\n\n $this->validate($request, $rules);\n $validator = Validator::make($input, $rules);\n $validator->setAttributeNames($attr);\n\n $fileName = $file->getClientOriginalName();\n $uploaded = Storage::putFileAs('public/video', $request->file('file'), $fileName);\n\n\n if($uploaded){\n\n $row->video_name = $fileName;\n $row->title = $request->get('title');\n $row->created_at = Carbon::now();\n $row->save();\n\n }\n $topic = 'test';\n\n fcm()\n ->toTopic(\"test\") // $topic must an string (topic name)\n ->notification([\n 'title' => 'New video has been added ',\n 'body' => 'Check it!!',\n ])\n ->send();\n\n\n //return with successfull message\n return new RedirectResponse(route('admin.videos.index'), ['flash_success' => trans('alerts.backend.videos.created')]);\n }", "public function default_video( $data ) {\r\n\t\t// Get a new video object.\r\n\t\t$video = Videos\\Models\\Video::get();\r\n\r\n\t\t// Setup required properties.\r\n\t\t$video->video_type = 'default';\r\n\t\t$video->author = get_current_user_id();\r\n\t\t$video->video_title = $this->get_value( 'video_title', $data );\r\n\t\t$video->video_slug = $this->get_value( 'video_slug', $data );\r\n\t\t$video->video_duration = $this->get_value( 'video_duration', $data );\r\n\r\n\t\t// Save the video.\r\n\t\treturn $video->save();\r\n\t}", "public function store(VideoRequest $request)\n {\n if($request->file('video')->isValid()){\n $model = new Video;\n $vidName = 'video'.time().'.'.$request->file('video')->getClientOriginalExtension();\n $model->video = $vidName;\n $model->title = $request->get('title');\n $model->description = $request->get('description');\n $model->save();\n $request->file('video')->move(base_path().'/public/upload/videos/',$vidName);\n Session::flash('flash_message','Video Posted!');\n return redirect('admin/videos'); \n }else{\n Session::flash('flash_message','Video File is not valid!');\n }\n }", "public function saveData(){\n if($this->u->isLogged() && $this->u->havePermission('homePage')){\n if(!empty($_POST)){\n // Array for check the keys\n $keys = array('title', 'media_type', 'media_link');\n if($this->s->array_keys_check($keys, $_POST)){\n $title = addslashes($_POST['title']);\n $text = addslashes($_POST['text']);\n $media_type = addslashes($_POST['media_type']);\n $media_link = addslashes($_POST['media_link']);\n $media = \"\";\n if(isset($_POST['active_radio'])){\n $status = \"on\";\n }else{\n $status = \"off\";\n }\n\n // Check medias validate\n if($status == \"on\"){\n if($media_type == 1){\n $youtubeID= $this->s->getYoutubeId($media_link);\n if(!empty($youtubeID)) {\n $media = $youtubeID;\n }else{\n echo json_encode(\"Link do Youtube inválido.\");\n exit;\n }\n }elseif($media_type == 2){\n $oembed_endpoint = 'http://vimeo.com/api/oembed';\n // Grab the video url from the url, or use default\n $video_url = $media_link;\n // Create the URLs\n $xml_url = $oembed_endpoint . '.xml?url=' . rawurlencode($video_url);\n if($this->s->curl_get($xml_url) == '404 Not Found'){\n echo json_encode(\"Link do Vimeo inválido.\");\n exit;\n }else{\n $oembed = simplexml_load_string($this->s->curl_get($xml_url));\n $media = $oembed->video_id;\n }\n }else{\n echo json_encode(\"Tipo de Mídia inválido.\");\n exit;\n }\n }\n $array = array(\n \"status\" => $status,\n \"data\" => array(\n \"title\" => $title,\n \"text\" => $text,\n \"media_type\" => $media_type,\n \"media_link\" => $media_link,\n \"media\" => $media\n )\n );\n\n $this->c->updateConfig('tutorial_advertisement', json_encode($array));\n echo json_encode(true);\n exit;\n }else{\n echo json_encode(\"Dados corrompidos.\");\n exit;\n }\n }\n }\n }", "public function store(VideoFormRequest $request)\n {\n $dataForm = $request->all();\n\n if(valid_file($request))\n {\n $upload = upload_file($request, 'videos');\n\n if($upload){\n $dataForm['file'] = $upload;\n }\n }\n\n $video = $this->video->create($dataForm)->id;\n\n if(!$video) return redirect('/admin/videos')->with('fail', 'Falha ao salvar o vídeo!');\n\n return redirect('/admin/videos')->with('success', 'Vídeo criado com sucesso!');\n }", "public function video_meta_information( $post ) {\n wp_nonce_field( 'video_meta_save', 'video_meta_box' );\n\n $provider = get_post_meta($post->ID, 'provider', true);\n $videoid = get_post_meta($post->ID, 'videoid', true);\n $season = get_post_meta($post->ID, 'season', true);\n $episode = get_post_meta($post->ID, 'episode', true);\n\n require_once(PLUGIN_ROOT. 'includes/tpl/video-meta.tpl.php');\n }", "function getdatavideo($videoid){\n\t\t$id = pg_escape_string($videoid);\n $query = \"SELECT u.username, v.location, v.videoname, v.upvotes, v.downvotes, v.description, v.idusuario, v.videotype \n FROM video v inner join usuario u on u.idusuario = v.idusuario WHERE v.idVideo = '\".$id.\"';\";\n\t\t$link = createConection();\n\t\t$result = pg_exec($link, $query);\n\t\tcloseConection($link);\n\t\treturn $result;\n\t}", "public function store()\n {\n $validation = Validator::make([\n 'videoURL' => request('title'),\n 'votes' => '1'\n ],[\n 'videoURL' => 'required',\n 'votes' => 'required|numeric'\n ]);\n\n\n if($validation->passes()){\n DB::table('videos')->insert([\n 'videoURL' => request('title'),\n 'votes' => '1'\n ]);\n\n return redirect('/videos')\n ->with('successStatus', 'Video was added successfully!');\n }\n else{\n return redirect('/videos/new')\n ->withErrors($validation);\n }\n\n\n }", "public function actionVideo()\n {\n $title = '微站设置/视频设置';\n //title of webpage,you can find title in /web/pub/top.php eg:wechat demo\n $keywords = 'wechat demo';\n //title of webpage,you can find title in /web/pub/top.php eg:''\n $description = '';\n return $this -> render('video',[\n 'title' => $title,//title of webpage,you can find title in the head of /web/pub/top.php\n 'keywords' => $keywords,//keywords of webpage,you can find keywords in the head of /web/pub/top.php\n 'description' => $description//description of webpage,you can find description in the head of /web/pub/top.php\n ]);\n }", "private function storeWatch($video)\n\t{\n\t $this->session->push('watched_video', $video->id);\n\t}", "public function store(Request $request)\n { \n\n $request->validate([\n 'name' => 'required'\n ]);\n\n $url_video = $request->url_video;\n\n $url_video_array = explode(\"/\", $url_video);\n\n if(Str::contains($url_video, 'youtube')) {\n $url_video_id = $url_video_array[4];\n $url_thumbail = 'https://img.youtube.com/vi/'.$url_video_id.'/0.jpg';\n } \n\n if(Str::contains($url_video, 'vimeo')) {\n $url_video_id = $url_video_array[4];\n $hash = unserialize(file_get_contents(\"https://vimeo.com/api/v2/video/\".$url_video_id.\".php\"));\n $url_thumbail_preview = $hash[0]['thumbnail_large'];\n $url_thumbail = substr_replace( $url_thumbail_preview, \"480x360\", -3);\n } \n\n $video = Video::create([\n\n 'name' => $request->name,\n 'date_public' => $request->date_public,\n 'status' => $request->status,\n 'category_id' => $request->category_id,\n 'url_video' => $url_video,\n 'url_thumbail' => $url_thumbail\n ]);\n\n return redirect()->route('admin.videos.edit', $video)->with('info', 'El video se creó con éxito');\n }", "function westreamuploadplug() {\r\n ?>\r\n\t<br><br>\r\n <table>\r\n <form action=\"<?php echo $PHP_SELF;?>\" method=\"post\" enctype=\"multipart/form-data\" >\r\n <tr>\r\n <td>\r\n Uploader: <input type=\"text\" name=\"username\" size=\"20\">\r\n </td>\r\n </tr>\r\n <tr>\r\n <td>\r\n <label for=\"file\">Filename:</label>\r\n <input type=\"file\" name=\"file\" id=\"file\" size=\"40\" multiple accept='video/*'/><br />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td> \r\n <input type=\"submit\" name=\"submit\" value=\"Submit\" />\r\n </td>\r\n </tr>\r\n </form>\r\n </table>\r\n <?php\r\n global $wpdb;\r\n $sql_create_table = \"CREATE TABLE IF NOT EXISTS `videos` (\r\n `id` int(11) NOT NULL AUTO_INCREMENT,\r\n `title` varchar(20) NOT NULL,\r\n `url` varchar(100) NOT NULL,\r\n `user` varchar(20) NOT NULL,\r\n activity_date datetime NOT NULL default '0000-00-00 00:00:00',\r\n PRIMARY KEY (`id`),\r\n UNIQUE KEY `id` (`id`)\r\n ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;\";\r\nrequire_once(ABSPATH . 'wp-admin/upgrade-functions.php');\r\ndbDelta( $sql_create_table );\r\n\r\nini_set('upload_max_filesize', '500M');\r\nini_set('post_max_size', '500M');\r\nini_set('max_input_time', 500);\r\nini_set('max_execution_time', 500);\r\nini_set('memory_limit', '1024M');\r\nini_set(\"session.gc_maxlifetime\",\"10800\");\r\n\r\n\r\n$upload_dir = wp_upload_dir();\r\n$upload_dir = $upload_dir['basedir'] . \"/westreamvid\";\r\n$upload_dircheck = wp_mkdir_p($upload_dir); \r\n\r\nif(isset($_POST['submit'])){\r\n if (file_exists(\"../wp-content/uploads/uploads/westreamvid/\" . $_FILES[\"file\"][\"name\"]))\r\n {\r\n echo $_FILES[\"file\"][\"name\"] . \" already exists. \";\r\n }\r\n else\r\n {\r\n $title = $_FILES[\"file\"][\"name\"];\r\n $username = $_POST[\"username\"];\r\n $time = date('Y-m-d H:i:s');\r\n move_uploaded_file($_FILES[\"file\"][\"tmp_name\"],\"../wp-content/uploads/westreamvid/\" . $title);\r\n $url = \"../wp-content/uploads/westreamvid/\" . $_FILES[\"file\"][\"name\"];\r\n $wpdb->query(\"INSERT INTO videos VALUE('','$title','$url','$username','$time')\");\r\n echo 'Preview: <br><video width=\"320\" height=\"240\" controls>\r\n <source src=\"../wp-content/uploads/westreamvid/'. $_FILES[\"file\"][\"name\"].'\" type=\"video/ogg\">\r\n <source src=\"../wp-content/uploads/westreamvid/'. $_FILES[\"file\"][\"name\"].'\" type=\"video/mp4\">\r\n <source src=\"../wp-content/uploads/westreamvid/'. $_FILES[\"file\"][\"name\"].'\" type=\"video/webm\">\r\n <object data=\"../wp-content/uploads/westreamvid/'. $_FILES[\"file\"][\"name\"].'\" width=\"320\" height=\"240\">\r\n <embed width=\"320\" height=\"240\" src=\"../wp-content/uploads/westreamvid/'. $_FILES[\"file\"][\"name\"].'\"></object></video>';\r\n \r\n }\r\n}\r\n}", "function grab_video_vine($url) {\n $vId = explode('/', $url);\n $vTitle = get_vine_title($url);\n $video = array();\n $video[0]['index'] = 1;\n $video[0]['video_id'] = $vId[4];\n $video[0]['title'] = (string) $vTitle;\n $video[0]['duration'] = 'Unknown';\n $video[0]['video_source'] = 'Vine';\n\n return $video;\n}", "function insertVideo() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $auth = $this->getAuthorization();\n $video = json_decode($_POST['json'], true);\n\t $userId = $video['user_id'];\n\n if (!$this->validateAuthorization($userId, $auth)) {\n $this->response('', 406);\n }\n\n if (!isset($_FILES['upfile']['error']) || is_array($_FILES['upfile']['error'])) {\n $this->response(json_encode(array(\"Error\" => 'Invalid parameters')), 400);\n }\n\n // You should also check filesize here. \n if ($_FILES['upfile']['size'] > 100000000000) {\n $this->response(json_encode(array(\"Error\" => 'Exceeded filesize limit.')), 400);\n }\n \n $videoFileType = pathinfo($_FILES['upfile']['name'],PATHINFO_EXTENSION);\n \n if (!in_array($videoFileType, array(\"mp4\", \"wmv\"))) {\n $this->response(json_encode(array(\"Error\" => \"Invalid file format.\")), 400);\n }\n\n $filePath = '../video/' . $_FILES['upfile']['name'];\n\n if ($_FILES['upfile']['name'] == \"\" or file_exists($filePath) ) {\n $this->response(json_encode(array(\"Error\" => $_FILES['upfile']['name'])), 400);\n }\n \n if (!move_uploaded_file($_FILES['upfile']['tmp_name'], $filePath)) {\n $this->response(json_encode(array(\"Error\" => \"Failed to move uploaded file.\")), 400);\n }\n\n $video['path_of_video'] = $filePath;\n $columns = 'user_id, title, description, path_of_video';\n $values = $userId . ',\\'' . $video['title'] . '\\',\\'' . $video['description'] . '\\',\\'' . $video['path_of_video'] . \"'\";\n $query = \"insert into videos(\". $columns . \") VALUES(\". $values . \");\";\n\t error_log($query);\n \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Video Posted.\", \"data\" => $video);\n $this->response(json_encode($success),200);\n }", "public function addVideo(){\n if (isset($_POST[\"add_video\"])) {\n $movie = $this->model('Movie');\n $system = $this->model('System');\n\n $video_name = $_POST[\"video_title\"];\n $video_url = $_POST[\"video_url\"];\n $video_category = $_POST[\"selected_category\"];\n $video_description = $_POST[\"video_description\"];\n $video_sef_url = $system->seflink($video_name);\n\n $movie->addVideo($video_name,$video_url,$video_category,$video_description,$video_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/videos');\n }", "function getVideos($url, $width, $height, $config) {\r\n \t$video = '';\r\n\r\n\t\t$url = trim($url);\r\n\t\t$url = str_replace('http://', '', $url);\r\n\r\n // youtube\r\n if (strpos($url,'outube.com')) {\r\n $found = 1;\r\n $split = explode('=',$url);\r\n $video = 'new SWFObject(\"http://www.youtube.com/v/'.$split[1].'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");';\r\n // Dailymotion\r\n } elseif (strpos($url,'ailymotion.co')) {\r\n $found = 1;\r\n $video = 'new SWFObject(\"http://'.$url.'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");';\r\n // video.google.com/.de\r\n } elseif (strpos($url,'ideo.google.')) {\r\n $found = 1; \r\n $split = explode('=',$url);\r\n $video = 'new SWFObject(\"http://video.google.com/googleplayer.swf?docId='.$split[1].'&hl='.$GLOBALS['TSFE']->lang.'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n // Metacafe\r\n } elseif (strpos($url,'metacafe.')) {\r\n $found = 1;\r\n $split = explode('/',$url);\r\n $video = 'new SWFObject(\"http://www.metacafe.com/fplayer/'.$split[2].'/.swf\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n // MyVideo.de\r\n } elseif (strpos($url,'yvideo.de')) {\r\n $found = 1;\r\n $split = explode('/',$url);\r\n $video = 'new SWFObject(\"http://www.myvideo.de/movie/'.$split[2].'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n // clipfish.de\r\n\t\t} elseif (strpos($url,'lipfish.de')) {\r\n $found = 1;\r\n $split = explode('=',$url);\r\n $video = 'new SWFObject(\"http://www.clipfish.de/videoplayer.swf?as=0&videoid='.$split[1].'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n\t\t// sevenload\r\n\t\t} elseif (strpos($url,'sevenload.com')) {\r\n $found = 1;\r\n $split = explode('/',$url);\r\n $video = 'new SWFObject(\"http://de.sevenload.com/pl/'.$split[2].'/'.$width.'x'.$height.'/swf\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n } \r\n\r\n\t\treturn $video;\r\n\t}", "public function saveVideo(Request $request) {\n $remote_connection = $this->remote_connection;\n\n $session = $request->input('session');\n $room_type = $request->input('room_type');\n $room_name = $request->input('room_name');\n $stream = $request->input('stream');\n $rec_dir = $request->input('rec_dir');\n\n $video_extension = '.webm';\n $audio_extension = '.ogg';\n\n $video_url = $rec_dir . '/' . $session . '-' . $stream . '-final' . $video_extension;\n $audio_url = $rec_dir . '/' . $session . '-' . $stream . $audio_extension;\n\n $video_room = VideoRoom::where('session_id', $session)->first();\n\n $video_id = $video_room->id;\n\n $video_details = json_encode(array('video_id' => $video_id, 'video' => $video_url, 'audio' => $audio_url), JSON_FORCE_OBJECT);\n\n //For Main video\n //$convert_to_webm_command = '/opt/janus/bin/janus-pp-rec /var/www/html/recordings/' . $session . '-' . $stream . '-video.mjr /var/www/html/recordings/' . $session . '-' . $stream . '-video.webm';\n //$convert_to_ogg_command = '/opt/janus/bin/janus-pp-rec /var/www/html/recordings/' . $session . '-' . $stream . '-audio.mjr /var/www/html/recordings/' . $session . '-' . $stream . '-audio.ogg';\n //$merge_webm_and_ogg_command = 'ffmpeg -i /var/www/html/recordings/' . $stream . '.webm -i /var/www/html/recordings/' . $stream . '.ogg -c:v copy -c:a libvorbis -strict experimental /var/www/html/recordings/' . $stream . '-final.webm';\n //$merge_webm_and_ogg_command = 'ffmpeg -i /var/www/html/recordings/' . $session . '-' . $stream . '-video.webm -i /var/www/html/recordings/' . $session . '-' . $stream . '-audio.ogg -c:v copy -shortest /var/www/html/recordings/' . $session . '-' . $stream . '-final.webm';\n\n //For Screenshare video\n //$convert_screenshare_to_webm_command = '/opt/janus/bin/janus-pp-rec /var/www/html/recordings/screenshare-'. $session .'-'. $stream .'-video.mjr /var/www/html/recordings/screenshare-'. $session . '-' . $stream . '-video.webm';\n //Execute main video scripts\n //$remote_connection->exec($convert_to_webm_command . ';' . $convert_to_ogg_command . ';' . $merge_webm_and_ogg_command);\n //$remote_connection->exec($merge_webm_and_ogg_command);\n //Execute main video scripts\n //$remote_connection->exec($convert_screenshare_to_webm_command);\n //$check_if_screenshare_exists = '[ -f /var/www/html/recordings/' . $session . '-screenshare-' . $stream . '-video.mjr ] && echo \"File exists\" || echo \"File doesn not exist\"';\n //$file_exists = $remote_connection->exec($check_if_screenshare_exists);\n //if ($file_exists === 'File exists') {\n //}\n\n return $video_details;\n }", "public function getIdVideo(){\n\t\treturn $this->idVideo;\t\n\t}", "public function store(VideoRequest $request)\n\t{\t\n\t\t$resource = new Resource;\n //dump($request->all());\n\t\t$category_id = $request->input('category_id');//栏目\n $title = rtrim($request->input('title'));//标题\n $content = rtrim($request->input('content'));//内容\n\t\t$path = rtrim($request->input('path'));//视频存放路径\n\t\t$duration = rtrim($request->input('duration'));//视频时长\n\t\t$author = rtrim($request->input('author'));//作者\n $size = $request->input('size');//视频大小\n\t\t\n\t\t//视频,封面公共名字部分\n $name = time().$this->nrand();\n\n //创建文件夹用来存放上传文件\n $dirname = date('Y-m-d' , time());\n if(!is_dir(base_path('public/uploads/videos/'.$dirname))) {\n mkdir(base_path('public/uploads/videos/'.$dirname,0777));\n }\n\n //获取图片\n $cover = $request->file('cover');\n\t\t\n\t\t//$size = $cover->getClientSize();//视频大小\n \n\t\tif($cover->isValid()) {\n //dd($cover->getMimeType());\n switch($cover->getMimeType()){\n case 'image/jpeg':\n $ext = '.jpeg';\n break;\n case 'image/jpg':\n $ext = '.jpg';\n break;\n case 'image/png':\n $ext = '.png';\n break;\n default:\n return back()->withInput()->with('notify_error' , '图片类型不符!');\n }\n $name_cover = $name.$ext;\n\n $cover->move(base_path('public/uploads/videos/'.$dirname) , $name_cover);\n $resource->cover = '/uploads/videos/'.$dirname.'/'.$name_cover;\n }\n\t\t\n $resource->title = $title;\n $resource->content = $content;\n\t\t$resource->path = $path;\n\t\t$resource->duration = $duration;\n\t\t$resource->size = $size;\n\t\t$resource->category_id = $category_id;\n\t\t$resource->type_id = 1;\n\t\t$resource->user_id = Auth::user()->id;\n\t\t$resource->author = $author;\n\t\t\n\t\tif(!$resource->save()) {\n\t\t\treturn back()->withInput()->with('notify_error' , '添加失败!');\n\t\t}\n\t\t\n\t\t$id = Resource::where('path' , $path)->first()->id;\n\t\t\n\t\t//这里是添加提示消息\n\t\t$this->record('create',$id,1);\n\t\t\n\t\treturn redirect('donkey/admin/video/index')->with('notify_success' , '添加成功!');\n \n //获取视频文件\n\n\t}", "public function custom_video( $data ) {\r\n\t\t// Get a new video object.\r\n\t\t$video = Videos\\Models\\Custom_Video::get();\r\n\r\n\t\t// Setup required properties.\r\n\t\t$video->video_type = 'custom';\r\n\t\t$video->author = get_current_user_id();\r\n\t\t$video->video_title = $this->get_value( 'video_title', $data );\r\n\t\t$video->video_slug = $this->get_value( 'video_slug', $data );\r\n\t\t$video->video_duration = $this->get_value( 'video_duration', $data );\r\n\t\t$video->video_host = $this->get_value( 'video_host', $data, 'youtube' );\r\n\t\t$video->video_url = $this->get_value( 'video_url', $data );\r\n\t\t$video->video_start = $this->get_value( 'video_start', $data, false );\r\n\t\t$video->video_end = $this->get_value( 'video_end', $data, false );\r\n\t\t$video->video_start_time = $this->get_value( 'video_start_time', $data );\r\n\t\t$video->video_end_time = $this->get_value( 'video_end_time', $data );\r\n\r\n\t\t// Create or update video.\r\n\t\t$video_id = $video->save();\r\n\r\n\t\t// Send error response.\r\n\t\tif ( $video->is_error() ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Upload thumb.\r\n\t\tif ( ! empty( $data['import_thumb'] ) && ! empty( $data['thumbnail']['url'] ) ) {\r\n\t\t\t$thumb_id = $this->upload_thumb(\r\n\t\t\t\t$data['thumbnail']['url'],\r\n\t\t\t\t$this->get_value( 'video_title', $data ),\r\n\t\t\t\t$video_id\r\n\t\t\t);\r\n\r\n\t\t\tif ( ! empty( $thumb_id ) ) {\r\n\t\t\t\t// Get the new video object.\r\n\t\t\t\t$video = Videos\\Controller::get()->get_video( $video_id );\r\n\r\n\t\t\t\t// Set the thumbnail.\r\n\t\t\t\t$video->set_thumbnail( $thumb_id );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $video_id;\r\n\t}", "public function get_videos()\r\n\t\t{\r\n\t\t\t$videos = $this->obj->result;\r\n\t\t\treturn $videos;\r\n\t\t}", "public function getHTML5Video() {\r\n if (empty($this->mime) && file_exists(RP_DOWNLOAD_DIR . $this->filepath)) {\r\n $this->getThumbnail(); \r\n }\r\n \r\n $mime = explode(\"/\", $this->mime); \r\n \r\n if ($mime[0] != \"video\") {\r\n return false;\r\n }\r\n \r\n $avlib = self::getAVLib();\r\n \r\n $videos = array();\r\n \r\n set_time_limit(1200);\r\n \r\n /**\r\n * Mp4\r\n */\r\n \r\n $dstfile = sprintf(\"%s/%s.v3.mp4\", pathinfo($this->filepath, PATHINFO_DIRNAME), pathinfo($this->filepath, PATHINFO_FILENAME));\r\n \r\n if (!file_exists(RP_DOWNLOAD_DIR . $dstfile)) {\r\n exec(sprintf(\"%s -i %s%s -vcodec h264 -acodec aac -strict -2 -ar 64k %s%s\", $avlib, RP_DOWNLOAD_DIR, $this->filepath, RP_DOWNLOAD_DIR, $dstfile), $return);\r\n }\r\n \r\n $finfo = finfo_open(FILEINFO_MIME_TYPE); \r\n $mime = finfo_file($finfo, RP_DOWNLOAD_DIR . $dstfile);\r\n \r\n $videos['mp4'] = array(\r\n \"absolute\" => RP_DOWNLOAD_DIR . $dstfile,\r\n \"file\" => $dstfile,\r\n \"size\" => filesize(RP_DOWNLOAD_DIR . $dstfile),\r\n \"mime\" => $mime\r\n );\r\n \r\n /**\r\n * WebM\r\n */\r\n \r\n $dstfile = sprintf(\"%s/%s.v3.webm\", pathinfo($this->filepath, PATHINFO_DIRNAME), pathinfo($this->filepath, PATHINFO_FILENAME));\r\n \r\n if (!file_exists(RP_DOWNLOAD_DIR . $dstfile)) {\r\n exec(sprintf(\"%s -i %s%s -acodec libvorbis -ac 2 -ab 96k -ar 44100 %s%s\", $avlib, RP_DOWNLOAD_DIR, $this->filepath, RP_DOWNLOAD_DIR, $dstfile), $return);\r\n }\r\n \r\n $finfo = finfo_open(FILEINFO_MIME_TYPE); \r\n $mime = finfo_file($finfo, RP_DOWNLOAD_DIR . $dstfile);\r\n \r\n $videos['webm'] = array(\r\n \"absolute\" => RP_DOWNLOAD_DIR . $dstfile,\r\n \"file\" => $dstfile,\r\n \"size\" => filesize(RP_DOWNLOAD_DIR . $dstfile),\r\n \"mime\" => $mime\r\n );\r\n \r\n return $videos;\r\n }", "function emvideo_dotsub_data($field, $item) {\n // Initialize the data array.\n $data = array();\n $data['emvideo_dotsub_version'] = EMVIDEO_DOTSUB_DATA_VERSION;\n\n // We are using oEmbed to retrieve a standard set of data from the provider.\n // You should change the URL as specified by the example provider.\n // If the example provider does not support oEmbed, you must remove this\n // section entirely, or rewrite it to use their API.\n // See http://oembed.com/ for for information.\n// $xml = emfield_request_xml('example', 'http://www.example.com/api/oembed.xml?url=http%3A//www.example.com/video/'. $item['value'], array(), TRUE, FALSE, $item['value']);\n // This stores a URL to the video's thumbnail.\n// $data['thumbnail'] = $xml['OEMBED']['THUMBNAIL_URL'][0];\n\n // Gather info about the item's raw flash video.\n // RSS / MRSS feeds with the item would have enough info.\n // Alternatively try getting the minimum from an HTTP get.\n $url = 'http://dotsub.com/static/players/portalplayer.swf?plugins=dotsub&uuid='. $item['value'];\n \n $response = emfield_request_header('dotsub', $url);\n \n if ($response->code == 200) {\n // Don't give the 303 path.\n $data['flash']['url'] = $url;\n $data['flash']['size'] = $response->headers['Content-Length'];\n $data['flash']['mime'] = $response->headers['Content-Type'];\n }\n\n return $data;\n}", "public function create_video() {\n $args = array (\n 'labels' => array(\n 'name' => __( 'Videos' ),\n 'singular_name' => __( 'Videos' ),\n 'add_new' => __( 'Add Video' ),\n 'add_new_item' => __( 'Add New Video' ),\n 'edit_item' => __( 'Edit Video' ),\n 'new_item' => __( 'Add New Video' ),\n 'view_item' => __( 'View Video' ),\n 'search_items' => __( 'Search Videos' ),\n 'not_found' => __( 'No Videos Found' ),\n 'not_found_in_trash' => __( 'No Videos found in trash. ' )\n\t ),\n 'has_archive' => true,\n 'menu_icon' => 'dashicons-format-video',\n 'public' => true,\n 'show_ui' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'rewrite' => true,\n 'menu_position' => 20,\n 'supports' => array('title', 'thumbnail', 'editor'),\n );\n register_post_type('video', $args);\n }", "public function video( Request $request )\n {\n $input = $request->all();\n $validator = Validator::make( $input,[\n 'video_link' => 'required',\n 'video_new_name' => 'required',\n ],[\n 'video_link.required' => '请输入视频链接!',\n 'video_new_name.required' => '请输入保存视频的新名称!',\n ]);\n if ( $validator->fails() ){\n return redirect('home' )->withErrors( $validator )->withInput();\n }\n $link_address = Arr::get( $input,'video_link');\n $baseUrl = trim( dirname( $link_address,1) );\n $content = '';\n try{\n $links = file( $link_address );\n foreach ( $links as $link ){\n if ( $link[0] != '#' ){\n $content .= file_get_contents($baseUrl . '/' . trim($link));\n }\n }\n Storage::disk( 'public' )->put('video.txt',$content);\n $file_path = storage_path( 'app/public/video.txt' );\n return response()->download($file_path,Arr::get( $input,'video_new_name' ) . '.mp4');\n }catch (\\Exception $exception){\n $validator->errors()->add('auth_url','链接解析失败,请重试!');\n return redirect('home' )->withErrors( $validator )->withInput();\n }\n\n }", "public function save() {\n $file = JRequest::getVar('jform', null, 'files', 'array');\n //Import filesystem libraries. Perhaps not necessary, but does not hurt\n jimport('joomla.filesystem.file');\n\n $type = $_POST['type'];\n $coid = $_POST['coid'];\n $video = json_decode(apiGetDetailsVideo($coid));\n $status = $video->status;\n\n switch ($type) {\n case \"cc\":\n $licenseType = \"CREATIVE_COMMONS\";\n $ccType = $_POST['cc_type'];\n break;\n\n case \"ppv\":\n $licenseType = \"TEMPLATE_LICENSE\";\n $paymentMode = \"PAYPERVIEW\";\n $pricePerView = $_POST[\"amount\"] . \",\" . $_POST['amount_cent'];\n $pricePerViewCurrency = $_POST[\"currency\"];\n break;\n\n case \"free\":\n $licenseType = \"TEMPLATE_LICENSE\";\n $paymentMode = \"FREEOFCHARGE\";\n break;\n }\n\n $post = array();\n if ($licenseType != \"\")\n $post[\"licenseType\"] = $licenseType;\n if ($paymentMode != \"\")\n $post[\"paymentMode\"] = $paymentMode;\n if ($ccType != \"\")\n $post[\"ccType\"] = $ccType;\n if ($pricePerView != \"\")\n $post[\"pricePerView\"] = $pricePerView;\n if ($pricePerViewCurrency != \"\")\n $post[\"pricePerViewCurrency\"] = $pricePerViewCurrency;\n\n $post = array(\"licenseType\" => $licenseType,\n \"paymentMode\" => $paymentMode,\n \"ccType\" => $ccType,\n \"pricePerView\" => $pricePerView,\n \"pricePerViewCurrency\" => $pricePerViewCurrency);\n if ($status != \"OWNED\") {\n $acquid = $video->relationId;\n $response = apiPublishAcquiredOnShowtime($coid, $acquid, $post);\n } else {\n $response = apiPublishOnShowtime($coid, $post);\n }\n\n\n $state = \"showtime\";\n $array_response = json_decode($response);\n if ($array_response->result == \"SUCCESS\") {\n $this->setRedirect('index.php?option=com_wimtvpro&view=mymedias&sync=true', false);\n } else {\n $error = \"\";\n foreach ($array_response->messages as $message) {\n $error .= $message->field . \":\" . $message->message;\n if ($message->field==\"paymentMode\")\n {\n $error.=\"<a style='margin-left:30px;' target='_BLANK' href='index.php?option=com_wimtvpro&view=settings&update=1'>\".JText::_('COM_WITVPRO_ERROR_WIMTVPRO_PAYMENTMODE').\"</a><BR/>\";\n }\n else\n {\n $error.= \"<br/>\";\n }\n }\n JError::raiseWarning(100, $error);\n $this->setRedirect('index.php?option=com_wimtvpro&view=putVideos&layout=edit&coid=' . $coid . '&put=' . $type, false);\n }\n }", "public function store(VideoRequest $request)\n {\n Video::create($request->all());\n Flash::success('El video se ha creado satisfactoriamente')->important();\n return redirect()->route('shoes.video.index');\n }", "function getVideo()\n {\n return $this->video;\n }", "public function __construct(){\n $this->db=Conectar::con();\n $this->videos=array();\n \n }", "function video_playable($id)\r\n{\r\n global $cbvideo,$userquery;\r\n\r\n if(isset($_POST['watch_protected_video']))\r\n $video_password = mysql_clean(post('video_password'));\r\n else\r\n $video_password = '';\r\n\r\n if(!is_array($id))\r\n $vdo = $cbvideo->get_video($id);\r\n else\r\n $vdo = $id;\r\n $uid = userid();\r\n if(!$vdo)\r\n {\r\n e(lang(\"class_vdo_del_err\"));\r\n return false;\r\n }elseif($vdo['status']!='Successful')\r\n {\r\n e(lang(\"this_vdo_not_working\"));\r\n if(!has_access('admin_access',TRUE))\r\n return false;\r\n else\r\n return true;\r\n }elseif($vdo['broadcast']=='private'\r\n && !$userquery->is_confirmed_friend($vdo['userid'],userid())\r\n && !is_video_user($vdo)\r\n && !has_access('video_moderation',true)\r\n && $vdo['userid']!=$uid){\r\n e(lang('private_video_error'));\r\n return false;\r\n }elseif($vdo['active'] == 'pen'){\r\n e(lang(\"video_in_pending_list\"));\r\n if(has_access('admin_access',TRUE) || $vdo['userid'] == userid())\r\n return true;\r\n else\r\n return false;\r\n }elseif($vdo['broadcast']=='logged'\r\n && !userid()\r\n && !has_access('video_moderation',true)\r\n && $vdo['userid']!=$uid){\r\n e(lang('not_logged_video_error'));\r\n return false;\r\n }elseif($vdo['active']=='no' )\r\n {\r\n e(lang(\"vdo_iac_msg\"));\r\n if(!has_access('admin_access',TRUE))\r\n return false;\r\n else\r\n return true;\r\n }\r\n //No Checking for video password\r\n elseif($vdo['video_password']\r\n && $vdo['broadcast']=='unlisted'\r\n && $vdo['video_password']!=$video_password\r\n && !has_access('video_moderation',true)\r\n && $vdo['userid']!=$uid)\r\n {\r\n if(!$video_password)\r\n e(lang(\"video_pass_protected\"));\r\n else\r\n e(lang(\"invalid_video_password\"));\r\n template_files(\"blocks/watch_video/video_password.html\",false,false);\r\n }\r\n else\r\n {\r\n $funcs = cb_get_functions('watch_video');\r\n\r\n if($funcs)\r\n foreach($funcs as $func)\r\n {\r\n $data = $func['func']($vdo);\r\n if($data)\r\n return $data;\r\n }\r\n return true;\r\n }\r\n}", "public function store(Request $request)\n {\n $request->validate([\n 'title' => 'required',\n 'image' => 'image|required',\n 'video' => 'required',\n ]);\n\n $randomPath = Str::random(16);\n\n $videoPath = $randomPath . '.' . $request->video->getClientOriginalExtension();\n $imagePath = $randomPath . '.' . $request->image->getClientOriginalExtension();\n\n $image = Image::make($request->image)->resize(320, 180);\n\n $path = Storage::put($imagePath, $image->stream());\n\n $request->video->storeAs('/',$videoPath,'public');\n\n $video=Video::create([\n 'disk' => 'public',\n 'video_path' => $videoPath,\n 'image_path' => $imagePath,\n 'title' => $request->title,\n 'user_id' => auth()->id(),\n ]);\n\n $view=View::create([\n 'video_id' => $video->id,\n 'user_id' => auth()->id(),\n 'views_number' => 0,\n ]);\n\n ConvertVideoForStreaming::dispatch($video);\n\n return redirect()->back()->with(\n 'success',\n 'loading'\n );\n }", "public function vodVideosListing()\n\t\t\t{\n\t\t\t\t$cls\t\t\t=\tnew adminUser();\n\t\t\t\t$cls->unsetSelectionRetention(array($this->getPageName()));\n\t\t\t\t$user\t\t\t\t\t\t=\tnew userManagement();\n\t\t\t\t$tutor\t\t\t=\t $user->getInstructors();\n\t\t\t\t$instmnt\t\t=\t new instrument();\n\t\t\t\t$instrument_list=\t $instmnt->getAllInstruments();\n\t\t\t\t$courses\t\t=\t new userCourse();\n\t\t\t\t$course_list\t=\t$courses->getAllTaughtCourses();\n\t\t\t\t\n\t\t\t\tunset($_SESSION[\"txtCourse\"]);\n\t\t\t\tunset($_SESSION[\"txtInst\"]);\n\t\t\t\tunset($_SESSION['instrument_id']);\n\t\t\t\t\t\t\t\n\t\t\t\tif(!empty($_POST[\"txtInst\"])){\n\t\t\t\t\t$_SESSION[\"txtInst\"]\t=\ttrim($_POST[\"txtInst\"]);\n\t\t\t\t}\n\t\t\t\tif(!empty($_POST[\"txtCourse\"])){\n\t\t\t\t\t$_SESSION[\"txtCourse\"]\t=\ttrim($_POST[\"txtCourse\"]);\n\t\t\t\t}\n\t\t\t\tif(!empty($_POST['instrument_id'])){\n\t\t\t\t$_SESSION[\"instrument_id\"]\t\t=\t$_POST[\"instrument_id\"];\n\t\t\t\t}\t\t\n\t\t\t\t\n\t\t\t\t$txtInst\t\t=\t$_POST[\"txtInst\"];\n\t\t\t\t$txtCourse\t\t=\t$_POST[\"txtCourse\"];\n\t\t\t\t$instrument_id\t=\t$_POST[\"instrument_id\"];\n\t\t\t\n\t\t\t\treturn array(\"tutor\"=>$tutor,\"instrument\"=>$instrument_list,\"course\"=>$course_list,\"txtInst\"=>$txtInst,\"txtCourse\"=>$txtCourse,\"instrument_id\"=>$instrument_id);\n\t\t\t}", "function showvideosmodel() {\n\t\tglobal $option, $mainframe, $db;\n\t\t$rs_showupload = '';\n\t\t$strVideoCount = 0;\n\t\t## To store and retrieve filter variables that are stored with the session\n\t\t$filter_order = $mainframe->getUserStateFromRequest($option . 'filter_order_adminvideos', 'filter_order', 'ordering', 'cmd');\n\t\t$filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'filter_order_Dir_adminvideos', 'filter_order_Dir', 'asc', 'word');\n\t\t$search = $mainframe->getUserStateFromRequest($option . 'search', 'search', '', 'string');\n $search1 = $search;\n\t\t$state_filter = $mainframe->getUserStateFromRequest($option . 'filter_state', 'filter_state', '', 'int');\n\t\t$featured_filter = $mainframe->getUserStateFromRequest($option . 'filter_featured', 'filter_featured', '', 'string');\n\t\t$category_filter = $mainframe->getUserStateFromRequest($option . 'filter_category', 'filter_category', '', '');\n\t\t## page navigation\n\t\t## Default List Limit\n\t\t$limit = $mainframe->getUserStateFromRequest($option . '.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');\n\t\t$limitstart = $mainframe->getUserStateFromRequest($option . '.limitstart', 'limitstart', 0, 'int');\n\n\t\t## set user = admin for admin videos\n\t\t$strAdmin = (JRequest::getVar('user', '', 'get')) ? JRequest::getVar('user', '', 'get') : '';\n\t\t## get logged user\n\t\t$user = JFactory::getUser();\n\t\t$userid = $user->get('id');\n\t\t## get user groups from joomla version above 1.6.0\n\t\tif(version_compare(JVERSION,'1.6.0','ge'))\n\t\t{\n\t\t\t## query items are returned as an associative array\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select('g.id AS group_id')\n\t\t\t\t ->from('#__usergroups AS g')\n\t\t\t\t ->leftJoin('#__user_usergroup_map AS map ON map.group_id = g.id')\n\t\t\t\t ->where('map.user_id = ' . (int) $userid);\n\t\t\t$db->setQuery($query);\n\t\t\t$arrUserGroup = $db->loadObject();\n\n\t\t\t/**\n\t\t\t * User group\n\t\t\t * 6 - Manager\n\t\t\t * 7 - Administrator\n\t\t\t * 8 - Super Users\n\t\t\t */\n\n\t\t\t## for videos added by admin\n\t\t\tif($strAdmin == 'admin') {\n\t\t\t\tif ($arrUserGroup->group_id == '8')\n\t\t\t\t$where = \"WHERE a.usergroupid IN (6,7,8)\";\n\t\t\t\telse\n\t\t\t\t$where = \"WHERE a.usergroupid='$arrUserGroup->group_id' AND a.memberid = $userid\";\n\t\t\t\t## for videos added by member\n\t\t\t} else {\n\t\t\t\t$where = \"WHERE a.usergroupid NOT IN (6,7,8) AND a.memberid != '$userid'\";\n\t\t\t}\n\t\t}\n\t\t## get user groups from joomla version below 1.6.0\n\t\telse\n\t\t{\n\t\t\t$query = 'SELECT gid from #__users\n WHERE id = ' . (int) $userid;\n\t\t\t$db->setQuery($query);\n\t\t\t$arrUserGroup = $db->loadObject();\n\t\t\t## for videos added by admin\n\t\t\tif($strAdmin == 'admin')\n\t\t\t{\n\t\t\t\tif ($arrUserGroup->gid == 25)\n\t\t\t\t{\n\t\t\t\t\t$where = \"WHERE c.gid='25'\";\n\t\t\t\t}\n\t\t\t\telse if($arrUserGroup->gid == 24)\n\t\t\t\t{\n\t\t\t\t\t$where = \"WHERE c.gid='24'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t## for videos added by member\n\t\t\telse\n\t\t\t{\n\t\t\t\t$where = \"WHERE c.gid NOT IN (24,25)\";\n\t\t\t}\n\t\t}\n\t\t$query = \"SELECT `id`,`member_id`,`category`,`seo_category`,`parent_id`,`ordering`,`published`\n \t\t FROM #__hdflv_category where published=1\";\n\t\t$db->setQuery($query);\n\t\t$rs_showplaylistname = $db->loadObjectList();\n\n\t\t/**\n\t\t * select videos details\n\t\t * for filter by order,title,category,viewed,video link,thumb link,order,featured,id\n\t\t * initially filter by order\n\t\t */\n\t\tif ($filter_order)\n\t\t{\n\t\t\t## for select videos details\n\t\t\t$strMainQuery = \"SELECT distinct(d.videoid) as cvid,a.`id`, a.`memberid`, a.`published`, a.`title`, a.`seotitle`,\n\t\t\t\t\t\t\t a.`featured`, a.`type`, a.`rate`, a.`ratecount`, a.`times_viewed`, a.`videos`, a.`filepath`,\n\t\t\t\t\t\t\t a.`videourl`, a.`thumburl`, a.`previewurl`, a.`hdurl`, a.`home`, a.`playlistid`, a.`duration`,\n\t\t\t\t\t\t\t a.`ordering`, a.`streamerpath`, a.`streameroption`, a.`postrollads`, a.`prerollads`, a.`midrollads`, a.`imaads`, a.`embedcode`,\n\t\t\t\t\t\t\t a.`description`, a.`targeturl`, a.`download`, a.`prerollid`, a.`postrollid`, a.`created_date`,\n\t\t\t\t\t\t\t a.`addedon`, a.`usergroupid`, a.`tags`, a.`useraccess`,b.category,c.username\n\t\t \t\t\t FROM #__hdflv_upload a\n\t\t \t INNER JOIN `#__users` c\";\n\n\t\t\t## for select user group id\n\t\t\tif(version_compare(JVERSION,'1.6.0','ge'))\n\t\t\t{\n\t\t\t\t$strMainQuery = \"$strMainQuery ON c.id = a.memberid\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$strMainQuery = \"$strMainQuery ON c.id = a.memberid\";\n\t\t\t}\n\n\t\t\t## for select video category and comments\n\t\t\t$strMainQuery = \"$strMainQuery\n\t\t\t\t\t\t\t LEFT JOIN #__hdflv_category b ON a.playlistid=b.id\n \t\t LEFT JOIN #__hdflv_comments d ON d.videoid=a.id\n \t\t $where\";\n\n\t\t}\n\t\t## assign filter variables\n\t\t$lists['order_Dir'] = $filter_order_Dir;\n\t\t$lists['order'] = $filter_order;\n $search = $this->phpSlashes($search);\n\t\t## filtering based on search keyword\n\t\tif ($search)\n\t\t{\n\t\t\t$strMainQuery .= \" AND a.title LIKE '%$search%'\";\n\t\t\t$lists['search'] = $search1;\n\t\t}\n\t\t## filtering based on status\n\t\tif($state_filter) {\n\t\t\tif($state_filter == 1) {\n\t\t\t\t$state_filterval = 1;\n\t\t\t}elseif ($state_filter == 2) {\n\t\t\t\t$state_filterval = 0;\n\t\t\t}else {\n\t\t\t\t$state_filterval = -2;\n\t\t\t}\n\t\t\t$strMainQuery .= \" AND a.published = $state_filterval\";\n\t\t\t$lists['state_filter'] = $state_filter;\n\t\t} else {\n\t\t\t$strMainQuery .= \" AND a.published != -2\";\n\t\t}\n\t\t## filtering based on featured status\n\t\tif($featured_filter) {\n\t\t\t$featured_filterval = ($featured_filter == '1')?'1':'0';\n\t\t\t$strMainQuery .= \" AND a.featured = $featured_filterval\";\n\t\t\t$lists['featured_filter'] = $featured_filter;\n\t\t}\n\t\tif($category_filter) {\n\t\t\t$strMainQuery .= \" AND a.playlistid = $category_filter\";\n\t\t\t$lists['category_filter'] = $category_filter;\n\t\t}\n\t\t\t$strMainQuery .= \" ORDER BY $filter_order $filter_order_Dir\";\n\n\t\t\t$db->setQuery($strMainQuery);\n\t\t\t$arrVideoList = $db->loadObjectList();\n\t\t\t$strTotalVideos = count($arrVideoList);\n\n\t\t\t## set pagination\n\n\t\t\t$pageNav = new JPagination($strTotalVideos, $limitstart, $limit);\n\n\t\t\t$strMainQuery .= \" LIMIT $pageNav->limitstart,$pageNav->limit\";\n\t\t\t$db->setQuery($strMainQuery);\n\t\t\t$arrVideoList = $db->loadObjectList();\n\n\t\t/**\n\t\t * get the most recent database error code\n\t\t * display the last database error message in a standard format\n\t\t *\n\t\t */\n\t\tif ($db->getErrorNum())\n\t\t{\n\t\t\tJError::raiseWarning($db->getErrorNum(), $db->stderr());\n\t\t}\n\n\t\treturn array('pageNav' => $pageNav, 'limitstart' => $limitstart,'lists' => $lists, 'rs_showupload' => $arrVideoList, 'rs_showplaylistname' => $rs_showplaylistname);\n\t}", "public function store(Request $request)\n {\n\n $data = new Video;\n\n $data->title = $request->title;\n $data->description = $request->description;\n\n if ($request->file('file')) {\n // file => video\n $file = $request->file('file');\n $fileName = time() . '.' . $file->getClientOriginalExtension();\n $result = $request->file->move('storage/', $fileName);\n $data->file = $fileName;\n }\n $data->save();\n DB::table('group_videos')->insert([\n 'video_id' => $data->id,\n 'group_id' => $request->group,\n ]);\n\n // DB::insert('insert into group_videos (group_id, video_id)\n // values (?, ?)', [6, 6]);\n\n return redirect()->back();\n }", "public function getVideoCompleteDataById($videoId);", "function sp_add_video ($url, $width = 620, $height = 349) {\n\t\n\t$video_url = @parse_url($url);\n\n\tif ( $video_url['host'] == 'www.youtube.com' || $video_url['host'] == 'youtube.com' ) {\n\t\tparse_str( @parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars );\n\t\t$video = $my_array_of_vars['v'] ;\n\t\t$output .='<iframe width=\"'.$width.'\" height=\"'.$height.'\" src=\"http://www.youtube.com/embed/'.$video.'?rel=0\" frameborder=\"0\" allowfullscreen></iframe>';\n\t}\n\telseif( $video_url['host'] == 'www.youtu.be' || $video_url['host'] == 'youtu.be' ){\n\t\t$video = substr(@parse_url($url, PHP_URL_PATH), 1);\n\t\t$output .='<iframe width=\"'.$width.'\" height=\"'.$height.'\" src=\"http://www.youtube.com/embed/'.$video.'?rel=0\" frameborder=\"0\" allowfullscreen></iframe>';\n\t}\n\telseif( $video_url['host'] == 'www.vimeo.com' || $video_url['host'] == 'vimeo.com' ){\n\t\t$video = (int) substr(@parse_url($url, PHP_URL_PATH), 1);\n\t\t$output .='<iframe src=\"http://player.vimeo.com/video/'.$video.'\" width=\"'.$width.'\" height=\"'.$height.'\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';\n\t}\n\telseif( $video_url['host'] == 'www.dailymotion.com' || $video_url['host'] == 'dailymotion.com' ){\n\t\t$video = substr(@parse_url($url, PHP_URL_PATH), 7);\n\t\t$video_id = strtok($video, '_');\n\t\t$output .='<iframe frameborder=\"0\" width=\"'.$width.'\" height=\"'.$height.'\" src=\"http://www.dailymotion.com/embed/video/'.$video_id.'\"></iframe>';\n\t}\n\t\n\treturn $output;\n}", "private function updateVideo()\n {\n try\n {\n $request = $_POST;\n\n global $cbvid;\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video Id not provided\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n //check if title provided\n if( !isset($request['title']) || $request['title']==\"\")\n throw_error_msg(\"title not provided\");\n else\n $title = mysql_clean($request['title']);\n\n //check if description provided\n if( !isset($request['description']) || $request['description']==\"\")\n throw_error_msg(\"description not provided.\");\n else\n $description = mysql_clean($request['description']);\n\n //check if tags provided\n if(!isset($request['tags']) || $request['tags']==\"\")\n throw_error_msg(\"tags not provided.\");\n else\n $tags = mysql_clean($request['tags']);\n\n //check if tags provided\n if(!isset($request['category']) || $request['category']==\"\")\n {\n throw_error_msg(\"category not provided.\");\n }\n else\n {\n $request['category'] = explode(',',$request['category']); \n $_POST['category'] = $request['category'];\n }\n \n if (isset($request['video_users-user']) || isset($request['video_users-group'])) \n {\n $video_user_ = mysql_clean($request['video_users-user']);\n $video_group_ = mysql_clean($request['video_users-group']);\n\n $request['video_users'] = get_video_users($video_user_,$video_group_,false);\n }\n \n $result = $cbvid->update_video($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $vdetails = $cbvid->get_video_details($request['videoid']);\n $formatted_video = format_videos(array($vdetails));\n\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $formatted_video[0]);\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function store(AddVideoRequest $request)\n {\n try{\n $videoFile = $request->file('video');\n $thumbnailFile = $request->file('thumbnail');\n $videoName = 'video_'.str_slug($request->input('title')).\".\".$videoFile->getClientOriginalExtension();\n $thumbnailName = 'thumbnail_'.str_slug($request->input('title')).\".\".$thumbnailFile->getClientOriginalExtension();\n $category = Category::find($request->input('category'));\n $tags = json_decode($request->input('tags'),true);\n\n if ($videoFile->move(public_path(\"uploads/videos/\"),$videoName) && $thumbnailFile->move(public_path(\"uploads/videos/\"),$thumbnailName)){\n $video = new Video();\n $video->title = ucfirst($request->input('title'));\n $video->subtitle = ucfirst($request->input('subtitle'));\n $video->description = ucfirst($request->input('description'));\n $video->duration = \"1:00\";\n $video->thumbnail = asset(\"uploads/videos/$thumbnailName\");\n $video->video = asset(\"uploads/videos/$videoName\");\n $video->user_id = Auth::id();\n $video->save();\n $video->categories()->attach($category->id);\n\n foreach ($tags as $key => $value) {\n $tagName = $tags[$key]['name'];\n //$tags = Tag::where('name','LIKE',\"%$name%\")->first();\n $tag = Tag::firstOrCreate(['name'=>$tagName]);\n $video->tags()->attach($tag->id);\n }\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was added successfully !!\");\n }\n return redirect()->back();\n } catch(\\Exception $e){\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not store the video\");\n\n if($video){\n $video->categories()->detach();\n $video->delete();\n }\n\n Log::warning(\"Can not upload Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n }", "public function store(VideoRequest $request)\n {\n $data = $request->all();\n $data['image'] = ($request->file('image') && $request->file('image')->isValid()) ? $this->saveImage($request) : '';\n Video::create($data);\n flash('Create video success!', 'success');\n return redirect('admin/videos');\n }", "public function hasVideo() {}", "public function get_user_video($user_id){\n\n $user_id = intval($user_id);\n $uid = $this->get_uid($user_id);\n\n $query = \"SELECT `id`, `source`, `uid`, `filename_or_link` FROM `user_video` WHERE `uid`='$uid';\";\n\n $user_videos = [];\n\n if ($res = sql::$con->query($query, MYSQLI_STORE_RESULT)) {\n\n while ($data = $res->fetch_array(MYSQLI_ASSOC)) {\n if($data['source'] == 'local'){\n $file_path = '/file/video/'.$uid.'/'.$data['filename_or_link'];\n $data['filename_or_link'] = $file_path;\n }\n $user_videos[] = $data;\n }\n\n if(is_object($res)){\n $res->close();\n sql::$con->store_result();\n }\n\n }\n /*\n * FOR EXAMPLE FRAMES\n * <iframe style=\"width: 485px; min-height: 411px;\" src=\"<YOUTUBE-LINK>\" frameborder=\"0\" allowfullscreen allow=\"accelerometer; encrypted-media; gyroscope; picture-in-picture\"></iframe>\n * <iframe style=\"width: 485px; min-height: 411px;\" src=\"<VIMEO-LINK>\" frameborder=\"0\" allowfullscreen webkitallowfullscreen mozallowfullscreen ></iframe>\n *\n * */\n\n return $user_videos;\n }", "public function videoposts(){\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n\t\t\t$browseUserid = $this->input->post(\"browseuser\");\n\t\t\t$result = array();\n\t\t\t$result = $this->post->videos($browseUserid,'studio');\n\t\t\techo json_encode($result);\n\t\t}\n\t\telse{\n\t\t\tredirect('error');\n\t\t}\n\t}", "public function store(Request $request)\n {\n $this->validate($request, [\n\n\n 'title' =>'required',\n \n \n ]);\n \n \n \n \n//$file = $request->file('file')->getClientOriginalName();\n$ext = $request->file('file')->extension();\n \n \n\n $filename = str_random(10) . '.' .$ext;\n // $pat = public_path().'/uploads/article/'.$filename;\n // $file->move($pat,$filename);\n \n\n$path = $request->file('file')->storeAs('/uploads/video/',$filename);\n\n\n \n \n\n\n $prod = Video::create([\n 'title'=>$request->get(\"title\"),\n 'file'=>$filename,\n\n\n\t\t]); \n$prod->save();\n \n // $prod->uploadVideo($request->file('file'));\n \n return redirect()->route('video.index');\n }", "function addvideo($name, $category, $length)\n\t{\n\t\t$obj = new clsdbaccess();\n\t\t$mysqli = $obj->db_connect();\n\t\t$result ='';\n\n\t\tif(!($stmt = $mysqli->prepare(\"INSERT INTO videoinventory (name, category, length) VALUES (?,?,?)\"))){\n\t\t\techo \"Prepare failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\n\t\tif(!($stmt->bind_param(\"ssi\", $name, $category, $length))){\n\t\t\techo \"Bind failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\n\t\tif(!$stmt->execute()) {\n\t\t\t$result = \"Execute failed: \" . $mysqli->error;\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$result='success';\n\t\t}\t\t\n\t\t$stmt->close();\t\n\t\treturn $result;\n\t}", "function get_video_file($vdetails,$return_default=true,$with_path=true,$multi=false,$count_only=false,$hq=false)\r\n{\r\n global $Cbucket;\r\n # checking if there is any other functions\r\n # available\r\n if(is_array($Cbucket->custom_video_file_funcs))\r\n foreach($Cbucket->custom_video_file_funcs as $func)\r\n if(function_exists($func))\r\n {\r\n $func_returned = $func($vdetails, $hq);\r\n if($func_returned)\r\n return $func_returned;\r\n }\r\n\r\n\r\n $fileDirectory = \"\";\r\n if(isset($vdetails['file_directory']) && !empty($vdetails['file_directory'])){\r\n $fileDirectory = \"{$vdetails['file_directory']}/\";\r\n }\r\n //dump($vdetails['file_name']);\r\n\r\n #Now there is no function so lets continue as\r\n if(isset($vdetails['file_name']))\r\n $vid_files = glob(VIDEOS_DIR.\"/\".$fileDirectory . $vdetails['file_name'].\"*\");\r\n // if($hq){\r\n // var_dump(glob(VIDEOS_DIR.\"/\".$fileDirectory . $vdetails['file_name'].\"*\"));\r\n // }\r\n\r\n #replace Dir with URL\r\n if(is_array($vid_files))\r\n foreach($vid_files as $file)\r\n {\r\n // if($hq){\r\n // echo \"filesize = \" . filesize($file); \r\n // }\r\n if(filesize($file) < 100) continue;\r\n $files_part = explode('/',$file);\r\n $video_file = $files_part[count($files_part)-1];\r\n\r\n if($with_path)\r\n $files[] = VIDEOS_URL.'/' . $fileDirectory . $video_file;\r\n else\r\n $files[] = $video_file;\r\n }\r\n\r\n\r\n if(count($files)==0 && !$multi && !$count_only)\r\n {\r\n if($return_default)\r\n {\r\n\r\n if($with_path)\r\n return VIDEOS_URL.'/no_video.flv';\r\n else\r\n return 'no_video.flv';\r\n }else{\r\n return false;\r\n }\r\n }else{\r\n if($multi)\r\n return $files;\r\n if($count_only)\r\n return count($files);\r\n\r\n\r\n foreach($files as $file)\r\n {\r\n if($hq)\r\n {\r\n if(getext($file)=='mp4')\r\n {\r\n return $file;\r\n break;\r\n }\r\n }else{\r\n return $file;\r\n break;\r\n }\r\n }\r\n return $files[0];\r\n }\r\n}", "protected function _check_videos_transient() {\n\n\t\t$video_urls_transient = get_transient( $this->_ttw_api_url_transient );\n\n\t\tif ( ! $video_urls_transient ) {\n\t\t\t$this->_build_videos_transient();\n\t\t}\n\t}", "public function store(Request $request)\n {\n\n request()->validate([\n 'nom_multimedia' => 'required',\n 'desc_multimedia' => 'required',\n ]);\n \n\n\n switch ($request->get('tipo_media_id')) {\n case 1: \n\n // request()->multimedia =request()->multimedia_img; \n // $nombre_archivo = time().'.'.request()->multimedia->getClientOriginalExtension();\n \n\n $image = $request->file('multimedia_img');\n $nombre_archivo = $request->get('nom_multimedia').substr(str_replace(\"0.\",\"\",microtime()),0,4).'.'.$image->getClientOriginalExtesion();\n \n \n $destinationPath = public_path('/archivos_media/images');\n $img = Image::make($image->getRealPath());\n $img->resize(null, 800, function ($constraint) {\n $constraint->aspectRatio();\n })->save($destinationPath.'/'.$nombre_archivo);\n\n\n $destinationPath = public_path('/archivos_media/thumbnail');\n $img = Image::make($image->getRealPath());\n $img->resize(100, 100, function ($constraint) {\n $constraint->aspectRatio();\n })->save($destinationPath.'/'.$nombre_archivo);\n\n\n\n\n\n\n\n\n // request()->multimedia->move(public_path('archivos_media'), $nombre_archivo); \n break;\n\n\n case 3:\n \n request()->multimedia =request()->multimedia_video; \n $time = time(); \n $nombre_archivo = $time.'.'.request()->multimedia->getClientOriginalExtension();\n request()->multimedia->move(public_path('archivos_media/videos'), $nombre_archivo); \n $ruta = public_path('archivos_media/videos/');\n $ruta_thumbnail = public_path('archivos_media/thumbnail/'); \n $frame = exec('ffmpeg -i '.$ruta_thumbnail.$nombre_archivo.' '. $ruta_thumbnail.$time.'.jpg');//capturo el frame del video\n \n break;\n\n case 2:\n request()->multimedia=request()->multimedia_youtube;\n $patron = '%^ (?:https?://)? (?:www\\.)? (?: youtu\\.be/ | youtube\\.com (?: /embed/ | /v/ | /watch\\?v= ) ) ([\\w-]{10,12}) $%x';\n $array = preg_match($patron, request()->multimedia, $parte);\n if (false !== $array) {\n $nombre_archivo = $parte[1];\n\n $imagen = file_get_contents(\"http://img.youtube.com/vi/\".$nombre_archivo.\"/default.jpg\");\n file_put_contents(\"archivos_media/thumbnail/\".$nombre_archivo.\".jpg\", $imagen);\n\n }\n break; \n\n default:\n # code...\n break;\n }\n \n\n MultiMedia::create([\n \n 'nom_multimedia' => $request->get('nom_multimedia'), \n 'desc_multimedia' => $request->get('desc_multimedia'),\n 'tipo_media_id' => $request->get('tipo_media_id'),\n 'categoria_media_id' => $request->get('categoria_media_id'),\n 'multimedia' => $nombre_archivo, \n\n ]);\n \n return redirect()->route('multimedia.index')\n ->with('success','multimedia created successfully');\n }" ]
[ "0.69222957", "0.6880366", "0.67624557", "0.6726896", "0.6717245", "0.65077674", "0.6483197", "0.648286", "0.64435446", "0.6418239", "0.6402158", "0.638988", "0.638033", "0.6371146", "0.6364014", "0.63444275", "0.6336959", "0.6326696", "0.6298246", "0.6284305", "0.6279199", "0.6274017", "0.62589085", "0.625725", "0.62409866", "0.62355393", "0.62115175", "0.6191016", "0.6153858", "0.6152369", "0.6147702", "0.6146191", "0.61455053", "0.6134049", "0.6127715", "0.6099069", "0.6086027", "0.6085271", "0.6083797", "0.60702014", "0.60687524", "0.6064887", "0.60509104", "0.60323644", "0.6032226", "0.60255253", "0.60246944", "0.6024343", "0.6023042", "0.6021196", "0.60197747", "0.60134315", "0.60128415", "0.6002299", "0.59973794", "0.5994187", "0.5991593", "0.5987738", "0.5984714", "0.5984186", "0.59833324", "0.5982234", "0.5981272", "0.597916", "0.5975743", "0.59741354", "0.5968109", "0.5965361", "0.59618145", "0.5955182", "0.59494054", "0.59470105", "0.5934648", "0.593463", "0.59343064", "0.5918868", "0.5913935", "0.5910552", "0.59104604", "0.59104306", "0.5897484", "0.589714", "0.58948046", "0.5890618", "0.5874593", "0.5870829", "0.5868637", "0.5856888", "0.5855492", "0.5848855", "0.5841969", "0.5802697", "0.57916117", "0.57866013", "0.5785601", "0.57731575", "0.57714856", "0.5770056", "0.57696146", "0.5768753" ]
0.6366752
14
/Store program data form
public function storeProgram(Request $request) { $this->validate($request,array( 'name' => 'required', 'details' => 'required', 'set1' => 'required', 'set3' => 'required', 'set2' => 'required', 'image' => 'required|mimes:jpg,jpeg,png' )); $program = new Program; $program->title = $request->name; $program->description = $request->details; $program->category = $request->category; $program->set1 = $request->set1; $program->set2 = $request->set2; $program->set3 = $request->set3; //$program->image = $request->project_title; if ($request->hasFile('image')) { $file = $request->file('image'); $filename = time().'.'.$file->getClientOriginalName(); /*$location = public_path('file/'.$filename); Storage::put($filename,file_get_contents($file));*/ $location = public_path('file/'.$filename); Storage::disk('file')->put($filename, file_get_contents($file)); //Storage::disk('public')->put($filename, file_get_contents($file)); $program->image = $filename; } $program->save(); if($program->save()){ return redirect()->back()->with('success','Program saved successfully.'); } else{ return redirect()->back()->with('denger-success','Program is not saved.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function AddProgram() {\n $data = $this->app[\"request\"];\n\n $isXML = false;\n\n $program = new Program($this->app[\"db\"]);\n\n if (0 === strpos($data->headers->get('Content-Type'), 'application/x-www-form-urlencoded')) {\n\n // posted from a html form\n\n $program->date = $data->get(\"date\");\n $program->time = $data->get(\"time\");\n $program->leadText = $data->get(\"leadText\");\n $program->name = $data->get(\"name\");\n $program->bLine = $data->get(\"b-line\");\n $program->synopsis = $data->get(\"synopsis\");\n $program->url = $data->get(\"url\");\n\n } elseif (0 === strpos($data->headers->get('Content-Type'), 'text/xml')) {\n\n // posted as xml\n\n $xml = (array)simplexml_load_string($data->getContent());\n\n $program->date = $xml[\"date\"];\n $program->time = $xml[\"start_time\"];\n $program->leadText = $xml[\"leadtext\"];\n $program->name = $xml[\"name\"];\n $program->bLine = $xml[\"b-line\"];\n $program->synopsis = $xml[\"synopsis\"];\n $program->url = $xml[\"url\"];\n\n $isXML = true;\n\n }\n\n\n // check for errors\n $errors = $program->validate();\n\n // show the form again if there where errors (and show what the errors where)\n if (count($errors) > 0) {\n if ($isXML) {\n return \"There where errors: \".print_r($errors,true);\n } else {\n return $this->app['twig']->render('index.html.twig', array(\"errors\" => $errors, \"program\" => $program));\n }\n }\n\n // store the record in db\n $persist = $program->persist();\n\n if ($isXML) {\n if ($persist) {\n return \"program persisted\";\n } else {\n return \"failed to persist\";\n }\n }\n\n return $this->app->redirect('/programs.html');\n }", "public function storeFormValues ( $params ) {\n\n // Store all the parameters\n $this->__construct( $params );\n\t\n // Parse and store the program start date \n if ( isset($params['programStart']) ) {\n $programStart = explode ( '-', $params['programStart'] );\n\n if ( count($programStart) == 3 ) {\n list ( $y, $m, $d ) = $programStart;\n $this->programStart = mktime ( 0, 0, 0, $m, $d, $y );\n }\n }\n }", "function saveForm(){\t\n\t\t$this->saveFormBase();\n\t\t$this->saveFormGeoCoverage();\n\t\t$this->saveVaFormResolution();\n\t\tif ($this->dataset->nbModForm >0) $this->saveModForm();\n\t\tif ($this->dataset->nbSatForm >0) $this->saveSatForm();\n\t\tif ($this->dataset->nbInstruForm >0) $this->saveInstruForm();\n\t\t$this->saveFormGrid();\n\t\t//Parameter\n\t\t$this->saveFormVariables($this->dataset->nbVars);\n\t\t//REQ DATA_FORMAT\n\t\t$this->dataset->required_data_formats = array();\n\t\t$this->dataset->required_data_formats[0] = new data_format;\n\t\t$this->dataset->required_data_formats[0]->data_format_id = $this->exportValue('required_data_format');\n\t}", "public function store()\n\t{\n\n $validator = Validator::make(\n Input::all(),\n array(\n 'description' => 'required'\n )\n );\n\n if( $validator->fails() ) {\n Session::flash('action_success', false);\n Session::flash('action_message', 'There is an error with your form. Please correct it and try again.');\n return Redirect::action('AdminProgramController@create')->withErrors($validator)->withInput();\n }\n\n $program = Program::create(array(\n 'description' => Input::get('description')\n ));\n\n $program->programOptions()->save(\n new ProgramOption(array(\n 'description' => 'None'\n ))\n );\n\n return Redirect::action('AdminProgramController@show', array($program->id));\n\n\t}", "public function run()\n {\n ProgramOption::create( array('description' => 'None', 'program_id' => 1) );\n\n // Entries for program 2: Bachelor of Computer Science\n ProgramOption::create( array('description' => 'None', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Computer Games', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Web Services and Applications', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Computer Systems', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Software Systems', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Information Systems', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Computer Applications', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Computation Arts', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Mathematics and Statistics', 'program_id' => 2) );\n\n // Entries for program 3: Bachelor of Software Engineering\n ProgramOption::create( array('program_id' => 3, 'description' => 'None') );\n ProgramOption::create( array('program_id' => 3, 'description' => 'Computer Games') );\n ProgramOption::create( array('program_id' => 3, 'description' => 'Real-Time, Embedded, and Avionics Software') );\n ProgramOption::create( array('program_id' => 3, 'description' => 'Web Services and Applications') );\n\n }", "public function program_save($data_program = array()) \n {\n $query = $this->db->insert($this->program,$data_program);\n if($query)\n {\n return $this->db->insert_id();\n }\n else\n {\n return FALSE;\n }\n }", "protected function saveData()\n {\n // TODO: データ保存\n\n // 一次データ削除\n $this->deleteStore();\n\n drupal_set_message($this->t('The form has been saved.'));\n }", "function affwp_save_affiliate_program( $affiliate_id, $status, $args ) {\n\n\t$program = sanitize_text_field( $_POST['affwp_program'] );\n\n\tif ( ! empty( $program ) ) {\n\t\taffwp_add_affiliate_meta( $affiliate_id, 'program', $program );\n\t}\n\n}", "public function __construct( $data=array() ) {\n\t \n\t//program basic information\n if ( isset( $data['programID'] ) ) $this->programID = (int) $data['programID'];\n if ( isset( $data['programName'] ) ) $this->programName = (string) $data['programName'];\n\tif ( isset( $data['programStart'] ) ) $this->programStart = (int) $data['programStart'];\n\tif ( isset( $data['programFrequency'] ) ) $this->programFrequency = (int) $data['programFrequency'];\n\t\n }", "function affwp_affiliate_dashboard_update_program( $data ) {\n\n\t$affiliate_id = absint( $data['affiliate_id'] );\n\n\tif ( ! empty( $data['program'] ) ) {\n\n\t\t$program = sanitize_text_field( $data['program'] );\n\n\t\taffwp_update_affiliate_meta( $affiliate_id, 'program', $program );\n\n\t} else {\n\n\t\taffwp_delete_affiliate_meta( $affiliate_id, 'program' );\n\n\t}\n\n}", "function store_data($data, $data_name)\n{\n /* @todo store the PUA data in its own table */\n update_option($data_name, serialize($data));\n}", "public function store(Request $request)\n {\n $prog = new program($request->all());\n \n if($prog->save()){\n \n $dll = new \\App\\Dllareaprog();\n $dll->id_area = $request->area;\n $dll->id_programa = $prog->id;\n $dll->save();\n \n return redirect('admin/programs');\n } else {\n return view('programs.create')\n ->with('prog', $prog);\n\n }\n }", "public function addProgram($program){\n $this->programArrayList[] = $program;\n }", "function readInputData() {\n\t\t$this->readUserVars(array('title', 'description', 'journalPath', 'enabled'));\n\t\t$this->setData('enabled', (int)$this->getData('enabled'));\n\n\t\tif (isset($this->journalId)) {\n\t\t\t$journalDao =& DAORegistry::getDAO('JournalDAO');\n\t\t\t$journal =& $journalDao->getById($this->journalId);\n\t\t\t$this->setData('oldPath', $journal->getPath());\n\t\t}\n\t}", "private function saveData()\n { \n // Save form data in session\n if (count($this->post) > 0) {\n $_SESSION['gentlesource_voting_configuration'] = $this->post;\n $this->data = $this->post;\n $this->votingOptions = $this->post['votingOptions'];\n } else {\n if (isset($_SESSION['gentlesource_voting_configuration'])) {\n $this->data = $_SESSION['gentlesource_voting_configuration'];\n $this->votingOptions = $this->data['votingOptions'];\n }\n }\n }", "public function saveProgram(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required'\n ]);\n\n $program = new Program();\n $program->name = $request->name;\n $program->description = $request->description;\n $program->user_id = '1';\n $program->save();\n return redirect()\n ->back()\n ->with('success', $request->name . ' has been saved successfully!');\n\n /* dd($request->all()); */\n }", "public function store(Request $request)\n {\n \n \n $program = Programs::create([\n 'main_image' => $request->main_image,\n 'price' => $request->price,\n 'name' => $request->name,\n 'start_day' => $request->start_day,\n 'kind' => $request->kind,\n 'days' => $request->days,\n 'nights' => $request->nights,\n 'brief' => $request->brief,\n 'place' => $request->place,\n 'overview' => $request->overview,\n 'pricing' => $request->pricing,\n 'general' => $request->general,\n 'price_children' => $request->price_children,\n 'image_gallery' => serialize($request->image_gallery),\n 'itinerary_heading' => serialize($request->itinerary_heading),\n 'itinerary' => serialize($request->itinerary),\n 'pages_id' => $request->pages_id,\n 'small_group' => $request->small_group,\n 'slug' => str_slug($request->name),\n\n ]);\n $program->related()->attach($request->related_programs_id);\n $program->Highlights()->attach($request->package_highlights_id);\n $program->Sights()->attach($request->holiday_sights_id);\n $program->Accommodations()->attach($request->accom_id);\n $program->Addons()->attach($request->add_on_id);\n \n\n\n$program->save();\nSession::flash('Success','Your Program created Successfully');\n return redirect()->route('Program.index')\n ->with('success','Program created successfully');\n }", "public function run()\n {\n //\n $internship = factory(Program::class, 1)->create([\n 'name' => 'Internship',\n 'value' => 'internship',\n 'fee_type_id' => DB::table('fee_types')->where('value', 'entry_fee')->first()->id,\n ]);\n\n $inter_relocat = factory(Program::class, 1)->create([\n 'name' => 'Internship + Relocation',\n 'value' => 'inter_relocat',\n 'fee_type_id' => DB::table('fee_types')->where('value', 'entry_fee')->first()->id,\n ]);\n\n $university = factory(Program::class, 1)->create([\n 'name' => 'University',\n 'value' => 'university',\n 'fee_type_id' => DB::table('fee_types')->where('value', 'entry_fee')->first()->id,\n ]);\n\n $study = factory(Program::class, 1)->create([\n 'name' => 'Study',\n 'value' => 'study',\n 'fee_type_id' => DB::table('fee_types')->where('value', 'unit_rate')->first()->id,\n ]);\n }", "public function saveData()\r\n {\r\n \r\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\n\t {\n\t //\n\t }", "public function storeIncomingData() {}", "function readInputData() {\n\t\t$this->readUserVars(array('monographId', 'decision', 'personalMessage'));\n\t}", "public function store(Request $request)\n {\n $program=new Programs();\n $program->name_en=$request->input('name_en');\n $program->name_ru=$request->input('name_ru');\n $program->name_am=$request->input('name_am');\n $program->description_en=$request->input('description_en');\n $program->description_ru=$request->input('description_ru');\n $program->description_am=$request->input('description_am');\n $program->url=$request->input('url');\n $program->save();\n return redirect('/programs');\n \n }", "public function store();", "public function store();", "public function store();", "public function save_form_elements($data) {\n global $DB, $detection_tools;\n\t\t$cmid = $data->coursemodule;\n\t\t$context = new stdClass();\n\t\t$context = get_system_context($cmid);\n //$context = context_module::instance($cmid);\n if (!$this->is_plugin_enabled($cmid)) {\n return;\n }\n\n if (!empty($data->programmingYN)) { // the plugin is enabled for this assignment\n $setting = $DB->get_record('plagiarism_programming', array('cmid'=>$cmid));\n $new = false;\n if (!$setting) {\n $new = true;\n $setting = new stdClass();\n $setting->cmid = $cmid;\n }\n\n $setting->language = $data->programming_language;\n $setting->moss = isset($data->detection_tools['moss']) ? 1 : 0;\n\t\t\n $setting->auto_publish = isset($data->auto_publish) ? 1 : 0;\n if (isset($data->notification)) {\n $setting->notification = 1;\n $setting->notification_text = $data->notification_text;\n } else {\n $setting->notification = 0;\n $setting->notification_text = '';\n }\n\n if ($new) {\n $setting->id = $DB->insert_record('plagiarism_programming', $setting);\n } else {\n $DB->update_record('plagiarism_programming', $setting);\n }\n file_postupdate_standard_filemanager($data, 'code', $this->filemanager_option, $context, 'plagiarism_programming', 'codeseeding', $setting->id);\n\n $date_num = $data->submit_date_num;\n $DB->delete_records('plagiarism_programming_date', array('settingid'=>$setting->id, 'finished'=>0));\n\n for ($i=0; $i<$date_num; $i++) {\n $element_name = \"scan_date[$i]\";\n if (isset($data->$element_name) && isset($data->$element_name) && $data->$element_name > 0) {\n $scan_date_obj = new stdClass();\n $scan_date_obj->scan_date = $data->$element_name;\n $scan_date_obj->finished = 0;\n $scan_date_obj->settingid = $setting->id;\n\n $DB->insert_record('plagiarism_programming_date', $scan_date_obj);\n }\n }\n foreach ($detection_tools as $toolname => $info) {\n if ($setting->$toolname && !$DB->get_record('plagiarism_programming_'.$toolname, array('settingid'=>$setting->id))) {\n $jplag_rec = new stdClass();\n $jplag_rec->settingid = $setting->id;\n $jplag_rec->status = 'pending';\n $DB->insert_record('plagiarism_programming_'.$toolname, $jplag_rec);//, //$jplag_rec);\n }\n }\n\n } else { // plugin not enabled, delete the records if there are\n plagiarism_programming_delete_config($cmid);\n }\n }", "function readInputData() {\n\t\t$this->readUserVars(array(\n\t\t\t'representativeId',\n\t\t\t'agentRole',\n\t\t\t'supplierRole',\n\t\t\t'representativeIdType',\n\t\t\t'representativeIdValue',\n\t\t\t'name',\n\t\t\t'phone',\n\t\t\t'fax',\n\t\t\t'email',\n\t\t\t'url',\n\t\t\t'isSupplier',\n\t\t));\n\t}", "public function store(Request $request)\n {\n request()->validate([\n 'programs' => 'required',\n 'programs_id' => 'required',\n \n ]);\n\n $program = programs::find($request->input('programs_id'));\n $programs= $request->input('programs');\n $programs=$program->programs()->save($programs);\n\n\n return redirect()->route('programs.index')\n ->with('success','projet ajouté avec succès.');\n }", "public function run()\n {\n Program::create([\n \t'name' => 'Agricultural Crops Production NC II',\n \t'batch_id' => 1,\n ]);\n }", "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}" ]
[ "0.6240998", "0.62035745", "0.61095464", "0.60383475", "0.58655787", "0.57584274", "0.5731271", "0.57262933", "0.5708512", "0.56396693", "0.5638476", "0.56063026", "0.55784184", "0.55771947", "0.55108297", "0.54851323", "0.5447166", "0.5419189", "0.5404201", "0.5384884", "0.53703713", "0.5358699", "0.5353644", "0.53493273", "0.5343336", "0.5343336", "0.5343336", "0.5333539", "0.5318158", "0.5307235", "0.5275956", "0.52718794", "0.52718794", "0.52718794", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279", "0.5267279" ]
0.0
-1
/Add nutrition Category form
public function addNutrationCategory() { return view('admin.addnutratoncategory'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio Category';\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "function CategoryForm() {\r\n\r\n\t\t$member = Member::currentUser();\r\n\r\n\t\t// Need to sort out how going to handle multiple instances of category\r\n\t\t// front end grid field : https://github.com/webbuilders-group/silverstripe-frontendgridfield\r\n\t\t// grid field extension : https://github.com/silverstripe-australia/silverstripe-gridfieldextensions\r\n\t\t$category = Category::get()->first();\r\n\t\t$fields = $category->FormFields();\r\n\r\n $actions = FieldList::create(\r\n FormAction::create(\"doCategoryForm\")->setTitle(\"Submit\")->addExtraClass('productive'),\r\n FormAction::create(\"cancel\")->setTitle(\"Cancel\")\r\n );\r\n\r\n $form = Form::create($this, 'CategoryForm', $fields, $actions);\r\n\r\n return $form;\r\n\r\n\t}", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "public function add_acct_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\nif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Accounts Category Created Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\ntheme('add_acct_category');\n\t}", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function addDietaryCategory(){\n \t$id = $this->formValueForKey(\"dietaryCategorySelection\");\n \t \n \t$foundDietaryCategory = BLGenericRecord::recordMatchingKeyAndValue(\"DietaryCategory\", \"id\", $id);\n \t$this->currentRecipe()->addDietaryCategory($foundDietaryCategory);\n }", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "public function addCathegory($values)\n\t{\n\t\treturn $this->getTable('kategoria')->insert(array(\n\t\t\t'Nazov' => $values->nazov,\n\t\t));\n\t}", "public function storeNutrationCategory(Request $request)\n {\n $this->validate($request,array(\n 'nutrationCategoryName' => 'required',\n //'tips' => 'required',\n ));\n\n $nutrationCategory = new NutrationCategory;\n\n $nutrationCategory->nutration_category_name = $request->nutrationCategoryName;\n //$nutrationCategory->tips = $request->tips;\n\n $nutrationCategory->save();\n\n if($nutrationCategory->save()){\n return redirect()->back()->with('success','Nutration category Saved successfully.');\n }\n else{\n return redirect()->back()->with('denger-success','Nutration category is not saved.');\n }\n \n }", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function newAction()\n {\n\t\tTag::appendTitle('Add New Category');\n }", "public function addNutritionalBenefit(){\n \t$id = $this->formValueForKey(\"nutritionalBenefitSelection\");\n \n \t$foundNutritionalBenefit = BLGenericRecord::recordMatchingKeyAndValue(\"NutritionalBenefit\", \"id\", $id);\n \t$this->currentRecipe()->addNutritionalBenefit($foundNutritionalBenefit);\n }", "public function showCategoryForm() {\n $company_logo = $this->showLogoImage();\n $category_images = \\App\\CouponCategory::categoryList();\n $signup_category_images = \\App\\CouponCategory::categoryListWeb();\n $country_list = \\App\\Country::countryList();\n\n return view('frontend.signup.category')->with(['company_logo' => $company_logo,\n 'category_images' => $category_images, 'signup_category_images' => $signup_category_images,\n 'country_list' => $country_list]);\n }", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "function gtags_group_category_form() {\n\tglobal $bp, $show_group_add_form_cats;\t\n\tif ($show_group_add_form_cats) return; // prevents showing form twice\n\t$show_group_add_form_cats = true;\n\n\t// the group category\t\n\t$group_cats = get_option('gtags_category'); \n\tif (empty($group_cats)) return;\n\t\n\t$selected = groups_get_groupmeta( $bp->groups->current_group->id, 'gtags_group_cat' ); \n\t?><label for=\"group-cat\"><?php _e( 'Group Category', 'gtags' ) ?></label>\n\t<select name=\"group-cat\" id=\"group-cat\" />\n\t\t<option value=\"\"><?php _e('--- SELECT ONE ---', 'gtags') ?></option>\n\t<?php foreach ( $group_cats as $tag => $desc ): ?>\n\t\t<?php if ( !$desc ) $desc = $tag; ?>\n\t\t<option value=\"<?php echo $tag; ?>\" <?php if ( $tag == $selected ) echo 'selected=\"selected\"' ?>><?php echo $desc; ?></option>\n\t<?php endforeach; ?>\n\t</select>\n\t<i><?php _e('(the primary group activity)', 'gtags'); ?></i><br><?php \t\n}", "public function addAction()\n {\n $form = new CategoryForm();\n $form->get('submit')->setValue('Add');\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n $category->exchangeArray($form->getData());\n $this->getCategoryTable()->saveCategory($category);\n\n // Redirect to list of categorys\n return $this->redirect()->toRoute('category');\n }\n }\n return array('form' => $form);\n }", "public function add_category() {\n\t\n\t\tif($this->input->post('add_type')=='add_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name'),\n\t\t'created_at' => date('d-m-Y h:i:s')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->add_assets_category($data);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_added');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "public function add()\n {\n $category = $this->Category->newEntity();\n if ($this->request->is('post')) {\n $category = $this->Category->patchEntity($category, $this->request->getData());\n if ($this->Category->save($category)) {\n $this->Flash->success(__('The category has been saved.'));\n\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error(__('The category could not be saved. Please, try again.'));\n }\n $this->set(compact('category'));\n }", "public function category()\n { \n if($this->access_role->is_Admin() == false) show_404();\n $this->load->model('Category_Model');\n \n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n if($this->form_validation->run('category_insert') ){\n $this->Category_Model->add_category(); \n } else {\n $error = ['class'=>'warning','text'=> validation_errors()];\n $this->session->set_flashdata('sms_flash', $error); \n redirect('Dashboard/category');\n }\n } \n else{\n $data = $this->Category_Model->view_category();\n }\n \n $this->load->view('admin/category_content',$data);\n }", "public function add()\n\t{\n\t\t$data[\"icons\"] = $this->M_Icon->getAll();\n\t\t$data[\"title\"] = 'Tambah Kategori';\n\n\t\t$validation = $this->form_validation;\n\n\t\t$rules = [\n\t\t\t[\n\t\t\t\t'field' => 'kategori',\n\t\t\t\t'rules' => 'required'\n\t\t\t],\n\t\t\t[\n\t\t\t\t'field' => 'deskripsi',\n\t\t\t\t'rules' => 'required'\n\t\t\t]\n\t\t];\n\n\t\t$validation->set_rules($rules);\n\n\t\tif ($validation->run()) {\n\t\t\t$this->kategori_model->save();\n\t\t\t$this->session->set_flashdata('stsMessage', 'Data Berhasil disimpan');\n\t\t\tredirect('Kategori');\n\t\t}\n\n\t\t$this->load->view(\"admin/kategori/new_form\", $data);\n\t}", "public function createCategory();", "function add()\n { \n $this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('CatName','CatName','required');\n\t\t\n\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t'CatName' => $this->input->post('CatName'),\n );\n \n $productcat_id = $this->Productcat_model->add_productcat($params);\n redirect('admin/productcat/index');\n }\n else\n { \n $data['_view'] = 'admin/productcat/add';\n $this->load->view('admin/layouts/main',$data);\n }\n }", "function colorpicker_field_add_new_category( $taxonomy ) { ?> \r\n\t<div class=\"form-field term-colorpicker-wrap\"> \r\n\t<label for=\"term-colorpicker\">Category Color</label> \r\n\t<input name=\"_category_color\" value=\"#ffffff\" class=\"colorpicker\" id=\"term-colorpicker\" /> \r\n\t<p>This is the field description where you can tell the user how the color is used in the theme.</p> \r\n\t</div> <?php }", "public function create()\n {\n return view('product.add_category');\n }", "public function newcategory() {\n\n if (ckeckAddmin()) {\n $this->load->view('admin/header/header');\n $this->load->view('admin/css/css');\n $this->load->view('admin/topnav/topnav');\n $this->load->view('admin/sidenav/sidenav');\n $this->load->view('admin/content/addcatogry');\n $this->load->view('admin/footer/footer');\n # $this->load->view('admin/js/extra');\n $this->load->view('admin/js/js');\n } else {\n CustomFlash('Admin/login', 'alert-danger', 'plz First Login');\n }\n }", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "function addcategory(){\n \treturn view('category');\n }", "public function addAction() {\n $session = new Container('User');\n $form = new CategoryForm('CategoryForm');\n\n $form->get('created_date')->setValue(time());\n $form->get('created_by')->setValue($session->offsetGet('userId'));\n $form->get('updated_date')->setValue(time());\n $form->get('updated_by')->setValue($session->offsetGet('userId'));\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $data = $request->getPost();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($data);\n if ($form->isValid()) {\n $validatorName = new \\Zend\\Validator\\Db\\NoRecordExists(\n array(\n 'table' => 'category',\n 'field' => 'title',\n 'adapter' => $this->getAdapter()\n )\n );\n if ($validatorName->isValid(trim($category->title))) {\n $no_duplicate_data = 1;\n } else {\n $flashMessage = $this->flashMessenger()->getErrorMessages();\n if (empty($flashMessage)) {\n $this->flashMessenger()->setNamespace('error')->addMessage('Category Name already Exists.');\n }\n $no_duplicate_data = 0;\n }\n\n if ($no_duplicate_data == 1) {\n $category->exchangeArray($form->getData());\n $data->created_date = time();\n $data->created_by = $session->offsetGet('userId');\n $data->updated_date = time();\n $data->updated_by = $session->offsetGet('userId');\n\n $questionId = $this->getCategoryTable()->saveCategory($category);\n// $this->getServiceLocator()->get('Zend\\Log')->info('Level created successfully by user ' . $session->offsetGet('userId'));\n $this->flashMessenger()->setNamespace('success')->addMessage('Category created successfully');\n return $this->redirect()->toRoute('category');\n }\n }\n }\n\n return array('form' => $form);\n }", "public\n\tfunction create() {\n\t\t$parent = Category::all();\n\t\treturn view( 'admin.grandcategory.add', compact( 'parent' ) );\n\t}", "public function create() {\n return view('admin.category.category_create_form');\n }", "public function create()\n {\n return view('backend.category.add');\n }", "public function addCategory()\n {\n $baker = Bakery::orderBy('id')->get();\n $this->authorize('category');\n return view('Admin.Bakery.Category.category', ['baker' => $baker]);\n }", "public function create()\n {\n return view('backend.cat_add');\n }", "public function addCategoryToGroupByName($gorup_name, $category_name);", "public function get_category_form_by_ajax() {\n $category_count = $_POST['id'];\n $data['category_id'] = $category_count;\n $data['category_branch_location'] = $this->get_branch_location();\n $data['get_printer'] = $this->get_printer();\n $this->load->view('restaurant/category/insert_category_form', $data);\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 add()\n\t{\t\n\t\t$data = array(); \n\n \t \treturn view('add-category')->with($data);\n\t}", "public function addcategory() {\n return view('Category.view-category');\n}", "public function addCategory()\n {\n $data['categorys'] = Category::whereNull('parent_id')->get();\n return view('category.addEdit', $data);\n }", "public function add_new_category(){\n if(isset($this->session->userdata['admin_name']) && !empty($this->session->userdata['admin_name'])) {\n $data['title'] = 'PBD - Admin | Add category';\n $this->load->view('add-new', $data);\n }\n else{\n redirect('signin');\n }\n }", "public function create()\n {\n $category = Categories::all();\n return view('panel.product-management.categories.form-create')->with(['category' => $category]);\n }", "public function create()\n { \n $form_type = 'Add';\n $images = [];\n $category = [];\n $questions = ['Case / Box','A Game','The Manual'];\n \n $categories = Categories::where('parent_id',0)->pluck('category_name','id')->prepend('Select League', ''); \n $regions = Regions::pluck('name','id')->prepend('Select Region', ''); \n \n return view('admin.subcategories.form', compact('form_type','categories','regions','images','category','questions')); \n }", "public function addCategory()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['category'];\n\t\t\t$sql = \"insert into lib_category (category,add_date,staff_id) \n\t\t\t\t\tvalues('\" . $category . \"','\" . date('Y-m-d') . \"','\" . cookie('staffAccount') . \"') \";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Add successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function addCategoryToGroupById($gorup_id, $category_id);", "public function addCategory()\n {\n $items = Categories::where('is_parent', 1)->orderBy('category_name')->get();\n return view('admin.category.addCategory', compact('items'));\n }", "public function create()\n {\n return view('admin.category.add');\n }", "public function addAction()\n {\n $form = $this->getServiceLocator()->get('civcontent_category_form');\n \n // Check if the request is a POST.\n $request = $this->getRequest();\n if ($request->isPost())\n {\n // Create a new category object.\n $category = $this->getServiceLocator()->get('civcontent_category');\n \n $data = (array) $request->getPost();\n $form->bind($category);\n $form->setData($data);\n if ($form->isValid())\n {\n // Persist changes.\n $this->getContentService()->persistCategory($category);\n \n // Redirect to content categories\n return $this->redirect()->toRoute('content/category', array(\n 'action' => 'index'\n ));\n }\n }\n \n // If a GET request, or invalid data then render/re-render the form\n return new ViewModel(array(\n 'form' => $form,\n ));\n }", "public function create()\n {\n return view(\"dashboard.pages.supervisor.category.add\");\n \n }", "public function create()\n {\n //\n return view('admin.products.add_category');\n }", "public function create() \n\t{\n\t\n\t\t$this->data = (object) array();\n\t\t// Check for post data\n\t\t$this->form_validation->set_rules($this->_validation_rules);\n\t\t\n\t\t\n\t\t// if postback-validate\n\t\tif ($this->form_validation->run()) \n\t\t{\n\t\t\t$input = $this->input->post();\n\t\t\t$id = $this->categories_m->create($input);\n\t\t\t\n\t\t\tEvents::trigger('evt_category_created', $id );\n\t\t\t\n\t\t\t$this->session->set_flashdata('success', lang('success'));\n\t\t\tredirect('admin/shop/categories');\n\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tforeach ($this->_validation_rules as $key => $value) \n\t\t\t{\n\t\t\t\t$this->data->{$value['field']} = '';\n\t\t\t}\n\t\t}\n\n\t\t$this->data->parent_category_select \t= $this->categories_m->build_dropdown(array(\n\t\t\t'type'\t=> 'all'\n\t\t)); \n\n\n\t\t// prepare dropdown image folders\n\t\t$folders = $this->_prep_folders();\n\n\n\t\t// Build page\n\t\t$this->template\n\t\t\t->title($this->module_details['name'])\n\t\t\t->set('folders',$folders)\n\t\t\t->append_js('module::admin/categories.js')\t\n\t\t\t->append_js('module::admin/admin.js')\t\t\n\t\t\t->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))\n\t\t\t->build('admin/categories/form', $this->data);\n\t}", "public function create()\n {\n return view('news.admin.categ.add');\n }", "public function create()\n {\n return view('admin.master.category_name.add');\n }", "function add()\n {\n if($this->acceso(3)){\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n 'categoria_nombre' => $this->input->post('categoria_nombre'),\n );\n\n $categoria_id = $this->Categoria_model->add_categoria($params);\n redirect('categoria/index');\n }\n else\n { \n $data['_view'] = 'categoria/add';\n $this->load->view('layouts/main',$data);\n }\n }\n }", "public function Add($id)\n\t{\n\n\t\t//dd( Categoria::$rules);\n\t\t$form = new GroupForm();\n\n\t\tif ($form->isPosted())\n\t\t{\n\t\t\t$this->beforeFilter('csf', array('on' => 'post'));\n\n\t\t\tif ($form->isValidForAdd(Categoria::$rules))\n\t\t\t{\n\t\t\t\t$entrada = new Categoria();\n\n\t\t\t\t\t$entrada->descricao = Input::get(\"descricao\");\n\t\t\t\t\t$entrada->tipo = Input::get(\"tipo\");\n\t\t\t\t\t$entrada->user_id = isset(Auth::user()->id)? Auth::user()->id : 1;\n\t\t\t\t\t$entrada->save();\n\t\t\t\t\n\n\t\t\t\treturn Redirect::route(\"categ_list\");\n\t\t\t}\n\n\t\t\treturn Redirect::route(\"categ_add\")->withInput([\n\t\t\t\t\"descricao\" => Input::get(\"descricao\"),\n\t\t\t\t\"tipo\" => Input::get(\"tipo\")\n\t\t\t])->withErrors($form->getErrors());\n\t\t}\n\t\t$categorias = Categoria::all();\n\t\t$cat = $categorias;\n\t\t$dadosCat = array();\n\t\tforeach ($categorias as $categoria) {\n\t\t\t\n\t\t\t$dadosCat[$categoria->id] = $categoria->descricao;\n\t\t}\n\n\t\t\n\t\treturn View::make(\"admin.categorias.create\", [\n\t\t\t\"tipo\" => $id,\n\t\t\t\"form\" => $form \n\t\t], compact('cat'))->with(\"categorias\", $dadosCat);\n\t\t\n\t}", "public function create()\n {\n return view (\"admin.category.create\");\n }", "public function create()\n {\n return view('admin.inventorymanagement.category.create');\n }", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "public function addCategory(Request $request){\n \t$this->validate($request, [\n \t\t'category' => 'required'\n \t]);\n\n \t$category = new Category;\n \t$category->category = $request->input('category');// this 'category' inside input is same as name='category' in form\n \t$category->save(); //save this category in database\n \treturn redirect('/category')->with('response','Category added successfully');\n }", "public function add_category() /// get routes of the form add cateogry\n {\n return view('admin.categories.add-category');\n }", "public function addPost(){\n\n if ($this->input->post(\"category_create\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n $categoryName = $this->input->post(\"category_name\");\n\n $this->validate->setRule(\"minlength\",$categoryName,3, \"Category name length must be more then 3 symbols!\");\n\n if ($this->validate->validate() === false){\n $error = $this->validate->getErrors();\n $this->view->redirect(\"/categories/manage\",$error);\n }\n\n $categoryModel = new CategoriesModel();\n try{\n if ($categoryModel->hasCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"This categories already exist!\");\n }\n\n if($categoryModel->addNewCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"Category created successfully!\",\"success\");\n }\n }catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception);\n }\n }", "function add(){\n\t\tif(!$this->checkLogin()){\n\t\t\tredirect(base_url());\n\t\t}\n\n\t\t$pageData['header_title'] = APP_NAME.' | Add Document Category';\n\t\t$pageData['page_title'] = 'Document Category Management';\n\t\t$pageData['parent_menu'] = 'document_management';\n\t\t$pageData['child_menu'] = 'document_category';\n\n\t\t$this->load->view('admin/document_management/category/add', $pageData);\n\t}", "public function add()\n {\n return view('category.add');\n }", "function addAction()\n\t{\n global $langCode;\n\t\t$error \t= array();\n\t\t$success \t= array();\n\t\t$contents \t= '';\n\t\t$formData \t= array();\n\t\t\n\t\t$parentid = (int)($this->registry->router->getArg('parentid'));\n\t\tif($parentid > 0)\n\t\t\t$formData['fparentid'] = $parentid; \n\t\t\n\t\tif(!empty($_POST['fsubmit']))\n\t\t{\n if($_SESSION['productcategoryAddToken']==$_POST['ftoken'])\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->addActionValidator($formData, $error))\n {\n $myProductCat = new Core_ProductCategory();\n //thong tin khong lien quan ngon ngu\n $myProductCat->name = $formData['fname'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n //Neu nguoi dung nhap SeoUrl thi xu li dau cua chuoi nguoi dung nhap \n //Truong hop nguoi dung khong nhap thi chung ta lay idtext de thay the!!!!!\n if(strlen($formData['fseourl']) > 0)\n $myProductCat->seoUrl = Helper::codau2khongdau($formData['fseourl'], true);\n else\n $myProductCat->seoUrl = Helper::codau2khongdau(strip_tags($formData['fname'][$langCode]), true);\n //cac thong tin lien quan ngong ngu\n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n if($myProductCat->addData())//them vao database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succAdd']);\n $this->registry->me->writelog('ProductCategoryadd', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n $formData = array('fparentid' => $formData['fparentid']); \n }\n else\n {\n $error[] = $this->registry->lang['controller']['errAdd']; \n }\n }\n }\n $_SESSION['productcategoryAddToken']=Helper::getSecurityToken();//Tao token moi\n\t\t}\n\t\t\n\t\t\n\t\t$this->registry->smarty->assign(array(\t'formData' \t\t=> $formData,\n\t\t\t\t\t\t\t\t\t\t\t\t'parentCategories' => Core_ProductCategory::getFullCategories(),\n\t\t\t\t\t\t\t\t\t\t\t\t'redirectUrl'\t=> $this->getRedirectUrl(),\n\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t'success'\t\t=> $success,\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));\n\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'add.tpl');\n\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategoryadd',\n\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_add'],\n\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t}", "public function create()\n {\n $data['heading'] = 'Add Secound Category';\n $data['categories'] = Category::where('level',0)->get();\n\n return view('admin.subcategory.create')->with($data);\n }", "public function create()\n { \n $category = self::getCates();\n //加载添加模板\n return view('Admin.Category.add',['category' => $category]);\n }", "public function create()\n {\n return view('admin.DrugCategory.create');\n }", "public function create()\n {\n return view('admin.add-category');\n }", "public function getName()\n {\n return 'category_form';\n }", "public function create()\n {\n $this->categoryRepository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n\n // Get Categories Dropdown list\n $categories = $this->categoryRepository->getCategoryDropdownList();\n $categories[0] = 'Root Category';\n\n return view('admin.categories.add',compact('categories'));\n }", "public function subcategory(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t$caterories = $modelservices->categorydata();\n\t//prd($caterories);\n\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Sub Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t$this->addElement('text', 'service_price', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required digits',\n\t\t\t\"label\" => \"Service Credit \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Price is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"onchange\"=>\"getcategorylist(this.value)\",\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n\t\t$this->addElement('select', 'service_sub_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$caterories,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}", "public function create()\n {\n return view('admin/add_category');\n }", "function getCategoryFields() {\n\t\t\n\t\t$model = $this->getModel();\n\t\t$category_id = JRequest::getVar('id');\n\t\t$form = $model->getFieldForm($category_id, 'category');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\" >';\n\t\techo '<legend>New Category</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "public function create()\n {\n if(\\request()->filled('catid')){\n $catid = intval(\\request()->input('catid'));\n $data['parent_ids'] = Category::ancestorsAndSelf($catid)->pluck('catid');\n }\n\n $top_categories = Category::withDepth()->having('depth', '=', 0)->get();\n $data['top_categories'] = [];\n foreach($top_categories as $category){\n $data['top_categories'][$category->catid] = ['name'=> $category->name];\n }\n\n return view('admin.category.add', $data);\n }", "public function create()\n {\n $parent = $this->cateRepository->getSelect();\n return view('backend.category.add',compact('parent'));\n }", "public function create()\n {\n $data = array();\n $data['status'] = DropdownHelper::where('group_code', '001')->orderBy('key_code', 'asc')->pluck('value', 'key_code');\n $data['services'] = Service::orderBy('service_name', 'asc')->pluck('service_name', 'id')->all();\n $data['add'] = trans('main.add');\n return view('category.form', $data);\n }", "public function create()\n {\n\n $item = new MuseumCategory();\n $categoryList = $this->museumCategoryRepository->getForComboBox();\n\n return view('museum.admin.category.create', compact('categoryList', 'item'));\n\n }", "public function create()\n {\n return view('admin.category.cate_add');\n }", "public function shipment_category_new_func($category,$subcategory=null)\n\n\t{\n\n\n\n\t\t$data['related_company']=$this->shipping->select_data('shipping_related_website');\n\n\t\t$data['equipment_category']=$this->shipping->select_data('equipment_category');\n\n\t\t$data['truck_trailer']=$this->shipping->select_data('shipping_truck_trailer');\n\n\t\t$data['category_id']=$category;\n\n\t\t$data['subcategory_id']=$subcategory;\n\n\t\t$this->load->view('shipment/shipment-category-new',$data);\n\n\t}", "public function create()\n {\n $fields = Field::all();\n\n $parent_id = Request::get('parent_id');\n\n return view_backend('category.create', compact('fields', 'parent_id'));\n }", "public function actionCreate()\n {\n $model = new Category();\n\n Yii::$app->view->params['active'] = 'category';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Категория добавлена');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n return view('admin.pages.category.add');\n }", "function expense_category_add_view()\n {\n if ($this->session->userdata('admin_login') != 1)\n redirect(base_url(), 'refresh');\n\n $page_data['page_name'] = 'expense_category_add';\n $page_data['page_title'] = get_phrase('add_expense_category');\n $this->load->view('backend/index', $page_data);\n }", "public function addCategory(){\n\n\t\tif (($categoryName = $this->input->get_post('categoryName')) && ($categoryTypeId = $this->input->get_post('categoryTypeId')) && \n ($description = $this->input->get_post('description')) && ($categoryImage = $this->input->get_post('categoryImage'))) {\n\t\t\t\n\t\t\t\n\t\t\t$data = array(\n\t\t\t\t'categoryName' => $categoryName,\n\t\t\t\t'categoryTypeId' => $categoryTypeId,\n\t\t\t\t'description' => $description,\n\t\t\t\t'categoryImage' => $categoryImage\n\t\t\t);\n \n $ret = $this->Lootel_model->addCategory($data);\n\t\t\t\n\t\t\tif($ret){\n\t\t\t\t$response = array(\"status\"=>true,\"message\"=>\"Success\",\"userid\"=>$ret);\n\t\t\t}else{\n\t\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Record not saved\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\t$response = array(\"status\"=>false,\"message\"=>\"Required parameter not found\");\n\t\t}\n\t\techo json_encode($response);\n\t}", "public function create()\n\t{\n\t\treturn view('admin.main_categories.addmain_category');\n\t}", "public function create()\n {\n return view('admin/categories/add_category');\n }", "public function create()\n\t{\n\t\t//\n\t\t\n\t\treturn view('categoria.add-categoria');\n\n\t}", "static public function ctrCrearCategoria(){\n\n\t\tif(isset($_POST[\"nuevaCategoria\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/',$_POST[\"nuevaCategoria\"])){\n\n\t\t\t\t$tabla=\"categorias\";\n\n\t\t\t\t$datos=$_POST[\"nuevaCategoria\"];\n\n\t\t\t\t$respuesta=ModelCategoria::mdlIngresarCategoria($tabla, $datos);\n\n\n\t\t\t\tif($respuesta==\"ok\"){\n\n\t\t\t\t\techo '<script> \n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype:\"success\",\n\t\t\t\t\t\t\ttitle:\"¡La categoria ha sido creada correctamente!\",\n\t\t\t\t\t\t\tshowConfirmButton:true,\n\t\t\t\t\t\t\tconfirmButtonText:\"cerrar\",\n\t\t\t\t\t\t\tclaseOnConfirm:false\n\t\t\t\t\t\t\t}).then((result)=>{\n\n\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\twindow.location=\"categorias\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t </script>';\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\techo '<script> \n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\ttitle:\"¡La categoria no puede ir vacia o llevar caracteres especiales!\",\n\t\t\t\t\t\t\tshowConfirmButton:true,\n\t\t\t\t\t\t\tconfirmButtonText:\"cerrar\",\n\t\t\t\t\t\t\tclaseOnConfirm:false\n\t\t\t\t\t\t\t}).then((result)=>{\n\n\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\twindow.location=\"categorias\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t});\n\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t </script>';\n\n\n\t\t\t}\n\n\t\t}\n\n\n\t}", "protected function addElements(FormInterface $form, Category $category = null)\n {\n $form->add('category', EntityType::class, array(\n 'required' => true,\n 'data' => $category,\n 'placeholder' => 'Select a Category..',\n 'class' => 'App\\Entity\\Category'\n ))\n ->add('Create', SubmitType::class);\n }", "public function create()\n {\n return view('admin.category.insert');\n }", "public function servicecat(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t//prd($servicelist);\n\t\t\t\t\t\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}" ]
[ "0.69676876", "0.69144493", "0.69017804", "0.68650234", "0.68249476", "0.67566377", "0.6712905", "0.668728", "0.6656021", "0.6614073", "0.6611625", "0.6608978", "0.6608551", "0.65376264", "0.65324306", "0.6525535", "0.65221816", "0.6514171", "0.6511999", "0.6508002", "0.64992195", "0.6498333", "0.64611644", "0.6458852", "0.64521813", "0.64521384", "0.64497775", "0.6434786", "0.6422214", "0.6422101", "0.63840646", "0.6383456", "0.6372293", "0.63588494", "0.6357178", "0.63515097", "0.632658", "0.6304464", "0.62979645", "0.6287985", "0.6285044", "0.6281664", "0.6277808", "0.62648916", "0.6260376", "0.62433493", "0.62388", "0.6236515", "0.62291676", "0.6222569", "0.6219657", "0.6219167", "0.62177074", "0.6215356", "0.6213139", "0.62079096", "0.6193636", "0.6182471", "0.6182398", "0.6176555", "0.616953", "0.6168437", "0.61662424", "0.61495554", "0.61488706", "0.6144298", "0.6140037", "0.6137465", "0.613686", "0.613282", "0.6127363", "0.6124668", "0.61201096", "0.611854", "0.6116702", "0.6114296", "0.6103411", "0.6101548", "0.6101057", "0.61006314", "0.6095138", "0.6088746", "0.6088684", "0.6086131", "0.6082916", "0.6076874", "0.60758555", "0.60753286", "0.60707086", "0.60684204", "0.6060758", "0.6060669", "0.60590416", "0.6057703", "0.60574937", "0.6056578", "0.605238", "0.60516155", "0.6051336", "0.60507876" ]
0.7627313
0
/Store nutrition category data form
public function storeNutrationCategory(Request $request) { $this->validate($request,array( 'nutrationCategoryName' => 'required', //'tips' => 'required', )); $nutrationCategory = new NutrationCategory; $nutrationCategory->nutration_category_name = $request->nutrationCategoryName; //$nutrationCategory->tips = $request->tips; $nutrationCategory->save(); if($nutrationCategory->save()){ return redirect()->back()->with('success','Nutration category Saved successfully.'); } else{ return redirect()->back()->with('denger-success','Nutration category is not saved.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function storeCategory(array $data): void\n {\n }", "private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function addNutrationCategory()\n {\n return view('admin.addnutratoncategory');\n }", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "public function save_category_info($data) {\n $this->db->insert('tbl_category', $data);\n }", "public function store() {\n if ($id = Input::get('id')) {\n $category = Category::find($id);\n } else {\n $category = new Category();\n }\n\n $inputs = Input::only(['type', 'parent_id', 'name', 'description',\n 'slug', 'keywords', 'order', 'status', 'template']);\n $rules = [\n 'type' => 'in:subject,application,product',\n 'name' => 'required|min:1',\n 'order' => 'required|numeric',\n ];\n\n $validator = Validator::make($inputs, $rules);\n $validator->sometimes('slug', 'unique:categories,slug', function() use($inputs, $category) {\n return !empty($inputs['slug']) && ($category->slug != $inputs['slug']);\n });\n //todo: 循环继承的问题解决思路\n //在数据库存一个layer的字段,标明改分类的层级,p_id=0的为1层\n //递归n次得到p_id=0则为n层\n //最后对比大小禁止循环继承\n if ($validator->fails()) {\n $messages = $validator->messages()->toArray();\n return $this->msg($messages, 1);\n }\n\n $category->fill($inputs);\n $category->save();\n\n return $this->msg('success', 0);\n }", "public function store(){\n $query = require 'core/bootstrap.php';\n \n $category = $_POST['category'];\n if(empty($category)){\n Validate::errorValidation('Category\\'s name is required!');\n return back();\n }elseif(strlen($category) < 3){\n Validate::errorValidation('Category\\'s name must have up to 3 characters');\n return back();\n }else{\n\n $query->insert('categories',[\n 'name' => $category\n ]);\n \n Validate::successValidation('Category stored successfully!!!');\n return redirect('categories');\n }\n }", "private function SaveData()\n {\n // loop tanks and save data\n foreach ($this->tanks AS $tank_id => $data) {\n // get category id from tank id\n $category_id_tank = $this->CreateCategoryByIdentifier($this->InstanceID, $tank_id, $data['Name']);\n\n // loop tank data and add variables to tank category\n $position = 0;\n foreach ($data AS $key => $value) {\n $this->CreateVariableByIdentifier($category_id_tank, $key, $value, $position);\n $position++;\n }\n }\n }", "protected function saveCategoryFromCategory($form){\n $data = $this->getRequest()->getPost();\n //@todo: validate the data\n $form->setData($data);\n if ($form->isValid()) {\n \n $this->category->exchangeArray($form->getData());\n $categoryTable = $this->getServiceLocator()->get(\"Category\\Model\\CategoryTable\");\n $this->category = $categoryTable->saveCategory($this->category);\n \n if($id = $this->category->getId()){\n $this->redirect()->toRoute('category_home');\n }\n }else{\n \n }\n }", "function category_data()\n\t{\n\t\t$this->data['title'] \t= 'Portfolio Category Data';\n\t\t$this->data['category']\t= $this->portfolio_model->get_all_category();\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/category_data';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function store() {\n\t\t$data = $this->input->post();\n\t\t$insert['kode_kategori'] = $data['sub_kategori'];\n\t\t$insert['nama'] = $data['nama_kategori'];\n\t\tif ($data['induk'] != \"\") {\n\t\t\t$insert['kode_induk_kategori'] = $this->kategori_m->get_by(array('id' => $data['induk']))->kode_kategori;\n\t\t}\n\t\tif ($this->kategori_m->insert($insert)) {\n\t\t\t$this->message('Berhasil! Data berhasil di simpan', 'success');\n $this->cache->delete('homepage');\n $this->cache->delete('list_kategori');\n\t\t} else {\n\t\t\t$this->message('Gagal! Data gagal di simpan', 'danger');\n\t\t}\n\t\tredirect('kategori');\n\t}", "public function store()\n\t{\n\t\t$category \t\t= \tInput::get('category');\n\t\t$categoryList \t=\tInput::get('categoryList');\n\t\tif ($category \t== \tnull) : \n\t\t\treturn Redirect::route('admin.categories.index')->with('message-error','همه گزینه ها اجباری است.')->withInput();\n\t\tendif;\n\t\tCategory::setCategory($category,$categoryList);\n\t\treturn Redirect::route('admin.categories.index')->with('message-success','دسته ایجاد شد.');\n\t}", "public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }", "function _arc_meta_category_meta($event, $step, $data, $rs)\n{\n // category types).\n if ($rs['type']!='article') {\n return $data;\n }\n\n // Get the existing meta data for this category.\n $meta = _arc_meta('category', $rs['name'], true);\n\n $form = hInput('arc_meta_id', $meta['id']);\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_title\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_title'), 'label', ' for=\"arc_meta_title\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . fInput('text', 'arc_meta_title', $meta['title'], '', '', '', '32', '', 'arc_meta_title') . '</div>';\n $form .= '</div>';\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_image\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_image'), 'label', ' for=\"arc_meta_image\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . fInput('number', 'arc_meta_image', $meta['image'], '', '', '', '32', '', 'arc_meta_image') . '</div>';\n $form .= '</div>';\n $form .= '<div class=\"txp-form-field edit-category-arc_meta_robots\">';\n $form .= '<div class=\"txp-form-field-label\">' . tag(gtxt('arc_meta_robots'), 'label', ' for=\"arc_meta_description\"') . '</div>';\n $form .= '<div class=\"txp-form-field-value\">' . selectInput('arc_meta_robots', _arc_meta_robots(), $meta['robots'], 'arc_meta_robots') . '</div>';\n $form .= '</div>';\n\n return $data . $form;\n}", "public function store()\n\t{\n\t\t$description = Input::get('description'); \n\t\t$acronym = substr($description, 0, 1);\n\t\t$category = new Category(); \n\t\t$category->language_id = Input::get('language_id'); \n\t\t$category->description = $description;\n\t\t$category->acronym = $acronym;\n\t\t$category->save(); \n\t\treturn Response::json(array('success'=>'Categoria registrada exitosamente')); \n\t}", "public function postStore()\n\t{\n\t\t$response['status'] = 'error';\n\t\t$response['message'] = trans('categories.not_created');\n\n\t\tif ( ! empty($_POST))\n\t\t{\n\t\t\t$error = FALSE;\n\n\t\t\tif (empty(trim(Input::get('title'))))\n\t\t\t{\n\t\t\t\t$response['message'] = trans('categories.title_required');\n\t\t\t\t$error = TRUE;\n\t\t\t}\n\n\t\t\t$category_level = Input::get('level');\n\t\t\t$parent = Input::get('parent');\n\t\t\tif ( ! empty($category_level) && in_array($category_level, ['1', '2']))\n\t\t\t{\n\t\t\t\tif (empty($parent))\n\t\t\t\t{\n\t\t\t\t\t$response['message'] = trans('categories.parent_required');\n\t\t\t\t\t$error = TRUE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($error === FALSE)\n\t\t\t{\n\t\t\t\t$data = [\n\t\t\t\t\t'title' => trim(Input::get('title')),\n\t\t\t\t\t'description' => Input::get('description'),\n\t\t\t\t\t'level' => $category_level,\n\t\t\t\t\t'parent' => $parent,\n\t\t\t\t\t'size_group' => Input::get('size_group'),\n\t\t\t\t\t'position' => Input::get('position'),\n\t\t\t\t\t'visible' => Input::get('visible'),\n\t\t\t\t\t'active' => Input::get('active'),\n\t\t\t\t\t'page_title' => Input::get('page_title'),\n\t\t\t\t\t'meta_description' => Input::get('meta_description'),\n\t\t\t\t\t'meta_keywords' => Input::get('meta_keywords'),\n\t\t\t\t];\n\n\t\t\t\tif (($id = Model_Categories::createCategory($data)) > 0)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t//Manage Friendly URL\n\t\t\t\t\t\tModel_Categories::setURL($id, Input::get('friendly_url'));\n\n\t\t\t\t\t\t$response['status'] = 'success';\n\t\t\t\t\t\t$response['message'] = trans('categories.created');\n\t\t\t\t\t\t$response['category_id'] = $id;\n\t\t\t\t\t} catch (Exception $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t$response['message'] = $e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$response['message'] = trans('categories.not_created');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn response()->json($response);\n\t}", "public function categoryStore(Request $request){\n $category = new ProductCategory();\n $category->category_name = $request->category_name;\n $category->company_id = company_id();\n $category->save();\n return redirect()->back();\n }", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "public function store()\n {\n /* VALIDATE DATA COMING IN FROM FORM */\n $this->validate(request(), [\n 'name' => 'required',\n 'is_active' => 'required'\n ]);\n /* CREATE AND SAVE NEW CATEGORY TO DATABASE */\n Category::create([\n 'name' => request('name'),\n 'is_active' => request('is_active')\n ]);\n /* REDIRECT USER AFTER SAVE */\n session()->flash('message', 'Category Added Successfully');\n return redirect()->route('categories.index');\n }", "public function addNutritionalBenefit(){\n \t$id = $this->formValueForKey(\"nutritionalBenefitSelection\");\n \n \t$foundNutritionalBenefit = BLGenericRecord::recordMatchingKeyAndValue(\"NutritionalBenefit\", \"id\", $id);\n \t$this->currentRecipe()->addNutritionalBenefit($foundNutritionalBenefit);\n }", "public function run()\n {\n Category::insert([\n \t['name'=>'Sci-fi','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Suspense','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Religious','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Romance','created_at'=>NULL,'updated_at'=>NULL]]);\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Opdcasecategory::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tOpdcasecategory::create($data);\n\n\t\treturn Redirect::route('opdcasecategories.index');\n\t}", "public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required|unique:product_characteristics,name',\n ]);\n\n ProductCharacteristic::create($request->input());\n\n return redirect()->route('product-characteristics.index')->with('success', 'Category created successfully');\n }", "public function addCathegory($values)\n\t{\n\t\treturn $this->getTable('kategoria')->insert(array(\n\t\t\t'Nazov' => $values->nazov,\n\t\t));\n\t}", "public function storeCategory()\n {\n $this->validate([\n 'name' =>'required',\n 'slug' =>'required|unique:categories'\n ]);\n $category = new Category();\n $category->name = $this->name; \n $category->slug = $this->slug;\n $category->save();\n $this->dispatchBrowserEvent('success');\n //$this->emit('alert', ['type' =>'success', 'message' => 'Operation Successful']);\n //session()->flash('message', 'Category has been saved successfully');\n //$this->dispatchBrowserEvent('hide-form', ['message' => 'Category Added Successfully']);\n }", "public function store()\n\t{\n\t\t$img = $this->save_file(Input::file('thumbnail'), 60, 25, 'categories');\n\t\t//滚动图像\n\t\t$slides = array();\n\t\tif(Input::hasFile('slides')){\n\t\t\tforeach(Input::file('slides') as $file){\n\t\t\t\t$slides[] = $this->save_file($file, 50, 14, 'categories');\n\t\t\t}\n\t\t}\n\t\t$slide = serialize($slides);\n\n\t\t$inputs = Input::except('thumbnail', 'slides');\n\t\t$inputs['thumbnail'] = $img;\n\t\t$inputs['slides'] = $slide;\n\n\t\t$category = Category::create($inputs);\n if ( !$category->errors()->all() )\n {\n return Redirect::route('admin.categories.index')\n ->with('success', Lang::get('cpanel::common.create_success'));\n }\n\n return Redirect::back()\n ->withInput()\n ->withErrors($category->errors());\n\t}", "public function store()\n {\n $this->validate(request(),[\n 'categoryname' => 'required',\n 'description' => 'max:200'\n ]);\n\n $cateName=strtolower(trim(request('categoryname')));\n $testCate=Category::where('name','=',$cateName)->first();\n $categorydes=request('description');\n //if there is no category create new one\n if($testCate==null){\n\n $newcategory=Category::create([\n 'teacher_id' => auth('teacher')->id(),\n 'name' => request('categoryname'),\n 'description' => $categorydes\n ]);\n\n $newcategory->description=$categorydes;\n $newcategory->save();\n session()->flash('message','categoty successfully created');\n return redirect(route('teacher.dashboard'));\n\n }\n else {\n\n session()->flash('message','duplicate category name');\n return redirect()->back();\n\n }\n\n }", "public function store($categoria)\n {\n $this->db->insert('categorias', $categoria);\n }", "public function createCategory();", "public function run()\n\t{\n\t\tModel::unguard();\n\n\t\tDdgCategory::create([\n\t\t\t'id' => CategoryConstant::CATEGORY_INDIVIDUAL,\n\t\t\t'name' => '個人情報系',\n\t\t]);\n\n\t\tDdgCategory::create([\n\t\t\t'id' => CategoryConstant::CATEGORY_WEB,\n\t\t\t'name' => 'Web系',\n\t\t]);\n\n\t\tDdgCategory::create([\n\t\t\t'id' => CategoryConstant::CATEGORY_TIME,\n\t\t\t'name' => '時間系',\n\t\t]);\n\n\t\tDdgCategory::create([\n\t\t\t'id' => CategoryConstant::CATEGORY_OTHER,\n\t\t\t'name' => '未分類',\n\t\t]);\n\t}", "function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }", "private function runCategory()\n {\n $num = (int) $this->ask('How many records do you want to create for the categories table?');\n factory(Category::class, $num)->create();\n }", "function realstate_form($catId = null) {\n if ($catId!= null) {\n // We check if the category is the same as our plugin\n if (osc_is_this_category('realstate_plugin', $catId)) {\n $conn = getConnection() ;\n $data = $conn->osc_dbFetchResults('SELECT * FROM %st_item_house_property_type_attr', DB_TABLE_PREFIX);\n $p_type = array();\n foreach ($data as $d) {\n $p_type[$d['fk_c_locale_code']][$d['pk_i_id']] = $d['s_name'];\n }\n unset($data);\n include_once 'item_edit.php';\n }\n }\n}", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "public function addCategory()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['category'];\n\t\t\t$sql = \"insert into lib_category (category,add_date,staff_id) \n\t\t\t\t\tvalues('\" . $category . \"','\" . date('Y-m-d') . \"','\" . cookie('staffAccount') . \"') \";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Add successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function store(Request $request)\n {\n // $this->validate($request, [\n // 'text' => 'required|max:255',\n // ]);\n\n // $request->user()->categories()->create([\n // 'text' => $request->text,\n // ]);\n/*\n $category = new Category;\n $category->name = $request->name;\n $category->color = $request->color;\n $category->user_id = $request->user()->id;\n $category->save();\n*/\n\n $category = $request->user()->categories()->create([\n 'name' => $request->name,\n 'color'=> $request->color,\n ]);\n\n $obj = array();\n $obj['html'] = view('frontend.category_item', [\n 'category' => $category,\n ])->render();\n $obj['jsonCategory'] = json_encode($category);\n return $obj;\n }", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "function save_extra_category_fileds( $term_id ) {\n\tif ( isset( $_POST['term_meta'] ) ) {\n\t\t$tag_id\t\t= $term_id;\n\t\t$term_meta\t= get_option( \"category_$tag_id\" );\n\t\t$cat_keys\t= array_keys( $_POST['term_meta'] );\n\t\tforeach ( $cat_keys as $key ) {\n\t\t\tif ( isset( $_POST['term_meta'][$key] ) ) {\n\t\t\t\t$term_meta[$key] = $_POST['term_meta'][$key];\n\t\t\t}\n\t\t}\n\t\t//save the option array\n\t\tupdate_option( \"category_$tag_id\", $term_meta );\n\t}\n}", "public function store(MicategoryRequest $request)\n {\n //\n M_i_category::create($request->all());\n \\Session::flash('flash_message','M Item Category 情報を追加しました');\n return redirect('micategories');\n }", "public function run()\n {\n //\n $categories = [\n ['name' => 'Spoon'],\n ['name' => 'Fork'],\n ['name' => 'Cups'],\n ['name' => 'Plates'],\n ['name' => 'Knife'],\n ];\n UtensilCategory::insert($categories);\n }", "public function get_category_form_by_ajax() {\n $category_count = $_POST['id'];\n $data['category_id'] = $category_count;\n $data['category_branch_location'] = $this->get_branch_location();\n $data['get_printer'] = $this->get_printer();\n $this->load->view('restaurant/category/insert_category_form', $data);\n }", "public function store(CategoryRequest $request)\n {\n /*Guardar Datos en la DB con el metodo all que envia todos los campos establecidos\n en el modelo en el campo protected $fillable*/\n Category::create($request->all());\n //Redireccionar al index\n return redirect()->route('category.index');\n }", "public function store(CategoryCreateRequest $request)\n {\n $datoscategoria = request()->all();\n categoria::create($datoscategoria);\n /* Envia mensaje */\n toast('¡Categoria guardada!','success');\n return redirect()->action('productoscrud@create');\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'head_category' => 'required',\n 'category' => 'required',\n ]);\n\n $category = new Category;\n\n $category->cat_name = $request->category;\n $category->cat_slug = str_slug($request->category, '-');\n $category->level = 1;\n $category->parent_id = $request->head_category;\n \n $category->save();\n\n Session::flash('success','Your data is save.');\n \n return redirect()->route('subcategory.index');\n }", "public function store(Request $request)\n {\n request()->validate([\n 'category' => 'required',\n ]);\n\n\n Indicatorcategory::create($request->all());\n\n\n return redirect()->route('indicatorcategories.index')\n ->with('success','Category created successfully.');\n }", "function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}", "function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function run()\n {\n DB::table('category')->insert($this->getData());\n }", "public function save_category_form( $term_id ) {\n\t\tif( $this->save_count < 1 ) :\n\n\t\t\t$id = $this->args['id'];\n\t\t\t$data = Database::get_row( $this->args['table'], 'cat_id', $term_id );\n\n\t\t\tforeach( $this->args['table']['structure'] as $name => $args ) {\n\t\t\t\t$data[$name] = isset( $_POST[$name] ) ? $_POST[$name] : $data[$name];\n\t\t\t}\n\n\t\t\tif( empty( $data['cat_id'] ) ) {\n\t\t\t\t$data['cat_id'] = $term_id;\n\t\t\t\tDatabase::insert_row( $this->args['table'], $data );\n\t\t\t} else {\n\t\t\t\tDatabase::update_row( $this->args['table'], 'cat_id', $term_id, $data );\n\t\t\t}\n\n\t\t\t$this->save_count++;\n\n\t\tendif;\n\n\t}", "public function category()\n { \n if($this->access_role->is_Admin() == false) show_404();\n $this->load->model('Category_Model');\n \n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n if($this->form_validation->run('category_insert') ){\n $this->Category_Model->add_category(); \n } else {\n $error = ['class'=>'warning','text'=> validation_errors()];\n $this->session->set_flashdata('sms_flash', $error); \n redirect('Dashboard/category');\n }\n } \n else{\n $data = $this->Category_Model->view_category();\n }\n \n $this->load->view('admin/category_content',$data);\n }", "public function store() {\n\n $input = Input::get('attribute');\n\n if ($this->attributeSubcategory->save($input)) {\n // Success!\n return Redirect::to('/attribute_subcategory')\n ->withSuccess(Lang::get('segment.attributetype.message.success.store'))\n ->with('status', 'success');\n } else {\n\n return Redirect::to('/attribute_subcategory')\n ->withInput()\n ->withErrors($this->attributeSubcategory->errors())\n ->with('status', 'error');\n }\n }", "function realstate_form_post($catId = null, $item_id = null) {\n $conn = getConnection() ;\n if ($catId!=null) {\n // We check if the category is the same as our plugin\n if (osc_is_this_category('realstate_plugin', $catId) && $item_id!=null) {\n // Insert the data in our plugin's table\n $conn->osc_dbExec(\"REPLACE INTO %st_item_house_attr (fk_i_item_id, s_square_meters, i_num_rooms, i_num_bathrooms, e_type, fk_i_property_type_id, e_status, i_num_floors, i_num_garages, b_heating, b_air_condition, b_elevator, b_terrace, b_parking, b_furnished, b_new, b_by_owner, s_condition, i_year, s_agency, i_floor_number, i_plot_area ) VALUES (%d, %d, %d, %d, '%s', %d, '%s', %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, '%s', %d, '%s', %d, %d)\",\n DB_TABLE_PREFIX,\n $item_id,\n Params::getParam('squareMeters'),\n Params::getParam('numRooms'),\n Params::getParam('numBathrooms'),\n Params::getParam('property_type'),\n Params::getParam('p_type'),\n Params::getParam('status'),\n Params::getParam('numFloors'),\n Params::getParam('numGarages'),\n (Params::getParam('heating')!='') ? 1 : 0,\n (Params::getParam('airCondition')!='') ? 1 : 0,\n (Params::getParam('elevator')!='') ? 1 : 0,\n (Params::getParam('terrace')!='') ? 1 : 0,\n (Params::getParam('parking')!='') ? 1 : 0,\n (Params::getParam('furnished')!='') ? 1 : 0,\n (Params::getParam('new')!='') ? 1 : 0,\n (Params::getParam('by_owner')!='') ? 1 : 0,\n Params::getParam('condition'),\n Params::getParam('year'),\n Params::getParam('agency'),\n Params::getParam('floorNumber'),\n Params::getParam('squareMetersTotal')\n );\n // prepare locales\n $dataItem = array();\n foreach ($_REQUEST as $k => $v) {\n if (preg_match('|(.+?)#(.+)|', $k, $m)) {\n $dataItem[$m[1]][$m[2]] = $v;\n }\n }\n\n // insert locales\n foreach ($dataItem as $k => $_data) {\n $conn->osc_dbExec(\"REPLACE INTO %st_item_house_description_attr (fk_i_item_id, fk_c_locale_code, s_transport, s_zone) VALUES (%d, '%s', '%s', '%s')\",\n DB_TABLE_PREFIX,\n $item_id,\n $k,\n $_data['transport'],\n $_data['zone']\n );\n }\n }\n }\n}", "public function add_new_category_post(){\n $data = $this->security->xss_clean($_POST);\n $data = $this->DeviceCategory_model->add_new_category($data);\n if (isset($data['status']) == 'FALSE')\n {\n $this->response($data, REST_Controller::HTTP_SEE_OTHER);\n }\n $this->set_response($data, REST_Controller::HTTP_CREATED);\n }", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'name' => 'required'\n\t\t);\n\t\t$input = Input::except('_token');\n\t\t$validator = Validator::make($input,$rules);\n\t\tif($validator->fails()) {\n\t\t\treturn Redirect::action('CategoryController@create')\n\t ->withErrors($validator)\n\t ->withInput(Input::except('password'));\n } else {\n\t\t\t$inputCategory = Input::only('name');\n\t\t\t$input['game_id'] = CommonNormal::create($inputCategory);\n\t\t\t// if (Input::get('category_parent_id')) {\n\t\t\t// \tforeach (Input::get('category_parent_id') as $value) {\n\t\t\t// \t\t$input['category_parent_id'] = $value;\n\t\t\t// \t\tCommonNormal::create($input, 'GameRelation');\n\t\t\t// \t}\n\t\t\t// }\n\t\t\treturn Redirect::action('CategoryController@index') ;\n\t\t}\n\t}", "public function addDietaryCategory(){\n \t$id = $this->formValueForKey(\"dietaryCategorySelection\");\n \t \n \t$foundDietaryCategory = BLGenericRecord::recordMatchingKeyAndValue(\"DietaryCategory\", \"id\", $id);\n \t$this->currentRecipe()->addDietaryCategory($foundDietaryCategory);\n }", "public function store(categoryrequest $request)\n { \n /*replace validator to categoryrequest*/\n category::create($request->all());// if you have lot of columns you can use it\n session()->flash('success','category created successfully');\n\n return redirect(route('categories.index'));\n }", "public function store(array $data, $_category_id)\n {\n $category = $this->find(new Category(), $_category_id);\n\n $data['category_id'] = $category->id;\n return Category::create($data);\n }", "function store()\n\t{\n\t\t$name = getParameter('name');\n\t\t$price = getParameter('price');\n\t\t$quantity = getParameter('quantity');\n\t\t$category = getParameter('category');\n\t\t$brand = getParameter('brand');\n\n\t\t// if ($category == 'VEST') {\n\t\t// \t$category = 1;\n\t\t// } elseif ($category == 'SƠ MI') {\n\t\t// \t$category = 2;\n\t\t// } elseif ($category == 'CARAVAT') {\n\t\t// \t$category = 3;\n\t\t// } elseif ($category == 'NƠ') {\n\t\t// \t$category = 4;\n\t\t// } elseif ($category == 'KHĂN CÀI VEST') {\n\t\t// \t$category = 5;\n\t\t// } elseif ($category == 'GIÀY DA') {\n\t\t// \t$category = 6;\n\t\t// } elseif ($category == 'ÁO DA') {\n\t\t// \t$category = 7;\n\t\t// } elseif ($category == 'QUẦN ÂU') {\n\t\t// \t$category = 8;\n\t\t// }\n\n\t\t// if ($brand == 'Adam') {\n\t\t// \t$brand = 1;\n\t\t// }\n\n\t\t$errors = [];\n\t\t// if (!$name) {\n\t\t// \t$errors['name'] = 'Vui long nhap name';\n\t\t// }\n\t\t// if (!$price) {\n\t\t// \t$errors['price'] = 'Vui long nhap price';\n\t\t// }\n\n\t\tif (count($errors) > 0) {\n\t\t\t$this->view->load('product/add', [\n\t\t\t\t'errors' => $errors\n\t\t\t]);\n\t\t} else {\n\t\t\t$product = $this->model->product->create([\n\t\t\t\t'name' => $name,\n\t\t\t\t'price' => $price,\n\t\t\t\t// 'image' => $ImageName,\n\t\t\t\t'quantity' => $quantity,\n\t\t\t\t'categories_id' => $category,\n\t\t\t\t'brand_id' => $brand\n\t\t\t]);\n\n\t\t\tif ($product) {\n\t\t\t\tredirect('product/index');\n\t\t\t} else {\n\t\t\t\t$this->view->load('product/add', [\n\t\t\t\t\t'error_message' => 'Khong them duoc'\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t}", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "function addCate()\n{\n $arr = $_POST;\n if (insert(\"shopping_cate\", $arr)) {\n $mes = \"add category success\";\n } else {\n $mes = \"add category failed\";\n }\n return $mes;\n}", "function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->begin( );\r\n\r\n $name = $db->escapeString( $this->Name );\r\n $description = $db->escapeString( $this->Description );\r\n\r\n if ( !isset( $this->ID ) )\r\n {\r\n $db->lock( \"eZImageCatalogue_Category\" );\r\n\r\n $this->ID = $db->nextID( \"eZImageCatalogue_Category\", \"ID\" );\r\n\r\n $db->query( \"INSERT INTO eZImageCatalogue_Category\r\n ( ID, Name, Description, UserID, ParentID, SectionID ) VALUES\r\n ( '$this->ID', '$name', '$description', '$this->UserID', '$this->ParentID', '$this->SectionID' )\" );\r\n $db->unlock();\r\n }\r\n else\r\n {\r\n $db->query( \"UPDATE eZImageCatalogue_Category SET\r\n Name='$name',\r\n Description='$description',\r\n UserID='$this->UserID',\r\n ParentID='$this->ParentID',\r\n SectionID='$this->SectionID' WHERE ID='$this->ID'\" );\r\n }\r\n\r\n\r\n if ( $dbError == true )\r\n $db->rollback( );\r\n else\r\n $db->commit();\r\n\r\n\r\n return true;\r\n }", "public function store(CategoryRequest $request)\n { \n $data = $request->all();\n\n $data['slug'] = str_slug($data['name']);\n\n $data['level'] += 1;\n\n $category = Category::insertData($data);\n\n return $category; \n \n }", "public function store(Request $request)\n {\n SubCatagory::create([ \n 'product_catagorie_id' => $request -> product_catagorie_id,\n 'sub_catagory_name' => $request -> sub_catagory_name,\n \n ]);\n return redirect() -> route('subcatagory.index') -> with('success', 'Slider Added Successfull');\n }", "public function add_attr_cat()\n\t{\n\t\t$rest_id=$this->session->userdata('user_rest_uns');\n\t\t$cat_name=$this->input->post('cat_name');\n\t\t$query=$this->db->insert(\"food_attribute\",array(\"f_att_name\"=>$cat_name,\"rest_id\"=>$rest_id));\n\t\t\n\t\tif($query)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function store()\n\t{\n\t\t$category = Category::create(['name' => \\Input::get('name')]);\n\n\t\tif($category){\n\t\t\treturn \"true\";\n\t\t}\n\t\treturn \"false\";\n\t}", "public function store()\n {\n $categories = Category::all();\n\n $subcategory = new Subcategory;\n $subcategory->name = request('name');\n foreach($categories as $category){\n if($category->name == request('cat')){\n $subcategory->categories_id = $category->id;\n }\n }\n $subcategory->save();\n\n return redirect('/cms/categories')->with('success', 'Subcategory was added succesfully');\n }", "public function store(Request $request)\n {\n $this->validateInput($request);\n $uniqueSlug = $this->buildUniqueSlug('trend_category', null, $request->slug);\n\n $path = base_path() . '/' . 'storage/app/trends';\n $newFolderPath = $this->buildNewFolderPath($path, $uniqueSlug);\n File::makeDirectory($newFolderPath[1], 0777, true, true);\n\n $files = $request->file('image');\n foreach ($files as $key => $file) {\n $fileName[$key] = $file->hashName();\n $file->store('trends/' . $newFolderPath[0]);\n }\n $image_json = json_encode($fileName);\n\n \n\n $keys = ['category_id', 'title', 'description', 'content', 'is_active'];\n $input = $this->createQueryInput($keys, $request);\n $input['image'] = $image_json;\n $input['avatar'] = $fileName[0];\n $input['slug'] = $uniqueSlug;\n \n\n $insert = Trend::create($input);\n if(!$insert){\n File::deleteDirectory('storage/app/trends/' . $uniqueSlug);\n }\n\n return redirect()->intended('admin/trend');\n }", "function add_category() {\r\n\r\n\tif(isset($_POST['addcategory'])){\r\n\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\tif(empty($_POST['cat_parent_id'])){$cat_parent_id\t\t= \"0\";}\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\t\r\n\r\n\t\t$xyquery = \"INSERT INTO categories (\";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"cat_name \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",cat_desc_short \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",cat_desc_long \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",cat_url\";}\r\n\t\t$xyquery .= \",cat_date\";\r\n\t\t$xyquery .= \",cat_mod\";\r\n\t\t$xyquery .= \",cat_mod_by\";\r\n\t\tif (!empty($page_template)){$xyquery .= \",page_template\";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",cat_meta_title\";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",cat_meta_keywords\";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",cat_meta_description\";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \") VALUES ( \";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"'$cat_name' \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",'$cat_desc_short' \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",'$cat_desc_long' \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",'$cat_parent_id' \";\t}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",'0' \";\t}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",'$cat_url' \";}\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",'$cat_mod_by' \";\r\n\t\tif (!empty($page_template)){$xyquery .= \",'$page_template' \";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",'$cat_meta_title' \";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",'$cat_meta_keywords' \";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",'$cat_meta_description' \";}\r\n\t\tif (!empty($insert_keywords)){$xyquery .= \",'$insert_keywords' \";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \" )\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" has been created!</h4></center>\";\r\n\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been created.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "function index_post() {\n $data = $this->categoriesmodel->get_all_categories();\n\n $inventory_id = generate_id('inventory');\n\n $category_data = array(\n 'inventoryID'=> $inventory_id,\n 'categories'=> $data\n );\n echo json_encode($category_data);\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "function savecat(){\n\n $data =[\n\n 'reservation_category' => $_POST['reservation_category'],\n 'category_description' => $_POST['category_description'],\n 'reservation_duration' => $_POST['reservation_duration']\n\n ];\n\n insert( 'reservation_categories', $data );\n\n redirect( route('dashboard/reservation/categories') );\n}", "public static function storeAppreciations()\n {\n // Get the json file\n $json = file_get_contents(base_path('database/data/appreciations.json'));\n $data = json_decode($json, true);\n\n foreach ($data as $category) {\n // Create a category\n $new_cat = Category::create([\n 'name' => $category['name'],\n 'protected' => true,\n ]);\n\n foreach ($category['appreciations'] as $appreciation) {\n // For each object create an appreciation\n Appreciation::create([\n 'level' => $appreciation['level'],\n 'content' => $appreciation['content'],\n 'category_id' => $new_cat->id,\n 'protected' => true,\n ]);\n }\n }\n }", "public function store(Request $request) {\n\n $this->validate($request, [\n 'catname' => 'required'\n ]);\n\n $category = categories::create([\n 'cat_name' => $request->catname\n ]);\n\n\n Session::flash('success','New Data Added Successfully!..');\n return redirect()->route('categories');\n }", "function read_Categories() {\n\n\t\tglobal $myCategories;\n\t\tglobal $gesamt;\n\t\t\n\t\t$i = 0;\n\t\t\n\t\tforeach ($myCategories as $catInfo):\n\t\t\n\t\t$test=$myCategories->category[$i]['typ'];\n\t\t\n\t\tarray_push($gesamt, $test);\n\t\t\n\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "public function insert_category() {\n $counter = $_POST['category_form_number'];\n $data = array();\n for ($i = 1; $i <= $counter; $i++) {\n\n $config['upload_path'] = \"assets/lib/images/category/\";\n $config['allowed_types'] = 'jpg|png|jpeg';\n\n $this->load->library('upload', $config);\n\n $imagename = $_FILES['category_image_' . $i]['name'];\n $this->upload->initialize($config);\n\n\n if (!$this->upload->do_upload('category_image_' . $i)) {\n $error = array('error' => $this->upload->display_errors());\n } else {\n $success = array('image_metadata' => $this->upload->data());\n }\n\n $ar_name = $_POST['category_ar_name_' . $i];\n $en_name = $_POST['category_en_name_' . $i];\n $discount = $_POST['category_discount_' . $i];\n\n\n if (isset($_POST['category_printer_' . $i])) {\n $printer = json_encode($_POST['category_printer_' . $i]);\n } else {\n $printer = NULL;\n }\n\n if (isset($_POST['category_brnach_location_' . $i])) {\n $branch_location = $_POST['category_brnach_location_' . $i];\n foreach ($branch_location as $key => $value) {\n $branch_location_id = $value;\n $sub_array = array('ar_name' => $ar_name, 'en_name' => $en_name, 'discount' => $discount / 100, 'branch_location_id' => $branch_location_id, 'image' => $imagename, 'printer_id' => $printer);\n array_push($data, $sub_array);\n }\n } else {\n $branch_location_id = NULL;\n $sub_array = array('ar_name' => $ar_name, 'en_name' => $en_name, 'discount' => $discount / 100, 'branch_location_id' => $branch_location_id, 'image' => $imagename, 'printer_id' => $printer);\n array_push($data, $sub_array);\n }\n }\n $this->Category_crud->insert_category($data);\n redirect(rest_path('Category'));\n }", "public function store(Request $request) {\n// echo json_encode($request->input());\n// exit();\n\n\n $this->validate($request, [\n 'category' => 'required|max:255|unique:tbl_file_category'\n ]);\n\n\n $formdata = array(\n 'category' => $request->input('category'),\n );\n\n $types = Tbl_file_category::create($formdata);\n if ($types->fc_id > 0) {\n return redirect('admin/filecategory')->with('success', 'Created Successfully...!');\n } else {\n return redirect('admin/filecategory')->with('error', 'Error occurred. Please try again...!');\n }\n }", "public function add_acct_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\nif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Accounts Category Created Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\ntheme('add_acct_category');\n\t}", "function store_addcategory()\r\n{\r\n\tglobal $_user;\r\n\tglobal $dropbox_cnf;\r\n\r\n\t// check if the target is valid\r\n\tif ($_POST['target']=='sent')\r\n\t{\r\n\t\t$sent=1;\r\n\t\t$received=0;\r\n\t}\r\n\telseif ($_POST['target']=='received')\r\n\t{\r\n\t\t$sent=0;\r\n\t\t$received=1;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// check if the category name is valid\r\n\tif ($_POST['category_name']=='')\r\n\t{\r\n\t\treturn get_lang('ErrorPleaseGiveCategoryName');\r\n\t}\r\n\r\n\tif (!$_POST['edit_id'])\r\n\t{\r\n\t\t// step 3a, we check if the category doesn't already exist\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE user_id='\".$_user['user_id'].\"' AND cat_name='\".Database::escape_string($_POST['category_name']).\"' AND received='\".$received.\"' AND sent='\".$sent.\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\r\n\r\n\t\t// step 3b, we add the category if it does not exist yet.\r\n\t\tif (mysql_num_rows($result)==0)\r\n\t\t{\r\n\t\t\t$sql=\"INSERT INTO \".$dropbox_cnf['tbl_category'].\" (cat_name, received, sent, user_id)\r\n\t\t\t\t\tVALUES ('\".Database::escape_string($_POST['category_name']).\"', '\".Database::escape_string($received).\"', '\".Database::escape_string($sent).\"', '\".Database::escape_string($_user['user_id']).\"')\";\r\n\t\t\tapi_sql_query($sql);\r\n\t\t\treturn get_lang('CategoryStored');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn get_lang('CategoryAlreadyExistsEditIt');\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$sql=\"UPDATE \".$dropbox_cnf['tbl_category'].\" SET cat_name='\".Database::escape_string($_POST['category_name']).\"', received='\".Database::escape_string($received).\"' , sent='\".Database::escape_string($sent).\"'\r\n\t\t\t\tWHERE user_id='\".Database::escape_string($_user['user_id']).\"'\r\n\t\t\t\tAND cat_id='\".Database::escape_string($_POST['edit_id']).\"'\";\r\n\t\tapi_sql_query($sql);\r\n\t\treturn get_lang('CategoryModified');\r\n\t}\r\n}", "public function run()\n {\n $category = [\n [\n \t'name' => 'Household'\n ],\n [\n 'name' => 'Construction'\n ],\n [\n 'name' => 'Personel'\n ],\n [\n 'name' => 'Maintenance'\n ]\n ];\n\n DB::table('categories')->insert($category);\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Category::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tCategory::create($data);\n\n\t\treturn Redirect::route('adm/categories');\n\n\t}", "function upload_metas(){\r\n\t\r\n\t\t$cat_id \t\t\t= clean_input($_POST['cat_id']);\r\n\t\t$cat_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_keywords \t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_descriptions \t= clean_input($_POST['cat_meta_description']);\r\n\t\t\r\n\t\tif(isset($_POST['upload'])){\r\n\t\t\r\n\t\t$query = \"INSERT INTO categories WHERE cat_id ='$cat_id' \";\r\n\t\t$result = mysql_query($query) or die(mysql_error());\r\n\t\t\r\n\t\treturn $result;\r\n\t\t}\r\n\t}", "public function store()\n\t{\n\t\t// validate\n\t\t// read more on validation at http://laravel.com/docs/validation\n\t\t$rules = array(\n\t\t\t'title' => 'required|unique:question-categories',\n\t\t\t'order' => 'required'\n\t\t);\n\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t// process the login\n\t\tif ($validator->fails()) {\n\t\t\tSession::flash('error_message', 'Validation error, please check all required fields.');\n\t\t\treturn Redirect::to('admin/question-categories/create')\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput(Input::except('password'));\n\t\t}\n\n\t\t// Store\n\t\t$category \t\t\t= new QuestionCategory;\n\t\t$category->title \t= Input::get('title');\n\t\t$category->slug \t= Str::slug(Input::get('title'));\n\t\t$category->order \t= Input::get('order');\n\t\t$category->created_by = Auth::user()->id;\n\n\t\t$category->save();\n\n\t\t// redirect\n\t\tSession::flash('success_message', Input::get('title') . ' category has been aded.');\n\n\t\treturn Redirect::to('admin/question-categories');\n\t}", "public function run()\n {\n Category::factory()\n ->count(3)\n ->create(\n [[\n \"name\" => 'Assets',\n \"resourceType\" => 'ACCOUNT',\n ],\n [\n \"name\" => 'Income',\n \"resourceType\" => 'ACCOUNT'\n ],\n [\n \"name\" => 'Expense',\n \"resourceType\" => 'ACCOUNT'\n ]]\n );\n\n \n }", "public function add_category() {\n\t\n\t\tif($this->input->post('add_type')=='add_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name'),\n\t\t'created_at' => date('d-m-Y h:i:s')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->add_assets_category($data);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_added');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function showCategoryForm() {\n $company_logo = $this->showLogoImage();\n $category_images = \\App\\CouponCategory::categoryList();\n $signup_category_images = \\App\\CouponCategory::categoryListWeb();\n $country_list = \\App\\Country::countryList();\n\n return view('frontend.signup.category')->with(['company_logo' => $company_logo,\n 'category_images' => $category_images, 'signup_category_images' => $signup_category_images,\n 'country_list' => $country_list]);\n }", "public function store(Request $request)\n {\n DB::beginTransaction();\n $validatedData = $request->validate([\n 'category_name' => 'required|unique:categories,category_name|max:255',\n 'description'=> 'nullable',\n 'image'=>'file|image|mimes:jpeg,png,gif,webp|max:2048',\n 'type'=> 'required|in:rental,sales,none',\n 'sub_category'=> 'nullable',\n 'display_order'=> 'required'\n ]);\n \n $category = Category::create([\n 'category_name'=>$validatedData['category_name'],\n 'description'=> $validatedData['description'],\n 'type'=> $validatedData['type'],\n 'sub_category'=> $validatedData['sub_category'],\n 'display_order'=> $validatedData['display_order']\n ]);\n $category->file()->create($category->upload($validatedData['image']));\n foreach (json_decode($request->big_array, TRUE) as $key => $value) {\n $form_item= FormItem::create([\n 'name'=> $value['name'],\n 'type'=> $value['type'],\n 'required'=> ($value['mandatory']== 'yes')?'1':'0',\n 'category_id'=> $category->id,\n ]);\n if(!empty($value['box_array'])){\n foreach ($value['box_array'] as $key => $value) {\n FormItem::create([\n 'name'=> $value['name'],\n 'type'=> array_key_exists('type', $value)?$value['type']:'None',\n 'required'=> array_key_exists('mandatory', $value)?($value['mandatory']== 'yes')?'1':'0':'0',\n 'category_id'=> $category->id,\n 'parent'=>$form_item->id, \n 'logo'=>array_key_exists('logo', $value)?$value['logo']:null,\n ]);\n }\n }\n }\n DB::commit();\n return response()->json([\n 'status' => 200,\n 'url'=> route('categories.show', ['category'=> $category->id]),\n ]);\n // $category->form_items()->createMany($new_array);\n // return redirect()->route('categories.show', ['category'=> $category->id]);\n }", "protected function afterSave()\n {\n $arrayIngresients = array();\n $ingredientsKey = $_POST['Ing'];\n $ingredientsValue = $_POST['IngV'];\n $amountIngredients = sizeof($ingredientsKey);\n\n for($i = 0; $i < $amountIngredients; $i++){\n $arrayIngresients[] = array(\n 'ingredient_id' => $ingredientsKey[$i],\n 'total' => $ingredientsValue[$i],\n );\n }\n $arr = serialize($arrayIngresients);\n $category = Categories::model()->findByAttributes(array('section_id' => $this->id));\n if($category == null){\n $category = new Categories;\n $category->section_id = $this->id;\n $category->values = $arr;\n $category->save();\n }\n /**\n * If old records to save in DB\n */\n $arrayOldIngresients = array();\n $ingredientsOld = $_POST['IngOld'];\n if($ingredientsOld != null){\n foreach($ingredientsOld as $key => $value){\n $arrayOldIngresients[] = array(\n 'ingredient_id' => $key,\n 'total' => $value,\n );\n }\n $arrOld = serialize($arrayOldIngresients);\n $categoryOld = Categories::model()->findByAttributes(array('section_id' => $this->id));\n $categoryOld->values = $arrOld;\n $categoryOld->update(array('values'));\n }\n }", "public function store()\n\t{\n\t\t$category = new Category(\\Input::except(['options, image']));\n\t\tif (!$category->save()) {\n\t\t\treturn \\Redirect::back()->withInput()->withErrors($category->getErrors());\n\t\t}\n\n\t\tif (\\Input::file('image')) {\n\t\t\tif (!$category->uploadImage(\\Input::file('image'), 'image')) {\n\t\t\t\t$category->delete();\n\t\t\t\treturn \\Redirect::back()->withInput()->withErrors($category->getErrors());\n\t\t\t}\n\t\t}\n\n\t\tif (\\Input::file('image_desc')) {\n\t\t\tif (!$category->uploadImage(\\Input::file('image_desc'), 'image_desc')) {\n\t\t\t\t$category->delete();\n\t\t\t\treturn \\Redirect::back()->withInput()->withErrors($category->getErrors());\n\t\t\t}\n\t\t}\n\n\t\t\\Session::flash('manager_success_message', \\Lang::get('manager.messages.entity_created') .\n\t\t ' <a href=\"' . \\URL::Route('manager.catalog.categories.edit', ['id' => $category->id]) . '\">' . \\Lang::get('buttons.edit') . '</a>');\n\t\treturn \\Redirect::route('manager.catalog.categories.index');\n\t}", "public function store(Request $request)\n {\n $category = new Category();\n $category->fill($request->all());\n $category->save();\n // Redirecting to create a new category\n redirect('category/create');\n }", "private function setCategoryDefaultValues()\n {\n if($this->formMode === 'add')\n {\n $this->data['category_title'] = '';\n }\n else if(empty($_POST['category_submit']))\n {\n // Retrieve data from database if NOT POST request\n $data = $this->post_categories_model->getByID($this->data['category_id']);\n $this->data['category_title'] = $data['Post_Category_Title'];\n }\n }", "public function shipment_category_new_func($category,$subcategory=null)\n\n\t{\n\n\n\n\t\t$data['related_company']=$this->shipping->select_data('shipping_related_website');\n\n\t\t$data['equipment_category']=$this->shipping->select_data('equipment_category');\n\n\t\t$data['truck_trailer']=$this->shipping->select_data('shipping_truck_trailer');\n\n\t\t$data['category_id']=$category;\n\n\t\t$data['subcategory_id']=$subcategory;\n\n\t\t$this->load->view('shipment/shipment-category-new',$data);\n\n\t}", "public function store(CreateCategoryRequest $request)\n {\n $data =$request->except('_token');\n // dd($data);\n Category::create($data);//chen data vào database\n return redirect()->route('list-category')->with('success','Create category successful !');\n }", "public function store(Request $request){\n $data = $request->only([\n 'categoryname',\n ]);\n\n // buat masuk ke database\n $a = new Category([\n 'name' => $data['categoryname']\n ]);\n\n // insert ke db\n try {\n $a->save();\n } catch (Exception $e) {\n $this->response->error($e,500);\n }\n\n // kirim response berhasil insert, status code 200\n $this->response->created();\n }", "public function AddData()\n {\n echo 'Создалась VirtualCategory - метод Data <br>';\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'detail' => 'required',\n ]);\n $inputs = array_merge($request->all(), ['user_id' => $request->user()->id]); \n Category::create($inputs);\n \n return redirect()->route('categorys')\n ->with('success','categorys created successfully.');\n/*\n $inputs = array_merge($request->all(), ['user_id' => $request->user()->id]);\n $this->categoryRepository->store($inputs);\n return redirect(route('categorys.index'));\n*/ \n }" ]
[ "0.638003", "0.6293937", "0.62295073", "0.6156473", "0.6106529", "0.6040855", "0.60370666", "0.602494", "0.6020303", "0.59738475", "0.5970187", "0.59676784", "0.5944608", "0.59403944", "0.59081626", "0.5884613", "0.5880202", "0.58768755", "0.58323884", "0.5800276", "0.5799089", "0.5795686", "0.57826823", "0.57779086", "0.5766555", "0.5761285", "0.5750716", "0.57454515", "0.57418746", "0.5738552", "0.5734482", "0.5734282", "0.57214606", "0.57206935", "0.57121664", "0.5711498", "0.56964034", "0.56872123", "0.5676466", "0.5676101", "0.56645787", "0.56645393", "0.5660494", "0.5655403", "0.5655067", "0.5653002", "0.56482667", "0.56402045", "0.5636103", "0.5636103", "0.56260204", "0.56176144", "0.560953", "0.56089145", "0.559606", "0.5588973", "0.5586357", "0.5583567", "0.55808836", "0.5577411", "0.5577011", "0.55740404", "0.55652016", "0.5564793", "0.55640274", "0.5561715", "0.5558917", "0.555583", "0.5551783", "0.5548291", "0.5546436", "0.55450934", "0.5544", "0.5540911", "0.5540311", "0.55364186", "0.55282164", "0.5520897", "0.551217", "0.5509915", "0.5509678", "0.5508512", "0.5508485", "0.5504528", "0.5500633", "0.5498049", "0.54944754", "0.54938614", "0.5492903", "0.5492014", "0.5490969", "0.5486749", "0.54799825", "0.54788595", "0.54760563", "0.5474874", "0.54736227", "0.54730886", "0.54715353", "0.54704845" ]
0.6651365
0
/Add program Category form
public function addProgramCategory() { return view('admin.addprogramcategory'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n if (!isset(request()->program)) {\n $category = Programs::all();\n } else {\n $category = Programs::where(\"id\", request()->program)->first();\n }\n return view(\"admin/action/create\", compact(\"category\"));\n }", "public function servicecat(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t//prd($servicelist);\n\t\t\t\t\t\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function newAction()\n {\n\t\tTag::appendTitle('Add New Category');\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio Category';\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "function add(){\n\t\tif(!$this->checkLogin()){\n\t\t\tredirect(base_url());\n\t\t}\n\n\t\t$pageData['header_title'] = APP_NAME.' | Add Document Category';\n\t\t$pageData['page_title'] = 'Document Category Management';\n\t\t$pageData['parent_menu'] = 'document_management';\n\t\t$pageData['child_menu'] = 'document_category';\n\n\t\t$this->load->view('admin/document_management/category/add', $pageData);\n\t}", "public function storeProgramCategory(Request $request)\n {\n $this->validate($request,array(\n 'categoryName' => 'required',\n 'tips' => 'required',\n ));\n\n $programCategory = new ProgramCategory;\n\n $programCategory->program_category_name = $request->categoryName;\n $programCategory->tips = $request->tips;\n\n $programCategory->save();\n\n if($programCategory->save()){\n return redirect()->back()->with('success','Program category Saved successfully.');\n }\n else{\n return redirect()->back()->with('denger-success','Program category is not saved.');\n }\n \n }", "public function addAction()\n {\n $form = new CategoryForm();\n $form->get('submit')->setValue('Add');\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n $category->exchangeArray($form->getData());\n $this->getCategoryTable()->saveCategory($category);\n\n // Redirect to list of categorys\n return $this->redirect()->toRoute('category');\n }\n }\n return array('form' => $form);\n }", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "function getCategoryFields() {\n\t\t\n\t\t$model = $this->getModel();\n\t\t$category_id = JRequest::getVar('id');\n\t\t$form = $model->getFieldForm($category_id, 'category');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\" >';\n\t\techo '<legend>New Category</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "public function create()\n {\n return view(\"dashboard.pages.supervisor.category.add\");\n \n }", "function add_cmd()\n\t{\n\t\tif(User::can_add(false,ANY_CATEGORY))\n\t\t{\n\t\t\trequire_once 'forms/edit.php';\n\t\t\t$this->add_form(new EditManageHelpForm());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tUrl::redirect_current();\n\t\t}\n\t}", "public function add_acct_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\nif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Accounts Category Created Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\ntheme('add_acct_category');\n\t}", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "public function create()\n {\n return view('backend.cat_add');\n }", "function CategoryForm() {\r\n\r\n\t\t$member = Member::currentUser();\r\n\r\n\t\t// Need to sort out how going to handle multiple instances of category\r\n\t\t// front end grid field : https://github.com/webbuilders-group/silverstripe-frontendgridfield\r\n\t\t// grid field extension : https://github.com/silverstripe-australia/silverstripe-gridfieldextensions\r\n\t\t$category = Category::get()->first();\r\n\t\t$fields = $category->FormFields();\r\n\r\n $actions = FieldList::create(\r\n FormAction::create(\"doCategoryForm\")->setTitle(\"Submit\")->addExtraClass('productive'),\r\n FormAction::create(\"cancel\")->setTitle(\"Cancel\")\r\n );\r\n\r\n $form = Form::create($this, 'CategoryForm', $fields, $actions);\r\n\r\n return $form;\r\n\r\n\t}", "public function page_add_edit_cat()\n\t{\n\t\t// Edition\n\t\t$cat_name = '';\n\t\tif ($this->mode == 'edit_cat')\n\t\t{\n\t\t\t$sql = 'SELECT cat_name\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat\n\t\t\t\t\tWHERE cat_id = ' . $this->id;\n\t\t\t$result = Fsb::$db->query($sql);\n\t\t\t$data = Fsb::$db->row($result);\n\t\t\tif (!$data)\n\t\t\t{\n\t\t\t\t$this->mode = 'add_cat';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tFsb::$db->free($result);\n\t\t\t\t$cat_name = $data['cat_name'];\n\t\t\t}\n\t\t}\n\n\t\tFsb::$tpl->set_switch('smileys_add_cat');\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'L_ADD_EDIT' =>\t\t($this->mode == 'add_cat') ? Fsb::$session->lang('adm_smiley_add_cat') : Fsb::$session->lang('adm_smiley_edit_cat'),\n\t\t\t'CAT_NAME' =>\t\t$cat_name,\n\n\t\t\t'U_ACTION' =>\t\tsid('index.' . PHPEXT . '?p=posts_smiley&amp;mode=' . $this->mode . '&amp;id=' . $this->id),\n\t\t));\n\t}", "public function create() \n\t{\n\t\n\t\t$this->data = (object) array();\n\t\t// Check for post data\n\t\t$this->form_validation->set_rules($this->_validation_rules);\n\t\t\n\t\t\n\t\t// if postback-validate\n\t\tif ($this->form_validation->run()) \n\t\t{\n\t\t\t$input = $this->input->post();\n\t\t\t$id = $this->categories_m->create($input);\n\t\t\t\n\t\t\tEvents::trigger('evt_category_created', $id );\n\t\t\t\n\t\t\t$this->session->set_flashdata('success', lang('success'));\n\t\t\tredirect('admin/shop/categories');\n\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tforeach ($this->_validation_rules as $key => $value) \n\t\t\t{\n\t\t\t\t$this->data->{$value['field']} = '';\n\t\t\t}\n\t\t}\n\n\t\t$this->data->parent_category_select \t= $this->categories_m->build_dropdown(array(\n\t\t\t'type'\t=> 'all'\n\t\t)); \n\n\n\t\t// prepare dropdown image folders\n\t\t$folders = $this->_prep_folders();\n\n\n\t\t// Build page\n\t\t$this->template\n\t\t\t->title($this->module_details['name'])\n\t\t\t->set('folders',$folders)\n\t\t\t->append_js('module::admin/categories.js')\t\n\t\t\t->append_js('module::admin/admin.js')\t\t\n\t\t\t->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))\n\t\t\t->build('admin/categories/form', $this->data);\n\t}", "public function createCategory();", "function addExtraCategoryFields($tag, $edit_form = false) {\n\t\tif($this->checkPermissions()) {\n\t\t\t$form_row_title = __('This category is a course', lepress_textdomain);\n\t\t\t$form_row_desc = __('Is this category a course for students ?', lepress_textdomain);\n\t\t\t$form_row_title2 = __('Open access course', lepress_textdomain);\n\t\t\t$form_row_desc2 = __('Can participant subscribe to this course without teacher\\'s verification ?', lepress_textdomain);\n\t\t\t$form_row_title3 = __('Course teachers', lepress_textdomain);\n\t\t\t$form_row_desc3 = __('Choose additional teachers for this course (Only current WordPress installation users).', lepress_textdomain);\n\t\t\t$form_row_title4 = __('Advertise this course', lepress_textdomain);\n\t\t\t$form_row_desc4 = __('Advertise this course on LePress Courses Sitewide widget ?', lepress_textdomain);\n\t\t\t$form_row_title5 = __('Close this course', lepress_textdomain);\n\t\t\t$form_row_desc5 = __('Close this course <b>CAUTION!</b> Cannot be undone! no changes can be made to course data!', lepress_textdomain);\n\t\t\t\n\t\t\tglobal $current_user;\n\t\t\tget_currentuserinfo();\n\t\t\tif(function_exists('get_users')) {\n\t\t\t\t$users = get_users(array('role' => 'lepress_teacher', 'exclude' => array($current_user->ID)));\n\t\t\t} else {\n\t\t\t\t$users = get_users_of_blog();\n\t\t\t}\n\t\t\t//Get also super admins, they are allowed to be teachers too\n\t\t\tif(is_super_admin()) {\n\t\t\t\tforeach(get_super_admins() as $super_user_login) {\n\t\t\t\t\t$user = get_user_by('login', $super_user_login);\n\t\t\t\t\t$users[] = $user;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//If new category page\n\t\t\tif(!$edit_form) {\n\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course\" name=\"lepress-course\" value=\"1\"/>';\n\t\t\t\techo '<label for=\"lepress-course\">'.$form_row_title.'</label>';\n\t\t\t\techo '<p>'.$form_row_desc.'</p>';\n\t\t\t\techo '</div>';\n\n\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course-open-access\" name=\"lepress-course-open-access\" value=\"1\" />';\n\t\t\t\techo '<label for=\"lepress-course-open-access\">'.$form_row_title2.'</label>';\n\t\t\t\techo '<p>'.$form_row_desc2.'</p>';\n\t\t\t\techo '</div>';\n\n\t\t\t\techo '<div style=\"margin:0 0 10px; padding: 8px;\">';\n\t\t\t\techo '<input type=\"hidden\" value=\"'.$current_user->ID.'\" name=\"lepress-course-teachers['.$current_user->ID.']\" />';\n\t\t\t\techo '<label><b>'.$form_row_title3.'</b></label>';\n\t\t\t\tforeach($users as $user) {\n\t\t\t\t\tif($user->ID != $current_user->ID) {\n\t\t\t\t\t\t$userdata = get_userdata($user->ID);\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"lepress-course-teachers['.$user->ID.']\" value=\"0\"/>';\n\t\t\t\t\t\techo '<div style=\"margin-left: 4px;\"><input type=\"checkbox\" class=\"lepress-teacher\" value=\"'.$user->ID.'\" name=\"lepress-course-teachers['.$user->ID.']\" /> '.(!empty($userdata->user_firstname) ? $userdata->user_firstname : $userdata->user_login).' '.$userdata->user_lastname.'</div>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Found only one user - current user\n\t\t\t\tif(count($users) <= 1) {\n\t\t\t\t\techo '<p><b>'.__('No LePress teachers found', lepress_textdomain).' <a href=\"'.admin_url().'user-new.php'.'\">'.__('Add here', lepress_textdomain).'</a></b></p>';\n\t\t\t\t}\n\t\t\t\techo '<p>'.$form_row_desc3.'</p>';\n\t\t\t\techo '</div>';\n\t\t\t\t\n\t\t\t\t//IF multisite, add advertise checkbox\n\t\t\t\tif(is_multisite()) {\n\t\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course-advertise\" name=\"lepress-course-advertise\" value=\"1\" />';\n\t\t\t\t\techo '<label for=\"lepress-course-advertise\">'.$form_row_title4.'</label>';\n\t\t\t\t\techo '<p>'.$form_row_desc4.'</p>';\n\t\t\t\t\techo '</div>';\n\t\t\t\t}\t\t\t\n\t\t\t} else { //If edit category page\n\t\t\t\t$course_meta = new CourseMeta($tag->term_id);\n\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course\">'.$form_row_title.'</label></th>';\n\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course\" value=\"0\"/>';\n\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course\" '.($course_meta->getIsCourse() ? 'checked=checked':'').' '.($course_meta->hasSubscriptions() ? 'disabled=\"disabled\"' : '').' name=\"lepress-course\" value=\"1\"/><br />';\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc.' '.__('You <b>cannot change</b> this, if course has <b>active subscriptions</b>', lepress_textdomain).'</span></td>';\n\t\t\t\techo '</tr>';\n\n\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title2.'</label></th>';\n\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-open-access\" value=\"0\" />';\n\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course-open-access\" '.($course_meta->getAccessType() ? 'checked=checked':'').' name=\"lepress-course-open-access\" value=\"1\"/><br />';\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc2.'</span></td>';\n\t\t\t\techo '</tr>';\n\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title3.'</label></th>';\n\t\t\t\techo '<td>';\n\t\t\t\tforeach($users as $user) {\n\t\t\t\t\tif($user->ID != $current_user->ID) {\n\t\t\t\t\t\t$userdata = get_userdata($user->ID);\n\t\t\t\t\t\t$isTeacher = $course_meta->isTeacher($user->ID) ? 'checked=\"checked\"' : '';\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"lepress-course-teachers['.$user->ID.']\" value=\"0\"/>';\n\t\t\t\t\t\techo '<div><input class=\"lepress-edit-form-field\" type=\"checkbox\" value=\"'.$user->ID.'\" '.$isTeacher.' name=\"lepress-course-teachers['.$user->ID.']\" /> '.(!empty($userdata->user_firstname) ? $userdata->user_firstname : $userdata->user_login).' '.$userdata->user_lastname.'</div>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Found only one user - current user\n\t\t\t\tif(count($users) <= 1) {\n\t\t\t\t\techo '<p><b>'.__('No LePress teachers found', lepress_textdomain).' <a href=\"'.admin_url().'user-new.php'.'\">'.__('Add here', lepress_textdomain).'</a></b></p>';\n\t\t\t\t}\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc3.'</span></td>';\n\t\t\t\techo '</tr>';\n\t\t\t\t\n\t\t\t\t//IF is multisite, add advertise checkbox\n\t\t\t\tif(is_multisite()) {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title4.'</label></th>';\n\t\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-advertise\" value=\"0\" />';\n\t\t\t\t\techo '<input class=\"lepress-edit-form-field\" type=\"checkbox\" id=\"lepress-course-advertise\" '.($course_meta->getAdvertise() ? 'checked=checked':'').' name=\"lepress-course-advertise\" value=\"1\"/><br />';\n\t\t\t\t\techo '<span class=\"description\">'.$form_row_desc4.'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$course_meta->getIsClosed()) {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-locked\">'.$form_row_title5.'</label></th>';\n\t\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-locked\" value=\"0\" />';\n\t\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course-locked\" '.($course_meta->getIsClosed() ? 'checked=checked':'').' name=\"lepress-course-locked\" value=\"1\"/><br />';\n\t\t\t\t\techo '<span class=\"description\">'.$form_row_desc5.'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t} else {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-locked\">'.__('Export', lepress_textdomain).'</label></th>';\n\t\t\t\t\techo '<td>';\n\t\t\t\t\techo '<a href=\"\">'.__('Export current state',lepress_textdomain).'</a><br />';\n\t\t\t\t\techo '<a href=\"'.add_query_arg(array('page' => 'lepress-import-export', 'export_tpl' => $tag->term_id), admin_url().'admin.php').'\">'.__('Export as template (all assignments without students related information)', lepress_textdomain).'</a><br />';\n\t\t\t\t\techo '<span class=\"description\">'.__('Export this course data. \"Export current state\" exports also classbook, \"Export as template\" exports assginments and creates a new template.', lepress_textdomain).'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public function add()\n {\n $category = $this->Category->newEntity();\n if ($this->request->is('post')) {\n $category = $this->Category->patchEntity($category, $this->request->getData());\n if ($this->Category->save($category)) {\n $this->Flash->success(__('The category has been saved.'));\n\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error(__('The category could not be saved. Please, try again.'));\n }\n $this->set(compact('category'));\n }", "public function create()\n\t{\n\t\treturn view('admin.main_categories.addmain_category');\n\t}", "function gtags_group_category_form() {\n\tglobal $bp, $show_group_add_form_cats;\t\n\tif ($show_group_add_form_cats) return; // prevents showing form twice\n\t$show_group_add_form_cats = true;\n\n\t// the group category\t\n\t$group_cats = get_option('gtags_category'); \n\tif (empty($group_cats)) return;\n\t\n\t$selected = groups_get_groupmeta( $bp->groups->current_group->id, 'gtags_group_cat' ); \n\t?><label for=\"group-cat\"><?php _e( 'Group Category', 'gtags' ) ?></label>\n\t<select name=\"group-cat\" id=\"group-cat\" />\n\t\t<option value=\"\"><?php _e('--- SELECT ONE ---', 'gtags') ?></option>\n\t<?php foreach ( $group_cats as $tag => $desc ): ?>\n\t\t<?php if ( !$desc ) $desc = $tag; ?>\n\t\t<option value=\"<?php echo $tag; ?>\" <?php if ( $tag == $selected ) echo 'selected=\"selected\"' ?>><?php echo $desc; ?></option>\n\t<?php endforeach; ?>\n\t</select>\n\t<i><?php _e('(the primary group activity)', 'gtags'); ?></i><br><?php \t\n}", "public function addCategory()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['category'];\n\t\t\t$sql = \"insert into lib_category (category,add_date,staff_id) \n\t\t\t\t\tvalues('\" . $category . \"','\" . date('Y-m-d') . \"','\" . cookie('staffAccount') . \"') \";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Add successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function add_category() /// get routes of the form add cateogry\n {\n return view('admin.categories.add-category');\n }", "private function runCategory()\n {\n $num = (int) $this->ask('How many records do you want to create for the categories table?');\n factory(Category::class, $num)->create();\n }", "public function add()\n\t{\t\n\t\t//Carrega o Model Categorias\t\t\t\n\t\t$this->load->model('CategoriasModel', 'Categorias');\n\t\n\t\t$data['categorias'] = $this->Categorias->getCategorias();\t\n\n\t\t// Editando texto do titulo do header\n\t\t$data['pagecfg']['Title'] = \"Adicionar Pessoa\";\t\t\n\n\t\t// Alterando o Estado da View Para Adicionar Pessoa\n\t\t$data['pagecfg']['viewState'] = \"Adicionar Pessoa\";\n\t\t$data['pagecfg']['btnState'] = \"Adicionar\";\n\t\t$data['pagecfg']['inputState'] = \"enable\";\n\t\t$data['pagecfg']['actionState'] = \"/ListarPessoas/salvar\";\n\t\t\n\t\t//Carrega a View\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->load->view('PessoaView', $data);\n\t\t$this->load->view('templates/footer', $data);\n\t}", "public function action_addBook() {\r\n $fieldset = Fieldset::forge('book')->add_model('Model_Book');\r\n $fieldset->delete('category_id');\r\n // get form from fieldset\r\n $form = $fieldset->form();\r\n\r\n // add category to the form\r\n $categories = Model_Category::find('all');\r\n $op = array();\r\n foreach ($categories as $category) {\r\n $op[$category['id']] = $category['name'];\r\n }\r\n\r\n $form->add(\r\n 'category', 'Book category',\r\n array('options' => $op, 'type' => 'radio', 'value' => 'true')\r\n );\r\n // add submit button to the form\r\n $form->add('Submit', '', array('type' => 'submit', 'value' => 'Submit'));\r\n\r\n\r\n // build the form and set the current page as action\r\n $formHtml = $fieldset->build(Uri::create('book/addBook'));\r\n $view = View::forge('book/addBook');\r\n $view->set('form', $formHtml, false);\r\n\r\n if (Input::param() != array()) {\r\n try {\r\n $book = Model_Book::forge();\r\n $book->title = Input::param('title');\r\n $book->author = Input::param('author');\r\n $book->price = Input::param('price');\r\n $book->url = Input::param('url');\r\n $book->category_id= Input::param('category');\r\n\r\n Log::debug('selected category '.$book->category_id);\r\n Log::debug('selected category '.Input::param('category'));\r\n $book->save();\r\n Response::redirect('book');\r\n } catch (Orm\\ValidationFailed $e) {\r\n $view->set('errors', $e->getMessage(), false);\r\n }\r\n }\r\n $this->template->title = \"Book add page\";\r\n $this->template->content = $view; \r\n }", "public function addCategory()\n {\n $baker = Bakery::orderBy('id')->get();\n $this->authorize('category');\n return view('Admin.Bakery.Category.category', ['baker' => $baker]);\n }", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "function add()\n { \n $this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('CatName','CatName','required');\n\t\t\n\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t'CatName' => $this->input->post('CatName'),\n );\n \n $productcat_id = $this->Productcat_model->add_productcat($params);\n redirect('admin/productcat/index');\n }\n else\n { \n $data['_view'] = 'admin/productcat/add';\n $this->load->view('admin/layouts/main',$data);\n }\n }", "public function getName()\n {\n return 'category_form';\n }", "public function addCategory()\n {\n $data['categorys'] = Category::whereNull('parent_id')->get();\n return view('category.addEdit', $data);\n }", "public function query_add_edit_cat()\n\t{\n\t\t$cat_name = trim(Http::request('cat_name', 'post'));\n\t\tif ($this->mode == 'add_cat')\n\t\t{\n\t\t\t$sql = 'SELECT MAX(cat_order) AS max_order\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat';\n\t\t\t$max_order = Fsb::$db->get($sql, 'max_order');\n\n\t\t\tFsb::$db->insert('smilies_cat', array(\n\t\t\t\t'cat_name' =>\t$cat_name,\n\t\t\t\t'cat_order' =>\t$max_order + 1,\n\t\t\t));\n\t\t\tFsb::$db->destroy_cache('smilies_');\n\n\t\t\tDisplay::message('adm_smiley_well_cat_add', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tFsb::$db->update('smilies_cat', array(\n\t\t\t\t'cat_name' =>\t$cat_name,\n\t\t\t), 'WHERE cat_id = ' . $this->id);\n\t\t\tFsb::$db->destroy_cache('smilies_');\n\n\t\t\tDisplay::message('adm_smiley_well_cat_edit', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t}", "public function addAction()\n {\n $form = $this->getServiceLocator()->get('civcontent_category_form');\n \n // Check if the request is a POST.\n $request = $this->getRequest();\n if ($request->isPost())\n {\n // Create a new category object.\n $category = $this->getServiceLocator()->get('civcontent_category');\n \n $data = (array) $request->getPost();\n $form->bind($category);\n $form->setData($data);\n if ($form->isValid())\n {\n // Persist changes.\n $this->getContentService()->persistCategory($category);\n \n // Redirect to content categories\n return $this->redirect()->toRoute('content/category', array(\n 'action' => 'index'\n ));\n }\n }\n \n // If a GET request, or invalid data then render/re-render the form\n return new ViewModel(array(\n 'form' => $form,\n ));\n }", "public function addDB()\n {\n $nom = $_POST['nom'];\n $description = $_POST['descrip'];\n\n $requete = $this->connexion->prepare(\"INSERT INTO `category`(`id`, `nom`, `description`)\n VALUES (NULL, :nom, :description)\");\n $requete->bindParam(':nom', $nom);\n $requete->bindParam(':description', $description);\n $resultat = $requete->execute();\n }", "public function create()\n {\n return view('backend.category.add');\n }", "public function subcategory(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t$caterories = $modelservices->categorydata();\n\t//prd($caterories);\n\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Sub Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t$this->addElement('text', 'service_price', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required digits',\n\t\t\t\"label\" => \"Service Credit \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Price is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"onchange\"=>\"getcategorylist(this.value)\",\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n\t\t$this->addElement('select', 'service_sub_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$caterories,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}", "function fill_parent_combo( $form_name, $category_id )\n\t{\n\t\t$q = \"SELECT * FROM title_dev_categories where status = 1\";\n\t\t$r = $this -> db -> getMultipleRecords( $q );\n\t\t$combo = '<select class=\"validate[required] txarea2\" name=\"category_id\" id=\"category_id\" onchange=\"document.uploadAdvert.submit()\" >\n\t\t\t\t\t<option value=\"\">---Please Select Category---</option>';\n\t\tif( $r != false )\n\t\t{\n\t\t\tfor( $i = 0; $i < count( $r ); $i++ )\n\t\t\t{\n\t\t\t\t$selected = $category_id== $r[$i]['category_id'] ? \"selected\" : \"\";\n\t\t\t\t$combo .= '<option '.$selected.' value=\"'.$r[$i]['category_id'].'\">'.$r[$i]['category_title'].'</option>';\n\t\t\t}\t//\tEnd of for Looooooop\n\t\t}\t//\tEnd of if( $r != false )\n\t\t$combo .= '</select>';\n\t\t\n\t\treturn $combo;\n\t}", "public function create()\n {\n return view('admin.pages.category.add');\n }", "public function formModify() {\n $categories=$this->model->listCategories();\n $this->view->display(\"view/form/ProductFormModify.php\", NULL, $categories); \n }", "public function actionCreate()\r\n {\r\n $model = new Category();\r\n\r\n //Значения по умолчанию\r\n $model->skay = 1;\r\n $model->solo = 1;\r\n $model->program = 1;\r\n\r\n $judge_list = Judge::find()->select(['sname'])->indexBy('id')->column();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n \r\n// $tur = new Tur();\r\n// $tur->category_id = $model->id;\r\n// $tur->dances = $model->dances;\r\n// $tur->save();\r\n \r\n return $this->redirect(['reglament/index']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n 'judge_list' => $judge_list,\r\n ]);\r\n }\r\n }", "function ccategories_create()\n\t{\n\t\tlusers_require(\"categories/create\");\n\n\t\t$post_data = linput_post();\n\t\t$post_data = linput_post_checkbox($post_data, \"content\");\n\t\t$content = $post_data[\"content\"];\n\n\t\tif (hform_validate(array(\"name\", \"link\", \"parentid\")))\n\t\t{\n\t\t\t$cat_created = mcategories_create($post_data);\n\t\t\tif ($content) $content_created = mcontent_create($post_data);\n\t\t\telse $content_created = false;\n\n\t\t\tif (($cat_created && !$content) || ($content && $cat_created && $content_created))\n\t\t\t{\n\t\t\t\tlcache_delete_all();\n\t\t\t\thmessage_set(l(\"Category successfully created.\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($cat_created) mcategories_delete($post_data[\"link\"]);\n\t\t\t\tif ($content_created) mcontent_delete($post_data[\"link\"]);\n\t\t\t\thmessage_set(l(\"Category create error.\") . \" \" . l(\"Link already in use.\"));\n\t\t\t}\n\n\t\t\tluri_redirect(\"main/user/admin/categories\");\n\t\t}\n\t\telse luri_redirect(\"main/user/admin/categories_create\", l(\"All fields marked with * are required.\"));\n\t}", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "public function addCategory()\n {\n return view('backend.admin-panel.pages.addCategory');\n }", "static public function ctrCrearCategoria(){\n\n\t\tif(isset($_POST[\"nuevaCategoria\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/',$_POST[\"nuevaCategoria\"])){\n\n\t\t\t\t$tabla=\"categorias\";\n\n\t\t\t\t$datos=$_POST[\"nuevaCategoria\"];\n\n\t\t\t\t$respuesta=ModelCategoria::mdlIngresarCategoria($tabla, $datos);\n\n\n\t\t\t\tif($respuesta==\"ok\"){\n\n\t\t\t\t\techo '<script> \n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype:\"success\",\n\t\t\t\t\t\t\ttitle:\"¡La categoria ha sido creada correctamente!\",\n\t\t\t\t\t\t\tshowConfirmButton:true,\n\t\t\t\t\t\t\tconfirmButtonText:\"cerrar\",\n\t\t\t\t\t\t\tclaseOnConfirm:false\n\t\t\t\t\t\t\t}).then((result)=>{\n\n\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\twindow.location=\"categorias\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t </script>';\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\techo '<script> \n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\ttitle:\"¡La categoria no puede ir vacia o llevar caracteres especiales!\",\n\t\t\t\t\t\t\tshowConfirmButton:true,\n\t\t\t\t\t\t\tconfirmButtonText:\"cerrar\",\n\t\t\t\t\t\t\tclaseOnConfirm:false\n\t\t\t\t\t\t\t}).then((result)=>{\n\n\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\twindow.location=\"categorias\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t});\n\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t </script>';\n\n\n\t\t\t}\n\n\t\t}\n\n\n\t}", "public function actionCreate()\n {\n $model = new Categoria();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function getFormCategory()\n\t{\n\t\treturn strtolower($this->_removeNonAlphaCharacters($this->category));\n\t}", "function target_add_cat($cat)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $cat['name']);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat (id, name, view_order, cat_opt) \n\t VALUES('. (int)$cat['id'] .','. _esc($cat['name']) .','. (int)$cat['view_order'] .', 3)');\n\t$GLOBALS['cat_map'][ $cat['id'] ] = $cat['id'];\n/*\nfud_use('cat.inc', true);\n$nc = new fud_cat;\n$nc->name = $c->name;\n$nc->description = $c->description;\n$nc->view_order = $c->disporder;\n$nc->cat_opt = 1|2;\t// This should be the default in cat.inc. Fix in next release and del this line.\n$GLOBALS['cat_map'][$c->fid] = $nc->add('LAST');\t// FIRST should also be defaulted.\n*/\n}", "public function create() {\n return view('admin.category.category_create_form');\n }", "function question_category_form($course, $current, $recurse=1, $showhidden=false, $showquestiontext=false) {\n global $CFG;\n\n/// Make sure the default category exists for this course\n get_default_question_category($course->id);\n\n/// Get all the existing categories now\n $catmenu = question_category_options($course->id, true);\n\n $strcategory = get_string(\"category\", \"quiz\");\n $strshow = get_string(\"show\", \"quiz\");\n $streditcats = get_string(\"editcategories\", \"quiz\");\n\n echo \"<table><tr><td style=\\\"white-space:nowrap;\\\">\";\n echo \"<strong>$strcategory:</strong>&nbsp;\";\n echo \"</td><td>\";\n popup_form (\"edit.php?courseid=$course->id&amp;cat=\", $catmenu, \"catmenu\", $current, \"\", \"\", \"\", false, \"self\");\n echo \"</td><td align=\\\"right\\\">\";\n echo \"<form method=\\\"get\\\" action=\\\"$CFG->wwwroot/question/category.php\\\">\";\n echo \"<div>\";\n echo \"<input type=\\\"hidden\\\" name=\\\"id\\\" value=\\\"$course->id\\\" />\";\n echo \"<input type=\\\"submit\\\" value=\\\"$streditcats\\\" />\";\n echo '</div>';\n echo \"</form>\";\n echo '</td></tr></table>';\n\n echo '<form method=\"get\" action=\"edit.php\" id=\"displayoptions\">';\n echo \"<fieldset class='invisiblefieldset'>\";\n echo \"<input type=\\\"hidden\\\" name=\\\"courseid\\\" value=\\\"{$course->id}\\\" />\\n\";\n question_category_form_checkbox('recurse', $recurse);\n question_category_form_checkbox('showhidden', $showhidden);\n question_category_form_checkbox('showquestiontext', $showquestiontext);\n echo '<noscript><div class=\"centerpara\"><input type=\"submit\" value=\"'. get_string('go') .'\" />';\n echo '</div></noscript></fieldset></form>';\n}", "public function add_category() {\n\t\n\t\tif($this->input->post('add_type')=='add_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name'),\n\t\t'created_at' => date('d-m-Y h:i:s')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->add_assets_category($data);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_added');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function Add($id)\n\t{\n\n\t\t//dd( Categoria::$rules);\n\t\t$form = new GroupForm();\n\n\t\tif ($form->isPosted())\n\t\t{\n\t\t\t$this->beforeFilter('csf', array('on' => 'post'));\n\n\t\t\tif ($form->isValidForAdd(Categoria::$rules))\n\t\t\t{\n\t\t\t\t$entrada = new Categoria();\n\n\t\t\t\t\t$entrada->descricao = Input::get(\"descricao\");\n\t\t\t\t\t$entrada->tipo = Input::get(\"tipo\");\n\t\t\t\t\t$entrada->user_id = isset(Auth::user()->id)? Auth::user()->id : 1;\n\t\t\t\t\t$entrada->save();\n\t\t\t\t\n\n\t\t\t\treturn Redirect::route(\"categ_list\");\n\t\t\t}\n\n\t\t\treturn Redirect::route(\"categ_add\")->withInput([\n\t\t\t\t\"descricao\" => Input::get(\"descricao\"),\n\t\t\t\t\"tipo\" => Input::get(\"tipo\")\n\t\t\t])->withErrors($form->getErrors());\n\t\t}\n\t\t$categorias = Categoria::all();\n\t\t$cat = $categorias;\n\t\t$dadosCat = array();\n\t\tforeach ($categorias as $categoria) {\n\t\t\t\n\t\t\t$dadosCat[$categoria->id] = $categoria->descricao;\n\t\t}\n\n\t\t\n\t\treturn View::make(\"admin.categorias.create\", [\n\t\t\t\"tipo\" => $id,\n\t\t\t\"form\" => $form \n\t\t], compact('cat'))->with(\"categorias\", $dadosCat);\n\t\t\n\t}", "function addcategory(){\n \treturn view('category');\n }", "public function create()\n {\n return view('admin.master.category_name.add');\n }", "public function create()\n {\n return view (\"admin.category.create\");\n }", "public function create()\n {\n return view('news.admin.categ.add');\n }", "public function getAddEditForm($target = '/admin/Cart') {\n\t\t$form = new Form('CartCategory_addedit', 'post', $target);\n\t\t\n\t\t$form->setConstants( array ( 'section' => 'categories' ) );\n\t\t$form->addElement( 'hidden', 'section' );\n\t\t$form->setConstants( array ( 'action' => 'addedit' ) );\n\t\t$form->addElement( 'hidden', 'action' );\n\t\t\n\t\tif (!is_null($this->getId())) {\n\t\t\t$form->setConstants( array ( 'cartcategory_categories_id' => $this->getId() ) );\n\t\t\t$form->addElement( 'hidden', 'cartcategory_categories_id' );\n\t\t\t\n\t\t\t$defaultValues ['cartcategory_name'] = $this->getName();\n\t\t\t$defaultValues ['cartcategory_description'] = $this->getDescription();\n\t\t\t$defaultValues ['cartcategory_image'] = $this->getImage();\n\t\t\t$defaultValues ['cartcategory_parent_id'] = $this->getParent_id();\n\t\t\t$defaultValues ['cartcategory_date_added'] = $this->getDate_added();\n\t\t\t$defaultValues ['cartcategory_last_modified'] = $this->getLast_modified();\n\t\t\t$defaultValues ['cartcategory_status'] = $this->getStatus();\n\n\t\t\t$form->setDefaults( $defaultValues );\n\t\t}\n\t\t\n\t\t$form->addElement('text', 'cartcategory_name', 'Name');\n\t\t\n\t\t$description = $form->addElement('textarea', 'cartcategory_description', 'Description');\n\t\t$description->setCols(80);\n\t\t$description->setRows(10);\n\t\t\n\t\t$newImage = $form->addElement('file', 'cartcategory_image_upload', 'Category Image');\n\t\t$curImage = $form->addElement('dbimage', 'cartcategory_image', $this->getImage());\n\t\t\n\t\t$form->addElement('select', 'cartcategory_parent_id', 'Parent Category', self::toArray());\n\t\t\n\t\t$added = $form->addElement('text', 'cartcategory_date_added', 'Date Added');\n\t\t$added->freeze();\n\t\t\n\t\t$modified = $form->addElement('text', 'cartcategory_last_modified', 'Date Last Modified');\n\t\t$modified->freeze();\n\t\t\n\t\t$form->addElement('select', 'cartcategory_status', 'Status', Form::statusArray());\n\t\t$form->addElement('submit', 'cartcategory_submit', 'Submit');\n\n\t\tif (isset($_REQUEST['cartcategory_submit']) && $form->validate() && $form->isSubmitted()) {\n\t\t\t$this->setName($form->exportValue('cartcategory_name'));\n\t\t\t$this->setDescription($form->exportValue('cartcategory_description'));\n\t\t\t$this->setImage($form->exportValue('cartcategory_image'));\n\t\t\t$this->setParent_id($form->exportValue('cartcategory_parent_id'));\n\t\t\t$this->setDate_added($form->exportValue('cartcategory_date_added'));\n\t\t\t$this->setLast_modified($form->exportValue('cartcategory_last_modified'));\n\t\t\t$this->setStatus($form->exportValue('cartcategory_status'));\n\t\t\t\n\t\t\tif ($newImage->isUploadedFile()) {\n\t\t\t\t$im = new Image();\n\t\t\t\t$id = $im->insert($newImage->getValue());\n\t\t\t\t$this->setImage($im);\n\t\t\t\t\n\t\t\t\t$curImage->setSource($this->getImage()->getId());\n\t\t\t}\n\t\t\t\n\t\t\t$this->save();\n\t\t}\n\n\t\treturn $form;\n\t\t\n\t}", "function addAction()\n\t{\n global $langCode;\n\t\t$error \t= array();\n\t\t$success \t= array();\n\t\t$contents \t= '';\n\t\t$formData \t= array();\n\t\t\n\t\t$parentid = (int)($this->registry->router->getArg('parentid'));\n\t\tif($parentid > 0)\n\t\t\t$formData['fparentid'] = $parentid; \n\t\t\n\t\tif(!empty($_POST['fsubmit']))\n\t\t{\n if($_SESSION['productcategoryAddToken']==$_POST['ftoken'])\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->addActionValidator($formData, $error))\n {\n $myProductCat = new Core_ProductCategory();\n //thong tin khong lien quan ngon ngu\n $myProductCat->name = $formData['fname'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n //Neu nguoi dung nhap SeoUrl thi xu li dau cua chuoi nguoi dung nhap \n //Truong hop nguoi dung khong nhap thi chung ta lay idtext de thay the!!!!!\n if(strlen($formData['fseourl']) > 0)\n $myProductCat->seoUrl = Helper::codau2khongdau($formData['fseourl'], true);\n else\n $myProductCat->seoUrl = Helper::codau2khongdau(strip_tags($formData['fname'][$langCode]), true);\n //cac thong tin lien quan ngong ngu\n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n if($myProductCat->addData())//them vao database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succAdd']);\n $this->registry->me->writelog('ProductCategoryadd', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n $formData = array('fparentid' => $formData['fparentid']); \n }\n else\n {\n $error[] = $this->registry->lang['controller']['errAdd']; \n }\n }\n }\n $_SESSION['productcategoryAddToken']=Helper::getSecurityToken();//Tao token moi\n\t\t}\n\t\t\n\t\t\n\t\t$this->registry->smarty->assign(array(\t'formData' \t\t=> $formData,\n\t\t\t\t\t\t\t\t\t\t\t\t'parentCategories' => Core_ProductCategory::getFullCategories(),\n\t\t\t\t\t\t\t\t\t\t\t\t'redirectUrl'\t=> $this->getRedirectUrl(),\n\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t'success'\t\t=> $success,\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));\n\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'add.tpl');\n\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategoryadd',\n\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_add'],\n\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t}", "public function create()\n {\n $category = Categories::all();\n return view('panel.product-management.categories.form-create')->with(['category' => $category]);\n }", "public function stepCategory()\n {\n global $rlSmarty, $rlCategories, $page_info, $account_info, $sError, $config;\n\n parent::step();\n\n $GLOBALS['rlHook']->load('addListingGetCats');\n\n // Define allowed types\n $allowed_type_keys = $account_info['Abilities'];\n\n // \"Individual add listing page\" mode\n if ($page_info['Key'] != 'add_listing') {\n $individual_type_key = substr($page_info['Key'], 3);\n\n if (in_array($individual_type_key, $allowed_type_keys)) {\n $allowed_type_keys = array($individual_type_key);\n } else {\n $sError = true;\n }\n }\n\n // Adapt listing types array\n $allowed_types = $GLOBALS['rlListingTypes']->adaptTypes($allowed_type_keys);\n $rlSmarty->assign_by_ref('allowed_types', $allowed_types);\n\n // Existing membership plan mode\n $this->existingMembershipHandler($account_info);\n\n // Remove unnecessary steps\n if (!$this->singleStep) {\n unset($this->steps['photo'], $this->steps['checkout']);\n }\n }", "public function newcategory() {\n\n if (ckeckAddmin()) {\n $this->load->view('admin/header/header');\n $this->load->view('admin/css/css');\n $this->load->view('admin/topnav/topnav');\n $this->load->view('admin/sidenav/sidenav');\n $this->load->view('admin/content/addcatogry');\n $this->load->view('admin/footer/footer');\n # $this->load->view('admin/js/extra');\n $this->load->view('admin/js/js');\n } else {\n CustomFlash('Admin/login', 'alert-danger', 'plz First Login');\n }\n }", "public function create()\n\t{\n\t\t//\n\t\t\n\t\treturn view('categoria.add-categoria');\n\n\t}", "public function addform()\n\t{\n\t\t\t$this->setMethod('get');\n\n\t\t\t//echo \"<pre>\";\n\t\t\t//print_r($_GET);\n\t\t\t//echo \"</pre>\";\n\t\t\t$this->addElement('radio', 'Status', array(\n\t\t\t\t'required' => true,\n 'separator' => '&nbsp;',\n\t\t\t\t'multiOptions' => array(\n\t\t\t\t\t'1' => IN_PROGRESS,\n\t\t\t\t\t'2' => 'Closed'\n\t\t\t\t\t\n\t\t\t\t),\n\t\t\t\t\t'separator' => '',\n\t\t\t\t'value' => '1' //key of multiOption\n\t\t\t));\n\n\t\t\n\t\t\n\t\t$this->addElement ( \n 'multiCheckbox', 'Functional_type', \n array (\n \n\t\t//'setrequired' => true,\n 'multiOptions' => array(\n '1' => 'Pre Installation',\n '2' => 'Installation',\n '3' => 'Post Installation'\n \n ),\n 'separator' => '',\n\t\t\t\t\t//'value' => '2' // select these 2 values\n )\n);\n\t\n\t\t\t\t\n\t\t\t$this->addElement('submit', 'submit', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t\t\t'label' => 'Submit',\n\t\t\t));\n\t\t\t\n\t\t\t// And finally add some CSRF protection\n\t\t\t$this->addElement('hash', 'csrf', array(\n\t\t\t\t\t'ignore' => true,\n\t\t\t));\t\n\t}", "public function addCategory()\n {\n $items = Categories::where('is_parent', 1)->orderBy('category_name')->get();\n return view('admin.category.addCategory', compact('items'));\n }", "function add()\n {\n if($this->acceso(3)){\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n 'categoria_nombre' => $this->input->post('categoria_nombre'),\n );\n\n $categoria_id = $this->Categoria_model->add_categoria($params);\n redirect('categoria/index');\n }\n else\n { \n $data['_view'] = 'categoria/add';\n $this->load->view('layouts/main',$data);\n }\n }\n }", "public function addAction() {\n $session = new Container('User');\n $form = new CategoryForm('CategoryForm');\n\n $form->get('created_date')->setValue(time());\n $form->get('created_by')->setValue($session->offsetGet('userId'));\n $form->get('updated_date')->setValue(time());\n $form->get('updated_by')->setValue($session->offsetGet('userId'));\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $data = $request->getPost();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($data);\n if ($form->isValid()) {\n $validatorName = new \\Zend\\Validator\\Db\\NoRecordExists(\n array(\n 'table' => 'category',\n 'field' => 'title',\n 'adapter' => $this->getAdapter()\n )\n );\n if ($validatorName->isValid(trim($category->title))) {\n $no_duplicate_data = 1;\n } else {\n $flashMessage = $this->flashMessenger()->getErrorMessages();\n if (empty($flashMessage)) {\n $this->flashMessenger()->setNamespace('error')->addMessage('Category Name already Exists.');\n }\n $no_duplicate_data = 0;\n }\n\n if ($no_duplicate_data == 1) {\n $category->exchangeArray($form->getData());\n $data->created_date = time();\n $data->created_by = $session->offsetGet('userId');\n $data->updated_date = time();\n $data->updated_by = $session->offsetGet('userId');\n\n $questionId = $this->getCategoryTable()->saveCategory($category);\n// $this->getServiceLocator()->get('Zend\\Log')->info('Level created successfully by user ' . $session->offsetGet('userId'));\n $this->flashMessenger()->setNamespace('success')->addMessage('Category created successfully');\n return $this->redirect()->toRoute('category');\n }\n }\n }\n\n return array('form' => $form);\n }", "public function create()\n {\n return view('admin.category.add');\n }", "function display_category_form($category = ''){\n\t// This form can be used for inserting or editing categries\n\t// To insert, don't pass any parameters\n\t// To update, pass an array containing a category\n\t$edit = is_array($category);\n?>\n<form method='post'\n action='<?php echo $edit?'edit_category.php':'insert_category.php'; ?>'>\n<table border='0'>\n <tr>\n <td>Category Name:</td>\n\t<td><input type='text' name='catname' size='40' maxlength='40'\n\t value='<?php echo $edit?$category['catname']:''; ?>' /></td>\n </tr>\n <tr>\n <td <?php if (!$edit) echo \"colspan='2'\"; ?> align='center'>\n<?php\nif ($edit)\n\techo \"<input type='hidden' name='catid' value='\" . $category['catid']\n\t\t. \"' />\";\n?>\n\t <input type='submit'\n\t value=\"<?php echo $edit?'Rename':'Add'; ?> Category\" /></td>\n\t </form>\n<?php\n\tif ($edit)\n\t\techo '<form method=\"post\" action=\"/myPHP/ShoppingCart/model/admin/delete_category.php\">\n\t\t\t\t<td align=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"catid\" value=\"' . $category['catid'] .'\" />\n\t\t\t\t<input type=\"submit\" value=\"Delete Category\" />\n\t\t\t \t</td>\n\t\t\t</form>';\n?>\n\n\n<?php\n}", "function shophead_add()\n {\n $this->layout = 'admin_layout';\n if ($this->request->is('post')) {\n $this->ProductCategory->set($this->request->data);\n\t\t\t $this->request->data = Sanitize::clean($this->request->data, array('encode' => false));\n if ($this->ProductCategory->validates()) {\n if ($this->ProductCategory->save($this->request->data)) {\n $this->Session->write('flash', array(ADD_RECORD, 'success'));\n\n } else {\n $this->Session->write('flash', array(ERROR_MSG, 'failure'));\n }\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }\n }", "public function add()\n {\n // Pull the categories from the Categorys table\n $allCategories = Categories::all();\n // compact it into the view\n // where you select the category, change to select with the options\n // being the categories which you compacted in\n\t return view(\"dishes.add\", compact(\"allCategories\"));\n }", "public function create()\n {\n $this->categoryRepository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n\n // Get Categories Dropdown list\n $categories = $this->categoryRepository->getCategoryDropdownList();\n $categories[0] = 'Root Category';\n\n return view('admin.categories.add',compact('categories'));\n }", "public function add()\n {\n return view('category.add');\n }", "public function newAction()\n {\n $entity = new Categoria();\n $form = $this->createForm(new CategoriaType(), $entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView()\n );\n }", "function add_categories(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function create()\n {\n return view('admin.pages.category.add');\n }", "public function create()\n { \n $form_type = 'Add';\n $images = [];\n $category = [];\n $questions = ['Case / Box','A Game','The Manual'];\n \n $categories = Categories::where('parent_id',0)->pluck('category_name','id')->prepend('Select League', ''); \n $regions = Regions::pluck('name','id')->prepend('Select Region', ''); \n \n return view('admin.subcategories.form', compact('form_type','categories','regions','images','category','questions')); \n }", "protected function form()\n {\n return Admin::form(Category::class, function (Form $form) {\n\n $form->display('catid', 'ID');\n $form->text('name','Category Name')->rules('required');\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n });\n }", "public function create()\n {\n $parent = $this->cateRepository->getSelect();\n return view('backend.category.add',compact('parent'));\n }", "public function actionCreate()\n\t{\n\t\t$model=new BookCategories;\n $step = 1;\n\t\tif(isset($_POST['BookCategories']))\n\t\t{\n\t\t\t$model->attributes=$_POST['BookCategories'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('update?id='.$model->id.'&step=2'));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n 'step' => $step\n\t\t));\n\t}", "private function addCategory(HTTPRequest $request)\n {\n if ($this->manager->getManagerOf('Category')->getCategoryByName($request->postData('newCategory')) != null) {\n Session::getInstance()->setFlash('danger', 'Cette catégorie existe déjà.');\n } else {\n if ($request->postExists('newCategory') && ($this->manager->getManagerOf('Category')->getCategoryByName($request->postData('newCategory')) == false)) {\n $category = new Category(\n ['name' => $request->postData('newCategory')]\n );\n\n if ($category->getErrors() != null) {\n $category->getErrorMessage();\n } else {\n $this->manager->getManagerOf('Category')->addNewCategory($category);\n Session::getInstance()->setFlash('success', 'Une nouvelle catégorie a été ajoutée.');\n }\n }\n }\n }", "public function create()\n {\n return \\view(\"pages.admin.category.create\");\n }", "function addCategory() {\n var_dump($this->request->data);\n if ($this->request->is('post') || $this->request->is('put')) {\n $ci = $this->CategoryItem->create();\n var_dump($ci);\n if ($this->CategoryItem->save($this->request->data)) {\n $this->Session->setFlash(__('The %s has been saved', __('link')), 'flash/success');\n } else {\n $this->Session->setFlash(__('The %s could not be saved. Please, try again.', __('link')), 'flash/failure');\n }\n// $this->redirect(array('action' => 'edit', $this->Item->id));\n } else {\n $this->redirect(array('action' => 'index'));\n }\n }", "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "private function categoriesFormInputs()\n {\n // Get the field name of the field with the category icon\n // #47631, dwildt, 1-\n //$arrLabels[ 'catIcon' ] = $this->confMap['configuration.']['categories.']['fields.']['categoryIcon'];\n // #47631, #i0007, dwildt, 10+\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Default space in HTML code\n $tab = ' ';\n\n // FOREACH category label\n//$this->pObj->dev_var_dump( $this->arrCategories );\n // #i0118, dwildt, 1-/+\n //foreach ( $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n foreach ( ( array ) $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n {\n // Get the draft for an input field\n $cObj_name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input' ];\n $cObj_conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input.' ];\n $input = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // replace the category marker\n $input = str_replace( '###CAT###', $labelValue, $input );\n // 4.1.17, 120927, dwildt\n // replace the category marker\n //$labelValueWoSpc = str_replace( ' ', null, $labelValue );\n $labelValueWoSpc = $this->zz_properFormLabel( $labelValue );\n $input = str_replace( '###CAT_WO_SPC###', $labelValueWoSpc, $input );\n // 4.1.17, 120927, dwildt\n // #54548, 131221, dwildt, 6+\n $class = $this->arrCategories[ 'cssClass' ][ $labelKey ];\n if ( !empty( $class ) )\n {\n $class = ' class=\"' . $class . '\"';\n }\n $input = str_replace( '###CLASS###', $class, $input );\n\n // IF draft for an input field contains ###IMG###, render an image\n $pos = strpos( $input, '###IMG###' );\n if ( !( $pos === false ) )\n {\n // SWITCH : Render the image\n switch ( true )\n {\n // #i0062\n case( $labelKey == $this->arrWoCategories[ 'iconKey' ] ):\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n case( is_array( $this->arrCategories[ 'icons' ] ) ):\n // 4.1.7, dwildt, +\n $this->cObjDataAddArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n $img = $this->renderMapMarkerVariablesSystemItem( 'categoryIconLegend' );\n $this->cObjDataRemoveArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n // 4.1.7, dwildt, +\n break;\n default:\n // Render the image\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n }\n // SWITCH : Render the image\n\n $input = str_replace( '###IMG###', $img, $input );\n }\n // IF draft for an input field contains ###IMG###, render an image\n\n $arrInputs[] = $tab . $input;\n }\n // FOREACH category label\n // Move array of input fields to a string\n // #i0118, dwildt, 1-/+\n //$inputs = implode( PHP_EOL, $arrInputs );\n $inputs = implode( PHP_EOL, ( array ) $arrInputs );\n $inputs = trim( $inputs );\n\n // RETURN input fields\n return $inputs;\n }", "public function create()\n {\n return view('admin.categories.form');\n }", "public function addPost(){\n\n if ($this->input->post(\"category_create\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n $categoryName = $this->input->post(\"category_name\");\n\n $this->validate->setRule(\"minlength\",$categoryName,3, \"Category name length must be more then 3 symbols!\");\n\n if ($this->validate->validate() === false){\n $error = $this->validate->getErrors();\n $this->view->redirect(\"/categories/manage\",$error);\n }\n\n $categoryModel = new CategoriesModel();\n try{\n if ($categoryModel->hasCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"This categories already exist!\");\n }\n\n if($categoryModel->addNewCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"Category created successfully!\",\"success\");\n }\n }catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception);\n }\n }", "public function create()\n {\n return view('product.add_category');\n }" ]
[ "0.6791251", "0.67398465", "0.6735368", "0.67165315", "0.67116857", "0.6615872", "0.6611898", "0.6589547", "0.65745264", "0.6573505", "0.6542764", "0.6485271", "0.64450854", "0.644032", "0.6434564", "0.64265096", "0.64235735", "0.6346596", "0.63265896", "0.62802815", "0.6237475", "0.622664", "0.62098485", "0.6189764", "0.6173463", "0.6167711", "0.6132987", "0.61317986", "0.60815275", "0.6079419", "0.6073783", "0.6073408", "0.60621417", "0.6044404", "0.6039578", "0.6016673", "0.60143924", "0.59895724", "0.5982438", "0.5982052", "0.5980242", "0.59639513", "0.5962017", "0.5957895", "0.5955538", "0.5949497", "0.5924536", "0.5924096", "0.59223306", "0.59176683", "0.5914387", "0.5908536", "0.59078133", "0.59058225", "0.5900901", "0.58960485", "0.58953166", "0.5889208", "0.5878686", "0.5870847", "0.5866938", "0.58663994", "0.5862003", "0.58609116", "0.5859491", "0.5849453", "0.5847037", "0.5836231", "0.5833504", "0.582879", "0.5823948", "0.581756", "0.5816101", "0.5815305", "0.58136976", "0.5812316", "0.5810805", "0.5810484", "0.5806095", "0.5804014", "0.5801605", "0.57975346", "0.5796188", "0.5792143", "0.57883406", "0.57806236", "0.5777421", "0.5776602", "0.57690144", "0.57654256", "0.57642406", "0.57553464", "0.5752244", "0.57481843", "0.57425576", "0.5737708", "0.5736718", "0.5731775", "0.57313675", "0.573135" ]
0.7373798
0
/Store program category data form
public function storeProgramCategory(Request $request) { $this->validate($request,array( 'categoryName' => 'required', 'tips' => 'required', )); $programCategory = new ProgramCategory; $programCategory->program_category_name = $request->categoryName; $programCategory->tips = $request->tips; $programCategory->save(); if($programCategory->save()){ return redirect()->back()->with('success','Program category Saved successfully.'); } else{ return redirect()->back()->with('denger-success','Program category is not saved.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function storeCategory(array $data): void\n {\n }", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "protected function saveCategoryFromCategory($form){\n $data = $this->getRequest()->getPost();\n //@todo: validate the data\n $form->setData($data);\n if ($form->isValid()) {\n \n $this->category->exchangeArray($form->getData());\n $categoryTable = $this->getServiceLocator()->get(\"Category\\Model\\CategoryTable\");\n $this->category = $categoryTable->saveCategory($this->category);\n \n if($id = $this->category->getId()){\n $this->redirect()->toRoute('category_home');\n }\n }else{\n \n }\n }", "private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }", "public function addProgramCategory()\n {\n return view('admin.addprogramcategory');\n }", "public function store()\n\t{\n\n $validator = Validator::make(\n Input::all(),\n array(\n 'description' => 'required'\n )\n );\n\n if( $validator->fails() ) {\n Session::flash('action_success', false);\n Session::flash('action_message', 'There is an error with your form. Please correct it and try again.');\n return Redirect::action('AdminProgramController@create')->withErrors($validator)->withInput();\n }\n\n $program = Program::create(array(\n 'description' => Input::get('description')\n ));\n\n $program->programOptions()->save(\n new ProgramOption(array(\n 'description' => 'None'\n ))\n );\n\n return Redirect::action('AdminProgramController@show', array($program->id));\n\n\t}", "public function save_category_info($data) {\n $this->db->insert('tbl_category', $data);\n }", "private function runCategory()\n {\n $num = (int) $this->ask('How many records do you want to create for the categories table?');\n factory(Category::class, $num)->create();\n }", "public function run()\n {\n ProgramOption::create( array('description' => 'None', 'program_id' => 1) );\n\n // Entries for program 2: Bachelor of Computer Science\n ProgramOption::create( array('description' => 'None', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Computer Games', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Web Services and Applications', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Computer Systems', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Software Systems', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Information Systems', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Computer Applications', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Computation Arts', 'program_id' => 2) );\n ProgramOption::create( array('description' => 'Mathematics and Statistics', 'program_id' => 2) );\n\n // Entries for program 3: Bachelor of Software Engineering\n ProgramOption::create( array('program_id' => 3, 'description' => 'None') );\n ProgramOption::create( array('program_id' => 3, 'description' => 'Computer Games') );\n ProgramOption::create( array('program_id' => 3, 'description' => 'Real-Time, Embedded, and Avionics Software') );\n ProgramOption::create( array('program_id' => 3, 'description' => 'Web Services and Applications') );\n\n }", "public function store(Request $request)\n {\n \n \n $program = Programs::create([\n 'main_image' => $request->main_image,\n 'price' => $request->price,\n 'name' => $request->name,\n 'start_day' => $request->start_day,\n 'kind' => $request->kind,\n 'days' => $request->days,\n 'nights' => $request->nights,\n 'brief' => $request->brief,\n 'place' => $request->place,\n 'overview' => $request->overview,\n 'pricing' => $request->pricing,\n 'general' => $request->general,\n 'price_children' => $request->price_children,\n 'image_gallery' => serialize($request->image_gallery),\n 'itinerary_heading' => serialize($request->itinerary_heading),\n 'itinerary' => serialize($request->itinerary),\n 'pages_id' => $request->pages_id,\n 'small_group' => $request->small_group,\n 'slug' => str_slug($request->name),\n\n ]);\n $program->related()->attach($request->related_programs_id);\n $program->Highlights()->attach($request->package_highlights_id);\n $program->Sights()->attach($request->holiday_sights_id);\n $program->Accommodations()->attach($request->accom_id);\n $program->Addons()->attach($request->add_on_id);\n \n\n\n$program->save();\nSession::flash('Success','Your Program created Successfully');\n return redirect()->route('Program.index')\n ->with('success','Program created successfully');\n }", "public function create()\n {\n if (!isset(request()->program)) {\n $category = Programs::all();\n } else {\n $category = Programs::where(\"id\", request()->program)->first();\n }\n return view(\"admin/action/create\", compact(\"category\"));\n }", "function target_add_cat($cat)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $cat['name']);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat (id, name, view_order, cat_opt) \n\t VALUES('. (int)$cat['id'] .','. _esc($cat['name']) .','. (int)$cat['view_order'] .', 3)');\n\t$GLOBALS['cat_map'][ $cat['id'] ] = $cat['id'];\n/*\nfud_use('cat.inc', true);\n$nc = new fud_cat;\n$nc->name = $c->name;\n$nc->description = $c->description;\n$nc->view_order = $c->disporder;\n$nc->cat_opt = 1|2;\t// This should be the default in cat.inc. Fix in next release and del this line.\n$GLOBALS['cat_map'][$c->fid] = $nc->add('LAST');\t// FIRST should also be defaulted.\n*/\n}", "public function store() {\n if ($id = Input::get('id')) {\n $category = Category::find($id);\n } else {\n $category = new Category();\n }\n\n $inputs = Input::only(['type', 'parent_id', 'name', 'description',\n 'slug', 'keywords', 'order', 'status', 'template']);\n $rules = [\n 'type' => 'in:subject,application,product',\n 'name' => 'required|min:1',\n 'order' => 'required|numeric',\n ];\n\n $validator = Validator::make($inputs, $rules);\n $validator->sometimes('slug', 'unique:categories,slug', function() use($inputs, $category) {\n return !empty($inputs['slug']) && ($category->slug != $inputs['slug']);\n });\n //todo: 循环继承的问题解决思路\n //在数据库存一个layer的字段,标明改分类的层级,p_id=0的为1层\n //递归n次得到p_id=0则为n层\n //最后对比大小禁止循环继承\n if ($validator->fails()) {\n $messages = $validator->messages()->toArray();\n return $this->msg($messages, 1);\n }\n\n $category->fill($inputs);\n $category->save();\n\n return $this->msg('success', 0);\n }", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "public function save(){\n\t\t$sql = new Sql();\n\n\t\t$results = $sql->select(\"CALL sp_categories_save(:idcategory, :descategory)\", array(\n\t\t\t\":idcategory\"=>$this->getidcategory(),\n\t\t\t\":descategory\"=>$this->getdescategory()\n\t\t));\n\n\t\t$this->setData($results[0]);\n\n\n\t\tCategory::updateFile();\n\n\t}", "public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }", "public function store(Request $request)\n {\n $prog = new program($request->all());\n \n if($prog->save()){\n \n $dll = new \\App\\Dllareaprog();\n $dll->id_area = $request->area;\n $dll->id_programa = $prog->id;\n $dll->save();\n \n return redirect('admin/programs');\n } else {\n return view('programs.create')\n ->with('prog', $prog);\n\n }\n }", "public function run()\n\t{\n\t\tModel::unguard();\n\n\t\tDdgCategory::create([\n\t\t\t'id' => CategoryConstant::CATEGORY_INDIVIDUAL,\n\t\t\t'name' => '個人情報系',\n\t\t]);\n\n\t\tDdgCategory::create([\n\t\t\t'id' => CategoryConstant::CATEGORY_WEB,\n\t\t\t'name' => 'Web系',\n\t\t]);\n\n\t\tDdgCategory::create([\n\t\t\t'id' => CategoryConstant::CATEGORY_TIME,\n\t\t\t'name' => '時間系',\n\t\t]);\n\n\t\tDdgCategory::create([\n\t\t\t'id' => CategoryConstant::CATEGORY_OTHER,\n\t\t\t'name' => '未分類',\n\t\t]);\n\t}", "public function run()\n {\n DB::table('categories')->insert(\n \t[\n \t\t[\n\t 'cat_name' => 'Smartphone',\n\t 'cat_desc' => 'Smartphone Description'\n\t ],\n\t [\n\t 'cat_name' => 'Tablet',\n\t 'cat_desc' => 'Tablet Description'\n\t ],\n\t [\n\t 'cat_name' => 'Smart Watch',\n\t 'cat_desc' => 'Smart Watch Description'\n\t ],\n\t [\n\t 'cat_name' => 'Other Smart Devices',\n\t 'cat_desc' => 'Other Smart Devices Description'\n\t ],\n\t [\n\t 'cat_name' => 'Accesories',\n\t 'cat_desc' => 'Accesories Description'\n\t ],\n \t]\n );\n }", "public function servicecat(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t//prd($servicelist);\n\t\t\t\t\t\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}", "public function AddData()\n {\n echo 'Создалась VirtualCategory - метод Data <br>';\n }", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function run()\n {\n Category::insert([\n ['name' => 'Laptops', 'slug' => 'laptops'],\n ['name' => 'Desktops', 'slug' => 'desktops'],\n ['name' => 'Mobile Phones', 'slug' => 'mobile-phones'],\n ['name' => 'Tablets', 'slug' => 'tablets'],\n ['name' => 'TVs', 'slug' => 'tvs'],\n ['name' => 'Digital Cameras', 'slug' => 'digital-cameras'],\n ['name' => 'Appliances', 'slug' => 'appliances'],\n ]);\n }", "public function AddProgram() {\n $data = $this->app[\"request\"];\n\n $isXML = false;\n\n $program = new Program($this->app[\"db\"]);\n\n if (0 === strpos($data->headers->get('Content-Type'), 'application/x-www-form-urlencoded')) {\n\n // posted from a html form\n\n $program->date = $data->get(\"date\");\n $program->time = $data->get(\"time\");\n $program->leadText = $data->get(\"leadText\");\n $program->name = $data->get(\"name\");\n $program->bLine = $data->get(\"b-line\");\n $program->synopsis = $data->get(\"synopsis\");\n $program->url = $data->get(\"url\");\n\n } elseif (0 === strpos($data->headers->get('Content-Type'), 'text/xml')) {\n\n // posted as xml\n\n $xml = (array)simplexml_load_string($data->getContent());\n\n $program->date = $xml[\"date\"];\n $program->time = $xml[\"start_time\"];\n $program->leadText = $xml[\"leadtext\"];\n $program->name = $xml[\"name\"];\n $program->bLine = $xml[\"b-line\"];\n $program->synopsis = $xml[\"synopsis\"];\n $program->url = $xml[\"url\"];\n\n $isXML = true;\n\n }\n\n\n // check for errors\n $errors = $program->validate();\n\n // show the form again if there where errors (and show what the errors where)\n if (count($errors) > 0) {\n if ($isXML) {\n return \"There where errors: \".print_r($errors,true);\n } else {\n return $this->app['twig']->render('index.html.twig', array(\"errors\" => $errors, \"program\" => $program));\n }\n }\n\n // store the record in db\n $persist = $program->persist();\n\n if ($isXML) {\n if ($persist) {\n return \"program persisted\";\n } else {\n return \"failed to persist\";\n }\n }\n\n return $this->app->redirect('/programs.html');\n }", "public function run()\n {\n $categories = [\n [\n 'name' => 'Processor',\n 'description' => 'Otak komputer',\n ],\n [\n 'name' => 'VGA',\n 'description' => 'Untuk kebutuhan grafis',\n ],\n ];\n\n foreach ($categories as $key => $value) {\n Category::create($value);\n }\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "function get_dataset_definitions_category($form) {\n global $CFG, $DB;\n $datasetdefs = array();\n $lnamemax = 30;\n if (!empty($form->category)) {\n $sql = \"SELECT i.*,d.*\n FROM {question_datasets} d,\n {question_dataset_definitions} i\n WHERE i.id = d.datasetdefinition\n AND i.category = ?\n ;\n \";\n if ($records = $DB->get_records_sql($sql, array($form->category))) {\n foreach ($records as $r) {\n if ( !isset ($datasetdefs[\"$r->name\"])) $datasetdefs[\"$r->name\"] = $r->itemcount;\n }\n }\n }\n return $datasetdefs ;\n }", "function realstate_form($catId = null) {\n if ($catId!= null) {\n // We check if the category is the same as our plugin\n if (osc_is_this_category('realstate_plugin', $catId)) {\n $conn = getConnection() ;\n $data = $conn->osc_dbFetchResults('SELECT * FROM %st_item_house_property_type_attr', DB_TABLE_PREFIX);\n $p_type = array();\n foreach ($data as $d) {\n $p_type[$d['fk_c_locale_code']][$d['pk_i_id']] = $d['s_name'];\n }\n unset($data);\n include_once 'item_edit.php';\n }\n }\n}", "public function run()\n {\n $category_data = [\n 'name' => 'Celulares'\n ];\n $category = new Category($category_data);\n $category->save();\n\n $category_data = [\n 'name' => 'Computadores'\n ];\n $category = new Category($category_data);\n $category->save();\n\n $category_data = [\n 'name' => 'Televisores'\n ];\n $category = new Category($category_data);\n $category->save();\n }", "public function run()\n {\n $category = [\n [\n \t'name' => 'Household'\n ],\n [\n 'name' => 'Construction'\n ],\n [\n 'name' => 'Personel'\n ],\n [\n 'name' => 'Maintenance'\n ]\n ];\n\n DB::table('categories')->insert($category);\n }", "public function run()\n {\n Category::insert([\n \t['name'=>'Sci-fi','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Suspense','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Religious','created_at'=>NULL,'updated_at'=>NULL],\n \t['name'=>'Romance','created_at'=>NULL,'updated_at'=>NULL]]);\n }", "public function run()\n {\n $category = new Category();\n $category -> name=\"Infantil\";\n $category ->save();\n\n $category1 = new Category();\n $category1 -> name=\"Regalo y Accesorios\";\n $category1 ->save();\n\n $category2 = new Category();\n $category2 -> name=\"Salud y belleza\";\n $category2 ->save();\n\n $category3 = new Category();\n $category3 -> name=\"Tiempo Libre\";\n $category3 ->save();\n\n $category4 = new Category();\n $category4 -> name=\"Vestuario y Calzado \";\n $category4 ->save();\n\n $category5 = new Category();\n $category5 -> name=\"Artesanias y Manualidades\";\n $category5 ->save();\n\n $category6 = new Category();\n $category6 -> name=\"Decohogar\";\n $category6 ->save();\n\n $category7 = new Category();\n $category7 -> name=\"Tecnologia\";\n $category7 ->save();\n }", "public function run()\n {\n\t\tDB::table('categories')->insert([\n\t\t\t[\n\t\t\t\t'name' => 'Nikon',\n\t\t\t\t'type' => 'Mirrorless',\n\t\t\t\t'model' => 2018\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Canon',\n\t\t\t\t'type' => 'Full frame',\n\t\t\t\t'model' => 2015\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Nikon',\n\t\t\t\t'type' => 'Full frame',\n\t\t\t\t'model' => 2015\n\t\t\t],\n\t\t\t[\n\t\t\t\t'name' => 'Canon',\n\t\t\t\t'type' => 'Point and Shoot',\n\t\t\t\t'model' => 2017\n\t\t\t]\n\t\t]);\n }", "public function addDB()\n {\n $nom = $_POST['nom'];\n $description = $_POST['descrip'];\n\n $requete = $this->connexion->prepare(\"INSERT INTO `category`(`id`, `nom`, `description`)\n VALUES (NULL, :nom, :description)\");\n $requete->bindParam(':nom', $nom);\n $requete->bindParam(':description', $description);\n $resultat = $requete->execute();\n }", "public function addCategory()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['category'];\n\t\t\t$sql = \"insert into lib_category (category,add_date,staff_id) \n\t\t\t\t\tvalues('\" . $category . \"','\" . date('Y-m-d') . \"','\" . cookie('staffAccount') . \"') \";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Add successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "function addExtraCategoryFields($tag, $edit_form = false) {\n\t\tif($this->checkPermissions()) {\n\t\t\t$form_row_title = __('This category is a course', lepress_textdomain);\n\t\t\t$form_row_desc = __('Is this category a course for students ?', lepress_textdomain);\n\t\t\t$form_row_title2 = __('Open access course', lepress_textdomain);\n\t\t\t$form_row_desc2 = __('Can participant subscribe to this course without teacher\\'s verification ?', lepress_textdomain);\n\t\t\t$form_row_title3 = __('Course teachers', lepress_textdomain);\n\t\t\t$form_row_desc3 = __('Choose additional teachers for this course (Only current WordPress installation users).', lepress_textdomain);\n\t\t\t$form_row_title4 = __('Advertise this course', lepress_textdomain);\n\t\t\t$form_row_desc4 = __('Advertise this course on LePress Courses Sitewide widget ?', lepress_textdomain);\n\t\t\t$form_row_title5 = __('Close this course', lepress_textdomain);\n\t\t\t$form_row_desc5 = __('Close this course <b>CAUTION!</b> Cannot be undone! no changes can be made to course data!', lepress_textdomain);\n\t\t\t\n\t\t\tglobal $current_user;\n\t\t\tget_currentuserinfo();\n\t\t\tif(function_exists('get_users')) {\n\t\t\t\t$users = get_users(array('role' => 'lepress_teacher', 'exclude' => array($current_user->ID)));\n\t\t\t} else {\n\t\t\t\t$users = get_users_of_blog();\n\t\t\t}\n\t\t\t//Get also super admins, they are allowed to be teachers too\n\t\t\tif(is_super_admin()) {\n\t\t\t\tforeach(get_super_admins() as $super_user_login) {\n\t\t\t\t\t$user = get_user_by('login', $super_user_login);\n\t\t\t\t\t$users[] = $user;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//If new category page\n\t\t\tif(!$edit_form) {\n\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course\" name=\"lepress-course\" value=\"1\"/>';\n\t\t\t\techo '<label for=\"lepress-course\">'.$form_row_title.'</label>';\n\t\t\t\techo '<p>'.$form_row_desc.'</p>';\n\t\t\t\techo '</div>';\n\n\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course-open-access\" name=\"lepress-course-open-access\" value=\"1\" />';\n\t\t\t\techo '<label for=\"lepress-course-open-access\">'.$form_row_title2.'</label>';\n\t\t\t\techo '<p>'.$form_row_desc2.'</p>';\n\t\t\t\techo '</div>';\n\n\t\t\t\techo '<div style=\"margin:0 0 10px; padding: 8px;\">';\n\t\t\t\techo '<input type=\"hidden\" value=\"'.$current_user->ID.'\" name=\"lepress-course-teachers['.$current_user->ID.']\" />';\n\t\t\t\techo '<label><b>'.$form_row_title3.'</b></label>';\n\t\t\t\tforeach($users as $user) {\n\t\t\t\t\tif($user->ID != $current_user->ID) {\n\t\t\t\t\t\t$userdata = get_userdata($user->ID);\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"lepress-course-teachers['.$user->ID.']\" value=\"0\"/>';\n\t\t\t\t\t\techo '<div style=\"margin-left: 4px;\"><input type=\"checkbox\" class=\"lepress-teacher\" value=\"'.$user->ID.'\" name=\"lepress-course-teachers['.$user->ID.']\" /> '.(!empty($userdata->user_firstname) ? $userdata->user_firstname : $userdata->user_login).' '.$userdata->user_lastname.'</div>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Found only one user - current user\n\t\t\t\tif(count($users) <= 1) {\n\t\t\t\t\techo '<p><b>'.__('No LePress teachers found', lepress_textdomain).' <a href=\"'.admin_url().'user-new.php'.'\">'.__('Add here', lepress_textdomain).'</a></b></p>';\n\t\t\t\t}\n\t\t\t\techo '<p>'.$form_row_desc3.'</p>';\n\t\t\t\techo '</div>';\n\t\t\t\t\n\t\t\t\t//IF multisite, add advertise checkbox\n\t\t\t\tif(is_multisite()) {\n\t\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course-advertise\" name=\"lepress-course-advertise\" value=\"1\" />';\n\t\t\t\t\techo '<label for=\"lepress-course-advertise\">'.$form_row_title4.'</label>';\n\t\t\t\t\techo '<p>'.$form_row_desc4.'</p>';\n\t\t\t\t\techo '</div>';\n\t\t\t\t}\t\t\t\n\t\t\t} else { //If edit category page\n\t\t\t\t$course_meta = new CourseMeta($tag->term_id);\n\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course\">'.$form_row_title.'</label></th>';\n\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course\" value=\"0\"/>';\n\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course\" '.($course_meta->getIsCourse() ? 'checked=checked':'').' '.($course_meta->hasSubscriptions() ? 'disabled=\"disabled\"' : '').' name=\"lepress-course\" value=\"1\"/><br />';\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc.' '.__('You <b>cannot change</b> this, if course has <b>active subscriptions</b>', lepress_textdomain).'</span></td>';\n\t\t\t\techo '</tr>';\n\n\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title2.'</label></th>';\n\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-open-access\" value=\"0\" />';\n\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course-open-access\" '.($course_meta->getAccessType() ? 'checked=checked':'').' name=\"lepress-course-open-access\" value=\"1\"/><br />';\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc2.'</span></td>';\n\t\t\t\techo '</tr>';\n\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title3.'</label></th>';\n\t\t\t\techo '<td>';\n\t\t\t\tforeach($users as $user) {\n\t\t\t\t\tif($user->ID != $current_user->ID) {\n\t\t\t\t\t\t$userdata = get_userdata($user->ID);\n\t\t\t\t\t\t$isTeacher = $course_meta->isTeacher($user->ID) ? 'checked=\"checked\"' : '';\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"lepress-course-teachers['.$user->ID.']\" value=\"0\"/>';\n\t\t\t\t\t\techo '<div><input class=\"lepress-edit-form-field\" type=\"checkbox\" value=\"'.$user->ID.'\" '.$isTeacher.' name=\"lepress-course-teachers['.$user->ID.']\" /> '.(!empty($userdata->user_firstname) ? $userdata->user_firstname : $userdata->user_login).' '.$userdata->user_lastname.'</div>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Found only one user - current user\n\t\t\t\tif(count($users) <= 1) {\n\t\t\t\t\techo '<p><b>'.__('No LePress teachers found', lepress_textdomain).' <a href=\"'.admin_url().'user-new.php'.'\">'.__('Add here', lepress_textdomain).'</a></b></p>';\n\t\t\t\t}\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc3.'</span></td>';\n\t\t\t\techo '</tr>';\n\t\t\t\t\n\t\t\t\t//IF is multisite, add advertise checkbox\n\t\t\t\tif(is_multisite()) {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title4.'</label></th>';\n\t\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-advertise\" value=\"0\" />';\n\t\t\t\t\techo '<input class=\"lepress-edit-form-field\" type=\"checkbox\" id=\"lepress-course-advertise\" '.($course_meta->getAdvertise() ? 'checked=checked':'').' name=\"lepress-course-advertise\" value=\"1\"/><br />';\n\t\t\t\t\techo '<span class=\"description\">'.$form_row_desc4.'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$course_meta->getIsClosed()) {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-locked\">'.$form_row_title5.'</label></th>';\n\t\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-locked\" value=\"0\" />';\n\t\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course-locked\" '.($course_meta->getIsClosed() ? 'checked=checked':'').' name=\"lepress-course-locked\" value=\"1\"/><br />';\n\t\t\t\t\techo '<span class=\"description\">'.$form_row_desc5.'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t} else {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-locked\">'.__('Export', lepress_textdomain).'</label></th>';\n\t\t\t\t\techo '<td>';\n\t\t\t\t\techo '<a href=\"\">'.__('Export current state',lepress_textdomain).'</a><br />';\n\t\t\t\t\techo '<a href=\"'.add_query_arg(array('page' => 'lepress-import-export', 'export_tpl' => $tag->term_id), admin_url().'admin.php').'\">'.__('Export as template (all assignments without students related information)', lepress_textdomain).'</a><br />';\n\t\t\t\t\techo '<span class=\"description\">'.__('Export this course data. \"Export current state\" exports also classbook, \"Export as template\" exports assginments and creates a new template.', lepress_textdomain).'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public function run()\n {\n $data = ['HTML', 'CSS', 'JavaScript', 'PHP'];\n foreach ($data as $value) {\n $new_cat = new Category();\n $new_cat->name = $value;\n $new_cat->slug = Str::slug($value, '-');\n $new_cat->save();\n }\n }", "public function run()\n {\n //\n $categories = [\n ['name' => 'Spoon'],\n ['name' => 'Fork'],\n ['name' => 'Cups'],\n ['name' => 'Plates'],\n ['name' => 'Knife'],\n ];\n UtensilCategory::insert($categories);\n }", "private function setCategoryDefaultValues()\n {\n if($this->formMode === 'add')\n {\n $this->data['category_title'] = '';\n }\n else if(empty($_POST['category_submit']))\n {\n // Retrieve data from database if NOT POST request\n $data = $this->post_categories_model->getByID($this->data['category_id']);\n $this->data['category_title'] = $data['Post_Category_Title'];\n }\n }", "function addCategory($data){\n\t\t\t\n\t\t\t$token = '847895ee848fdb5fb2d43b275705470c';\n\t\t\t$domainname = 'https://elearning.inaba.ac.id';\n\t\t\t$functionname = 'core_course_create_categories';\n\t\t\t$restformat = 'json';\n\t\t\t\t$category = new stdClass();\n\t\t\t\t$category->name=$data['nama'];\t\n\t\t\t\t$category->parent=$data['parent'];\t\t\t\t\t\n\t\t\t\t$category->description='<p>'.$data['nama'].'</p>';\n\t\t\t\t$category->idnumber=$data['idnumber'];\t\t\t\t\t\n\t\t\t\t$category->descriptionformat=1;\t\t\t\t\t\t\t\t\t\n\t\t\t\t$categories = array($category);\n\t\t\t\t$params = array('categories' => $categories);\n\t\t\t\t/// REST CALL\n\t\t\t\t//header('Content-Type: text/plain');\n\t\t\t\t$serverurl = $domainname . '/webservice/rest/server.php'. '?wstoken=' . $token . '&wsfunction='.$functionname;\n\t\t\t\trequire_once($conf['model_dir'].'m_curl.php');\n\t\t\t\t$curl = new curl;\n\t\t\t\t//if rest format == 'xml', then we do not add the param for backward compatibility with Moodle < 2.2\n\t\t\t\t$restformat = ($restformat == 'json')?'&moodlewsrestformat=' . $restformat:'';\n\t\t\t\t$resp = $curl->post($serverurl . $restformat, $params);\n\t\t\t\t$data = json_decode($resp, true);\n\t\t\t\t\n\t\t\t\t\n\n\t\t\n\n\t\t}", "public function run()\n {\n $cat = new Category();\n $cat->name = 'phones';\n $cat->save();\n\n $cat = new Category();\n $cat->name = 'Labtop';\n $cat->save();\n\n $cat = new Category();\n $cat->name = 'Food';\n $cat->save();\n }", "public function run()\n {\n Category::factory()\n ->count(3)\n ->create(\n [[\n \"name\" => 'Assets',\n \"resourceType\" => 'ACCOUNT',\n ],\n [\n \"name\" => 'Income',\n \"resourceType\" => 'ACCOUNT'\n ],\n [\n \"name\" => 'Expense',\n \"resourceType\" => 'ACCOUNT'\n ]]\n );\n\n \n }", "function obtenerCategoriaProg()\n {\n //crea el objetoFunSeguridad que contiene todos los metodos del sistema de seguridad\n $this->objFunSeguridad = $this->create('sis_seguridad/MODSubsistema');\n $objParam = new CTParametro($aPostData['p'], null, $aPostFiles);\n $objParam->addParametro('codigo', 'pre_verificar_categoria');\n $objFunc = new MODSubsistema($objParam);\n $this->res = $objFunc->obtenerVariableGlobal($this->objParam);\n\n return $this->res->getDatos();\n }", "public function save($data)\n\t{\n\t $input = Factory::getApplication()->input;\n\t\tJLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR.\n\t\t\t'/components/com_categories/helpers/categories.php');\n\t\t// validate id\n\t\tif((int)$data['catid']>0)\n\t\t{\n\t\t\t$catid = CategoriesHelper::validateCategoryId\n\t\t\t\t($data['catid'], 'com_dinning_philosophers');\n\t\t\t// If catid and extension don't match, validate will return 0.\n\t\t\t// Let's create a new category to for this component.\n\t\t\tif($catid===0){\n\t\t\t $category = array();\n\t\t\t $category['id'] = $data['catid'];\n\t\t\t \n\t\t\t $categoryTable = Table::getInstance('Category');\n\t\t\t if (!$categoryTable->load($category))\n\t\t\t {\n\t\t\t $catid = 0;\n\t\t\t } else {\n\t\t\t $properties = $categoryTable->getProperties();\n\t\t\t unset($properties['id']);\n\t\t\t unset($properties['alias']);\n\t\t\t array_values($properties);\n\t\t\t // categories uses extension as an alias to identify\n\t\t\t // duplicates. Use unique extension.\n\t\t\t $properties['extension'] = 'com_dinning_philosophers';\n\t\t\t $catid = CategoriesHelper::createCategory($properties);\n\t\t\t }\n\t\t\t}\n\t\t\t$data['catid'] = $catid;\n\t\t}\n\t\t// Alter the alias for save as copy.\n\t\tif($input->get('task') == 'save2copy')\n\t\t{\n\t\t\t$origTable = clone $this-getTable();\n\t\t\t$origTable->load($input->getInt('id'));\n\t\t\tif($data['alias']==$origTable->alias)\n\t\t\t{\n\t\t\t\t$data['alias']='';\n\t\t\t}\n\t\t\t$data['published']=0;\n\t\t}\n\t\treturn parent::save($data);\n\t}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function run()\n {\n $categories = array(\n array('name' => 'Learning'),\n array('name' => 'Reminder'),\n array('name' => 'Personal')\n );\n Category::insert($categories); \n }", "public function run()\n {\n $category = [\n [\n 'text' => 'Спорт',\n 'slug' => 'sport'\n ],\n [\n 'text' => 'Политика',\n 'slug' => 'politics'\n ],\n [\n 'text' => 'Экономика',\n 'slug' => 'economics'\n ],\n [\n 'text' => 'Здоровье',\n 'slug' => 'health'\n ],\n [\n 'text' => 'Технологии',\n 'slug' => 'hitec'\n ],\n [\n 'text' => 'Погода',\n 'slug' => 'weather'\n ],\n ];\n\n DB::table('categories')->insert($category);\n }", "public function store()\n\t{\n\t\t$description = Input::get('description'); \n\t\t$acronym = substr($description, 0, 1);\n\t\t$category = new Category(); \n\t\t$category->language_id = Input::get('language_id'); \n\t\t$category->description = $description;\n\t\t$category->acronym = $acronym;\n\t\t$category->save(); \n\t\treturn Response::json(array('success'=>'Categoria registrada exitosamente')); \n\t}", "public function run()\n {\n\n $category_array = [\n \n //category\n 'Home Services' => [\n \n // sub-category\n 'Key Making' => [\n //services\n 'Car Key',\n 'Door Key',\n 'Bike Key',\n 'Other key making'\n ],\n \n // sub-category\n 'Carpenter' => [\n //services\n 'Furniture repair/manufacturing',\n 'Modular kitchen',\n 'Door/gate repairing and manufacturing',\n 'Interior decoration',\n 'Antique wooden work',\n 'Other wooden work',\n ],\n\n //sub-category\n 'Electrician' => [\n //services\n 'AC/refrigerator repairing',\n 'Geyser repairing',\n 'Juicer/mixture repairing',\n 'Home Wiring',\n 'Other electrician service',\n ],\n\n //sub-category\n 'Plumber' => [\n 'Tap Repair',\n 'Flush Repair',\n 'Leakage',\n 'Installation of Sanitaryware',\n 'Other plumber service',\n ]\n ],\n\n //category\n 'Road Services' => [\n \n //sub-category\n 'Crane/Towing' => [\n \n //services\n 'Hydraulic/Rope',\n 'Chain',\n 'Zero degree',\n 'Other towing service'\n ]\n ],\n\n //category\n 'Office Services' => [\n\n //sub-category\n 'Key Making' => [\n\n //services\n 'Car Key',\n 'Door Key',\n 'Bike Key',\n 'Others key making',\n ],\n\n //sub-category\n 'Carpenter' => [\n\n //services\n 'Flooring',\n 'Furniture repair/manufacturing',\n 'Modular kitchen',\n 'Door/gate repairing and manufacturing',\n 'Interior decoration',\n 'Antique wooden work',\n 'Other wooden work',\n ],\n\n //sub-category\n 'Electrician' => [\n\n //services\n 'AC/refrigerator repairing',\n 'Geyser repairing',\n 'Juicer/mixer repairing',\n 'Home Wiring',\n 'Other electrician service',\n ],\n ]\n ];\n\n foreach ($category_array as $category_name => $sub_category_array) {\n $category = new Category();\n $category->name = $category_name;\n $category->save();\n\n foreach ($sub_category_array as $sub_category_name => $services_array) {\n $sub_category = new SubCategory();\n $sub_category->name = $sub_category_name;\n $sub_category->category_id = $category->id;\n $sub_category->save();\n\n $total_services = count($services_array);\n for ($i = 0; $i < $total_services; $i++) {\n $service = new Service();\n $service->name = $services_array[$i];\n $service->sub_category_id = $sub_category->id;\n $service->save();\n }\n }\n }\n }", "public function run(){\n DB::table('categorias')->insert([\n [\n 'categoria' => 'rol',\n 'valor' => 'superAdmin'\n ],\n [\n 'categoria' => 'rol',\n 'valor' => 'admin'\n ],\n [\n 'categoria' => 'rol',\n 'valor' => 'operador'\n ],\n [\n 'categoria' => 'tipoDocumento',\n 'valor' => 'cedula'\n ],\n [\n 'categoria' => 'tipoDocumento',\n 'valor' => 'ruc'\n ],\n [\n 'categoria' => 'estado',\n 'valor' => 'activo'\n ],\n [\n 'categoria' => 'estado',\n 'valor' => 'inactivo'\n ]\n ]);\n }", "public function run()\n {\n $category = new \\App\\SysProductCategory([\n 'name' => 'Clothing',\n 'description' => 'T-Shirts, Sweaters, Baseball Caps etc.'\n ]);\n $category->save();\n\n $category = new \\App\\SysProductCategory([\n 'name' => 'Sticker & Patches',\n 'description' => ''\n ]);\n $category->save();\n\n $category = new \\App\\SysProductCategory([\n 'name' => 'Media',\n 'description' => 'CDs, digital downloads etc.'\n ]);\n $category->save();\n }", "public function run()\n {\n DB::table('category')->insert($this->getData());\n }", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function create($postArray)\n {\n $params = BaseAta_program_category::getParams();\n return $this->insertRow($postArray, $params);\n }", "private function categoriesFormInputs()\n {\n // Get the field name of the field with the category icon\n // #47631, dwildt, 1-\n //$arrLabels[ 'catIcon' ] = $this->confMap['configuration.']['categories.']['fields.']['categoryIcon'];\n // #47631, #i0007, dwildt, 10+\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Default space in HTML code\n $tab = ' ';\n\n // FOREACH category label\n//$this->pObj->dev_var_dump( $this->arrCategories );\n // #i0118, dwildt, 1-/+\n //foreach ( $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n foreach ( ( array ) $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n {\n // Get the draft for an input field\n $cObj_name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input' ];\n $cObj_conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input.' ];\n $input = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // replace the category marker\n $input = str_replace( '###CAT###', $labelValue, $input );\n // 4.1.17, 120927, dwildt\n // replace the category marker\n //$labelValueWoSpc = str_replace( ' ', null, $labelValue );\n $labelValueWoSpc = $this->zz_properFormLabel( $labelValue );\n $input = str_replace( '###CAT_WO_SPC###', $labelValueWoSpc, $input );\n // 4.1.17, 120927, dwildt\n // #54548, 131221, dwildt, 6+\n $class = $this->arrCategories[ 'cssClass' ][ $labelKey ];\n if ( !empty( $class ) )\n {\n $class = ' class=\"' . $class . '\"';\n }\n $input = str_replace( '###CLASS###', $class, $input );\n\n // IF draft for an input field contains ###IMG###, render an image\n $pos = strpos( $input, '###IMG###' );\n if ( !( $pos === false ) )\n {\n // SWITCH : Render the image\n switch ( true )\n {\n // #i0062\n case( $labelKey == $this->arrWoCategories[ 'iconKey' ] ):\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n case( is_array( $this->arrCategories[ 'icons' ] ) ):\n // 4.1.7, dwildt, +\n $this->cObjDataAddArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n $img = $this->renderMapMarkerVariablesSystemItem( 'categoryIconLegend' );\n $this->cObjDataRemoveArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n // 4.1.7, dwildt, +\n break;\n default:\n // Render the image\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n }\n // SWITCH : Render the image\n\n $input = str_replace( '###IMG###', $img, $input );\n }\n // IF draft for an input field contains ###IMG###, render an image\n\n $arrInputs[] = $tab . $input;\n }\n // FOREACH category label\n // Move array of input fields to a string\n // #i0118, dwildt, 1-/+\n //$inputs = implode( PHP_EOL, $arrInputs );\n $inputs = implode( PHP_EOL, ( array ) $arrInputs );\n $inputs = trim( $inputs );\n\n // RETURN input fields\n return $inputs;\n }", "function saveCategories($product_id)\n {\n //var_dump(Category::$cats); exit;\n if(is_null($this->categories) || sizeof($this->categories) < 1){\n return;\n }\n \n foreach ($this->categories as $ids) {\n if(empty($ids)){\n continue;\n }\n \tif(isset(Category::$cats[$ids]) && is_object(Category::$cats[$ids])){\n\t $names[] = array('name'=>Category::$cats[$ids]->name);\n\t $cids[] = array('name'=>Category::$cats[$ids]->cid);\n\t $i = 0;\n\t $parent_id = $ids;\n\t \n\t while(($parent_id = Category::$cats[$parent_id]->parent_id) != 0){\n\t \n\t $names[] = array('name'=>Category::$cats[$parent_id]->name);\n\t $cids[] = array('name'=>Category::$cats[$parent_id]->cid);\n\t $i++;\n\t if($i > 7 ){ $i = 0; break; }\n\t }\n\t \t\n\t // \t\n\t \t$this->saveWords(Category::$cats[$ids]->name, $product_id, 2);\n\t \t $this->saveWords(Category::$cats[$ids]->description, $product_id, 1);\n\t\t//\t\t}\n\t\t\t}\n } \n\t\tif(isset($names)){\n \t$this->options['category'] = array('name'=>'category','value'=>$names);\n \t$this->options['category_id'] = array('name'=>'category_id','value'=>$cids);\n\t\t}\n }", "public function run()\n {\n Category::insert([\n [\n 'name' => 'exchange',\n 'slug' =>'exchange',\n ],\n [\n 'name' => 'card',\n 'slug' =>'card',\n\n ],\n [\n 'name' => 'loan',\n 'slug' =>'loan',\n\n ],\n [\n 'name' => 'wallet',\n 'slug' =>'wallet',\n\n ],\n [\n 'name' => 'interest account',\n 'slug' =>'interest-account',\n\n ],\n\n ]);\n }", "function read_Categories() {\n\n\t\tglobal $myCategories;\n\t\tglobal $gesamt;\n\t\t\n\t\t$i = 0;\n\t\t\n\t\tforeach ($myCategories as $catInfo):\n\t\t\n\t\t$test=$myCategories->category[$i]['typ'];\n\t\t\n\t\tarray_push($gesamt, $test);\n\t\t\n\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "public function getCategoryData()\n {\n $_category = Mage::registry('current_category');\n $data = array();\n if ($_category) {\n $data['categoryId'] = $_category->getId();\n $data['categoryName'] = $_category->getName();\n }\n return $data;\n }", "public function run()\n {\n $categories = ['Western','Chinese','Indonesia', 'Jepang', 'Korea'];\n foreach ($categories as $cat) {\n \t$mc = new MenuCategory();\n \t$mc->name = $cat;\n \t$mc->save();\n }\n }", "public function store(){\n $query = require 'core/bootstrap.php';\n \n $category = $_POST['category'];\n if(empty($category)){\n Validate::errorValidation('Category\\'s name is required!');\n return back();\n }elseif(strlen($category) < 3){\n Validate::errorValidation('Category\\'s name must have up to 3 characters');\n return back();\n }else{\n\n $query->insert('categories',[\n 'name' => $category\n ]);\n \n Validate::successValidation('Category stored successfully!!!');\n return redirect('categories');\n }\n }", "public function process()\n {\n $this->addCategory(self::ROOT_CATEGORY_ID, $this->_categories);\n }", "function addChoiceCategory($data){\n\n\t\t$this->db->insert('tbl_choice_category',$data);\n\t\treturn $this->db->insert_id();\n\t\t\n\t}", "function category_data()\n\t{\n\t\t$this->data['title'] \t= 'Portfolio Category Data';\n\t\t$this->data['category']\t= $this->portfolio_model->get_all_category();\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/category_data';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "function getCategoryFields() {\n\t\t\n\t\t$model = $this->getModel();\n\t\t$category_id = JRequest::getVar('id');\n\t\t$form = $model->getFieldForm($category_id, 'category');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\" >';\n\t\techo '<legend>New Category</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "public function actionCategorySave()\n {\n $this->_assertCanManageCategories();\n\n $category_id = $this->_input->filterSingle('faq_id', XenForo_Input::UINT);\n $saveAction = new XenForo_Phrase('iversia_faq_category_added');\n\n $dw = XenForo_DataWriter::create('Iversia_FAQ_DataWriter_Category');\n if ($category_id) {\n $dw->setExistingData($category_id);\n $saveAction = new XenForo_Phrase('iversia_faq_category_edited');\n }\n $dw->bulkSet(\n array(\n 'title' => $this->_input->filterSingle('title', XenForo_Input::STRING),\n 'display_order' => $this->_input->filterSingle('display_order', XenForo_Input::UINT),\n )\n );\n $dw->save();\n\n return $this->responseRedirect(\n XenForo_ControllerResponse_Redirect::SUCCESS,\n XenForo_Link::buildPublicLink('faq'),\n $saveAction\n );\n }", "public function add_new_category_post(){\n $data = $this->security->xss_clean($_POST);\n $data = $this->DeviceCategory_model->add_new_category($data);\n if (isset($data['status']) == 'FALSE')\n {\n $this->response($data, REST_Controller::HTTP_SEE_OTHER);\n }\n $this->set_response($data, REST_Controller::HTTP_CREATED);\n }", "public function run()\n {\n $category = new Category();\n $category->category_name = 'Concerts & Shows';\n $category->save();\n\n $category = new Category();\n $category->category_name = 'Museums';\n $category->save();\n\n $category = new Category();\n $category->category_name = 'Sights & Landmarks';\n $category->save();\n\n $category = new Category();\n $category->category_name = 'Shopping';\n $category->save();\n\n $category = new Category();\n $category->category_name = 'Fun & Games';\n $category->save();\n }", "public function createCategory();", "function readInputData() {\n\t\t$this->_metadataFormImplem->readInputData();\n\t\t$this->readUserVars(array('categories', 'seriesId', 'seriesPosition'));\n\t\tListbuilderHandler::unpack($request, $this->getData('categories'));\n\t}", "public function add_attr_cat()\n\t{\n\t\t$rest_id=$this->session->userdata('user_rest_uns');\n\t\t$cat_name=$this->input->post('cat_name');\n\t\t$query=$this->db->insert(\"food_attribute\",array(\"f_att_name\"=>$cat_name,\"rest_id\"=>$rest_id));\n\t\t\n\t\tif($query)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function run()\n {\n $category = new Category();\n $category->name = \"Terror\";\n $category->description = \"Matemáticas, en pocas palabras. \";\n $category->save();\n\n $category = new Category();\n $category->name = \"Romance\";\n $category->description = \"Muchos muchos besos.\";\n $category->save();\n\n $category = new Category();\n $category->name = \"Ciencia ficción\";\n $category->description = \"Aquí hay waifus. \";\n $category->save();\n }", "public function processTaskcodesCategory()\n {\n $directory=\"data/taskcodes_category\";\n set_time_limit(160);\n \n\n $files = File::allFiles($directory);\n\n foreach ($files as $file) {\n $file_exists=File_load::where('file_name', $file)\n ->where('type', 25)\n ->exists();\n if(!$file_exists){\n $count_insert=0;\n $count_update=0;\n Quote_category::truncate();\n \n $data = Excel::load($file)->toArray();\n \n foreach ($data as $row) {\n \n $data_value=$row;\n\n //Insert Profile\n Quote_category::create([\n 'type_id' => $data_value['id'],\n 'name' => $data_value['description'],\n 'type' => 1, \n 'active' => $data_value['active']\n ]); \n $count_insert++; \n }\n\n File_load::create([\n 'file_name' => $file,\n 'type' => 25, \n 'count_insert'=> $count_insert,\n 'count_update'=> $count_update,\n ]);\n }\n } \n\n return \"Data Inserted TaskCodes Category\";\n }", "public function run()\n {\n //\n $categories = [\n \t'社交娱乐',\n \t'射击竞速',\n \t'冒险益智',\n \t'场景体验',\n \t'其他',\n ];\n\n foreach ($categories as $value) {\n \tAppCategory::create([\n\t \t'category'=>$value,\n \t]);\n }\n }", "function save_extra_category_fileds( $term_id ) {\n\tif ( isset( $_POST['term_meta'] ) ) {\n\t\t$tag_id\t\t= $term_id;\n\t\t$term_meta\t= get_option( \"category_$tag_id\" );\n\t\t$cat_keys\t= array_keys( $_POST['term_meta'] );\n\t\tforeach ( $cat_keys as $key ) {\n\t\t\tif ( isset( $_POST['term_meta'][$key] ) ) {\n\t\t\t\t$term_meta[$key] = $_POST['term_meta'][$key];\n\t\t\t}\n\t\t}\n\t\t//save the option array\n\t\tupdate_option( \"category_$tag_id\", $term_meta );\n\t}\n}", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function run()\n {\n foreach (self::CATEGORIAS as $value) {\n Categoria::create([\n 'nombre' => $value\n ]);\n }\n }", "public function run()\n {\n\n \n $categories = array(\n [\n 'name' => 'Local Resolutions',\n 'description' => 'Local Resolutions'\n ],\n [\n 'name' => 'Minutes of Meetings',\n 'description' => 'Minutes of Meetings'\n ], \n [\n 'name' => 'Journals',\n 'description' => 'Journals',\n ], \n [\n 'name' => 'Agenda',\n 'description' => 'Agenda',\n ], \n [\n 'name' => 'Committee Reports',\n 'description' => 'Committee Reports',\n ], \n [\n 'name' => 'Proposed Legislation',\n 'description' => 'Proposed Legislation',\n ], \n [\n 'name' => 'Local Ordinance',\n 'description' => 'Local Ordinance',\n ]\n );\n\n foreach ($categories as $category) {\n $data = \\App\\FileCategory::firstOrNew($category);\n $data->fill($category);\n $data->save();\n }\n }", "function print_dataset_definitions_category($form) {\n global $CFG, $DB;\n $datasetdefs = array();\n $lnamemax = 22;\n $namestr =get_string('name', 'quiz');\n $minstr=get_string('min', 'quiz');\n $maxstr=get_string('max', 'quiz');\n $rangeofvaluestr=get_string('minmax','qtype_datasetdependent');\n $questionusingstr = get_string('usedinquestion','qtype_calculated');\n $itemscountstr = get_string('itemscount','qtype_datasetdependent');\n $text ='';\n if (!empty($form->category)) {\n list($category) = explode(',', $form->category);\n $sql = \"SELECT i.*,d.*\n FROM {question_datasets} d,\n {question_dataset_definitions} i\n WHERE i.id = d.datasetdefinition\n AND i.category = ?;\n \" ;\n if ($records = $DB->get_records_sql($sql, array($category))) {\n foreach ($records as $r) {\n $sql1 = \"SELECT q.*\n FROM {question} q\n WHERE q.id = ?\n \";\n if ( !isset ($datasetdefs[\"$r->type-$r->category-$r->name\"])){\n $datasetdefs[\"$r->type-$r->category-$r->name\"]= $r;\n }\n if ($questionb = $DB->get_records_sql($sql1, array($r->question))) {\n $datasetdefs[\"$r->type-$r->category-$r->name\"]->questions[$r->question]->name =$questionb[$r->question]->name ;\n }\n }\n }\n }\n if (!empty ($datasetdefs)){\n\n $text =\"<table width=\\\"100%\\\" border=\\\"1\\\"><tr><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\" >$namestr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$rangeofvaluestr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$itemscountstr</th><th style=\\\"white-space:nowrap;\\\" class=\\\"header\\\" scope=\\\"col\\\">$questionusingstr</th></tr>\";\n foreach ($datasetdefs as $datasetdef){\n list($distribution, $min, $max,$dec) = explode(':', $datasetdef->options, 4);\n $text .=\"<tr><td valign=\\\"top\\\" align=\\\"center\\\"> $datasetdef->name </td><td align=\\\"center\\\" valign=\\\"top\\\"> $min <strong>-</strong> $max </td><td align=\\\"right\\\" valign=\\\"top\\\">$datasetdef->itemcount&nbsp;&nbsp;</td><td align=\\\"left\\\">\";\n foreach ($datasetdef->questions as $qu) {\n //limit the name length displayed\n if (!empty($qu->name)) {\n $qu->name = (strlen($qu->name) > $lnamemax) ?\n substr($qu->name, 0, $lnamemax).'...' : $qu->name;\n } else {\n $qu->name = '';\n }\n $text .=\" &nbsp;&nbsp; $qu->name <br/>\";\n }\n $text .=\"</td></tr>\";\n }\n $text .=\"</table>\";\n }else{\n $text .=get_string('nosharedwildcard', 'qtype_calculated');\n }\n return $text ;\n }", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "public function run()\n {\n //\n $academicpostcategory = [\n [\n 'type' => 'quiz'\n\n ],\n [\n 'type' => 'assignment'\n ],\n [\n 'type' => 'first-sessional'\n ],\n [\n 'type' => 'second-sessional'\n ],\n [\n 'type' => 'final'\n ]\n\n ];\n\n\n foreach ($academicpostcategory as $key => $value) {\n AcademicPostCategory::create($value);\n }\n }", "function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}", "function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}", "public function run()\n {\n $categories = [\n ['name' => 'php'], ['name' => 'laravel'], ['name' => 'jquery'], ['name' => 'vue'], ['name' => 'react'],\n ['name' => 'html'], ['name' => 'css'], ['name' => 'javascript'], ['name' => 'mysql'], ['name' => 'linux']\n ];\n\n \\DB::table('categories')->insert($categories);\n }", "public function store($categoria)\n {\n $this->db->insert('categorias', $categoria);\n }", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function storeCategory()\n {\n $this->validate([\n 'name' =>'required',\n 'slug' =>'required|unique:categories'\n ]);\n $category = new Category();\n $category->name = $this->name; \n $category->slug = $this->slug;\n $category->save();\n $this->dispatchBrowserEvent('success');\n //$this->emit('alert', ['type' =>'success', 'message' => 'Operation Successful']);\n //session()->flash('message', 'Category has been saved successfully');\n //$this->dispatchBrowserEvent('hide-form', ['message' => 'Category Added Successfully']);\n }", "public function run()\n { \n $typologies = config('typologies');\n foreach ($typologies as $typology) {\n $newCategory = new Typology();\n $newCategory->name = $typology['name'];\n $newCategory->img = $typology['img'];\n $newCategory->save();\n }\n \n }", "public function run()\n {\n\n Category::create(['name' => 'Portada']);\n\t\tCategory::create(['name' => 'Internacional']);\n\t\tCategory::create(['name' => 'Nacional']);\n\t\tCategory::create(['name' => 'Local']);\n\t\tCategory::create(['name' => 'Sociedad']);\n\t\tCategory::create(['name' => 'Cultura']);\n\t\tCategory::create(['name' => 'Cartelera']);\n\t\tCategory::create(['name' => 'Anuncios']);\n\t\tCategory::create(['name' => 'Deportes']);\n\t\tCategory::create(['name' => 'Economía']);\n\t\tCategory::create(['name' => 'Bolsa']);\n\t\tCategory::create(['name' => 'Agenda']);\n\t\tCategory::create(['name' => 'Pasatiempos']);\n\t\tCategory::create(['name' => 'Radio y televisión']);\n }", "function affwp_save_affiliate_program( $affiliate_id, $status, $args ) {\n\n\t$program = sanitize_text_field( $_POST['affwp_program'] );\n\n\tif ( ! empty( $program ) ) {\n\t\taffwp_add_affiliate_meta( $affiliate_id, 'program', $program );\n\t}\n\n}", "public function run()\n {\n Category::create(\n [\n 'name' => 'uncategorized',\n 'slug' => 'uncategorized'\n ],\n [\n 'name' => 'Entertainment',\n 'slug' => 'entertainment'\n ],\n [\n 'name' => 'Social',\n 'slug' => 'social'\n ],\n [\n 'name' => 'Main',\n 'slug' => 'main'\n ]\n );\n }", "function add_cat() {\n $item = mysql_real_escape_string($_POST['cat']);\n $sql = \"INSERT INTO Categories (name) \n VALUES ('$item')\";\n\tmysql_query($sql);\n}", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}", "public function updateProgramCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $programCategory = ProgramCategory::find($id);\n $programCategory->program_category_name = $request->name;\n $programCategory->tips = $request->tips;\n $programCategory->save();\n Session::flash('success','Program Category Updated succcessfully.');\n return redirect()->back()->with('workout',$programCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }" ]
[ "0.6249412", "0.6124111", "0.5888456", "0.57923037", "0.5727026", "0.57267463", "0.5641175", "0.56360894", "0.5622185", "0.5558223", "0.5539674", "0.55263704", "0.55060816", "0.550298", "0.5502602", "0.5431195", "0.5417658", "0.5393107", "0.5385183", "0.53831905", "0.5369164", "0.53674865", "0.5357434", "0.5333144", "0.53299254", "0.5326019", "0.530585", "0.5304398", "0.5302868", "0.52944", "0.52934366", "0.5289784", "0.528108", "0.52718043", "0.5268436", "0.525495", "0.525077", "0.52335405", "0.52320284", "0.5226517", "0.52233344", "0.52209187", "0.52199215", "0.5217158", "0.52144784", "0.5211553", "0.5208471", "0.52015495", "0.5200795", "0.52003384", "0.5199273", "0.5184344", "0.51813513", "0.5177146", "0.5171988", "0.5171899", "0.51714146", "0.5171117", "0.5166855", "0.51599264", "0.51559347", "0.5145688", "0.5141293", "0.51397616", "0.51388246", "0.51360244", "0.51255864", "0.5107083", "0.5098393", "0.50983346", "0.50982535", "0.5096877", "0.50903857", "0.50889415", "0.50882167", "0.5087769", "0.50867176", "0.50825393", "0.50806427", "0.5075625", "0.5074764", "0.50729024", "0.5070619", "0.50695103", "0.5060957", "0.50599366", "0.5057445", "0.5055439", "0.5055439", "0.50539845", "0.50495243", "0.50487417", "0.5047432", "0.5044519", "0.50437814", "0.50423187", "0.5040718", "0.5033468", "0.5031751", "0.5029945" ]
0.6413852
0
/Add Workout category form
public function addWorkoutCategory() { return view('admin.addworkoutcategory'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function storeWorkoutCategory(Request $request)\n {\n $this->validate($request,array(\n 'categoryName' => 'required',\n ));\n\n $workoutCategory = new Category;\n\n $workoutCategory->category = $request->categoryName;\n\n $workoutCategory->save();\n\n if($workoutCategory->save()){\n return redirect()->back()->with('success','Workout category Saved successfully.');\n }\n else{\n return redirect()->back()->with('denger-success','Workout category is not saved.');\n }\n \n }", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio Category';\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function updateworkoutcategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $workoutCategory = Category::find($id);\n $workoutCategory->Category = $request->name;\n $workoutCategory->save();\n Session::flash('success','Workout Category Updated succcessfully.');\n return redirect()->back()->with('workout',$workoutCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function addWorkout()\n {\n return view('admin.addworkout');\n }", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "function gtags_group_category_form() {\n\tglobal $bp, $show_group_add_form_cats;\t\n\tif ($show_group_add_form_cats) return; // prevents showing form twice\n\t$show_group_add_form_cats = true;\n\n\t// the group category\t\n\t$group_cats = get_option('gtags_category'); \n\tif (empty($group_cats)) return;\n\t\n\t$selected = groups_get_groupmeta( $bp->groups->current_group->id, 'gtags_group_cat' ); \n\t?><label for=\"group-cat\"><?php _e( 'Group Category', 'gtags' ) ?></label>\n\t<select name=\"group-cat\" id=\"group-cat\" />\n\t\t<option value=\"\"><?php _e('--- SELECT ONE ---', 'gtags') ?></option>\n\t<?php foreach ( $group_cats as $tag => $desc ): ?>\n\t\t<?php if ( !$desc ) $desc = $tag; ?>\n\t\t<option value=\"<?php echo $tag; ?>\" <?php if ( $tag == $selected ) echo 'selected=\"selected\"' ?>><?php echo $desc; ?></option>\n\t<?php endforeach; ?>\n\t</select>\n\t<i><?php _e('(the primary group activity)', 'gtags'); ?></i><br><?php \t\n}", "function CategoryForm() {\r\n\r\n\t\t$member = Member::currentUser();\r\n\r\n\t\t// Need to sort out how going to handle multiple instances of category\r\n\t\t// front end grid field : https://github.com/webbuilders-group/silverstripe-frontendgridfield\r\n\t\t// grid field extension : https://github.com/silverstripe-australia/silverstripe-gridfieldextensions\r\n\t\t$category = Category::get()->first();\r\n\t\t$fields = $category->FormFields();\r\n\r\n $actions = FieldList::create(\r\n FormAction::create(\"doCategoryForm\")->setTitle(\"Submit\")->addExtraClass('productive'),\r\n FormAction::create(\"cancel\")->setTitle(\"Cancel\")\r\n );\r\n\r\n $form = Form::create($this, 'CategoryForm', $fields, $actions);\r\n\r\n return $form;\r\n\r\n\t}", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function add_category_cmb_field( $cmb ) {\n\t\t$field_ids = wp_list_pluck( $cmb->prop( 'fields' ), 'id' );\n\t\t$field_position = array_search( 'header_code', array_keys( $field_ids ), true ) + 1;\n\n\t\t$add_button = '<span class=\"button button-secondary add-redirection-category-button\">' . esc_html__( 'Add New', 'rank-math-pro' ) . '</span>';\n\t\t$add_input = '<input type=\"text\" class=\"add-redirection-category-input exclude\" placeholder=\"' . esc_attr__( 'New Category', 'rank-math-pro' ) . '\" value=\"\">';\n\t\t$manage_link = '<a href=\"' . admin_url( 'edit-tags.php?taxonomy=rank_math_redirection_category' ) . '\" class=\"manage-redirection-categories-link\">' . esc_html__( 'Manage Categories', 'rank-math-pro' ) . '</a>';\n\n\t\t$terms = get_terms(\n\t\t\t[\n\t\t\t\t'taxonomy' => 'rank_math_redirection_category',\n\t\t\t\t'hide_empty' => false,\n\t\t\t]\n\t\t);\n\n\t\t$default_options = [];\n\t\tif ( $this->is_editing() ) {\n\t\t\t$default_options = $this->get_redirection_categories( Param::get( 'redirection' ), [ 'fields' => 'ids' ] );\n\t\t}\n\n\t\t$ids = wp_list_pluck( $terms, 'term_id' );\n\t\t$names = wp_list_pluck( $terms, 'name' );\n\n\t\t$multicheck_options = array_combine( $ids, $names );\n\n\t\t$cmb->add_field(\n\t\t\t[\n\t\t\t\t'id' => 'redirection_category',\n\t\t\t\t'type' => 'multicheck_inline',\n\t\t\t\t'name' => esc_html__( 'Redirection Category', 'rank-math-pro' ),\n\t\t\t\t'desc' => esc_html__( 'Organize your redirections in categories.', 'rank-math-pro' ),\n\t\t\t\t'options' => $multicheck_options,\n\t\t\t\t'select_all_button' => false,\n\t\t\t\t'after_field' => $add_input . $add_button . $manage_link,\n\t\t\t\t'default' => $default_options,\n\t\t\t],\n\t\t\t++$field_position\n\t\t);\n\n\t\t$cmb->add_field(\n\t\t\t[\n\t\t\t\t'id' => 'set_redirection_category',\n\t\t\t\t'type' => 'hidden',\n\t\t\t\t'default' => '1',\n\t\t\t],\n\t\t\t++$field_position\n\t\t);\n\n\t}", "public function addAction()\n {\n $request = $this->getRequest();\n\n $routeMatch = $this->getEvent()->getRouteMatch();\n $id = $routeMatch->getParam('workout_id', 0);\n\n if ($id <= 0) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $workout = $this->_workout->getRow(array('workout_id' => $id));\n//\n if (!$workout) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n /**\n * Grid FORM\n */\n $form = new WorkoutExerciseGrid(\n array(\n 'view' => $this->_view,\n )\n );\n\n /**\n * BUILDING Row\n */\n $row = new WorkoutExerciseRow(\n array(\n 'model' => $this->_exercise,\n 'view' => $this->_view,\n )\n );\n\n $row->setFieldOptions('type_id', array(\n 'values' => $this->_exerciseType->getBehaviour('nestedSet')->getResultSetForSelect(),\n 'onchange' => 'exerciseType(this);',\n ));\n $row->setFieldOptions('workout_id', array(\n 'value' => $id,\n ));\n\n //\n\n\n\n //\n $row->build();\n\n //\n $form->addSubForm($row, $row->getName());\n\n //\n $this->_view->headScript()->appendScript(\n $this->_view->render(\n 'workout-exercise/add.js',\n array(\n 'currentFormType' => 0,\n 'back' => $this->url()->fromRoute(\n 'hi-training/workout-exercise/list/wildcard',\n array('workout_id' => $id)\n ),\n 'ajaxFormType' => $this->url()->fromRoute(\n 'hi-training/exercise-type/ajax-form-type/wildcard',\n array('type_id' => '')\n ),\n 'ajaxLastOfType' => $this->url()->fromRoute(\n 'hi-training/workout-exercise/ajax-last-of-type/wildcard',\n array('type_id' => '')\n ),\n )\n )\n );\n\n\n /**\n * POST\n */\n if ($this->getRequest()->isPost()) {\n\n $formData = $this->getRequest()->post()->toArray();\n\n if ($form->isValid($formData)) {\n\n// \\Zend\\Debug::dump($formData);\n\n if ( isset($formData['header']['formId'])\n && $formData['header']['formId'] == 'WorkoutExerciseGridForm') {\n\n if (isset($formData['WorkoutExerciseRow']['actions']['save'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $newRow = $this->_exercise->createRow()->populate($formData['WorkoutExerciseRow']['row']);\n $newRow->save();\n\n return $this->redirect()->toRoute('hi-training/workout-exercise/list/wildcard', array('workout_id' => $id));\n }\n\n }\n\n if (isset($formData['WorkoutExerciseRow']['actions']['saveAdd'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $newRow = $this->_exercise->createRow()->populate($formData['WorkoutExerciseRow']['row']);\n $newRow->save();\n\n return $this->redirect()->toRoute('hi-training/workout-exercise/add/wildcard', array('workout_id' => $id));\n }\n\n }\n }\n }\n }\n\n //\n return array(\n 'form' => $form,\n 'workout' => $workout,\n );\n\n }", "public function add_acct_category(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\nif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['ledger1'] = $this->db->get_where('acct_categories', ['category_type' => 'Main']);\n\t\t\t\n\t\t}\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'add_acct_category') die('Error! sorry');\n\n\t\t\t$this->form_validation->set_rules('category_name', 'Category Name', 'required|trim');\n\t\t\t$this->form_validation->set_rules('visible', 'Access To Payspecifications', 'required|trim');\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->add_acct_category();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Accounts Category Created Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\ntheme('add_acct_category');\n\t}", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "function colorpicker_field_add_new_category( $taxonomy ) { ?> \r\n\t<div class=\"form-field term-colorpicker-wrap\"> \r\n\t<label for=\"term-colorpicker\">Category Color</label> \r\n\t<input name=\"_category_color\" value=\"#ffffff\" class=\"colorpicker\" id=\"term-colorpicker\" /> \r\n\t<p>This is the field description where you can tell the user how the color is used in the theme.</p> \r\n\t</div> <?php }", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function create()\n {\n return view(\"jobcategory.create\");\n }", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function add()\n {\n \t\t$options = array(\n \t\t\t\t'order' => array('Categories.name' => 'asc')\n \t\t);\n \t\t//Get Categories\n \t\t$categories = $this->Jobs->Categories->find('list', $options);\n \t\t//Set Categories\n \t\t$this->set('categories', $categories);\n\n \t\t//Get types for select list\n \t\t$types = $this->Jobs->Types->find('list');\n \t\t//Set Types\n \t\t$this->set('types', $types);\n\n $job = $this->Jobs->newEntity();\n if($this->request->is('post')){\n $this->request->data['Jobs']['user_id'] = $this->Auth->user('id');\n $job = $this->Jobs->patchEntity($job, $this->request->data);\n\n if($this->Jobs->save($job)){\n $this->Flash->success('Your job has been listed');\n return $this->redirect(array('action' => 'index'));\n }\n\n $this->Flash->set('Unable to add your job');\n }\n }", "public function servicecat(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t//prd($servicelist);\n\t\t\t\t\t\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}", "public function stepCategory()\n {\n global $rlSmarty, $rlCategories, $page_info, $account_info, $sError, $config;\n\n parent::step();\n\n $GLOBALS['rlHook']->load('addListingGetCats');\n\n // Define allowed types\n $allowed_type_keys = $account_info['Abilities'];\n\n // \"Individual add listing page\" mode\n if ($page_info['Key'] != 'add_listing') {\n $individual_type_key = substr($page_info['Key'], 3);\n\n if (in_array($individual_type_key, $allowed_type_keys)) {\n $allowed_type_keys = array($individual_type_key);\n } else {\n $sError = true;\n }\n }\n\n // Adapt listing types array\n $allowed_types = $GLOBALS['rlListingTypes']->adaptTypes($allowed_type_keys);\n $rlSmarty->assign_by_ref('allowed_types', $allowed_types);\n\n // Existing membership plan mode\n $this->existingMembershipHandler($account_info);\n\n // Remove unnecessary steps\n if (!$this->singleStep) {\n unset($this->steps['photo'], $this->steps['checkout']);\n }\n }", "public function getAddEditForm($target = '/admin/Cart') {\n\t\t$form = new Form('CartCategory_addedit', 'post', $target);\n\t\t\n\t\t$form->setConstants( array ( 'section' => 'categories' ) );\n\t\t$form->addElement( 'hidden', 'section' );\n\t\t$form->setConstants( array ( 'action' => 'addedit' ) );\n\t\t$form->addElement( 'hidden', 'action' );\n\t\t\n\t\tif (!is_null($this->getId())) {\n\t\t\t$form->setConstants( array ( 'cartcategory_categories_id' => $this->getId() ) );\n\t\t\t$form->addElement( 'hidden', 'cartcategory_categories_id' );\n\t\t\t\n\t\t\t$defaultValues ['cartcategory_name'] = $this->getName();\n\t\t\t$defaultValues ['cartcategory_description'] = $this->getDescription();\n\t\t\t$defaultValues ['cartcategory_image'] = $this->getImage();\n\t\t\t$defaultValues ['cartcategory_parent_id'] = $this->getParent_id();\n\t\t\t$defaultValues ['cartcategory_date_added'] = $this->getDate_added();\n\t\t\t$defaultValues ['cartcategory_last_modified'] = $this->getLast_modified();\n\t\t\t$defaultValues ['cartcategory_status'] = $this->getStatus();\n\n\t\t\t$form->setDefaults( $defaultValues );\n\t\t}\n\t\t\n\t\t$form->addElement('text', 'cartcategory_name', 'Name');\n\t\t\n\t\t$description = $form->addElement('textarea', 'cartcategory_description', 'Description');\n\t\t$description->setCols(80);\n\t\t$description->setRows(10);\n\t\t\n\t\t$newImage = $form->addElement('file', 'cartcategory_image_upload', 'Category Image');\n\t\t$curImage = $form->addElement('dbimage', 'cartcategory_image', $this->getImage());\n\t\t\n\t\t$form->addElement('select', 'cartcategory_parent_id', 'Parent Category', self::toArray());\n\t\t\n\t\t$added = $form->addElement('text', 'cartcategory_date_added', 'Date Added');\n\t\t$added->freeze();\n\t\t\n\t\t$modified = $form->addElement('text', 'cartcategory_last_modified', 'Date Last Modified');\n\t\t$modified->freeze();\n\t\t\n\t\t$form->addElement('select', 'cartcategory_status', 'Status', Form::statusArray());\n\t\t$form->addElement('submit', 'cartcategory_submit', 'Submit');\n\n\t\tif (isset($_REQUEST['cartcategory_submit']) && $form->validate() && $form->isSubmitted()) {\n\t\t\t$this->setName($form->exportValue('cartcategory_name'));\n\t\t\t$this->setDescription($form->exportValue('cartcategory_description'));\n\t\t\t$this->setImage($form->exportValue('cartcategory_image'));\n\t\t\t$this->setParent_id($form->exportValue('cartcategory_parent_id'));\n\t\t\t$this->setDate_added($form->exportValue('cartcategory_date_added'));\n\t\t\t$this->setLast_modified($form->exportValue('cartcategory_last_modified'));\n\t\t\t$this->setStatus($form->exportValue('cartcategory_status'));\n\t\t\t\n\t\t\tif ($newImage->isUploadedFile()) {\n\t\t\t\t$im = new Image();\n\t\t\t\t$id = $im->insert($newImage->getValue());\n\t\t\t\t$this->setImage($im);\n\t\t\t\t\n\t\t\t\t$curImage->setSource($this->getImage()->getId());\n\t\t\t}\n\t\t\t\n\t\t\t$this->save();\n\t\t}\n\n\t\treturn $form;\n\t\t\n\t}", "public function newAction()\n {\n\t\tTag::appendTitle('Add New Category');\n }", "function rmmfNew(){\n\tglobal $db, $mc;\n\t\n\tlist($num) = $db->fetchRow($db->query(\"SELECT COUNT(*) FROM \".$db->prefix(\"rmmf_categos\")));\n\tif ($num<=0){\n\t\tredirect_header('categos.php?op=new', 1, _MA_RMMF_CATEGOFIRST);\n\t\tdie();\n\t}\n\t\n\tdefine('_RMMF_LOCATION','NEWWORK');\n\txoops_cp_header();\n\trmmf_make_adminnav();\n\t\n\tinclude_once '../common/form.class.php';\n\t$form = new RMForm(_MA_RMMF_NEWWORK, 'frmNew', 'index.php?op=save');\n\t$form->setExtra(\"enctype='multipart/form-data'\");\n\t$form->addElement(new RMText(_MA_RMMF_TITLE, 'titulo', 50, 150));\n\t$result = array();\n\t$select = \"<select name='catego'>\n\t\t\t\t<option value='0'>\"._MA_RMMF_SELECT.\"</option>\";\n\trmmf_get_categos($result);\n\tforeach ($result as $k => $v){\n\t\t$select .= \"<option value='$v[id_cat]'>\".str_repeat('-', $v['saltos']).\" $v[nombre]</option>\";\n\t}\n\t$select .= \"</select>\";\n\t$form->addElement(new RMLabel(_MA_RMMF_CATEGO, $select));\n\t$form->addElement(new RMText(_MA_RMMF_CLIENT, 'cliente', 50, 255));\n\t$form->addElement(new RMText(_MA_RMMF_URL, 'url', 50, 255, 'http://'));\n\t$form->addElement(new RMTextArea(_MA_RMMF_SHORT, 'short', 4, 45));\n\t$form->addElement(new RMLabel(_MA_RMMF_DESC, rmmf_select_editor('desc',$mc['editor'],'','100%','250px')));\n\t$form->addElement(new RMTextArea(_MA_RMMF_COMMENT, 'comentario', 4, 45));\n\t$form->addElement(new RMFile(_MA_RMMF_IMG, 'imagen', 45));\n\t$form->addElement(new RMYesNo(_MA_RMMF_FEATURED, 'resaltado', 0));\n\t$form->addElement(new RMButton('sbt',_MA_RMMF_SEND));\n\t$form->display();\n\trmmf_make_footer();\n\txoops_cp_footer();\n}", "public function addAction()\n {\n $form = new CategoryForm();\n $form->get('submit')->setValue('Add');\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n $category->exchangeArray($form->getData());\n $this->getCategoryTable()->saveCategory($category);\n\n // Redirect to list of categorys\n return $this->redirect()->toRoute('category');\n }\n }\n return array('form' => $form);\n }", "public function create() \n\t{\n\t\n\t\t$this->data = (object) array();\n\t\t// Check for post data\n\t\t$this->form_validation->set_rules($this->_validation_rules);\n\t\t\n\t\t\n\t\t// if postback-validate\n\t\tif ($this->form_validation->run()) \n\t\t{\n\t\t\t$input = $this->input->post();\n\t\t\t$id = $this->categories_m->create($input);\n\t\t\t\n\t\t\tEvents::trigger('evt_category_created', $id );\n\t\t\t\n\t\t\t$this->session->set_flashdata('success', lang('success'));\n\t\t\tredirect('admin/shop/categories');\n\t\t\t\n\t\t} \n\t\telse \n\t\t{\n\t\t\tforeach ($this->_validation_rules as $key => $value) \n\t\t\t{\n\t\t\t\t$this->data->{$value['field']} = '';\n\t\t\t}\n\t\t}\n\n\t\t$this->data->parent_category_select \t= $this->categories_m->build_dropdown(array(\n\t\t\t'type'\t=> 'all'\n\t\t)); \n\n\n\t\t// prepare dropdown image folders\n\t\t$folders = $this->_prep_folders();\n\n\n\t\t// Build page\n\t\t$this->template\n\t\t\t->title($this->module_details['name'])\n\t\t\t->set('folders',$folders)\n\t\t\t->append_js('module::admin/categories.js')\t\n\t\t\t->append_js('module::admin/admin.js')\t\t\n\t\t\t->append_metadata($this->load->view('fragments/wysiwyg', $this->data, TRUE))\n\t\t\t->build('admin/categories/form', $this->data);\n\t}", "public function add_category() /// get routes of the form add cateogry\n {\n return view('admin.categories.add-category');\n }", "public function create()\n {\n return view(\"dashboard.pages.supervisor.category.add\");\n \n }", "public function addProgramCategory()\n {\n return view('admin.addprogramcategory');\n }", "public function addCategory()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['category'];\n\t\t\t$sql = \"insert into lib_category (category,add_date,staff_id) \n\t\t\t\t\tvalues('\" . $category . \"','\" . date('Y-m-d') . \"','\" . cookie('staffAccount') . \"') \";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Add successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function create()\n {\n $categories = Category::all();\n return view('jobCategories.create', compact('categories'));\n }", "public function addNutrationCategory()\n {\n return view('admin.addnutratoncategory');\n }", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "function getCategoryFields() {\n\t\t\n\t\t$model = $this->getModel();\n\t\t$category_id = JRequest::getVar('id');\n\t\t$form = $model->getFieldForm($category_id, 'category');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\" >';\n\t\techo '<legend>New Category</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "public function newcategory() {\n\n if (ckeckAddmin()) {\n $this->load->view('admin/header/header');\n $this->load->view('admin/css/css');\n $this->load->view('admin/topnav/topnav');\n $this->load->view('admin/sidenav/sidenav');\n $this->load->view('admin/content/addcatogry');\n $this->load->view('admin/footer/footer');\n # $this->load->view('admin/js/extra');\n $this->load->view('admin/js/js');\n } else {\n CustomFlash('Admin/login', 'alert-danger', 'plz First Login');\n }\n }", "public function showCategoryForm() {\n $company_logo = $this->showLogoImage();\n $category_images = \\App\\CouponCategory::categoryList();\n $signup_category_images = \\App\\CouponCategory::categoryListWeb();\n $country_list = \\App\\Country::countryList();\n\n return view('frontend.signup.category')->with(['company_logo' => $company_logo,\n 'category_images' => $category_images, 'signup_category_images' => $signup_category_images,\n 'country_list' => $country_list]);\n }", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "public function addCategory()\n {\n $data['categorys'] = Category::whereNull('parent_id')->get();\n return view('category.addEdit', $data);\n }", "public function add_category() {\n\t\n\t\tif($this->input->post('add_type')=='add_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name'),\n\t\t'created_at' => date('d-m-Y h:i:s')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->add_assets_category($data);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_added');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "function question_category_form($course, $current, $recurse=1, $showhidden=false, $showquestiontext=false) {\n global $CFG;\n\n/// Make sure the default category exists for this course\n get_default_question_category($course->id);\n\n/// Get all the existing categories now\n $catmenu = question_category_options($course->id, true);\n\n $strcategory = get_string(\"category\", \"quiz\");\n $strshow = get_string(\"show\", \"quiz\");\n $streditcats = get_string(\"editcategories\", \"quiz\");\n\n echo \"<table><tr><td style=\\\"white-space:nowrap;\\\">\";\n echo \"<strong>$strcategory:</strong>&nbsp;\";\n echo \"</td><td>\";\n popup_form (\"edit.php?courseid=$course->id&amp;cat=\", $catmenu, \"catmenu\", $current, \"\", \"\", \"\", false, \"self\");\n echo \"</td><td align=\\\"right\\\">\";\n echo \"<form method=\\\"get\\\" action=\\\"$CFG->wwwroot/question/category.php\\\">\";\n echo \"<div>\";\n echo \"<input type=\\\"hidden\\\" name=\\\"id\\\" value=\\\"$course->id\\\" />\";\n echo \"<input type=\\\"submit\\\" value=\\\"$streditcats\\\" />\";\n echo '</div>';\n echo \"</form>\";\n echo '</td></tr></table>';\n\n echo '<form method=\"get\" action=\"edit.php\" id=\"displayoptions\">';\n echo \"<fieldset class='invisiblefieldset'>\";\n echo \"<input type=\\\"hidden\\\" name=\\\"courseid\\\" value=\\\"{$course->id}\\\" />\\n\";\n question_category_form_checkbox('recurse', $recurse);\n question_category_form_checkbox('showhidden', $showhidden);\n question_category_form_checkbox('showquestiontext', $showquestiontext);\n echo '<noscript><div class=\"centerpara\"><input type=\"submit\" value=\"'. get_string('go') .'\" />';\n echo '</div></noscript></fieldset></form>';\n}", "function addForm()\n {\n $content = '';\n $template['job_bank_add'] = $this->cObj->getSubpart($this->__getTemplateCode(),\"###ADD_JOB_PLACEHOLDER###\"); \n\n $subPartArray['###CAREERLEVEL###'] = $this->createDropDown($this->job_careerlevel);\n $subPartArray['###FORMNAMEEXTENSIONJOB###'] = $this->prefixId;\n $subPartArray['###FORMNAMEEXTENSION###'] = $this->prefixId;\n $subPartArray[\"###HELP_IMAGE###\"] = t3lib_extMgm::siteRelPath($this->extKey).'images/help.gif';\n $subPartArray['###JOB_BANK_LOCATION###'] = $this->getCountryZone();\n $subPartArray['###QUALIFICATION###'] = $this->createDropDown($this->job_qualifiacation);\n $subPartArray['###SCRIPTNAME_POPUP_HELP_JS###'] = t3lib_extMgm::siteRelPath($this->extKey).'styles/overlib.js';\n $subPartArray[\"###SPONSOR_ID###\"] = $this->sponsorId;\n $subPartArray['###STATUS###'] = $this->createDropDown($this->job_status);\n\n $content .= $this->cObj->substituteMarkerArrayCached($template['job_bank_add'],$subPartArray,array(),array());\n \n return $this->pi_wrapInBaseClass($content);\n\n }", "public function addPost(){\n\n if ($this->input->post(\"category_create\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n $categoryName = $this->input->post(\"category_name\");\n\n $this->validate->setRule(\"minlength\",$categoryName,3, \"Category name length must be more then 3 symbols!\");\n\n if ($this->validate->validate() === false){\n $error = $this->validate->getErrors();\n $this->view->redirect(\"/categories/manage\",$error);\n }\n\n $categoryModel = new CategoriesModel();\n try{\n if ($categoryModel->hasCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"This categories already exist!\");\n }\n\n if($categoryModel->addNewCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"Category created successfully!\",\"success\");\n }\n }catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception);\n }\n }", "public function add()\n {\n $category = $this->Category->newEntity();\n if ($this->request->is('post')) {\n $category = $this->Category->patchEntity($category, $this->request->getData());\n if ($this->Category->save($category)) {\n $this->Flash->success(__('The category has been saved.'));\n\n return $this->redirect(['action' => 'index']);\n }\n $this->Flash->error(__('The category could not be saved. Please, try again.'));\n }\n $this->set(compact('category'));\n }", "public function subcategory(){\n\t\t$modelservices = new Application_Model_Services();\n\t\t$servicelist = $modelservices->servicesdata();\n\t\t$caterories = $modelservices->categorydata();\n\t//prd($caterories);\n\n \t\t$this->addElement('text', 'service_name', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required',\n\t\t\t\"label\" => \"Service Sub Category Title \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\" Expertise Title is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t$this->addElement('text', 'service_price', array (\n\t\t\t\"required\" => TRUE,\n\t\t\t'class' => 'form-control required digits',\n\t\t\t\"label\" => \"Service Credit \" ,\n\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\"),\n\t\t\t\"validators\" => array(\n\t\t\t\t\t\t\t\tarray(\"NotEmpty\",true,array(\"messages\"=>\"Price is required \")),\n \t\t\t\t\t\t\t),\n \t\t));\n\t\t$this->addElement('select', 'service_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$servicelist,\n\t\t\t\t\"onchange\"=>\"getcategorylist(this.value)\",\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n\t\t$this->addElement('select', 'service_sub_parent_id', array (\n\t\t\t\t'class' => 'form-control required' ,\n\t\t\t\t\"required\"=>true,\n\t\t\t\t\"multioptions\"=>$caterories,\n\t\t\t\t\"filters\" => array(\"StringTrim\",\"StripTags\",\"HtmlEntities\"),\n\t\t\t\t\n\t\t));\n \t\t$this->submitButton();\n \t}", "public function output_category_widget() {\n\n\t\t$categories = get_terms( 'product_cat', array( 'orderby' => 'name' ) );\n\t\t?>\n\t\t<form method=\"GET\">\n\t\t\t<div>\n\t\t\t\t<select multiple=\"multiple\" data-placeholder=\"<?php _e( 'Select categories&hellip;', 'woocommerce-cost-of-goods' ); ?>\" class=\"wc-enhanced-select\" id=\"category_ids\" name=\"category_ids[]\" style=\"width: 205px;\">\n\t\t\t\t\t<?php\n\t\t\t\t\t$r = array();\n\t\t\t\t\t$r['pad_counts'] = 1;\n\t\t\t\t\t$r['hierarchical'] = 1;\n\t\t\t\t\t$r['hide_empty'] = 1;\n\t\t\t\t\t$r['value'] = 'id';\n\t\t\t\t\t$r['selected'] = $this->category_ids;\n\n\t\t\t\t\tinclude_once( WC()->plugin_path() . '/includes/walkers/class-product-cat-dropdown-walker.php' );\n\n\t\t\t\t\techo wc_walk_category_dropdown_tree( $categories, 0, $r );\n\t\t\t\t\t?>\n\t\t\t\t</select>\n\t\t\t\t<a href=\"#\" class=\"select_none\"><?php esc_html_e( 'None', 'woocommerce-cost-of-goods' ); ?></a>\n\t\t\t\t<a href=\"#\" class=\"select_all\"><?php esc_html_e( 'All', 'woocommerce-cost-of-goods' ); ?></a>\n\t\t\t\t<input type=\"submit\" class=\"submit button\" value=\"<?php esc_attr_e( 'Show', 'woocommerce-cost-of-goods' ); ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"range\" value=\"<?php if ( ! empty( $_GET['range'] ) ) echo esc_attr( $_GET['range'] ) ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"start_date\" value=\"<?php if ( ! empty( $_GET['start_date'] ) ) echo esc_attr( $_GET['start_date'] ) ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"end_date\" value=\"<?php if ( ! empty( $_GET['end_date'] ) ) echo esc_attr( $_GET['end_date'] ) ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"page\" value=\"<?php if ( ! empty( $_GET['page'] ) ) echo esc_attr( $_GET['page'] ) ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"tab\" value=\"<?php if ( ! empty( $_GET['tab'] ) ) echo esc_attr( $_GET['tab'] ) ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"report\" value=\"<?php if ( ! empty( $_GET['report'] ) ) echo esc_attr( $_GET['report'] ) ?>\" />\n\t\t\t</div>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tjQuery( function() {\n\t\t\t\t\t// select all\n\t\t\t\t\tjQuery( '.chart-widget' ).on( 'click', '.select_all', function() {\n\t\t\t\t\t\tjQuery(this).closest( 'div' ).find( 'select option' ).attr( \"selected\", \"selected\" );\n\t\t\t\t\t\tjQuery(this).closest( 'div' ).find('select').change();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} );\n\n\t\t\t\t\t// select none\n\t\t\t\t\tjQuery( '.chart-widget').on( 'click', '.select_none', function() {\n\t\t\t\t\t\tjQuery(this).closest( 'div' ).find( 'select option' ).removeAttr( \"selected\" );\n\t\t\t\t\t\tjQuery(this).closest( 'div' ).find('select').change();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t</script>\n\t\t</form>\n\t\t<?php\n\t}", "public function addCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t \t$name = $_REQUEST['name'];\n $father = $_REQUEST['father'];\n\t\t\t$form = M(\"categoryinfo\");\n\t\t\t$addnew['name'] = $name;\n $addnew['father'] = $father;\n\t\t\t$result = $form->add($addnew);\n\t\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t//else {$this->error('添加失败');}\n }", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "function categoryAdd($str=''){\n\n\t#Get referring page to send users back to\n\t$previous = $_SERVER['HTTP_REFERER'];\n\n\t$str .= '<!-- start general content -->\n\t\t<script type=\"text/javascript\" src=\"' . VIRTUAL_PATH . '_js/util.js\"></script>\n\n\t\t<script type=\"text/javascript\">\n\n\t\t\tfunction checkForm(thisForm)\n\n\t\t\t{//check form data for valid info\n\t\t\t\tif(empty(thisForm.FirstName,\"Please Enter Customer\\'s First Name\")){return false;}\n\t\t\t\tif(empty(thisForm.LastName,\"Please Enter Customer\\'s Last Name\")){return false;}\n\t\t\t\tif(!isEmail(thisForm.Email,\"Please Enter a Valid Email\")){return false;}\n\t\t\t\treturn true;//if all is passed, submit!\n\t\t\t}\n\n\t\t</script>\n\n\n\t\t<div class=\"row\" style=\"\"><!-- begin content -->\n\t\t\t<form action=\"' . THIS_PAGE . '\" method=\"post\" onsubmit=\"return checkForm(this);\" >\n\n\n\t\t\t\t<input type=\"hidden\" name=\"CatID\" />\n\n\t\t\t\t<!-- inner container -->\n\t\t\t\t<div class=\"class=\"col-sm-9 pull-right\" style=\"\">\n\n\t\t\t\t\t<!-- left container -->\n\t\t\t\t\t<div class=\"col-sm-8 pull-left\" style=\"\">\n\t\t\t\t\t\t<h4 class=\"text-center\">Add New Catagory</b></h4>';\n\n\n\n\n\t\t\t\t\t\t\t$str .= '<div class=\"row \">\n\t\t\t\t\t\t\t\t<div class=\"pull-middle\">\n\n\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t<option value=\"person\" select=\"select\">Group By: Indivual</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"team\">Group By: Group/Team</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"organization\">Group By: Organization</option>\n\t\t\t\t\t\t\t\t\t</select>\n\n\n\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t<option value=\"individual\" select=\"select\">Catagory Type: IC</option>\n\t\t\t\t\t\t\t\t\t\t<option value=\"team\">Catagory Type: OOC</option>\n\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\tclass=\"col-sm-12\"\n\t\t\t\t\t\t\t\t\ttype=\"text\"\n\n\t\t\t\t\t\t\t\t\tname=\"CatTitle\"\n\t\t\t\t\t\t\t\t\tplaceholder=\"Team/Group/Character Name here\"/>\n\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\tname=\"CatDescription\"\n\n\t\t\t\t\t\t\t\t\tclass=\"autoExpand col-sm-12\"\n\t\t\t\t\t\t\t\t\trows=\"3\"\n\t\t\t\t\t\t\t\t\tdata-min-rows=\"3\"\n\n\t\t\t\t\t\t\t\t\tplaceholder=\"Catagory Description\"\n\t\t\t\t\t\t\t\t\t></textarea>\n\t\t\t\t\t\t\t</div><!-- end container-->\n\n\n\t\t\t\t\t</div><!-- end inner container -->\n\n\t\t\t\t<div class=\"clearfix\">\n\t\t\t\t\t<br /><br />\n\t\t\t\t</div>\n\n\t\t\t\t<div\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tstyle=\"\">\n\n\t\t\t\t\t<input type=\"hidden\" name=\"act\" value=\"categoryInsert\" />\n\t\t\t\t\t<input class=\"btn btn-primary btn-xs \" type=\"submit\" value=\"Add Catagory\">\n\n\t\t\t\t\t&nbsp; &nbsp;\n\n\t\t\t\t\t<a class=\"btn btn-primary btn-xs outline\" href=\"' . $previous . '\">Exit Post</a>\n\t\t\t\t</div>\n\n\t\t\t</form>\n\t\t</div>\n\n\t<!-- END content -->';\n\n\treturn $str;\n}", "function add_new()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio';\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['category'] = $this->portfolio_model->get_all_active_category();\n\t\t$this->data['content'] \t= 'content/admin/portfolio/add_portfolio';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "private function categoriesFormInputs()\n {\n // Get the field name of the field with the category icon\n // #47631, dwildt, 1-\n //$arrLabels[ 'catIcon' ] = $this->confMap['configuration.']['categories.']['fields.']['categoryIcon'];\n // #47631, #i0007, dwildt, 10+\n switch ( true )\n {\n case( $this->pObj->typoscriptVersion <= 4005004 ):\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'categoryIcon' ];\n break;\n case( $this->pObj->typoscriptVersion <= 4005007 ):\n default:\n $arrLabels[ 'catIcon' ] = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'fields.' ][ 'marker.' ][ 'categoryIcon' ];\n break;\n }\n // #47631, #i0007, dwildt, 10+\n // Default space in HTML code\n $tab = ' ';\n\n // FOREACH category label\n//$this->pObj->dev_var_dump( $this->arrCategories );\n // #i0118, dwildt, 1-/+\n //foreach ( $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n foreach ( ( array ) $this->arrCategories[ 'labels' ] as $labelKey => $labelValue )\n {\n // Get the draft for an input field\n $cObj_name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input' ];\n $cObj_conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'form_input.' ];\n $input = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n // replace the category marker\n $input = str_replace( '###CAT###', $labelValue, $input );\n // 4.1.17, 120927, dwildt\n // replace the category marker\n //$labelValueWoSpc = str_replace( ' ', null, $labelValue );\n $labelValueWoSpc = $this->zz_properFormLabel( $labelValue );\n $input = str_replace( '###CAT_WO_SPC###', $labelValueWoSpc, $input );\n // 4.1.17, 120927, dwildt\n // #54548, 131221, dwildt, 6+\n $class = $this->arrCategories[ 'cssClass' ][ $labelKey ];\n if ( !empty( $class ) )\n {\n $class = ' class=\"' . $class . '\"';\n }\n $input = str_replace( '###CLASS###', $class, $input );\n\n // IF draft for an input field contains ###IMG###, render an image\n $pos = strpos( $input, '###IMG###' );\n if ( !( $pos === false ) )\n {\n // SWITCH : Render the image\n switch ( true )\n {\n // #i0062\n case( $labelKey == $this->arrWoCategories[ 'iconKey' ] ):\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n case( is_array( $this->arrCategories[ 'icons' ] ) ):\n // 4.1.7, dwildt, +\n $this->cObjDataAddArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n $img = $this->renderMapMarkerVariablesSystemItem( 'categoryIconLegend' );\n $this->cObjDataRemoveArray( array( $arrLabels[ 'catIcon' ] => $this->arrCategories[ 'icons' ][ $labelKey ] ) );\n // 4.1.7, dwildt, +\n break;\n default:\n // Render the image\n $name = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey ];\n $conf = $this->confMap[ 'configuration.' ][ 'categories.' ][ 'colours.' ][ 'legend.' ][ $labelKey . '.' ];\n $img = $this->pObj->cObj->cObjGetSingle( $name, $conf );\n break;\n }\n // SWITCH : Render the image\n\n $input = str_replace( '###IMG###', $img, $input );\n }\n // IF draft for an input field contains ###IMG###, render an image\n\n $arrInputs[] = $tab . $input;\n }\n // FOREACH category label\n // Move array of input fields to a string\n // #i0118, dwildt, 1-/+\n //$inputs = implode( PHP_EOL, $arrInputs );\n $inputs = implode( PHP_EOL, ( array ) $arrInputs );\n $inputs = trim( $inputs );\n\n // RETURN input fields\n return $inputs;\n }", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "public static function func_ajax_add_category() {\n\t\t\t \n\t\t\t\tglobal $wpdb;\n\t\t\t\t\n\t\t\t\tif(!defined('DOING_AJAX')){\n wp_redirect (site_url());\n exit;\n } else {\n $self = self::sanitize($_POST['name']);\n $day = self::sanitize($_POST['day']);\n $desc = self::sanitize($_POST['description']);\n $wpdb->query($wpdb->prepare( \"INSERT INTO \".$wpdb->prefix.self::$table_name .\" VALUES (%d, %s, %s, %s)\", null, $self,$day,$desc ));\n die();\n\t\t\t\t}\n\t\t\n\t\t}", "public function create()\n {\n // Retrieving models\n $site_info = SiteInfo::first();\n $categories = WorkshopCategory::all()->where('status',1);\n\n if(count($categories) > 0) {\n return view('admin-panel.workshop.project.create', compact('categories', 'site_info'));\n } else{\n return redirect()->route('workshop-category.index')\n ->with('success','Please create a category.');\n }\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 addCategory()\n {\n $baker = Bakery::orderBy('id')->get();\n $this->authorize('category');\n return view('Admin.Bakery.Category.category', ['baker' => $baker]);\n }", "public function create() {\n return view('admin.category.category_create_form');\n }", "function add_utility_bill_category()\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['created_on']\t\t\t\t=\ttime();\n\t\t$data['created_by']\t\t\t\t=\t$this->session->userdata('user_id');\n\t\t$data['timestamp']\t\t\t\t=\ttime();\n\t\t$data['updated_by']\t\t\t\t=\t$this->session->userdata('user_id');\n\n\t\t$this->db->insert('utility_bill_category', $data);\n\n\t\t$this->session->set_flashdata('success', 'New utility bill category has been added successfully.');\n\n\t\tredirect(base_url() . 'utility_bill_categories', 'refresh');\n\t}", "public function addCategory()\n {\n return view('backend.admin-panel.pages.addCategory');\n }", "public function getName()\n {\n return 'category_form';\n }", "public function addAction()\n {\n $form = $this->getServiceLocator()->get('civcontent_category_form');\n \n // Check if the request is a POST.\n $request = $this->getRequest();\n if ($request->isPost())\n {\n // Create a new category object.\n $category = $this->getServiceLocator()->get('civcontent_category');\n \n $data = (array) $request->getPost();\n $form->bind($category);\n $form->setData($data);\n if ($form->isValid())\n {\n // Persist changes.\n $this->getContentService()->persistCategory($category);\n \n // Redirect to content categories\n return $this->redirect()->toRoute('content/category', array(\n 'action' => 'index'\n ));\n }\n }\n \n // If a GET request, or invalid data then render/re-render the form\n return new ViewModel(array(\n 'form' => $form,\n ));\n }", "function work_category_add_new_meta_field() {\r\n\t\t$textdomain = 'milk';\r\n\t\t?>\r\n\t \t\t<div class=\"row\">\r\n\t \t\t\t<p class=\"col-md-6 desc\" >\r\n\t \t\t\t\t<label for=\"term_meta[featured_img]\"><?php _e( \"Featured Image\", $textdomain ); ?></label>\r\n\t \t\t\t\t<br/>\r\n\t \t\t\t\t<label for=\"term_meta[featured_img]\"><?php _e( \"If you choose to show work categories on work page instead of works, you need to upload featured image for category\", $textdomain ); ?></label>\r\n\t \t\t\t</p>\r\n\t\t\t \r\n\t\t\t\t<div class=\"col-md-6\">\r\n\t\t\t\t\t<input \tclass=\"post_meta_image_upload button button-primary\" \r\n\t\t\t\t\t\tname=\"image_btn\" \r\n\t\t\t\t\t\ttype=\"button\" \r\n\t\t\t\t\t\tdata-uploader_title=<?php _e( \"Choose image\", $textdomain ); ?>\r\n\t\t\t\t\t\tdata-uploader_button_text=<?php _e( \"Select\" , $textdomain ); ?>\r\n\t\t\t\t\t\tvalue=<?php _e( \"Select images\", $textdomain ); ?>/>\r\n\t\t\t\t\t<input id=\"term_meta[featured_img]\"\r\n\t\t\t\t\t\tname=\"term_meta[featured_img]\"\r\n\t\t\t\t\t\tclass=\"img_url\" \r\n\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\tstyle=\"display:none\"\r\n\t\t\t\t\t\tvalue=\"\"/>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<div class=\"row\">\r\n\t\t\t \t<p class=\"col-md-6 desc\" >\r\n\t \t\t\t\t<label for=\"term_meta[work_color]\"><?php _e( \"Acent Color\", $textdomain ); ?></label>\r\n\t \t\t\t\t<br/>\r\n\t \t\t\t\t<label for=\"term_meta[work_color]\"><?php _e( \"If you choose to show work categories on work page instead of works, you need to select accent color for work categorie preview\", $textdomain ); ?></label>\r\n\t \t\t\t</p>\r\n\t \t\t\t<div class=\"col-md-6\">\r\n\t\t \t\t\t<input name=\"term_meta[work_color]\" \r\n\t\t\t\t \t\ttype=\"text\" \r\n\t\t\t\t \t\tclass=\"colorPicker\"\r\n\t\t\t\t \t\tid=\"term_meta[work_color]\" \r\n\t\t\t\t \t\tvalue=\"\"\r\n\t\t\t\t \t\tdata-default-color=\"#49b4ff\">\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t<?php }", "function addcategory(){\n \treturn view('category');\n }", "function add_cmd()\n\t{\n\t\tif(User::can_add(false,ANY_CATEGORY))\n\t\t{\n\t\t\trequire_once 'forms/edit.php';\n\t\t\t$this->add_form(new EditManageHelpForm());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tUrl::redirect_current();\n\t\t}\n\t}", "public function addCategory(Request $request){\n \t$this->validate($request, [\n \t\t'category' => 'required'\n \t]);\n\n \t$category = new Category;\n \t$category->category = $request->input('category');// this 'category' inside input is same as name='category' in form\n \t$category->save(); //save this category in database\n \treturn redirect('/category')->with('response','Category added successfully');\n }", "function add(){\n\t\tif(!$this->checkLogin()){\n\t\t\tredirect(base_url());\n\t\t}\n\n\t\t$pageData['header_title'] = APP_NAME.' | Add Document Category';\n\t\t$pageData['page_title'] = 'Document Category Management';\n\t\t$pageData['parent_menu'] = 'document_management';\n\t\t$pageData['child_menu'] = 'document_category';\n\n\t\t$this->load->view('admin/document_management/category/add', $pageData);\n\t}", "function wc_marketplace_category() {\n global $wmp;\n $wmp->output_report_category();\n }", "function add_categories(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "function ccategories_create()\n\t{\n\t\tlusers_require(\"categories/create\");\n\n\t\t$post_data = linput_post();\n\t\t$post_data = linput_post_checkbox($post_data, \"content\");\n\t\t$content = $post_data[\"content\"];\n\n\t\tif (hform_validate(array(\"name\", \"link\", \"parentid\")))\n\t\t{\n\t\t\t$cat_created = mcategories_create($post_data);\n\t\t\tif ($content) $content_created = mcontent_create($post_data);\n\t\t\telse $content_created = false;\n\n\t\t\tif (($cat_created && !$content) || ($content && $cat_created && $content_created))\n\t\t\t{\n\t\t\t\tlcache_delete_all();\n\t\t\t\thmessage_set(l(\"Category successfully created.\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($cat_created) mcategories_delete($post_data[\"link\"]);\n\t\t\t\tif ($content_created) mcontent_delete($post_data[\"link\"]);\n\t\t\t\thmessage_set(l(\"Category create error.\") . \" \" . l(\"Link already in use.\"));\n\t\t\t}\n\n\t\t\tluri_redirect(\"main/user/admin/categories\");\n\t\t}\n\t\telse luri_redirect(\"main/user/admin/categories_create\", l(\"All fields marked with * are required.\"));\n\t}", "public function addCategoryToGroupByName($gorup_name, $category_name);", "public function add_new_category(){\n if(isset($this->session->userdata['admin_name']) && !empty($this->session->userdata['admin_name'])) {\n $data['title'] = 'PBD - Admin | Add category';\n $this->load->view('add-new', $data);\n }\n else{\n redirect('signin');\n }\n }", "public function manageCategory()\n {\n $categories = Category::where('parent_category_id', '=', 0)->get();\n $allCategories = Category::pluck('name','id')->all();\n return view('category.add',compact('categories','allCategories'));\n }", "public function createCategory();", "public function actionStrategicAdd(){\n $modelstrategic = new Strategic();\n $this->layout =\"main_module\";\n if(Yii::$app->request->post()){\n $modelstrategic->load(Yii::$app->request->post());\n if($modelstrategic->save()){\n return $this->redirect('strategic-show');\n }\n }\n $modelstrategicissues = StrategicIssues::find()->all();\n return $this->render('strategic_add',['modelstrategic' => $modelstrategic , 'modelstrategicissues' => $modelstrategicissues]);\n }", "public function create()\n {\n $parent = $this->cateRepository->getSelect();\n return view('backend.category.add',compact('parent'));\n }", "public function formModify() {\n $categories=$this->model->listCategories();\n $this->view->display(\"view/form/ProductFormModify.php\", NULL, $categories); \n }", "public function category()\n { \n if($this->access_role->is_Admin() == false) show_404();\n $this->load->model('Category_Model');\n \n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n if($this->form_validation->run('category_insert') ){\n $this->Category_Model->add_category(); \n } else {\n $error = ['class'=>'warning','text'=> validation_errors()];\n $this->session->set_flashdata('sms_flash', $error); \n redirect('Dashboard/category');\n }\n } \n else{\n $data = $this->Category_Model->view_category();\n }\n \n $this->load->view('admin/category_content',$data);\n }", "public function actionCreate()\r\n {\r\n $model = new Category();\r\n\r\n //Значения по умолчанию\r\n $model->skay = 1;\r\n $model->solo = 1;\r\n $model->program = 1;\r\n\r\n $judge_list = Judge::find()->select(['sname'])->indexBy('id')->column();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n \r\n// $tur = new Tur();\r\n// $tur->category_id = $model->id;\r\n// $tur->dances = $model->dances;\r\n// $tur->save();\r\n \r\n return $this->redirect(['reglament/index']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n 'judge_list' => $judge_list,\r\n ]);\r\n }\r\n }", "public function create()\n {\n return view('backend.category.add');\n }", "public function addcategory() {\n return view('Category.view-category');\n}", "public function actionCreate()\n\t{\n\t\t$model=new BookCategories;\n $step = 1;\n\t\tif(isset($_POST['BookCategories']))\n\t\t{\n\t\t\t$model->attributes=$_POST['BookCategories'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('update?id='.$model->id.'&step=2'));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n 'step' => $step\n\t\t));\n\t}", "public function create()\n\t{\n\t\treturn view('admin.main_categories.addmain_category');\n\t}", "function addingcategory(Request $request){\n $res = Category::addCategory($request);\n if ($res) {\n return view('category');\n }\n }", "public function add()\n\t{\t\n\t\t$data = array(); \n\n \t \treturn view('add-category')->with($data);\n\t}", "public function create() {\n// user must be logged in\n if (User::is_logged_in()) {\n// preventing double submitting\n $token = md5(time());\n $_SESSION[$token] = true;\n\n// get all categories for the select box in form\n $categories = Category::all();\n// show post creation form\n require_once('views/posts/create.php');\n }\n }", "public function create()\n {\n $type_submit = 'Thêm mới';\n $listCategory = $this->categoryRepository->all();\n $viewData = [\n 'listCategory' => $listCategory,\n 'type_submit' => $type_submit\n ];\n return view('admin::jobs.job_add', $viewData);\n }", "public function createAction() {\n $form = $this->view->form = new Whmedia_Form_Circle();\n\n // Check post\n if( $this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost()) )\n {\n // we will add the category\n $values = $form->getValues();\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\n try\n {\n // add category to the database\n // Transaction\n $table = Engine_Api::_()->getDbtable('circles', 'whmedia');\n\n $row = $table->createRow($values);\n $row->user_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n $box_id = $row->save();\n\n $db->commit();\n \n // ** auto add if the box id exist ** \n $addnew = (int) $this->_getParam('addnew' , false);\n $_subject = Engine_Api::_()->user()->getUser($addnew); \n if( $_subject->getIdentity() )\n {\n $viewer = Engine_Api::_()->user()->getViewer();\n $listsTable = Engine_Api::_()->getDbTable('circles', 'whmedia');\n $box = $listsTable->fetchRow(array('user_id = ?' => $viewer->getIdentity(),\n 'circle_id = ?' => $box_id ));\n\n $box->add($_subject);\n }\n // ** auto add if the box id exist ** \n }\n\n catch( Exception $e )\n {\n $db->rollBack(); \n throw $e;\n }\n\n return $this->_helper->Message(\"Box added.\");\n }\n\n // Output\n $this->renderScript('admin-settings/form.tpl');\n }", "public function create()\n {\n $category = Categories::all();\n return view('panel.product-management.categories.form-create')->with(['category' => $category]);\n }", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "function add_category() {\r\n\r\n\tif(isset($_POST['addcategory'])){\r\n\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\tif(empty($_POST['cat_parent_id'])){$cat_parent_id\t\t= \"0\";}\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\t\r\n\r\n\t\t$xyquery = \"INSERT INTO categories (\";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"cat_name \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",cat_desc_short \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",cat_desc_long \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",cat_parent_id\";}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",cat_url\";}\r\n\t\t$xyquery .= \",cat_date\";\r\n\t\t$xyquery .= \",cat_mod\";\r\n\t\t$xyquery .= \",cat_mod_by\";\r\n\t\tif (!empty($page_template)){$xyquery .= \",page_template\";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",cat_meta_title\";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",cat_meta_keywords\";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",cat_meta_description\";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \") VALUES ( \";\r\n\r\n\t\tif (!empty($cat_name)){$xyquery .= \"'$cat_name' \";}\r\n\t\tif (!empty($cat_desc_short)){$xyquery .= \",'$cat_desc_short' \";}\r\n\t\tif (!empty($cat_desc_long)){$xyquery .= \",'$cat_desc_long' \";}\r\n\t\tif (!empty($cat_parent_id)){$xyquery .= \",'$cat_parent_id' \";\t}\r\n\t\tif (empty($cat_parent_id)){$xyquery .= \",'0' \";\t}\r\n\t\tif (!empty($cat_url)){$xyquery .= \",'$cat_url' \";}\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",NOW() \";\r\n\t\t$xyquery .= \",'$cat_mod_by' \";\r\n\t\tif (!empty($page_template)){$xyquery .= \",'$page_template' \";}\r\n\t\tif (!empty($cat_meta_title)){$xyquery .= \",'$cat_meta_title' \";}\r\n\t\tif (!empty($cat_meta_keywords)){$xyquery .= \",'$cat_meta_keywords' \";}\r\n\t\tif (!empty($cat_meta_description)){$xyquery .= \",'$cat_meta_description' \";}\r\n\t\tif (!empty($insert_keywords)){$xyquery .= \",'$insert_keywords' \";}\t\t\t\t\r\n\r\n\t\t$xyquery .= \" )\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" has been created!</h4></center>\";\r\n\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been created.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public function store(CaregoryRequest $request)\n {\n $category = new Category();\n $category->category_name = $request->category_name;\n $category->save();\n\n return redirect()->route('category.index')->with('feedback', 'บันทึกข้อมูลเรียบร้อยแล้ว');\n }", "public function shipment_category_new_func($category,$subcategory=null)\n\n\t{\n\n\n\n\t\t$data['related_company']=$this->shipping->select_data('shipping_related_website');\n\n\t\t$data['equipment_category']=$this->shipping->select_data('equipment_category');\n\n\t\t$data['truck_trailer']=$this->shipping->select_data('shipping_truck_trailer');\n\n\t\t$data['category_id']=$category;\n\n\t\t$data['subcategory_id']=$subcategory;\n\n\t\t$this->load->view('shipment/shipment-category-new',$data);\n\n\t}", "public function create()\n {\n return view('admin/categories/add_category');\n }", "public function create()\n {\n return view(\"admin.contractor_categories.create\");\n }", "public function executeAddCategoryNewPost(HTTPRequest $request)\n {\n $this->addCategory($request);\n $this->app->getHttpResponse()->redirect('/admin/addPost');\n }" ]
[ "0.67460954", "0.62550235", "0.6202757", "0.59804004", "0.5974859", "0.5883679", "0.5875688", "0.58718485", "0.58620435", "0.5860522", "0.58561087", "0.5849379", "0.58476734", "0.584638", "0.5837361", "0.5828801", "0.5822643", "0.58087504", "0.5780437", "0.5755626", "0.5730684", "0.57295454", "0.572751", "0.572375", "0.56945306", "0.5688677", "0.5654104", "0.5652301", "0.5637", "0.56151676", "0.5608652", "0.56081384", "0.5588094", "0.5581396", "0.5566614", "0.55664676", "0.5561343", "0.55463505", "0.5540642", "0.55397683", "0.55262136", "0.55114067", "0.55058175", "0.55041605", "0.5503968", "0.5500586", "0.54981875", "0.5492015", "0.549013", "0.5489103", "0.5488244", "0.54845643", "0.5484046", "0.5480412", "0.54695237", "0.54579103", "0.54532886", "0.5444181", "0.54431826", "0.5440816", "0.5422985", "0.5422285", "0.5420024", "0.54188", "0.5405578", "0.54013485", "0.53964883", "0.5391659", "0.5383836", "0.53811526", "0.5380929", "0.5380392", "0.5371316", "0.53702617", "0.5369668", "0.5362489", "0.5361485", "0.5359286", "0.5355616", "0.5354322", "0.53513575", "0.5348444", "0.534723", "0.5347134", "0.5343442", "0.5342318", "0.5341555", "0.53410345", "0.53352314", "0.5330804", "0.5329696", "0.53290457", "0.5327564", "0.532703", "0.53230584", "0.53181434", "0.5317599", "0.5317281", "0.5315885", "0.53157365" ]
0.7685577
0
/Store Workout category data form
public function storeWorkoutCategory(Request $request) { $this->validate($request,array( 'categoryName' => 'required', )); $workoutCategory = new Category; $workoutCategory->category = $request->categoryName; $workoutCategory->save(); if($workoutCategory->save()){ return redirect()->back()->with('success','Workout category Saved successfully.'); } else{ return redirect()->back()->with('denger-success','Workout category is not saved.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addWorkoutCategory()\n {\n return view('admin.addworkoutcategory');\n }", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function storeCategory(array $data): void\n {\n }", "public function store(Request $request)\n {\n // Validate and store the workout...\n $validatedData = $request->validate([\n 'workout' => 'required|max:255' \n ]);\n }", "private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }", "public function updateworkoutcategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $workoutCategory = Category::find($id);\n $workoutCategory->Category = $request->name;\n $workoutCategory->save();\n Session::flash('success','Workout Category Updated succcessfully.');\n return redirect()->back()->with('workout',$workoutCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function categoryStore(Request $request){\n $category = new ProductCategory();\n $category->category_name = $request->category_name;\n $category->company_id = company_id();\n $category->save();\n return redirect()->back();\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Opdcasecategory::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tOpdcasecategory::create($data);\n\n\t\treturn Redirect::route('opdcasecategories.index');\n\t}", "public function store() {\n if ($id = Input::get('id')) {\n $category = Category::find($id);\n } else {\n $category = new Category();\n }\n\n $inputs = Input::only(['type', 'parent_id', 'name', 'description',\n 'slug', 'keywords', 'order', 'status', 'template']);\n $rules = [\n 'type' => 'in:subject,application,product',\n 'name' => 'required|min:1',\n 'order' => 'required|numeric',\n ];\n\n $validator = Validator::make($inputs, $rules);\n $validator->sometimes('slug', 'unique:categories,slug', function() use($inputs, $category) {\n return !empty($inputs['slug']) && ($category->slug != $inputs['slug']);\n });\n //todo: 循环继承的问题解决思路\n //在数据库存一个layer的字段,标明改分类的层级,p_id=0的为1层\n //递归n次得到p_id=0则为n层\n //最后对比大小禁止循环继承\n if ($validator->fails()) {\n $messages = $validator->messages()->toArray();\n return $this->msg($messages, 1);\n }\n\n $category->fill($inputs);\n $category->save();\n\n return $this->msg('success', 0);\n }", "public function save_category_info($data) {\n $this->db->insert('tbl_category', $data);\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required',\n ]);\n\n $workout = new Workout;\n $workout->name = $request->get('name');\n $workout->description = $request->get('description');\n $workout->save();\n \n return redirect('/admin/workout/create')\n ->with('success', 'Workout creado correctamente');\n }", "public function store($data)\n {\n try {\n $store = new Listing;\n $store->user_id = $data['user_id'] ?? Auth::user()->id;\n $store->listing_category_id = $data['listing_category_id'];\n $store->listing_type = $data['listing_type'];\n $store->state_id = $data['state_id'];\n $store->city_id = $data['city_id'];\n $store->local_govt_id = $data['local_govt_id'];\n $store->title = $data['title'];\n $store->address = $data['address'];\n $store->description = $data['description'] ?? null;\n $store->room_policy = $data['room_policy'] ?? null;\n $store->service_option = $data['service_option'] ?? 'no';\n $store->service_description = $data['service_description'] ?? null;\n $store->baths = $data['baths'] ?? null;\n $store->rooms = $data['rooms'] ?? null;\n $store->pricing_type = $data['pricing_type'] ?? \"monthly\";\n $store->amount = $data['amount'] ?? 0;\n $store->amount = $data['step'] ?? 1;\n $store->save();\n activity()\n ->causedBy(Auth::user())\n ->performedOn($store)\n ->withProperties(['id' => $store->id])\n ->log('listing category created');\n if(!empty($data['property_amenities'])){\n $amenities = new Request(['listing_id' => $store->id, 'amenities'=> $data['property_amenities']]);\n ListingAmenitiesController::bulk_update($amenities);\n }\n return $store;\n } catch (Exception $e) {\n return $e->getMessage();\n }\n }", "public function addNewItem($category)\n {\n //Add tool\n if ($category==\"tools\") {\n\n if (isset($_POST['addTool'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['description'];\n\n //create an object of tools and add it to the database\n $tool=new Tool($name, $quantity, $date_added ,$description_type);\n $tool->addItem();\n\n }\n //add feeds\n }else if ($category==\"feeds\") {\n if (isset($_POST['addFeed'])) {\n $name=$_POST['name'];\n $quantity=$_POST['quantity'];\n $date_added=$_POST['addition_date'];\n $description_type=$_POST['type'];\n\n //create an object of feeeds and add it to the database\n $feed= new Feed($name, $quantity, $date_added ,$description_type);\n $feed->addItem();\n }\n }\n\n }", "public function run()\n {\n //\n DB::table('workout_categories')->insert([\n [\n 'name' => 'workoutCat1',\n 'image' => 'image 1',\n ],\n ]);\n }", "public function store(MicategoryRequest $request)\n {\n //\n M_i_category::create($request->all());\n \\Session::flash('flash_message','M Item Category 情報を追加しました');\n return redirect('micategories');\n }", "public function store()\n\t{\n\t\t$input = Input::all();\n\t\tDB::table($input)->create();\n\t\t//Project::create( $input );\n\n\t\treturn Redirect::route('tasksCatagories.index')->with('message', 'Catagory created');\n\n\t}", "public function store()\n {\n $categories = Category::all();\n\n $subcategory = new Subcategory;\n $subcategory->name = request('name');\n foreach($categories as $category){\n if($category->name == request('cat')){\n $subcategory->categories_id = $category->id;\n }\n }\n $subcategory->save();\n\n return redirect('/cms/categories')->with('success', 'Subcategory was added succesfully');\n }", "public function store()\n\t{\n\t\t$category \t\t= \tInput::get('category');\n\t\t$categoryList \t=\tInput::get('categoryList');\n\t\tif ($category \t== \tnull) : \n\t\t\treturn Redirect::route('admin.categories.index')->with('message-error','همه گزینه ها اجباری است.')->withInput();\n\t\tendif;\n\t\tCategory::setCategory($category,$categoryList);\n\t\treturn Redirect::route('admin.categories.index')->with('message-success','دسته ایجاد شد.');\n\t}", "public function store(Request $request)\n {\n // Validazione\n $request->validate($this->validationData());\n\n $requested_data = $request->all();\n // dd($requested_data);\n\n // Nuova istanza Car\n $new_workout = new Workout();\n // $new_workout->user_id = $requested_data['user_id'];\n // $new_workout->name = $requested_data['name'];\n // $new_workout->imgurl = $requested_data['imgurl'];\n // $new_workout->description = $requested_data['description'];\n // $new_workout->reps = $requested_data['reps'];\n $new_workout->fill($requested_data);\n $new_workout->save();\n\n return redirect()->route('admin.workouts.index', $new_workout);\n }", "protected function saveCategoryFromCategory($form){\n $data = $this->getRequest()->getPost();\n //@todo: validate the data\n $form->setData($data);\n if ($form->isValid()) {\n \n $this->category->exchangeArray($form->getData());\n $categoryTable = $this->getServiceLocator()->get(\"Category\\Model\\CategoryTable\");\n $this->category = $categoryTable->saveCategory($this->category);\n \n if($id = $this->category->getId()){\n $this->redirect()->toRoute('category_home');\n }\n }else{\n \n }\n }", "public function store()\n\t{\n\t\t$img = $this->save_file(Input::file('thumbnail'), 60, 25, 'categories');\n\t\t//滚动图像\n\t\t$slides = array();\n\t\tif(Input::hasFile('slides')){\n\t\t\tforeach(Input::file('slides') as $file){\n\t\t\t\t$slides[] = $this->save_file($file, 50, 14, 'categories');\n\t\t\t}\n\t\t}\n\t\t$slide = serialize($slides);\n\n\t\t$inputs = Input::except('thumbnail', 'slides');\n\t\t$inputs['thumbnail'] = $img;\n\t\t$inputs['slides'] = $slide;\n\n\t\t$category = Category::create($inputs);\n if ( !$category->errors()->all() )\n {\n return Redirect::route('admin.categories.index')\n ->with('success', Lang::get('cpanel::common.create_success'));\n }\n\n return Redirect::back()\n ->withInput()\n ->withErrors($category->errors());\n\t}", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'name' => 'required'\n\t\t);\n\t\t$input = Input::except('_token');\n\t\t$validator = Validator::make($input,$rules);\n\t\tif($validator->fails()) {\n\t\t\treturn Redirect::action('CategoryController@create')\n\t ->withErrors($validator)\n\t ->withInput(Input::except('password'));\n } else {\n\t\t\t$inputCategory = Input::only('name');\n\t\t\t$input['game_id'] = CommonNormal::create($inputCategory);\n\t\t\t// if (Input::get('category_parent_id')) {\n\t\t\t// \tforeach (Input::get('category_parent_id') as $value) {\n\t\t\t// \t\t$input['category_parent_id'] = $value;\n\t\t\t// \t\tCommonNormal::create($input, 'GameRelation');\n\t\t\t// \t}\n\t\t\t// }\n\t\t\treturn Redirect::action('CategoryController@index') ;\n\t\t}\n\t}", "public function store(CategoryRequest $request)\n {\n //\n $cates = new Category();\n $cates->name = $request->input('name');\n $cates->role = $request->input('role');\n $cates->status = 1;\n $cates->slug = Str::slug($request->name,\"-\");\n $datetime = Carbon::now('Asia/Ho_Chi_Minh');\n $cates->created_at = $datetime;\n $cates->updated_at = null;\n $cates->save();\n return redirect('admin/danh-muc');\n }", "function category_data()\n\t{\n\t\t$this->data['title'] \t= 'Portfolio Category Data';\n\t\t$this->data['category']\t= $this->portfolio_model->get_all_category();\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/category_data';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function store(Workout $workout)\n {\n request()->validate(['name' => 'required']);\n $workout->addDay(request('name'));\n\n return redirect($workout->path());\n }", "function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}", "function save_extra_category_fileds( $term_id ) {\n if ( isset( $_POST['Cat_meta'] ) ) {\n $t_id = $term_id;\n $cat_meta = get_option( \"category_$t_id\");\n $cat_keys = array_keys($_POST['Cat_meta']);\n foreach ($cat_keys as $key){\n if (isset($_POST['Cat_meta'][$key])){\n $cat_meta[$key] = $_POST['Cat_meta'][$key];\n }\n }\n //save the option array\n update_option( \"category_$t_id\", $cat_meta );\n }\n}", "public function store()\n\t{\n\t\t// validate\n\t\t// read more on validation at http://laravel.com/docs/validation\n\t\t$rules = array(\n\t\t\t'title' => 'required|unique:question-categories',\n\t\t\t'order' => 'required'\n\t\t);\n\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t// process the login\n\t\tif ($validator->fails()) {\n\t\t\tSession::flash('error_message', 'Validation error, please check all required fields.');\n\t\t\treturn Redirect::to('admin/question-categories/create')\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput(Input::except('password'));\n\t\t}\n\n\t\t// Store\n\t\t$category \t\t\t= new QuestionCategory;\n\t\t$category->title \t= Input::get('title');\n\t\t$category->slug \t= Str::slug(Input::get('title'));\n\t\t$category->order \t= Input::get('order');\n\t\t$category->created_by = Auth::user()->id;\n\n\t\t$category->save();\n\n\t\t// redirect\n\t\tSession::flash('success_message', Input::get('title') . ' category has been aded.');\n\n\t\treturn Redirect::to('admin/question-categories');\n\t}", "public function store(Request $request)\n {\n $validatedData = $request->validate([\n 'file_name'=>'required',\n 'workout'=>'required|min:2',\n 'description'=>'required|min:10',\n 'day'=>'required',\n 'time'=>'required'\n\n ]);\n\n\n $getValueDay = $request->input('day');\n $getValueTime = $request->input('time');\n\n $path = $request->file('file_name')->storePublicly('public/images/workouts');\n\n $post = [\n 'file_name'=> $path,\n 'workout'=>$request['workout'],\n 'description'=>$request['description'],\n 'day'=>$getValueDay['0'],\n 'time'=>$getValueTime,\n 'users_id'=>Auth::user()->id\n ];\n\n // var_dump($post);\n\n Workout::create($post);\n\n $post = $request->except('_token');\n\n\n return redirect()->route('workout');\n }", "private function SaveData()\n {\n // loop tanks and save data\n foreach ($this->tanks AS $tank_id => $data) {\n // get category id from tank id\n $category_id_tank = $this->CreateCategoryByIdentifier($this->InstanceID, $tank_id, $data['Name']);\n\n // loop tank data and add variables to tank category\n $position = 0;\n foreach ($data AS $key => $value) {\n $this->CreateVariableByIdentifier($category_id_tank, $key, $value, $position);\n $position++;\n }\n }\n }", "public function store()\n {\n\n if ($model = $this->form->save(Input::all())) {\n return Input::get('exit') ?\n Redirect::route('admin.categories.index') :\n Redirect::route('admin.categories.edit', $model->id) ;\n }\n\n return Redirect::route('admin.categories.create')\n ->withInput()\n ->withErrors($this->form->errors());\n\n }", "public function store(CategoriesRequest $request)\n {\n //\n }", "public function store(StoreOrUpdateCategory $request)\n {\n $category = new Categories;\n $category->name = $request->input('name');\n $category->briefing = $request->input('briefing');\n\n $category->save();\n\n return redirect()->route('categories.index');\n }", "function save_listing_category_custom_meta( $term_id ) {\n\n\tif ( isset( $_POST['listing_cat_meta'] ) ) {\n\t\t$t_id = $term_id;\n\t\t$listing_cat_meta = get_option( \"taxonomy_listing_category_$t_id\" );\n\t\t$cat_keys = array_keys( $_POST['listing_cat_meta'] );\n\t\tforeach ( $cat_keys as $key ) {\n\t\t\tif ( isset ( $_POST['listing_cat_meta'][$key] ) ) {\n\t\t\t\t$listing_cat_meta[$key] = $_POST['listing_cat_meta'][$key];\n\t\t\t}\n\t\t}\n\t\t// Save the option array.\n\t\tupdate_option( \"taxonomy_listing_category_$t_id\", $listing_cat_meta );\n\t}\n}", "public function store(){\n $query = require 'core/bootstrap.php';\n \n $category = $_POST['category'];\n if(empty($category)){\n Validate::errorValidation('Category\\'s name is required!');\n return back();\n }elseif(strlen($category) < 3){\n Validate::errorValidation('Category\\'s name must have up to 3 characters');\n return back();\n }else{\n\n $query->insert('categories',[\n 'name' => $category\n ]);\n \n Validate::successValidation('Category stored successfully!!!');\n return redirect('categories');\n }\n }", "public function store(Request $request)\n {\n $v = Validator::make($request->all(), [\n 'name' => 'required|unique:subcategories|max:255',\n 'category_id' => 'required',\n 'facilities' => 'required'\n ]);\n\n if ($v->fails())\n {\n return redirect()->back()->withInput($request->input())->withErrors($v->errors());\n }\n $inputs = $request->all();\n\n $subcategory = new Subcategory($inputs);\n $subcategory->save();\n\n if(count($inputs['facilities']))\n $subcategory->facilities()->attach($inputs['facilities']);\n \n session()->flash('flash_message', 'Subcategory Added!');\n return redirect('subcategories');\n }", "public static function save_custom_post( ) {\n\n\t\t\tglobal $post;\t\n\t\t\t\n\t\t\tif( $_POST ) {\n\t\t\t\tupdate_post_meta( $post->ID, 'meta_menucat', $_POST['cat_id'] );\n\t\t\t\t$price = $_POST['dish_price'] . \".\" . $_POST['dish_price_cents'];\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishprice', $price );\n\t\t\t\t$price2 = $_POST['dish_price2'] . \".\" . $_POST['dish_price_cents2'];\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishprice2', $price2 );\n\t\t\t\t$type = $_POST['new_dish'] . \"=\" . $_POST['special_dish']. \"=\" . $_POST['hot_dish']. \"=\" . $_POST['spicy_dish']. \"=\" . $_POST['vegetarian_dish'];\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishtype', $type );\n\t\t\t\t$break = (isset($_POST['breakfast'])) ? \"1\" : \"0\";\n\t\t\t\t$lunch = (isset($_POST['lunch'])) ? \"1\" : \"0\";\n\t\t\t\t$dinner = (isset($_POST['dinner'])) ? \"1\" : \"0\";\n\t\t\t\t$serve = $break . \"=\" . $lunch . \"=\" . $dinner;\n\t\t\t\tupdate_post_meta( $post->ID, 'post_dishserve', $serve );\n\t\t\t\t\n\t\t\t}\n\n\t\t}", "public function store(Request $request)\n {\n\n //dd($request);\n $WorkShift = WorkShift::create($request->all());\n// $WorkShift->company()->associate(Auth::guard('admins')->user()->id);\n// dd($request->duallistbox_demo2);\n $employeeID = Employee::find($request->duallistbox_demo2);\n $WorkShift->Employees()->attach($employeeID);\n $WorkShift->save();\n\n return redirect('/administration/work-shift')->with('success','WorkShift has been created');\n }", "public function store() {\n\t\t$post = new Post;\n\t\t$post->title = Input::get('title');\n\t\t$post->body = Input::get('body');\n\t\t$post->save();\n\n\t\t$post->category()->sync([\n\t\t\tInput::get('category_id'), $post->post_id\n\t\t]);\n\t}", "public function store(CaregoryRequest $request)\n {\n $category = new Category();\n $category->category_name = $request->category_name;\n $category->save();\n\n return redirect()->route('category.index')->with('feedback', 'บันทึกข้อมูลเรียบร้อยแล้ว');\n }", "public function save(){\n\t\t$sql = new Sql();\n\n\t\t$results = $sql->select(\"CALL sp_categories_save(:idcategory, :descategory)\", array(\n\t\t\t\":idcategory\"=>$this->getidcategory(),\n\t\t\t\":descategory\"=>$this->getdescategory()\n\t\t));\n\n\t\t$this->setData($results[0]);\n\n\n\t\tCategory::updateFile();\n\n\t}", "public function store(QuestionCategoryPost $request)\n {\n try{\n $req = $request->only('name', 'course_id', 'description');\n $this->questionCategoryRepo->store($req);\n flash('Question category added successfully!')->success();\n }catch (Exception $e){\n flash('Question category has not been added!')->error();\n }\n\n return redirect()->route('question-category.index');\n }", "public function postStore()\n\t{\n\t\t$response['status'] = 'error';\n\t\t$response['message'] = trans('categories.not_created');\n\n\t\tif ( ! empty($_POST))\n\t\t{\n\t\t\t$error = FALSE;\n\n\t\t\tif (empty(trim(Input::get('title'))))\n\t\t\t{\n\t\t\t\t$response['message'] = trans('categories.title_required');\n\t\t\t\t$error = TRUE;\n\t\t\t}\n\n\t\t\t$category_level = Input::get('level');\n\t\t\t$parent = Input::get('parent');\n\t\t\tif ( ! empty($category_level) && in_array($category_level, ['1', '2']))\n\t\t\t{\n\t\t\t\tif (empty($parent))\n\t\t\t\t{\n\t\t\t\t\t$response['message'] = trans('categories.parent_required');\n\t\t\t\t\t$error = TRUE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($error === FALSE)\n\t\t\t{\n\t\t\t\t$data = [\n\t\t\t\t\t'title' => trim(Input::get('title')),\n\t\t\t\t\t'description' => Input::get('description'),\n\t\t\t\t\t'level' => $category_level,\n\t\t\t\t\t'parent' => $parent,\n\t\t\t\t\t'size_group' => Input::get('size_group'),\n\t\t\t\t\t'position' => Input::get('position'),\n\t\t\t\t\t'visible' => Input::get('visible'),\n\t\t\t\t\t'active' => Input::get('active'),\n\t\t\t\t\t'page_title' => Input::get('page_title'),\n\t\t\t\t\t'meta_description' => Input::get('meta_description'),\n\t\t\t\t\t'meta_keywords' => Input::get('meta_keywords'),\n\t\t\t\t];\n\n\t\t\t\tif (($id = Model_Categories::createCategory($data)) > 0)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t//Manage Friendly URL\n\t\t\t\t\t\tModel_Categories::setURL($id, Input::get('friendly_url'));\n\n\t\t\t\t\t\t$response['status'] = 'success';\n\t\t\t\t\t\t$response['message'] = trans('categories.created');\n\t\t\t\t\t\t$response['category_id'] = $id;\n\t\t\t\t\t} catch (Exception $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t$response['message'] = $e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$response['message'] = trans('categories.not_created');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn response()->json($response);\n\t}", "public function store(Request $request)\n {\n return $this->categoryService->addCate($request['name']);\n }", "public function create()\n\t{\n\t\t$present_users = \\App\\User::where('category', '!=', 0)->orderBy('created_at', 'desc')->get();\n\t\t\n\t\t$data = new \\App\\Work;\n\t\t$industries = \\App\\Industry::orderBy(\"sort\", 'asc')->get();\n\t\t$work_categories = \\App\\WorkCategory::orderBy('sort', 'asc')->get();\n\t\t$area_provinces = \\App\\AreaProvince::orderBy('sort', 'asc')->get(array('id','code', 'name', 'id'));\n\t\t$area_cities = null;\n\t\t$area_streets = null;\n\t\t\t\n\t\treturn view('admin.works.create')->with('data', $data)->with('present_users', $present_users)->with('area_provinces', $area_provinces)->with('area_cities', $area_cities)->with('area_streets', $area_streets)->with('work_categories', $work_categories)->with('industries', $industries);\n\t}", "public function store(Request $request)\n {\n $this->validate($request,[\n 'type'=>'required' \n ]);\n\n //add to database\n $type =new Category;\n $type->name = $request->input('type');\n\n $type->save();\n \n Session::flash('success','Incident type added successfully');\n\n return redirect('/pages')->with('success');\n }", "public function store(Request $request)\n {\n //\n \n // dd($request);\n $createCategorie=Category::create($request->only(['name_category']));\n $IdCategorie = $createCategorie->id;\n $nb_op = intval($request->tab_option);\n \n for($i=0;$i<$nb_op;$i++){\n \n $x = 'name_option_'.$i;\n $y = 'description_option_'.$i;\n $option = new Option();\n $option->name = $request->$x;\n $option->description = $request->$y;\n $option->category_id = $IdCategorie;\n $option->save();\n // Option::create($request->only(['name'=>'name-option-'.$i, 'description'=>'description-option-'.$i]))->attach($IdCategorie);\n \n }\n \n //dd($option);\n return redirect(route('categoryIndex'));\n }", "public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "public function store(CatelogsRequest $request)\n {\n $request->merge(['slug' => str_slug($request->name,'-')]);\n Categorylist::create($request->all());\n return redirect()->route('category.index');\n }", "public function store(CategoriesRequest $request)\n {\n\t$inputs = array_merge($request->all());\n\t$this->categoriesRepository->store($inputs);\n\treturn redirect(route('categories.index'));\n }", "public function store(StoreCategoryRequest $request)\n {\n Category::create($request->all());\n return redirect('admin/category')->with('info','You added new items, follow next step!');\n }", "public function store(CategoryRequest $request)\n {\n $inputs = $request->all();\n $inputs['active'] = $request->has('active')?1:0;\n Category::create($inputs);\n return redirect('admin/category');\n }", "public function storeCategory()\n {\n $this->validate([\n 'name' =>'required',\n 'slug' =>'required|unique:categories'\n ]);\n $category = new Category();\n $category->name = $this->name; \n $category->slug = $this->slug;\n $category->save();\n $this->dispatchBrowserEvent('success');\n //$this->emit('alert', ['type' =>'success', 'message' => 'Operation Successful']);\n //session()->flash('message', 'Category has been saved successfully');\n //$this->dispatchBrowserEvent('hide-form', ['message' => 'Category Added Successfully']);\n }", "public function addCategory()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['category'];\n\t\t\t$sql = \"insert into lib_category (category,add_date,staff_id) \n\t\t\t\t\tvalues('\" . $category . \"','\" . date('Y-m-d') . \"','\" . cookie('staffAccount') . \"') \";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Add successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}", "public function store()\n {\n /* VALIDATE DATA COMING IN FROM FORM */\n $this->validate(request(), [\n 'name' => 'required',\n 'is_active' => 'required'\n ]);\n /* CREATE AND SAVE NEW CATEGORY TO DATABASE */\n Category::create([\n 'name' => request('name'),\n 'is_active' => request('is_active')\n ]);\n /* REDIRECT USER AFTER SAVE */\n session()->flash('message', 'Category Added Successfully');\n return redirect()->route('categories.index');\n }", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "public function store()\n\t{\n\t\t$manager = new CategoryRegisterManager($this->repository->newCategory(), Input::all());\n \n $manager->save();\n\n return $this->index();\n\t}", "public function addJobToDatabase() {\r\n\t\t//get the addProduct form data in the form of key = value (form name = form input)\r\n\t\t$post = $this -> sanitize();\r\n\t\textract($post);\r\n\t\t$userID = $_SESSION['userID'];\r\n\t\t$timestamp = time();\r\n\t\t//query\r\n\t\t$query = \"INSERT INTO jobs VALUES(NULL,'$userID','$category','$name','$price', '$rank', '$about', '$timestamp')\";\r\n\t\t$data = $this -> updateDeleteQuery($query);\r\n\t\treturn $data;\r\n\t}", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Category::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tCategory::create($data);\n\n\t\treturn Redirect::route('adm/categories');\n\n\t}", "public function adminPostCategoriesStore(Request $request)\n {\n $adminSettings = DB::table('settings')->get();\n $adminPostCategories = DB::table('post_Categories');\n\n return redirect()->back();\n }", "public function adminPostCategoriesStore(Request $request)\n {\n $adminSettings = DB::table('settings')->get();\n $adminPostCategories = DB::table('post_Categories');\n\n return redirect()->back();\n }", "public function store(Request $request)\n {\n $data = $request->input('data');\n if(count($data))\n {\n CategoryWiseSpecification::where('category_id',$data[0]['category_id'])->delete();\n }\n CategoryWiseSpecification::insert($request->input('data'));\n }", "function wc_marketplace_category() {\n global $wmp;\n $wmp->output_report_category();\n }", "public function store() {\n\n $input = Input::get('attribute');\n\n if ($this->attributeSubcategory->save($input)) {\n // Success!\n return Redirect::to('/attribute_subcategory')\n ->withSuccess(Lang::get('segment.attributetype.message.success.store'))\n ->with('status', 'success');\n } else {\n\n return Redirect::to('/attribute_subcategory')\n ->withInput()\n ->withErrors($this->attributeSubcategory->errors())\n ->with('status', 'error');\n }\n }", "public function store(Request $request){\n $this->chakeValidation($request);\n\n $menu = new MemberCategory;\n $menu->categoryHeadding = $request->categoryHeadding;\n $menu->categoryTitle = $request->categoryTitle;\n $menu->position = $request->position;\n $menu->publicationStatus = $request->publicationStatus;\n $menu->save();\n return redirect()->back()->with('message', 'Team Member Category Information Save SuccessFully ');\n }", "public function storeNutrationCategory(Request $request)\n {\n $this->validate($request,array(\n 'nutrationCategoryName' => 'required',\n //'tips' => 'required',\n ));\n\n $nutrationCategory = new NutrationCategory;\n\n $nutrationCategory->nutration_category_name = $request->nutrationCategoryName;\n //$nutrationCategory->tips = $request->tips;\n\n $nutrationCategory->save();\n\n if($nutrationCategory->save()){\n return redirect()->back()->with('success','Nutration category Saved successfully.');\n }\n else{\n return redirect()->back()->with('denger-success','Nutration category is not saved.');\n }\n \n }", "public function store(CategoryRequest $request)\n {\n /*Guardar Datos en la DB con el metodo all que envia todos los campos establecidos\n en el modelo en el campo protected $fillable*/\n Category::create($request->all());\n //Redireccionar al index\n return redirect()->route('category.index');\n }", "public function store(Request $request)\n {\n request()->validate([\n 'category' => 'required',\n ]);\n\n\n Indicatorcategory::create($request->all());\n\n\n return redirect()->route('indicatorcategories.index')\n ->with('success','Category created successfully.');\n }", "function savecat(){\n\n $data =[\n\n 'reservation_category' => $_POST['reservation_category'],\n 'category_description' => $_POST['category_description'],\n 'reservation_duration' => $_POST['reservation_duration']\n\n ];\n\n insert( 'reservation_categories', $data );\n\n redirect( route('dashboard/reservation/categories') );\n}", "public function store(Request $request)\n {\n $this->validate($request,[\n 'head_category' => 'required',\n 'category' => 'required',\n ]);\n\n $category = new Category;\n\n $category->cat_name = $request->category;\n $category->cat_slug = str_slug($request->category, '-');\n $category->level = 1;\n $category->parent_id = $request->head_category;\n \n $category->save();\n\n Session::flash('success','Your data is save.');\n \n return redirect()->route('subcategory.index');\n }", "function saveCategories($product_id)\n {\n //var_dump(Category::$cats); exit;\n if(is_null($this->categories) || sizeof($this->categories) < 1){\n return;\n }\n \n foreach ($this->categories as $ids) {\n if(empty($ids)){\n continue;\n }\n \tif(isset(Category::$cats[$ids]) && is_object(Category::$cats[$ids])){\n\t $names[] = array('name'=>Category::$cats[$ids]->name);\n\t $cids[] = array('name'=>Category::$cats[$ids]->cid);\n\t $i = 0;\n\t $parent_id = $ids;\n\t \n\t while(($parent_id = Category::$cats[$parent_id]->parent_id) != 0){\n\t \n\t $names[] = array('name'=>Category::$cats[$parent_id]->name);\n\t $cids[] = array('name'=>Category::$cats[$parent_id]->cid);\n\t $i++;\n\t if($i > 7 ){ $i = 0; break; }\n\t }\n\t \t\n\t // \t\n\t \t$this->saveWords(Category::$cats[$ids]->name, $product_id, 2);\n\t \t $this->saveWords(Category::$cats[$ids]->description, $product_id, 1);\n\t\t//\t\t}\n\t\t\t}\n } \n\t\tif(isset($names)){\n \t$this->options['category'] = array('name'=>'category','value'=>$names);\n \t$this->options['category_id'] = array('name'=>'category_id','value'=>$cids);\n\t\t}\n }", "public function store(Request $request)\n {\n $category = new Category();\n $category->fill($request->all());\n $category->save();\n // Redirecting to create a new category\n redirect('category/create');\n }", "public function storeSubCategory(Request $request) {\n $subCategory = new subCategory();\n $subCategory->SelectCategoryId = $request->SelectCategoryId;\n $subCategory->subCategoryName = $request->subCategoryName;\n $subCategory->subCategoryTitle = $request->subCategoryTitle;\n $subCategory->publicationStatus = $request->publicationStatus;\n $subCategory->save();\n return redirect('/sub-category')->with('message', 'Info Save Successfully');\n }", "public function store($post) { \n $now = date('Y-m-d h:i:s');\n \n $mileagechoice = ($post['mileagechoice_id']==0 ? R::dispense('mileagechoice') : R::load('mileagechoice', $post['mileagechoice_id']));\n $mileagechoice->mileage_choice = $post['mileage_choice'];\n \n if($post['mileagechoice_id']==0) {\n $mileagechoice->created = $now;\n $mileagechoice->created_by = $_SESSION['user_id'];\n } else {\n $mileagechoice->modified = $now;\n $mileagechoice->modified_by = $_SESSION['user_id'];\n }\n \n R::store($mileagechoice);\n }", "function save_extra_category_fileds( $term_id ) {\n\tif ( isset( $_POST['term_meta'] ) ) {\n\t\t$tag_id\t\t= $term_id;\n\t\t$term_meta\t= get_option( \"category_$tag_id\" );\n\t\t$cat_keys\t= array_keys( $_POST['term_meta'] );\n\t\tforeach ( $cat_keys as $key ) {\n\t\t\tif ( isset( $_POST['term_meta'][$key] ) ) {\n\t\t\t\t$term_meta[$key] = $_POST['term_meta'][$key];\n\t\t\t}\n\t\t}\n\t\t//save the option array\n\t\tupdate_option( \"category_$tag_id\", $term_meta );\n\t}\n}", "public function store(Request $request)\n {\n //\n $workout=new WorkOutSessions();\n $workout->user_id=$request->input('user_id');\n $workout->date=$request->input('date');\n $workout->location=$request->input('location');\n $workout->exercise_name=$request->input('exercise_name');\n $workout->reps=$request->input('reps');\n $workout->sets=$request->input('sets');\n $user=User::findorfail($request->input('user_id'));\n if($user->WorkOutSessions()->save($workout)){\n return response()->json(['response'=>'Work Out has been saved'],$this->success_status);\n }else{\n return response()->json(['response'=>'Work Out has been saved'],$this->error_status);\n\n }\n }", "public function run()\n {\n $category = [\n [\n \t'name' => 'Household'\n ],\n [\n 'name' => 'Construction'\n ],\n [\n 'name' => 'Personel'\n ],\n [\n 'name' => 'Maintenance'\n ]\n ];\n\n DB::table('categories')->insert($category);\n }", "public function SaveGroupCategory() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstGroup) $this->objGroupCategory->GroupId = $this->lstGroup->SelectedValue;\n\t\t\t\tif ($this->calDateRefreshed) $this->objGroupCategory->DateRefreshed = $this->calDateRefreshed->DateTime;\n\t\t\t\tif ($this->txtProcessTimeMs) $this->objGroupCategory->ProcessTimeMs = $this->txtProcessTimeMs->Text;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the GroupCategory object\n\t\t\t\t$this->objGroupCategory->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}", "function save_softsdev_mc_product_cat_custom_meta($term_id) {\n if (isset($_POST['softsdev_mc_group'])) {\n $t_id = $term_id;\n $softsdev_wc_mc_setting = get_softsdev_wc_mc_setting();\n $softsdev_mc_terms_groups = get_option('softsdev_mc_term_group');\n $softsdev_mc_terms_groups['term' . $softsdev_wc_mc_setting['list_mgroup_id'] . '_' . $t_id] = $_POST['softsdev_mc_group'];\n // Save the option array.\n update_option(softsdev_mc_term_group, $softsdev_mc_terms_groups);\n }\n }", "public function store(Request $request)\n {\n // $this->validate($request, [\n // 'text' => 'required|max:255',\n // ]);\n\n // $request->user()->categories()->create([\n // 'text' => $request->text,\n // ]);\n/*\n $category = new Category;\n $category->name = $request->name;\n $category->color = $request->color;\n $category->user_id = $request->user()->id;\n $category->save();\n*/\n\n $category = $request->user()->categories()->create([\n 'name' => $request->name,\n 'color'=> $request->color,\n ]);\n\n $obj = array();\n $obj['html'] = view('frontend.category_item', [\n 'category' => $category,\n ])->render();\n $obj['jsonCategory'] = json_encode($category);\n return $obj;\n }", "public function store(WorkRequest $request)\n {\n $data = $request->all();\n $data['slug'] = Str::slug($request->title).'-'.Str::slug($request->short_description);\n Work::create($data);\n\n return redirect()->route('work.index');\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'detail' => 'required',\n ]);\n $inputs = array_merge($request->all(), ['user_id' => $request->user()->id]); \n Category::create($inputs);\n \n return redirect()->route('categorys')\n ->with('success','categorys created successfully.');\n/*\n $inputs = array_merge($request->all(), ['user_id' => $request->user()->id]);\n $this->categoryRepository->store($inputs);\n return redirect(route('categorys.index'));\n*/ \n }", "public function storeCategory(Request $request)\n {\n\n // validate input of category name..\n $request->validate([\n 'category_name' => 'required|max:255|unique:categories'\n ]);\n\n // use query builder..\n// $data = array();\n// $data['category_name'] = $request->category_name;\n// $data['created_at'] = Carbon::now();\n// DB::table('categories')->insert($data);\n\n // store category by using Model category..\n $category = new Category();\n $category->category_name = $request->category_name;\n $category->created_at = Carbon::now();\n $category->save();\n\n // Display a toaster message..\n $notification = array(\n 'message' => 'Category added successfully.',\n 'alert-type' => 'success'\n );\n return Redirect()->back()->with($notification);\n }", "function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->begin( );\r\n\r\n $name = $db->escapeString( $this->Name );\r\n $description = $db->escapeString( $this->Description );\r\n\r\n if ( !isset( $this->ID ) )\r\n {\r\n $db->lock( \"eZImageCatalogue_Category\" );\r\n\r\n $this->ID = $db->nextID( \"eZImageCatalogue_Category\", \"ID\" );\r\n\r\n $db->query( \"INSERT INTO eZImageCatalogue_Category\r\n ( ID, Name, Description, UserID, ParentID, SectionID ) VALUES\r\n ( '$this->ID', '$name', '$description', '$this->UserID', '$this->ParentID', '$this->SectionID' )\" );\r\n $db->unlock();\r\n }\r\n else\r\n {\r\n $db->query( \"UPDATE eZImageCatalogue_Category SET\r\n Name='$name',\r\n Description='$description',\r\n UserID='$this->UserID',\r\n ParentID='$this->ParentID',\r\n SectionID='$this->SectionID' WHERE ID='$this->ID'\" );\r\n }\r\n\r\n\r\n if ( $dbError == true )\r\n $db->rollback( );\r\n else\r\n $db->commit();\r\n\r\n\r\n return true;\r\n }", "public function store(Request $request)\n {\n // $category = new Category;\n // $category->name = $request->category_name;\n // $category->save();\n\n $product = new Product;\n $product->name = $request->product_name;\n $product->quantity = $request->quantity;\n $product->price = $request->price;\n $product->cost = $request->cost;\n $product->image = $request->fileURL;\n $product->category_id = $request->category_id;\n $product->save();\n\n $bb = new BranchProduct;\n $bb->product_id = Product::all()->last()->id;\n $bb->branch_id = 1;\n $bb->quantity = $request->quantity;\n $bb->save();\n\n $categories = Category::all();\n return view('manager.addProduct',compact('categories'));\n\n }", "public function store(categoryrequest $request)\n { \n /*replace validator to categoryrequest*/\n category::create($request->all());// if you have lot of columns you can use it\n session()->flash('success','category created successfully');\n\n return redirect(route('categories.index'));\n }", "public function store(CategoryForm $request)\n {\n $category = new Category;\n\n $category->shop_id = $this->shop->id;\n $category->name = $request->input('name');\n $category->description = $request->input('description');\n $category->status = $request->input('status');\n $category->image = $request->input('image');\n\n $category->save();\n\n flash('Category created successfully.', 'success');\n\n return redirect('shop/categories');\n }", "public function store(CategoryRequest $request)\n { \n $data = $request->all();\n\n $data['slug'] = str_slug($data['name']);\n\n $data['level'] += 1;\n\n $category = Category::insertData($data);\n\n return $category; \n \n }", "public function store(Request $request)\n {\n \ntry {\n // start of db transaction\n DB::beginTransaction();\n\n if(isset($request->inputs['id'])){\n\n \n // for edit/update\n $category = Category::where('id', $request->inputs['id'])->first();\n $category->name = $request->inputs['name'];\n $category->sub_discipline_id = $request->id;\n $category->update();\n }else{\n\n // for create/saving\n\n\n $category = new category;\n $category->name = $request->inputs['name'];\n $category->sub_discipline_id = $request->id;\n $category->user()->associate(\\Auth::user());\n $category->save();\n }\n\n\n DB::commit();\n\n return ['status' => 'success'];\n\n} catch (\\Exception $e) {\n // rollback db transactions\n DB::rollback();\n\n // return to previous page with errors\n return json_encode(['message' => $e->getMessage(), 'status' => 'error']);\n}\n\n \n}", "function add_utility_bill_category()\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['created_on']\t\t\t\t=\ttime();\n\t\t$data['created_by']\t\t\t\t=\t$this->session->userdata('user_id');\n\t\t$data['timestamp']\t\t\t\t=\ttime();\n\t\t$data['updated_by']\t\t\t\t=\t$this->session->userdata('user_id');\n\n\t\t$this->db->insert('utility_bill_category', $data);\n\n\t\t$this->session->set_flashdata('success', 'New utility bill category has been added successfully.');\n\n\t\tredirect(base_url() . 'utility_bill_categories', 'refresh');\n\t}", "public function run()\n {\n $category_data = [\n 'name' => 'Celulares'\n ];\n $category = new Category($category_data);\n $category->save();\n\n $category_data = [\n 'name' => 'Computadores'\n ];\n $category = new Category($category_data);\n $category->save();\n\n $category_data = [\n 'name' => 'Televisores'\n ];\n $category = new Category($category_data);\n $category->save();\n }", "public function output_category_widget() {\n\n\t\t$categories = get_terms( 'product_cat', array( 'orderby' => 'name' ) );\n\t\t?>\n\t\t<form method=\"GET\">\n\t\t\t<div>\n\t\t\t\t<select multiple=\"multiple\" data-placeholder=\"<?php _e( 'Select categories&hellip;', 'woocommerce-cost-of-goods' ); ?>\" class=\"wc-enhanced-select\" id=\"category_ids\" name=\"category_ids[]\" style=\"width: 205px;\">\n\t\t\t\t\t<?php\n\t\t\t\t\t$r = array();\n\t\t\t\t\t$r['pad_counts'] = 1;\n\t\t\t\t\t$r['hierarchical'] = 1;\n\t\t\t\t\t$r['hide_empty'] = 1;\n\t\t\t\t\t$r['value'] = 'id';\n\t\t\t\t\t$r['selected'] = $this->category_ids;\n\n\t\t\t\t\tinclude_once( WC()->plugin_path() . '/includes/walkers/class-product-cat-dropdown-walker.php' );\n\n\t\t\t\t\techo wc_walk_category_dropdown_tree( $categories, 0, $r );\n\t\t\t\t\t?>\n\t\t\t\t</select>\n\t\t\t\t<a href=\"#\" class=\"select_none\"><?php esc_html_e( 'None', 'woocommerce-cost-of-goods' ); ?></a>\n\t\t\t\t<a href=\"#\" class=\"select_all\"><?php esc_html_e( 'All', 'woocommerce-cost-of-goods' ); ?></a>\n\t\t\t\t<input type=\"submit\" class=\"submit button\" value=\"<?php esc_attr_e( 'Show', 'woocommerce-cost-of-goods' ); ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"range\" value=\"<?php if ( ! empty( $_GET['range'] ) ) echo esc_attr( $_GET['range'] ) ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"start_date\" value=\"<?php if ( ! empty( $_GET['start_date'] ) ) echo esc_attr( $_GET['start_date'] ) ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"end_date\" value=\"<?php if ( ! empty( $_GET['end_date'] ) ) echo esc_attr( $_GET['end_date'] ) ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"page\" value=\"<?php if ( ! empty( $_GET['page'] ) ) echo esc_attr( $_GET['page'] ) ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"tab\" value=\"<?php if ( ! empty( $_GET['tab'] ) ) echo esc_attr( $_GET['tab'] ) ?>\" />\n\t\t\t\t<input type=\"hidden\" name=\"report\" value=\"<?php if ( ! empty( $_GET['report'] ) ) echo esc_attr( $_GET['report'] ) ?>\" />\n\t\t\t</div>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\tjQuery( function() {\n\t\t\t\t\t// select all\n\t\t\t\t\tjQuery( '.chart-widget' ).on( 'click', '.select_all', function() {\n\t\t\t\t\t\tjQuery(this).closest( 'div' ).find( 'select option' ).attr( \"selected\", \"selected\" );\n\t\t\t\t\t\tjQuery(this).closest( 'div' ).find('select').change();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} );\n\n\t\t\t\t\t// select none\n\t\t\t\t\tjQuery( '.chart-widget').on( 'click', '.select_none', function() {\n\t\t\t\t\t\tjQuery(this).closest( 'div' ).find( 'select option' ).removeAttr( \"selected\" );\n\t\t\t\t\t\tjQuery(this).closest( 'div' ).find('select').change();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} );\n\t\t\t\t} );\n\t\t\t</script>\n\t\t</form>\n\t\t<?php\n\t}", "public function store(Request $request)\n {\n \n $getscategory=request(\"scategory\");\n $getsubcategory=request(\"subcategory\");\n $getpayment=request(\"payment\");\n $userInfo = CategoryModel::where('Category','=', $getscategory)->first();\n $subcategory = new SubcategoryModel();\n $subcategory->Categoryid=$userInfo->id;\n $subcategory->Subcategory=$getsubcategory;\n $subcategory->Payment=$getpayment;\n $subcategory->save();\n\n return redirect('/adminhome');\n\n }", "public function save($data)\n\t{\n\t $input = Factory::getApplication()->input;\n\t\tJLoader::register('CategoriesHelper', JPATH_ADMINISTRATOR.\n\t\t\t'/components/com_categories/helpers/categories.php');\n\t\t// validate id\n\t\tif((int)$data['catid']>0)\n\t\t{\n\t\t\t$catid = CategoriesHelper::validateCategoryId\n\t\t\t\t($data['catid'], 'com_dinning_philosophers');\n\t\t\t// If catid and extension don't match, validate will return 0.\n\t\t\t// Let's create a new category to for this component.\n\t\t\tif($catid===0){\n\t\t\t $category = array();\n\t\t\t $category['id'] = $data['catid'];\n\t\t\t \n\t\t\t $categoryTable = Table::getInstance('Category');\n\t\t\t if (!$categoryTable->load($category))\n\t\t\t {\n\t\t\t $catid = 0;\n\t\t\t } else {\n\t\t\t $properties = $categoryTable->getProperties();\n\t\t\t unset($properties['id']);\n\t\t\t unset($properties['alias']);\n\t\t\t array_values($properties);\n\t\t\t // categories uses extension as an alias to identify\n\t\t\t // duplicates. Use unique extension.\n\t\t\t $properties['extension'] = 'com_dinning_philosophers';\n\t\t\t $catid = CategoriesHelper::createCategory($properties);\n\t\t\t }\n\t\t\t}\n\t\t\t$data['catid'] = $catid;\n\t\t}\n\t\t// Alter the alias for save as copy.\n\t\tif($input->get('task') == 'save2copy')\n\t\t{\n\t\t\t$origTable = clone $this-getTable();\n\t\t\t$origTable->load($input->getInt('id'));\n\t\t\tif($data['alias']==$origTable->alias)\n\t\t\t{\n\t\t\t\t$data['alias']='';\n\t\t\t}\n\t\t\t$data['published']=0;\n\t\t}\n\t\treturn parent::save($data);\n\t}", "public function store(){\n\n App::get('database')->insert('categories', [\n 'name' => $_POST['name'],\n ]);\n\n return redirect('admin/categories');\n }", "public function stepCategory()\n {\n global $rlSmarty, $rlCategories, $page_info, $account_info, $sError, $config;\n\n parent::step();\n\n $GLOBALS['rlHook']->load('addListingGetCats');\n\n // Define allowed types\n $allowed_type_keys = $account_info['Abilities'];\n\n // \"Individual add listing page\" mode\n if ($page_info['Key'] != 'add_listing') {\n $individual_type_key = substr($page_info['Key'], 3);\n\n if (in_array($individual_type_key, $allowed_type_keys)) {\n $allowed_type_keys = array($individual_type_key);\n } else {\n $sError = true;\n }\n }\n\n // Adapt listing types array\n $allowed_types = $GLOBALS['rlListingTypes']->adaptTypes($allowed_type_keys);\n $rlSmarty->assign_by_ref('allowed_types', $allowed_types);\n\n // Existing membership plan mode\n $this->existingMembershipHandler($account_info);\n\n // Remove unnecessary steps\n if (!$this->singleStep) {\n unset($this->steps['photo'], $this->steps['checkout']);\n }\n }", "public function store()\n\t{\n\t\t$category = Category::create(['name' => \\Input::get('name')]);\n\n\t\tif($category){\n\t\t\treturn \"true\";\n\t\t}\n\t\treturn \"false\";\n\t}", "public function store(SubcategoryDiaryStoreRequest $request)\n {\n $count=SubcategoryDiary::where('name', request('name'))->count();\n $slug=Str::slug(request('name'), '-');\n if ($count>0) {\n $slug=$slug.\"-\".$count;\n }\n\n // Validación para que no se repita el slug\n $num=0;\n while (true) {\n $count2=SubcategoryDiary::where('slug', $slug)->count();\n if ($count2>0) {\n $slug=Str::slug(request('name'), '-').\"-\".$num;\n $num++;\n } else {\n $category=CategoryDiary::where('slug', request('category_id'))->firstOrFail();\n $data=array('name' => request('name'), 'slug' => $slug, 'code' => request('code'), 'category_id' => $category->id);\n break;\n }\n }\n\n $subcategory=SubcategoryDiary::create($data);\n\n $num=0;\n if (!is_null(request('service')) && is_array(request('service'))) {\n foreach (request('service') as $service) {\n if(!is_null(request('day')[$num]) && (request('day')[$num]>=0 && request('day')[$num]<=6) && !empty(request('start')[$num]) && !is_null(request('start')[$num]) && !empty(request('end')[$num]) && !is_null(request('end')[$num]) && request('start')[$num]<=request('end')[$num] && !empty(request('price')[$num]) && !is_null(request('price')[$num])) {\n\n $service=Service::where('slug', $service)->first();\n $exist=ScheduleSubcategory::where([\n ['service_id', $service->id],\n ['day', request('day')[$num]],\n ['start', '<=', date('H:i', strtotime(request('start')[$num]))],\n ['end', '>=', date('H:i', strtotime(request('end')[$num]))],\n ['subcategory_id', $subcategory->id]\n ])->orWhere([\n ['service_id', $service->id],\n ['day', request('day')[$num]],\n ['start', '>', date('H:i', strtotime(request('start')[$num]))],\n ['start', '<=', date('H:i', strtotime(request('end')[$num]))],\n ['subcategory_id', $subcategory->id]\n ])->orWhere([\n ['service_id', $service->id],\n ['day', request('day')[$num]],\n ['end', '>=', date('H:i', strtotime(request('start')[$num]))],\n ['end', '<', date('H:i', strtotime(request('end')[$num]))],\n ['subcategory_id', $subcategory->id]\n ])->count();\n \n if (!is_null($service) && $exist==0) {\n $data=array('day' => request('day')[$num], 'start' => request('start')[$num], 'end' => request('end')[$num], 'service_id' => $service->id, 'price' => request('price')[$num], 'subcategory_id' => $subcategory->id);\n ScheduleSubcategory::create($data);\n }\n }\n $num++;\n }\n }\n\n if($subcategory){\n return redirect()->route('subcategorias.agenda.index')->with(['alert' => 'sweet', 'type' => 'success', 'title' => 'Registro exitoso', 'msg' => 'La subcategoría ha sido registrada exitosamente.']);\n } else {\n return redirect()->route('subcategorias.agenda.index')->with(['alert' => 'lobibox', 'type' => 'error', 'title' => 'Registro fallido', 'msg' => 'Ha ocurrido un error durante el proceso, intentelo nuevamente.']);\n }\n }" ]
[ "0.61515504", "0.60063905", "0.58394295", "0.58378613", "0.5620386", "0.5580089", "0.555611", "0.55307066", "0.55281335", "0.5486131", "0.5485075", "0.54284894", "0.5389126", "0.5386289", "0.5377289", "0.5354097", "0.5353045", "0.5351274", "0.53213197", "0.5312135", "0.5308805", "0.53027326", "0.5292323", "0.5283346", "0.5263917", "0.52618647", "0.52518326", "0.52518326", "0.5246731", "0.5240466", "0.5237145", "0.5226465", "0.52174956", "0.5214785", "0.5208926", "0.5208282", "0.52075857", "0.5191805", "0.51821923", "0.5181438", "0.51808363", "0.5177047", "0.5158785", "0.5146238", "0.51459813", "0.51422185", "0.51301885", "0.51291525", "0.51289696", "0.5127955", "0.51278335", "0.51234245", "0.5122548", "0.5121483", "0.51111335", "0.51074874", "0.5105673", "0.508538", "0.50788593", "0.5076284", "0.50759786", "0.5073123", "0.5073123", "0.5068451", "0.5061856", "0.5060225", "0.50533915", "0.50510836", "0.50481105", "0.50475097", "0.50463724", "0.50457793", "0.50429124", "0.50389236", "0.5030373", "0.5027029", "0.5026867", "0.50244445", "0.5022698", "0.5022", "0.50214016", "0.50138634", "0.50106007", "0.5009528", "0.50036645", "0.49975973", "0.49913377", "0.4988235", "0.49816525", "0.49812534", "0.4979132", "0.49783418", "0.49770775", "0.49729902", "0.49683636", "0.4966902", "0.49647555", "0.49615073", "0.49601445", "0.49582636" ]
0.680613
0
/Add video category form
public function addVideocategory() { return view('admin.addvideocategory'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n $categories = Category::all()->pluck('name','id');\n \n return view('admin.video.create', compact('categories'));\n }", "public function addVideo()\n {\n $getAllVideoCategory = VideoCategory::all();\n return view('admin.addvideo')->with('videoCategory',$getAllVideoCategory);\n }", "public function create()\n {\n return view('adminVideo.category.create');\n }", "public function addVideo(){\n if (isset($_POST[\"add_video\"])) {\n $movie = $this->model('Movie');\n $system = $this->model('System');\n\n $video_name = $_POST[\"video_title\"];\n $video_url = $_POST[\"video_url\"];\n $video_category = $_POST[\"selected_category\"];\n $video_description = $_POST[\"video_description\"];\n $video_sef_url = $system->seflink($video_name);\n\n $movie->addVideo($video_name,$video_url,$video_category,$video_description,$video_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/videos');\n }", "public function add() {\n if ($this->GdataAuth->isAuthorized()) {\n if (!empty($this->data)) {\n $this->YouTubeVideo->set($this->data);\n if ($this->YouTubeVideo->validates() && $this->YouTubeVideo->save($this->data)) {\n $this->Session->setFlash('It worked!');\n $this->redirect(array());\n }\n }\n // Set official you tube categories and access control options to populate\n // form fields\n $this->set('categories', $this->YouTubeVideo->categories());\n foreach ($this->YouTubeVideo->accessControls as $accessControl => $options) {\n $this->set(Inflector::pluralize($accessControl), array_combine($options, $options));\n }\n }\n }", "public function create()\n {\n //\n\n $categories = DB::table('categories')->Select('categoryID', 'categoryName')->paginate();\n\n return view('video.addVideo', compact('categories'));\n }", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function create()\n {\n $categories = Category::where('status',1)->orderBy('name')->get();\n //dd($categories->toArray());\n return view('adminCMS.videos.addVideo',compact('categories'));\n }", "public function videoCategory() {\n $this->loadModel('VideoCategories');\n $data = $this->VideoCategories->find('all');\n $this->paginate = [ ];\n $videoCategories = $this->paginate($data);\n\n $this->set(compact('videoCategories'));\n \n }", "public function create()\n\t{\n\t\t$compact = [];\n\n\t\t$categories = Category::with('child')->find(1);\n\t\t$compact[] = 'categories';\n\n\t\treturn view('admin.video.create')->with(compact($compact));\n\t}", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "public function create()\n { \n\n $categories = Category::pluck('name', 'id');\n\n return view('admin.videos.create', compact('categories'));\n }", "public function create_video() {\n $args = array (\n 'labels' => array(\n 'name' => __( 'Videos' ),\n 'singular_name' => __( 'Videos' ),\n 'add_new' => __( 'Add Video' ),\n 'add_new_item' => __( 'Add New Video' ),\n 'edit_item' => __( 'Edit Video' ),\n 'new_item' => __( 'Add New Video' ),\n 'view_item' => __( 'View Video' ),\n 'search_items' => __( 'Search Videos' ),\n 'not_found' => __( 'No Videos Found' ),\n 'not_found_in_trash' => __( 'No Videos found in trash. ' )\n\t ),\n 'has_archive' => true,\n 'menu_icon' => 'dashicons-format-video',\n 'public' => true,\n 'show_ui' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'rewrite' => true,\n 'menu_position' => 20,\n 'supports' => array('title', 'thumbnail', 'editor'),\n );\n register_post_type('video', $args);\n }", "function yggallery_youtube_video_category_load_widget() {\n\tregister_widget( 'yggallery_youtube_video_category_widget' );\n}", "public function category_add() {\n\t\t// Setup validation\n\t\t$this->data['validation'] = \"\";\n\t\t$this->data['category']\t= array('name' => '', 'url_name' => '');\n\t\t\n\t\t// Handle POST\n\t\tif ($this->mojo->input->post('category')) {\n\t\t\t// Get the category data\n\t\t\t$this->data['category']\t= $this->mojo->input->post('category');\n\t\t\t\n\t\t\t// Insert it!\n\t\t\tif ($this->mojo->blog_model->insert_category($this->data['category'])) {\n\t\t\t\t// It's success\n\t\t\t\t$response['result'] = 'success';\n\t\t\t\t$response['reveal_page'] = site_url('admin/addons/blog/categories_all');\n\t\t\t\t$response['message'] = 'Successfully created category';\n\t\t\t\t\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t} else {\n\t\t\t\t// There have been validation errors\n\t\t\t\t$response['result'] = 'error';\n\t\t\t\t$response['message'] = $this->mojo->blog_model->validation_errors;\n\t\t\t\t\n\t\t\t\t// Output the response\n\t\t\t\texit($this->mojo->javascript->generate_json($response));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Show the view\n\t\t$this->_view('category_add');\n\t}", "public function create()\n {\n $title = 'Create Video';\n $category = Categories::get();\n\n return view('video::create')->withTitle($title)->withCategory($category);\n }", "public function storeVideocategory(Request $request)\n {\n $this->validate($request,array(\n 'categoryName' => 'required',\n ));\n\n $videoCategory = new VideoCategory;\n\n $videoCategory->video_category_name = $request->categoryName;\n\n $videoCategory->save();\n\n if($videoCategory->save()){\n return redirect()->back()->with('success','Video category Saved successfully.');\n }\n else{\n return redirect()->back()->with('denger-success','Video category is not saved.');\n }\n \n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function addCategory(){\n if (isset($_POST[\"add_category\"])) {\n $categories = $this->model('Categories');\n $system = $this->model('System');\n $cat_name = $_POST[\"cat_name\"];\n $cat_sef_url = $system->seflink($cat_name);\n\n $categories->addCat($cat_name,$cat_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/categories');\n }", "public function newAction()\n {\n\t\tTag::appendTitle('Add New Category');\n }", "function add_new_category()\n\t{\n\t\t$this->data['title'] \t= 'Add New Portfolio Category';\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/add_new_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function addAction()\n {\n $manager = $this->getDI()->get('core_category_manager');\n $this->view->form = $manager->getForm();\n }", "public function create()\n {\n $data['category'] = Category::all();\n return view('media.add', $data);\n }", "public function create()\n {\n return view('Admin.Videos.add');\n }", "public function postContributedVideoAction() {\n\t\t$userSession= new Container('fo_user');\n\t\t$request\t= $this->getRequest();\n\t\t\n\t\tif(!isset($userSession->userSession['_id']) || trim($userSession->userSession['_id']) == '') {\n\t\t\techo '-1';\n\t\t\tdie();\n\t\t}\n\t\t\n\t\tif($request->isPost()) {\n\t\t\t$formData\t= $request->getPost();\n\t\t\t\n\t\t\tif(isset($formData['contribute_video_url']) && $formData['contribute_video_url'] != '' && \n\t\t\t\tisset($formData['contribute_video_title']) && $formData['contribute_video_title'] != '' && \n\t\t\t\tisset($formData['contribute_video_category']) && $formData['contribute_video_category'] != '') {\n\t\t\t\t$formData['_id']\t\t\t\t= new \\MongoId();\n\t\t\t\t$formData['user_id']\t\t\t= $userSession->userSession['_id'];\n\t\t\t\t$formData['media_title']\t\t= $formData['contribute_video_title'];\n\t\t\t\t$formData['media_title_lower']\t= strtolower($formData['contribute_video_title']);\n\t\t\t\t$formData['media_category']\t\t= $formData['contribute_video_category'];\n\t\t\t\t$formData['media_description']\t= $formData['contribute_video_desc'];\n\t\t\t\t$formData['media_url']\t\t\t= $formData['contribute_video_url'];\n\t\t\t\t$formData['media_tags']\t\t\t= $formData['contribute_video_tags'];\n\t\t\t\t\n\t\t\t\t$youtubeUrl\t= parse_url($formData['media_url'], PHP_URL_QUERY);\n\t\t\t\tparse_str($youtubeUrl, $params);\n\t\t\t $videoId\t= $params['v'];\n\t\t\t\t$feedURL\t= 'https://gdata.youtube.com/feeds/api/videos/' . $videoId;\n\t\t\t\t$entry\t\t= \\simplexml_load_file($feedURL);\n\t\t\t\tif($entry === false) {\n\t\t\t\t\t$time\t= '0';\n\t\t\t\t} else {\n\t\t\t\t\t$video\t= $this->parseVideoEntry($entry);\n\t\t\t\t\t$time\t= sprintf(\"%0.2f\", $video->length/60);\n\t\t\t\t}\n\t\t\t\tif($time <= 10) {\n\t\t\t\t\t$formData['media_length']\t= $time;\n\t\t\t\t\t$results\t= $this->contributeVideo($formData);\n\t\t\t\t\techo \"1\";\t//\tSuccess\n\t\t\t\t} else {\n\t\t\t\t\techo \"3\";\t// Time exceeded\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo \"0\";\t//\timproper request\n\t\t\t}\n\t\t} else {\n\t\t\techo \"0\";\t//\timproper request\n\t\t}\n\t\treturn $this->getResponse();\n\t}", "public function add_video(){\n\t\t$this->load->view('admin/video_gallery/add_video');\n\t}", "function mctf_media_list_view_filter_add() {\n $this->mctf_add_content_category_filter_dropdown();\n }", "function linkVideo(){\n \n $vid = uniqid();\n $ar = array('id' => $vid, 'web_id' => WEB_ID, 'video_url' => $_POST['vurl'], 'video_name' => $_POST['name'], 'video_disc' => $_POST['disc'], 'type' => 'YouTube', 'category'=>$_POST['cats']);\n \n $this->db->insert('video_library', $ar);\n \n \n }", "public function add_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors_form', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n if ($this->gallery_category_model->add_category()) {\n $this->session->set_flashdata('success_form', trans(\"category\") . \" \" . trans(\"msg_suc_added\"));\n redirect($this->agent->referrer());\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error_form', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }", "public function store(AddVideoRequest $request)\n {\n try{\n $videoFile = $request->file('video');\n $thumbnailFile = $request->file('thumbnail');\n $videoName = 'video_'.str_slug($request->input('title')).\".\".$videoFile->getClientOriginalExtension();\n $thumbnailName = 'thumbnail_'.str_slug($request->input('title')).\".\".$thumbnailFile->getClientOriginalExtension();\n $category = Category::find($request->input('category'));\n $tags = json_decode($request->input('tags'),true);\n\n if ($videoFile->move(public_path(\"uploads/videos/\"),$videoName) && $thumbnailFile->move(public_path(\"uploads/videos/\"),$thumbnailName)){\n $video = new Video();\n $video->title = ucfirst($request->input('title'));\n $video->subtitle = ucfirst($request->input('subtitle'));\n $video->description = ucfirst($request->input('description'));\n $video->duration = \"1:00\";\n $video->thumbnail = asset(\"uploads/videos/$thumbnailName\");\n $video->video = asset(\"uploads/videos/$videoName\");\n $video->user_id = Auth::id();\n $video->save();\n $video->categories()->attach($category->id);\n\n foreach ($tags as $key => $value) {\n $tagName = $tags[$key]['name'];\n //$tags = Tag::where('name','LIKE',\"%$name%\")->first();\n $tag = Tag::firstOrCreate(['name'=>$tagName]);\n $video->tags()->attach($tag->id);\n }\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was added successfully !!\");\n }\n return redirect()->back();\n } catch(\\Exception $e){\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not store the video\");\n\n if($video){\n $video->categories()->detach();\n $video->delete();\n }\n\n Log::warning(\"Can not upload Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n }", "public function add(){\n\t\t\t\n\t\t\trequire_once('views/category/add.php');\n\t\t}", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "public function addEdit(){\n\t\tif (isset($this->session->userdata['logged_in'])){\n\t\t\t$video_id = $this->uri->segment(4);// get id form url\n\t\t\tif($video_id==''){\n\t\t\t\t$data['title'] = \"Add Video\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$data['title'] = \"Edit Video\";\n\t\t\t}\n\t\t\t$data['content'] = 'admin/addeditvideo';\n\t\t\t$data['getVideo'] = $this->VideoModel->getVideoById($video_id); //retrive all category By Id\n\t\t\t//print_r($data['getVideo']); die;\n\t\t\t$this->load->view('admin/layout/adminmaster',$data);\n\t\t}else{\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "public function create()\n {\n $category = Category::all();\n return view('pages.backend.movie.add', compact('category'));\n }", "public function category(VideoCategory $videoCategory)\n {\n $page = Input::get('page', 1);\n\n $cat = VideoCategory::where('slug', '=', $videoCategory)->first();\n\n $parent_cat = VideoCategory::where('parent_id', '=', $cat->id)->first();\n\n if (!empty($parent_cat->id)) {\n $parent_cat2 = VideoCategory::where('parent_id', '=', $parent_cat->id)->first();\n if (!empty($parent_cat2->id)) {\n $videos = Video::select($this->getVideoFieldsForFrontend())\n ->where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orWhere('video_category_id', '=', $parent_cat->id)\n ->orWhere('video_category_id', '=', $parent_cat2->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n } else {\n $videos = Video::where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orWhere('video_category_id', '=', $parent_cat->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n }\n } else {\n $videos = Video::where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n }\n\n $data = [\n 'videos' => $videos,\n 'current_page' => $page,\n 'category' => $cat,\n 'page_title' => 'Videos - ' . $cat->name,\n 'page_description' => 'Page ' . $page,\n 'pagination_url' => '/videos/category/' . $videoCategory,\n 'menu' => Menu::orderBy('order', 'ASC')->get(),\n 'video_categories' => VideoCategory::all(),\n 'theme_settings' => config('settings.theme'),\n ];\n\n return view('Theme::video-list', $data);\n }", "public function add_category()\n {\n \n if(isset($_POST['category_name']) && isset($_POST['category_desc'])){\n\t\t \n\t\t \n\t\t $query = $this->Product_model->add_category();\n\t\t\t if($query){\n\t\t\t\t \n\t\t\t\t echo 'added';\n\t\t\t\t }else{\n\t\t\t\t\t \n\t\t\t\t\t echo 'error';\n\t\t\t\t\t }\n\t\t \n\t\t }\n \n }", "public function actionCreate()\n {\n $form = new VideoForm();\n if(\\Yii::$app->request->isPost)\n {\n $form->load(Yii::$app->request->post());\n\n $form->file = UploadedFile::getInstance($form,'file');\n\n if($form->file && $form->validate())\n {\n $new_name = date('YmdHis', time()) . rand(0, 999). '.' . $form->file->getExtension();\n $new_path = 'static/upload/video/' . $new_name;\n if ($form->file->saveAs($new_path)) {\n $model = new Video();\n $model->attributes = [\n 'name' => $new_name,\n 'file' => $new_path,\n 'size' => $form->file->size,\n 'type' => $form->file->type,\n 'created_at' => $form->created_at,\n 'author' => $form->author,\n 'description' => $form->description,\n ];\n\n if ($model->save()) {\n return $this->redirect(['index']);\n } else {\n unlink($new_path);\n }\n }\n }\n }\n\n return $this->render('create', [\n 'model' => $form,\n ]);\n }", "public function indexAction()\n {\n $module = $this->params('module');\n $slug = $this->params('slug');\n\n // Get config\n $config = Pi::service('registry')->config->read($module);\n\n // Get category information from model\n $category = $this->getModel('category')->find($slug, 'slug');\n $category = Pi::api('category', 'video')->canonizeCategory($category);\n\n // Check category\n if (!$category || $category['status'] != 1) {\n $this->getResponse()->setStatusCode(404);\n $this->terminate(__('The category not found.'), '', 'error-404');\n $this->view()->setLayout('layout-simple');\n return;\n }\n // Update Hits\n $this->getModel('category')->increment('hits', ['id' => $category['id']]);\n // category list\n $categoriesJson = Pi::api('category', 'video')->categoryListJson();\n // Check display type\n switch ($category['display_type']) {\n case 'video':\n $template = 'video-angular';\n break;\n\n case 'subcategory':\n // Get info\n $list = [];\n $where = ['status' => 1, 'parent' => $category['id']];\n $order = ['display_order ASC', 'time_create DESC', 'title ASC'];\n $select = $this->getModel('category')->select()->where($where)->order($order);\n $rowSet = $this->getModel('category')->selectWith($select);\n // Make list\n foreach ($rowSet as $row) {\n $list[$row->id] = Pi::api('category', 'video')->canonizeCategory($row);\n }\n // Set view\n $this->view()->assign('list', $list);\n // Set template\n $template = 'category-single';\n break;\n }\n\n // Save statistics\n if (Pi::service('module')->isActive('statistics')) {\n Pi::api('log', 'statistics')->save('video', 'category', $category['id']);\n }\n\n // Set view\n $this->view()->headTitle($category['seo_title']);\n $this->view()->headDescription($category['seo_description'], 'set');\n $this->view()->headKeywords($category['seo_keywords'], 'set');\n $this->view()->setTemplate($template);\n $this->view()->assign('config', $config);\n $this->view()->assign('category', $category);\n $this->view()->assign('categoriesJson', $categoriesJson);\n $this->view()->assign('pageType', 'category');\n }", "function addcategory(){\n \treturn view('category');\n }", "public function addAction()\n\t{\n\t\t$this->oView->box_title = \"Add Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\n\t\t$this->oView->link_url = site_url('dashboard/category/add');\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$objCat = new Category();\n\t\t\t\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\t\t\t\n\t\t\t$data['create_at'] = now_to_mysql();\n\t\t\t$last_id = $objCat->insert($data);\n\t\t\t\n\t\t\tredirect(\"dashboard/category/list\");\n\t\t}\n\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function create()\n {\n return view('admin.pages.category.add');\n }", "public function create()\n {\n return view('admin.gallerycategory.add');\n }", "public function create()\n\t{\n\t\t// Validate the data\n\t\tif ($this->form_validation->run())\n\t\t{\n\t\t\t$input = array(\n\t\t\t\t'title' => $this->input->post('title'),\n\t\t\t\t'description' => $this->input->post('description'),\n\t\t\t\t'parent_id' => $this->input->post('parent_id'),\n\t\t\t);\n\t\t\t\n\t\t\tif ( ! empty($_FILES['thumbnail']['name']))\n\t\t\t{\n\t\t\t\tif ( ! self::_upload())\n\t\t\t\t{\n\t\t\t\t\t$this->template->messages = array('error' => $this->upload->display_errors());\n\t\t\t\t\tgoto display;\n\t\t\t\t}\n\n\t\t\t\tif ( ! self::_resize())\n\t\t\t\t{\n\t\t\t\t\t$this->template->messages = array('error' => $this->image_lib->display_errors());\n\t\t\t\t\tgoto display;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$thumbnail = $this->upload->data();\n\t\t\t\t$input['thumbnail'] = $thumbnail['file_name'];\n\t\t\t}\n\t\t\t\n\t\t\t$this->video_channel_m->insert($input)\n\t\t\t\t? $this->session->set_flashdata('success', sprintf(lang('video_channel:add_success'), $this->input->post('title')))\n\t\t\t\t: $this->session->set_flashdata(array('error'=> lang('video_channel:add_error')));\n\n\t\t\tredirect('admin/videos/channels');\n\t\t}\n\n\t\tdisplay:\n\t\t\n\t\t// Loop through each validation rule\n\t\tforeach($this->validation_rules as $rule)\n\t\t{\n\t\t\t$channel->{$rule['field']} = set_value($rule['field']);\n\t\t}\t\n\t\t\t\n\t\t$channels = array(lang('select.none')) + $this->video_channel_m->order_by('title')->where('parent_id', 0)->dropdown('id', 'title');\n\t\t\t\n\t\t$this->template\n\t\t\t->title($this->module_details['name'], lang('video_channel:create_title'))\n\t\t\t->set('channel', $channel)\n\t\t\t->set('channels', $channels)\n\t\t\t->build('admin/channels/form', $this->data);\t\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Video;\n\n $this->performAjaxValidation($model, 'video-form');\n\n\t\tif(isset($_POST['Video']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Video'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function add_category() /// get routes of the form add cateogry\n {\n return view('admin.categories.add-category');\n }", "function addvideo($name, $category, $length)\n\t{\n\t\t$obj = new clsdbaccess();\n\t\t$mysqli = $obj->db_connect();\n\t\t$result ='';\n\n\t\tif(!($stmt = $mysqli->prepare(\"INSERT INTO videoinventory (name, category, length) VALUES (?,?,?)\"))){\n\t\t\techo \"Prepare failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\n\t\tif(!($stmt->bind_param(\"ssi\", $name, $category, $length))){\n\t\t\techo \"Bind failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\n\t\tif(!$stmt->execute()) {\n\t\t\t$result = \"Execute failed: \" . $mysqli->error;\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$result='success';\n\t\t}\t\t\n\t\t$stmt->close();\t\n\t\treturn $result;\n\t}", "public function add_video_glance() {\n\t\t/* How many videos are published. */\n\t\t$video_count = wp_count_posts( 'video' )->publish;\n\t\t\n\t\t/* Get the correct label (video, videos) depending on the count. */\n\t\t$video_type = get_post_type_object( 'video' );\n\t\t$video_text = _n( $video_type->labels->singular_name, $video_type->labels->name, intval( $video_count ), 'makigas-videoman' );\n\t\t\n\t\t/* Render HTML code. */\n\t\techo '<li class=\"page-count video-count\">';\n\t\techo '<a href=\"edit.php?post_type=video\">' . $video_count . ' ' . strtolower( $video_text ) . '</a>';\n\t\techo '</li>';\n\t\t\n\t\t/* TODO: content: \"\\f236\"; in CSS: */\n\t}", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "public function addVideoAction(){\n $data = $this->getRequestData();\n if(isset($data['video']['name']) && isset($data['video']['content'])){\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Asset_Folder::getByPath('/video/operation/'.$user->getKey().'-video');\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-video\");\n $folder->setParentId(6);\n $folder->save();\n }\n\n $asset = new Asset_Video();\n $asset->setCreationDate(time());\n $asset->setUserOwner(1);\n $asset->setUserModification(1);\n $asset->setParentId($folder->getId());\n $asset->setFilename(Pimcore_File::getValidFilename($data['name'] . \"-\" . time()));\n $asset->setData(base64_decode($data['content']));\n if(!$asset->save()){\n $this->setErrorResponse('cannot save video!');\n }\n } else {\n $this->setErrorResponse('video is mandatory for this request!');\n }\n\n $this->_helper->json(array('video' => $asset->getId()));\n }", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function widget( $args, $instance ) {\n$title = apply_filters( 'widget_title', $instance['title'] );\n$youtubeurl = apply_filters( 'widget_catno', $instance['catno'] );\n$viewmore = apply_filters( 'widget_spantext', $instance['viewmore'] );\n$sviewmore = apply_filters( 'widget_spantext', $instance['sviewmore'] );\n\n\t\t\t $video_url1=split('[&]',$youtubeurl);\n\t $url_array=explode(\"=\",$video_url1[0]);\n\t\t $path=$url_array[1];\n\n// before and after widget arguments are defined by themes\necho $args['before_widget'];\nif ( ! empty( $title ) )\necho $args['before_title'] . $title . $args['after_title'];\n\n$taxonomy = 'ygallery_category';\n//$taxonomy = 'category';\n$orderby = 'name';\n$show_count = 0; // 1 for yes, 0 for no\n$pad_counts = 0; // 1 for yes, 0 for no\n$hierarchical = 1; // 1 for yes, 0 for no\n$title = '';\n$empty = 0;\n\n$args = array(\n 'taxonomy' => $taxonomy,\n 'orderby' => $orderby,\n 'show_count' => $show_count,\n 'pad_counts' => $pad_counts,\n 'hierarchical' => $hierarchical,\n 'title_li' => $title,\n 'hide_empty' => $empty\n);\n\n\n $categories = get_categories($args); \n foreach ($categories as $category) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\techo '<li><a href=\"' .get_site_url() . '/video-categories/?category='.$category->slug.'\">' . $category->cat_name . '('.$category->category_count.')</a></li>';\n\t\t\t\t\n\t\t\t\t//echo $term->name.\",\"; \n\t\t\t}\n\t\techo '</ul>';\n\n\nif($viewmore&&$sviewmore)\n{\n?>\n<a href=\"http://chicagomalayaleeassociation.org/video-gallery/\" class=\"video_category_video\" >\n<?php \necho $viewmore; \n?>\n</a>\n<?php\n}\n// This is where you run the code and display the output\n//echo __( 'Hello, World!', 'yggallery_kalamela_widget_domain' );\necho $args['after_widget'];\n}", "public function addAction()\n {\n $form = $this->getServiceLocator()->get('civcontent_category_form');\n \n // Check if the request is a POST.\n $request = $this->getRequest();\n if ($request->isPost())\n {\n // Create a new category object.\n $category = $this->getServiceLocator()->get('civcontent_category');\n \n $data = (array) $request->getPost();\n $form->bind($category);\n $form->setData($data);\n if ($form->isValid())\n {\n // Persist changes.\n $this->getContentService()->persistCategory($category);\n \n // Redirect to content categories\n return $this->redirect()->toRoute('content/category', array(\n 'action' => 'index'\n ));\n }\n }\n \n // If a GET request, or invalid data then render/re-render the form\n return new ViewModel(array(\n 'form' => $form,\n ));\n }", "public function addcategory() {\n return view('Category.view-category');\n}", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "public function create()\n {\n //\n $categories = Category::lists('category_name', 'id');\n return view('media.create', $this->data)->withCategories($categories);\n }", "public function add_category() {\n\t\n\t\tif($this->input->post('add_type')=='add_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name'),\n\t\t'created_at' => date('d-m-Y h:i:s')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->add_assets_category($data);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_added');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function store(Request $request)\n {\n $data = $request->validate([\n 'name' => 'required',\n ]);\n\n VideoCategory::create($data);\n\n return back()->with('success', 'تمت الاضافة بنجاح');\n }", "public function createAction() {\n $form = $this->view->form = new Whmedia_Form_Circle();\n\n // Check post\n if( $this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost()) )\n {\n // we will add the category\n $values = $form->getValues();\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\n try\n {\n // add category to the database\n // Transaction\n $table = Engine_Api::_()->getDbtable('circles', 'whmedia');\n\n $row = $table->createRow($values);\n $row->user_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n $box_id = $row->save();\n\n $db->commit();\n \n // ** auto add if the box id exist ** \n $addnew = (int) $this->_getParam('addnew' , false);\n $_subject = Engine_Api::_()->user()->getUser($addnew); \n if( $_subject->getIdentity() )\n {\n $viewer = Engine_Api::_()->user()->getViewer();\n $listsTable = Engine_Api::_()->getDbTable('circles', 'whmedia');\n $box = $listsTable->fetchRow(array('user_id = ?' => $viewer->getIdentity(),\n 'circle_id = ?' => $box_id ));\n\n $box->add($_subject);\n }\n // ** auto add if the box id exist ** \n }\n\n catch( Exception $e )\n {\n $db->rollBack(); \n throw $e;\n }\n\n return $this->_helper->Message(\"Box added.\");\n }\n\n // Output\n $this->renderScript('admin-settings/form.tpl');\n }", "public function video_add($id)\n {\n $data['content'] = Content::findorfail($id);\n\n $data['page_title'] = 'Content Add';\n return view('client.content.video_add', $data);\n }", "public function updateVideoCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $videoCategory = VideoCategory::find($id);\n $videoCategory->video_category_name = $request->name;\n $videoCategory->save();\n Session::flash('success','Video Category Updated succcessfully.');\n return redirect()->back()->with('workout',$videoCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function create()\n {\n return view('product.add_category');\n }", "public function create()\n {\n return view('backend.category.add');\n }", "public function postVideo(){\r\n if(!$this->hasLoginCheck())\r\n return;\r\n $blogItem = new BlogItemModel();\r\n $video_url=$_POST['video_url'];\r\n $video_img_path=$_POST['video_img_path'];\r\n $title=$_POST['video_title'];\r\n $desc=$_POST['content'];\r\n $embed_value=$_POST['video_embed_value'];\r\n $tag=$_POST['tag'];\r\n $blogItem->addVideo($video_url,$video_img_path,$title,$desc,$tag,$embed_value);\r\n echo json_encode(array('status'=>'true'));\r\n }", "public function addVideo(VideoMedia $video);", "public function newcategory() {\n\n if (ckeckAddmin()) {\n $this->load->view('admin/header/header');\n $this->load->view('admin/css/css');\n $this->load->view('admin/topnav/topnav');\n $this->load->view('admin/sidenav/sidenav');\n $this->load->view('admin/content/addcatogry');\n $this->load->view('admin/footer/footer');\n # $this->load->view('admin/js/extra');\n $this->load->view('admin/js/js');\n } else {\n CustomFlash('Admin/login', 'alert-danger', 'plz First Login');\n }\n }", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);\n }", "function add()\n {\n $this->load->library('form_validation');\n $this->load->helper('form');\n \n //neu ma co du lieu post len thi kiem tra\n if($this->input->post())\n {\n $this->form_validation->set_rules('name', 'Tên video', 'required');\n $this->form_validation->set_rules('link', 'Link video', 'required');\n \n if($this->form_validation->run())\n {\n \n //lay ten file anh minh hoa duoc update len\n $this->load->library('upload_library');\n $upload_path = './upload/video';\n $upload_data = $this->upload_library->upload($upload_path, 'image'); \n $images = '';\n if(isset($upload_data['file_name']))\n {\n $images = $upload_data['file_name'];\n }\n \n //luu du lieu can them\n $data = array(\n 'name' => $this->input->post('name'),\n 'images' => $images,\n 'link' => $this->input->post('link'),\n ); \n //them moi vao csdl\n if($this->video_model->create($data))\n {\n $this->session->set_flashdata('message', 'Thêm thành công');\n }else{\n $this->session->set_flashdata('message', 'Không thêm được');\n }\n redirect(admin_url('video'));\n }\n }\n \n \n //load view\n $this->data['temp'] = 'admin/video/add';\n $this->load->view('admin/main', $this->data);\n }", "function getCategoryFields() {\n\t\t\n\t\t$model = $this->getModel();\n\t\t$category_id = JRequest::getVar('id');\n\t\t$form = $model->getFieldForm($category_id, 'category');\n\t\t\n\t\tif (!$form) {\n\t\t\techo \"There was an error creating the form\";\n\t\t\texit();\n\t\t}\n\t\t\n\t\techo '<div class=\"fltlft\" style=\"width:250px;\">';\n\t\techo '<fieldset class=\"adminform\" >';\n\t\techo '<legend>New Category</legend>';\n\t\techo '<div class=\"adminformlist\">';\n\t\tforeach ($form->getFieldset() as $field) {\n\t\t\tJHtml::_('wbty.renderField', $field);\n\t\t}\n\t\techo \"</div></fieldset></div>\";\n\t\t\n\t\texit();\n\t}", "public function addPost(){\n\n if ($this->input->post(\"category_create\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n $categoryName = $this->input->post(\"category_name\");\n\n $this->validate->setRule(\"minlength\",$categoryName,3, \"Category name length must be more then 3 symbols!\");\n\n if ($this->validate->validate() === false){\n $error = $this->validate->getErrors();\n $this->view->redirect(\"/categories/manage\",$error);\n }\n\n $categoryModel = new CategoriesModel();\n try{\n if ($categoryModel->hasCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"This categories already exist!\");\n }\n\n if($categoryModel->addNewCategory($categoryName)){\n $this->view->redirect(\"/categories/manage\",\"Category created successfully!\",\"success\");\n }\n }catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception);\n }\n }", "function CategoryForm() {\r\n\r\n\t\t$member = Member::currentUser();\r\n\r\n\t\t// Need to sort out how going to handle multiple instances of category\r\n\t\t// front end grid field : https://github.com/webbuilders-group/silverstripe-frontendgridfield\r\n\t\t// grid field extension : https://github.com/silverstripe-australia/silverstripe-gridfieldextensions\r\n\t\t$category = Category::get()->first();\r\n\t\t$fields = $category->FormFields();\r\n\r\n $actions = FieldList::create(\r\n FormAction::create(\"doCategoryForm\")->setTitle(\"Submit\")->addExtraClass('productive'),\r\n FormAction::create(\"cancel\")->setTitle(\"Cancel\")\r\n );\r\n\r\n $form = Form::create($this, 'CategoryForm', $fields, $actions);\r\n\r\n return $form;\r\n\r\n\t}", "public function addCategory()\n {\n $this->validate($this->request, [\n 'name' => 'required|max:191',\n 'file' => ['required', 'mimes:jpeg,jpg,bmp,png']\n ]);\n\n $slide = Category::create(['name' => $this->request->name]);\n if ($this->request->hasFile('file')) {\n $file = $this->request->file('file');\n $fileStored = $file->store(\"categories\", 'uploads');\n $slide->update(['file_url' => $fileStored]);\n }\n return $slide;\n }", "public function createCategory();", "public function create()\n {\n //\n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = UserMoodle::where('id', $user_id)->first();\n\n $videos = Video::all();\n $users = UserMoodle::all();\n $competitor_types = CompetitorType::where('status', 1)->get();\n $video_types = VideoType::where('status', 1)->get();\n\n return view('admin.videos.create', compact('videos', 'usuario', 'users', 'video_types', 'competitor_types'));\n }", "function gtags_group_category_form() {\n\tglobal $bp, $show_group_add_form_cats;\t\n\tif ($show_group_add_form_cats) return; // prevents showing form twice\n\t$show_group_add_form_cats = true;\n\n\t// the group category\t\n\t$group_cats = get_option('gtags_category'); \n\tif (empty($group_cats)) return;\n\t\n\t$selected = groups_get_groupmeta( $bp->groups->current_group->id, 'gtags_group_cat' ); \n\t?><label for=\"group-cat\"><?php _e( 'Group Category', 'gtags' ) ?></label>\n\t<select name=\"group-cat\" id=\"group-cat\" />\n\t\t<option value=\"\"><?php _e('--- SELECT ONE ---', 'gtags') ?></option>\n\t<?php foreach ( $group_cats as $tag => $desc ): ?>\n\t\t<?php if ( !$desc ) $desc = $tag; ?>\n\t\t<option value=\"<?php echo $tag; ?>\" <?php if ( $tag == $selected ) echo 'selected=\"selected\"' ?>><?php echo $desc; ?></option>\n\t<?php endforeach; ?>\n\t</select>\n\t<i><?php _e('(the primary group activity)', 'gtags'); ?></i><br><?php \t\n}", "public function actionCreate()\n {\n $model = new TbYoutube();\n\n if ($model->load(Yii::$app->request->post())){\n // $model->yt_thumbnailURL\n //echo $model->yt_watchURL;\n $data = Yii::$app->video->getData($model->yt_watchURL);\n \n// echo \"<pre>\";\n// print_r($data);\n// exit();\n $delimiter='&list=';\n @list($a,$list)= @explode($delimiter, $model->yt_watchURL);\n \n $model->yt_vid = $data->id.($list?'?list='.$list:'');\n $model->yt_title = $data->snippet->title;\n $model->yt_description = $data->snippet->description;\n $model->yt_author = $data->snippet->channelTitle;\n $model->yt_thumbnailURL = $data->snippet->thumbnails->medium->url;\n \n if($model->save()) { \n return $this->redirect(['update', 'id' => $model->yt_id]);\n }else{\n print_r($model->getErrors());\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n return view('admin.category.add');\n }", "public function create()\n {\n return view('admin.blogcategory.add');\n }", "public function add_category(){\n\n $add_category_content=view('admin.pages.add_category');\n return view('admin.admin_master')\n ->with('admin_content',$add_category_content);\n }", "public function create()\n {\n return view('backend.cat_add');\n }", "public function category()\n { \n if($this->access_role->is_Admin() == false) show_404();\n $this->load->model('Category_Model');\n \n if($_SERVER['REQUEST_METHOD'] == 'POST')\n {\n if($this->form_validation->run('category_insert') ){\n $this->Category_Model->add_category(); \n } else {\n $error = ['class'=>'warning','text'=> validation_errors()];\n $this->session->set_flashdata('sms_flash', $error); \n redirect('Dashboard/category');\n }\n } \n else{\n $data = $this->Category_Model->view_category();\n }\n \n $this->load->view('admin/category_content',$data);\n }", "public function newAction()\n {\n $galleryvideo = new GalleryVideo();\n $form = $this->createForm(GalleryVideoType::class, $galleryvideo);\n\n return $this->render('AdminBundle:galleryvideo:new.html.twig', array(\n 'video' => $galleryvideo,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('admin.pages.category.add');\n }", "public function actionCreate()\n {\n $model = new Video();\n \n $post = Yii::$app->request->post();\n if ($post) { \n// $file = UploadedFile::getInstance($model, 'file'); \n// $path = Yii::$app->basePath. \"/../frontend/web/\";\n// $filePath = Yii::$app->basePath. \"/../frontend/web/videos/\";\n \n// if ($file) {\n// $filename = \"videos/\" . time() . rand(1,1000) . '.' . $file->getExtension();\n// $path = $path . $filename;\n \n// if(!file_exists($filePath)){\n// mkdir($filePath);\n// }\n// $file->saveAs($path);\n $url = $path = Yii::$app->params['uploadsUrl'].$post['Video']['video'];\n $header_array = get_headers($url, true);\n $size = $header_array['Content-Length']; \n \n $post['Video']['video'] = $post['Video']['video'];\n $post['Video']['filesize'] = $size;\n $post['Video']['ext'] = explode('.', basename($post['Video']['video']))[1];\n $post['Video']['is_complete'] = '1';\n $post['Video']['product_id'] = empty($post['Video']['product_id']) ? '' : join(',', $post['Video']['product_id']);\n// }\n\n if ($model->load($post) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function addAction()\n {\n $form = new CategoryForm();\n $form->get('submit')->setValue('Add');\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $form->setInputFilter($category->getInputFilter());\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n $category->exchangeArray($form->getData());\n $this->getCategoryTable()->saveCategory($category);\n\n // Redirect to list of categorys\n return $this->redirect()->toRoute('category');\n }\n }\n return array('form' => $form);\n }", "public function create()\n {\n $model = new Categories();\n $this->data['cat'] = $model->getCategories();\n return view('admin.pages.form_insert_gallery',$this->data);\n }", "public function create()\n {\n return view('admin.category.create');\n }", "public function store(Request $request)\n {\n //\n $request->validate([\n 'input_videoName',\n 'input_category',\n 'input_videoDescription',\n 'input_videoFile',\n 'input_videoThumbnail',\n ]);\n\n $input = $request->all();\n\n $input['input_videoThumbnail'] = \"defaultCategory.png\";\n\n if ($file = $request->file('input_videoFile')) {\n\n if ($thumbNail_file = $request->file('input_videoThumbnail')) {\n $destinationPath = 'image/';\n $thumbNail = date('YmdHis') . \".\" . $thumbNail_file->getClientOriginalExtension();\n $thumbNail_file->move($destinationPath, $thumbNail);\n $input['input_videoThumbnail'] = \"$thumbNail\";\n }\n\n $destinationPath = 'videos/';\n $videoFile = date('YmdHis') . \".\" . $file->getClientOriginalExtension();\n $file->move($destinationPath, $videoFile);\n $input['input_videoFile'] = \"$videoFile\";\n\n Video::create([\n 'videoName' => $input['input_videoName'],\n 'videoDescription' => $input['input_videoDescription'],\n 'videoFile' => $input['input_videoFile'],\n 'image' => $input['input_videoThumbnail'],\n 'categoryID' => $input['input_category']\n ]);\n }\n }", "public function create()\n { \n $form_type = 'Add';\n $images = [];\n $category = [];\n $questions = ['Case / Box','A Game','The Manual'];\n \n $categories = Categories::where('parent_id',0)->pluck('category_name','id')->prepend('Select League', ''); \n $regions = Regions::pluck('name','id')->prepend('Select Region', ''); \n \n return view('admin.subcategories.form', compact('form_type','categories','regions','images','category','questions')); \n }", "public function category_add() {\n $this->autoRender = false;\n $params = $this->request->data;\n //echo \"<pre>\";print_r($params);echo \"</pre>\"; exit;\n $categoryTable = TableRegistry::get('SkillCategory');\n $getCategory = $categoryTable->find()->select(['id'])->where(['category_name' => $params['category_name']])->toArray();\n if(empty($getCategory)){\n $category = $categoryTable->newEntity($params);\n if ($categoryTable->save($category)) {\n echo json_encode(\n [\n 'status' => 1,\n 'message' => \"Skill Category Added!\",\n ]\n );\n exit;\n }\n }else{\n echo json_encode(\n [\n 'status' => 0,\n 'message' => \"Skill Category Already Exists!\",\n ]\n );\n exit;\n }\n \n }", "public function galleryCategoryCreate()\n {\n $data['pageTitle'] = __('Add Image Category');\n $data['menu'] = 'gallery';\n\n return view('admin.gallery.category.add', $data);\n }", "public function store(ContentCreateRequest $request, $category_id)\n {\n $newContent = $request->except(array('_token','checkVideo'));\n $content = new Content();\n $newContent['category_id']=$category_id;\n if (!$request->input('checkVideo') == 'on'){\n $newContent['video'] = null;\n }\n $content = Content::create($newContent);\n\n return redirect()\n ->route('teacher.{category}.content.index', $category_id)\n ->withSuccess('Шинэ агуулга амжилттай нэмэгдлээ.');\n }", "function type_url_form_video()\n {\n }", "public function metaform()\n {\n $validation = $this->getValidationData();\n $validation['extension'] = array(\n 'args' => array(\n 'extension',\n '3gp|aaf|asf|avchd|avi|cam|dat|dsh|fla|flr|flv|m1v|m2v|m4v|mng|mp4|mxf|nsv|ogg|rm|roq|smi|sol|svi|swf|wmv|wrap|mkv|mov|mpe|mpeg|mpg',\n ),\n 'message' => __( 'You can add only video.', 'wpv-views' ),\n );\n $this->setValidationData($validation);\n return parent::metaform(); \n }", "public function actionCreate()\n {\n $categoryOptions = DataHelper::getCategoryOptions();\n $statusMap = CmsCategory::getCategoryStatus();\n $type=Yii::$app->request->get('type',0);\n $model = new CmsCategory();\n $model->sort_val = 10;\n\t\t$model->created_at=time();\n\t\t$model->updated_at=time();\n if (Yii::$app->request->isPost) {\n $model->image_main_file = UploadedFile::getInstance($model, 'image_main_file');\n if (($file = $model->uploadImageMain())!=false) {\n $model->image_main = $file['src'];\n }\n $model->image_node_file = UploadedFile::getInstance($model, 'image_node_file');\n if (($file = $model->uploadImageNode())!=false) {\n $model->image_node = $file['src'];\n }\n $model->banner_file = UploadedFile::getInstance($model, 'banner_file');\n if (($file = $model->uploadBanner())!=false) {\n $model->banner = $file['src'];\n }\n\n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n DataHelper::deleteCache();\n return $this->redirect(['index']);\n }else{\n var_dump($model->getErrors());die();\n }\n }\n return $this->render('create', [\n 'model' => $model,\n 'categoryOptions' => $categoryOptions,\n 'statusMap' => $statusMap,\n 'type'=>$type\n ]);\n }", "public function create()\n {\n //\n $user_id = session('user')['id'];\n $category_id = PushUser::find($user_id)->category_id;\n $channels = Channel::whereHas('association', function($qr)use($category_id){\n $qr->where('category_id', $category_id);\n })->where('is_sponser', 1)->pluck('title','id');\n $channel_ids = Channel::whereHas('association', function($qr)use($category_id){\n $qr->where('category_id', $category_id);\n })->where('is_sponser', 1)->pluck('id')->toArray();\n\n $videos = Video::with(['channel'])->whereIn('channel_id', $channel_ids)->pluck('title','id');\n // $videos = Video::pluck('title','id');\n // dd($videos);\n return view('Push::videos.create', compact(['channels','videos']));\n }", "function colorpicker_field_add_new_category( $taxonomy ) { ?> \r\n\t<div class=\"form-field term-colorpicker-wrap\"> \r\n\t<label for=\"term-colorpicker\">Category Color</label> \r\n\t<input name=\"_category_color\" value=\"#ffffff\" class=\"colorpicker\" id=\"term-colorpicker\" /> \r\n\t<p>This is the field description where you can tell the user how the color is used in the theme.</p> \r\n\t</div> <?php }", "function save_video_post( $post_id, $post ) {\n if ( 'publish' === $post->post_status && $post->post_type === 'video' ) {\n $defaults = array(\n 'video_category' => array( 'fitness' )\n );\n $taxonomies = get_object_taxonomies( $post->post_type );\n foreach ( (array) $taxonomies as $taxonomy ) {\n $terms = wp_get_post_terms( $post_id, $taxonomy );\n if ( empty( $terms ) && array_key_exists( $taxonomy, $defaults ) ) {\n wp_set_object_terms( $post_id, $defaults[$taxonomy], $taxonomy );\n }\n }\n }\n}", "public function actionCreate()\n {\n $model = new Category();\n\n Yii::$app->view->params['active'] = 'category';\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Категория добавлена');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function action_addBook() {\r\n $fieldset = Fieldset::forge('book')->add_model('Model_Book');\r\n $fieldset->delete('category_id');\r\n // get form from fieldset\r\n $form = $fieldset->form();\r\n\r\n // add category to the form\r\n $categories = Model_Category::find('all');\r\n $op = array();\r\n foreach ($categories as $category) {\r\n $op[$category['id']] = $category['name'];\r\n }\r\n\r\n $form->add(\r\n 'category', 'Book category',\r\n array('options' => $op, 'type' => 'radio', 'value' => 'true')\r\n );\r\n // add submit button to the form\r\n $form->add('Submit', '', array('type' => 'submit', 'value' => 'Submit'));\r\n\r\n\r\n // build the form and set the current page as action\r\n $formHtml = $fieldset->build(Uri::create('book/addBook'));\r\n $view = View::forge('book/addBook');\r\n $view->set('form', $formHtml, false);\r\n\r\n if (Input::param() != array()) {\r\n try {\r\n $book = Model_Book::forge();\r\n $book->title = Input::param('title');\r\n $book->author = Input::param('author');\r\n $book->price = Input::param('price');\r\n $book->url = Input::param('url');\r\n $book->category_id= Input::param('category');\r\n\r\n Log::debug('selected category '.$book->category_id);\r\n Log::debug('selected category '.Input::param('category'));\r\n $book->save();\r\n Response::redirect('book');\r\n } catch (Orm\\ValidationFailed $e) {\r\n $view->set('errors', $e->getMessage(), false);\r\n }\r\n }\r\n $this->template->title = \"Book add page\";\r\n $this->template->content = $view; \r\n }" ]
[ "0.69920427", "0.69584477", "0.6941191", "0.6830765", "0.68297964", "0.6758075", "0.67541033", "0.66597044", "0.66583365", "0.6615286", "0.6614905", "0.65550804", "0.64604056", "0.64333004", "0.64281654", "0.63976806", "0.63896465", "0.6372445", "0.63030934", "0.62761736", "0.62740034", "0.6253232", "0.62369454", "0.6230123", "0.6182566", "0.6156128", "0.61400515", "0.6134335", "0.612753", "0.6114256", "0.6101636", "0.6086115", "0.6083336", "0.60828394", "0.60616827", "0.6041268", "0.6041159", "0.603691", "0.60270965", "0.6026183", "0.60254973", "0.60128367", "0.60101944", "0.5999306", "0.5992771", "0.59758276", "0.5964736", "0.5946436", "0.59442735", "0.59329337", "0.5921693", "0.59204763", "0.59162724", "0.59104013", "0.590848", "0.59061736", "0.5897247", "0.58940804", "0.5889478", "0.5886905", "0.58842874", "0.5884088", "0.5876998", "0.5876545", "0.587365", "0.58735424", "0.58708864", "0.587038", "0.58680326", "0.5866548", "0.584671", "0.5844348", "0.58259237", "0.58240896", "0.5822398", "0.5819506", "0.5819485", "0.5816911", "0.58110243", "0.57971114", "0.57919604", "0.57906985", "0.57898015", "0.57886815", "0.578835", "0.5786767", "0.57825667", "0.57805395", "0.5776631", "0.57742417", "0.5768741", "0.5767057", "0.57636213", "0.57539487", "0.5753323", "0.5746821", "0.5743059", "0.57308817", "0.5730675", "0.57245773" ]
0.6706827
7
/Store video category data form
public function storeVideocategory(Request $request) { $this->validate($request,array( 'categoryName' => 'required', )); $videoCategory = new VideoCategory; $videoCategory->video_category_name = $request->categoryName; $videoCategory->save(); if($videoCategory->save()){ return redirect()->back()->with('success','Video category Saved successfully.'); } else{ return redirect()->back()->with('denger-success','Video category is not saved.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(AddVideoRequest $request)\n {\n try{\n $videoFile = $request->file('video');\n $thumbnailFile = $request->file('thumbnail');\n $videoName = 'video_'.str_slug($request->input('title')).\".\".$videoFile->getClientOriginalExtension();\n $thumbnailName = 'thumbnail_'.str_slug($request->input('title')).\".\".$thumbnailFile->getClientOriginalExtension();\n $category = Category::find($request->input('category'));\n $tags = json_decode($request->input('tags'),true);\n\n if ($videoFile->move(public_path(\"uploads/videos/\"),$videoName) && $thumbnailFile->move(public_path(\"uploads/videos/\"),$thumbnailName)){\n $video = new Video();\n $video->title = ucfirst($request->input('title'));\n $video->subtitle = ucfirst($request->input('subtitle'));\n $video->description = ucfirst($request->input('description'));\n $video->duration = \"1:00\";\n $video->thumbnail = asset(\"uploads/videos/$thumbnailName\");\n $video->video = asset(\"uploads/videos/$videoName\");\n $video->user_id = Auth::id();\n $video->save();\n $video->categories()->attach($category->id);\n\n foreach ($tags as $key => $value) {\n $tagName = $tags[$key]['name'];\n //$tags = Tag::where('name','LIKE',\"%$name%\")->first();\n $tag = Tag::firstOrCreate(['name'=>$tagName]);\n $video->tags()->attach($tag->id);\n }\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was added successfully !!\");\n }\n return redirect()->back();\n } catch(\\Exception $e){\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not store the video\");\n\n if($video){\n $video->categories()->detach();\n $video->delete();\n }\n\n Log::warning(\"Can not upload Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n }", "public function store()\n {\n // Validate input\n $this->validate($this->request, [\n 'title' => 'required',\n 'description' => 'required',\n 'order_number' => 'required|integer|unique:videos',\n 'embed_code' => 'required',\n 'access_name' => 'required',\n ]);\n\n $this->video->create([\n 'title' => $this->request->input('title'),\n 'description' => $this->request->input('description'),\n 'order_number' => $this->request->input('order_number'),\n 'embed_code' => $this->request->input('embed_code'),\n 'slug' => str_slug($this->request->input('title'), '-'),\n 'access_name' => $this->request->input('access_name')\n ]);\n\n return redirect('videos/all')->withSuccessMessage('Video added');\n }", "public function store(Request $request)\n {\n $data['page_title'] = 'Content';\n $data['categories'] = Category::all()->sortBy('name');\n $data['languages'] = Settings::LANGUAGES;\n $data['genres'] = Settings::GENRES;\n\n $validationData = $request->validate(\n [\n 'category' => ['required'],\n 'name' => ['required', 'string', 'max:255'],\n //'videofile' => 'sometimes|nullable|mimes:mpeg,ogg,mp4,webm,3gp,mov,flv,avi,wmv,ts|max:' . config('constants.MAX_VIDEO_UPLOAD_SIZE'),\n 'file' => 'required|mimes:png,PNG,jpg,JPG,jpeg,JPEG|max:' . config('constants.MAX_FILE_UPLOAD_SIZE'),\n 'language' => ['required', 'string'],\n 'genres' => ['required', 'string'],\n 'artist' => ['required', 'string'],\n 'castandcrew' => ['required', 'string'],\n 'description' => ['required', 'string'],\n\n ]\n );\n if ($request->hasfile('file')) {\n $image = $request->file('file');\n $image_name = time() . '_' . $image->getClientOriginalName();\n //$image_path = $request->file('file')->storeAs('uploads', $image_name);\n $image_path = 'banner_images/' . $image_name;\n Storage::disk('s3')->put($image_path, file_get_contents($image));\n }\n $tags = ($request->tags) ? explode(',', $request->tags) : '';\n $display_tags = ($request->display_tags) ? explode(',', $request->display_tags) : '';\n\n $save_data = [\n 'category_id' => $request->category,\n 'name' => $request->name,\n 'banner_image' => $image_path,\n 'language' => $request->language,\n 'genres' => $request->genres,\n //'content_link' => ($video_path) ?? '',\n //'format' => ($video_extension) ?? '',\n 'tags' => json_encode($tags),\n 'display_tags' => json_encode($display_tags),\n 'client_id' => $this->client(),\n 'artist' => $request->artist,\n 'castandcrew' => $request->castandcrew,\n 'description' => $request->description,\n 'created_by' => Auth::id(),\n 'updated_by' => Auth::id(),\n ];\n //dd($save_data);\n $content = Content::create($save_data);\n if ($content) {\n return redirect('client/contents/view/' . $content->id)->with('success', \"Content Added Successfully.\");\n } else {\n return redirect('client/contents')->with('failure', \"Oops! Content Not added.\");\n }\n }", "public function videoCategory() {\n $this->loadModel('VideoCategories');\n $data = $this->VideoCategories->find('all');\n $this->paginate = [ ];\n $videoCategories = $this->paginate($data);\n\n $this->set(compact('videoCategories'));\n \n }", "public function add() {\n if ($this->GdataAuth->isAuthorized()) {\n if (!empty($this->data)) {\n $this->YouTubeVideo->set($this->data);\n if ($this->YouTubeVideo->validates() && $this->YouTubeVideo->save($this->data)) {\n $this->Session->setFlash('It worked!');\n $this->redirect(array());\n }\n }\n // Set official you tube categories and access control options to populate\n // form fields\n $this->set('categories', $this->YouTubeVideo->categories());\n foreach ($this->YouTubeVideo->accessControls as $accessControl => $options) {\n $this->set(Inflector::pluralize($accessControl), array_combine($options, $options));\n }\n }\n }", "public function create()\n {\n $categories = Category::all()->pluck('name','id');\n \n return view('admin.video.create', compact('categories'));\n }", "function save_video_post( $post_id, $post ) {\n if ( 'publish' === $post->post_status && $post->post_type === 'video' ) {\n $defaults = array(\n 'video_category' => array( 'fitness' )\n );\n $taxonomies = get_object_taxonomies( $post->post_type );\n foreach ( (array) $taxonomies as $taxonomy ) {\n $terms = wp_get_post_terms( $post_id, $taxonomy );\n if ( empty( $terms ) && array_key_exists( $taxonomy, $defaults ) ) {\n wp_set_object_terms( $post_id, $defaults[$taxonomy], $taxonomy );\n }\n }\n }\n}", "public function store(Request $request)\n {\n //\n $request->validate([\n 'input_videoName',\n 'input_category',\n 'input_videoDescription',\n 'input_videoFile',\n 'input_videoThumbnail',\n ]);\n\n $input = $request->all();\n\n $input['input_videoThumbnail'] = \"defaultCategory.png\";\n\n if ($file = $request->file('input_videoFile')) {\n\n if ($thumbNail_file = $request->file('input_videoThumbnail')) {\n $destinationPath = 'image/';\n $thumbNail = date('YmdHis') . \".\" . $thumbNail_file->getClientOriginalExtension();\n $thumbNail_file->move($destinationPath, $thumbNail);\n $input['input_videoThumbnail'] = \"$thumbNail\";\n }\n\n $destinationPath = 'videos/';\n $videoFile = date('YmdHis') . \".\" . $file->getClientOriginalExtension();\n $file->move($destinationPath, $videoFile);\n $input['input_videoFile'] = \"$videoFile\";\n\n Video::create([\n 'videoName' => $input['input_videoName'],\n 'videoDescription' => $input['input_videoDescription'],\n 'videoFile' => $input['input_videoFile'],\n 'image' => $input['input_videoThumbnail'],\n 'categoryID' => $input['input_category']\n ]);\n }\n }", "function linkVideo(){\n \n $vid = uniqid();\n $ar = array('id' => $vid, 'web_id' => WEB_ID, 'video_url' => $_POST['vurl'], 'video_name' => $_POST['name'], 'video_disc' => $_POST['disc'], 'type' => 'YouTube', 'category'=>$_POST['cats']);\n \n $this->db->insert('video_library', $ar);\n \n \n }", "public function store()\n\t{\n\t\t$img = $this->save_file(Input::file('thumbnail'), 60, 25, 'categories');\n\t\t//滚动图像\n\t\t$slides = array();\n\t\tif(Input::hasFile('slides')){\n\t\t\tforeach(Input::file('slides') as $file){\n\t\t\t\t$slides[] = $this->save_file($file, 50, 14, 'categories');\n\t\t\t}\n\t\t}\n\t\t$slide = serialize($slides);\n\n\t\t$inputs = Input::except('thumbnail', 'slides');\n\t\t$inputs['thumbnail'] = $img;\n\t\t$inputs['slides'] = $slide;\n\n\t\t$category = Category::create($inputs);\n if ( !$category->errors()->all() )\n {\n return Redirect::route('admin.categories.index')\n ->with('success', Lang::get('cpanel::common.create_success'));\n }\n\n return Redirect::back()\n ->withInput()\n ->withErrors($category->errors());\n\t}", "function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (function_exists('return_i18n_languages')) {\n\t\tforeach(return_i18n_languages() as $lang) {\n\t\t\tif ($lang != return_i18n_default_language()) {\n\t\t\t\t$arr['name_'.$lang] = safe_slash_html($_POST['category-name_'.$lang]);\n\t\t\t}\n\t\t}\n\t}\n\t$categories = lm_get_categories();\n\tif (isset($id))\n\t\t$categories[$id] = $arr;\n\telse\n\t\t$categories[] = $arr;\n\tif (lm_c_to_xml($categories))\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/SUCCESS_SAVE'), true, false, true);\n\telse\n\t\tlm_display_message(i18n_r(LM_PLUGIN.'/ERROR_SAVE'), false);\n}", "public function addVideo(){\n if (isset($_POST[\"add_video\"])) {\n $movie = $this->model('Movie');\n $system = $this->model('System');\n\n $video_name = $_POST[\"video_title\"];\n $video_url = $_POST[\"video_url\"];\n $video_category = $_POST[\"selected_category\"];\n $video_description = $_POST[\"video_description\"];\n $video_sef_url = $system->seflink($video_name);\n\n $movie->addVideo($video_name,$video_url,$video_category,$video_description,$video_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/videos');\n }", "public function addVideo()\n {\n $getAllVideoCategory = VideoCategory::all();\n return view('admin.addvideo')->with('videoCategory',$getAllVideoCategory);\n }", "public function store(Request $request)\n {\n // dd($output);\n $validator = Validator::make(\n $request->all(), \n [\n 'title' => 'required', ],\n [\n 'title.required' => 'メールアドレスが間違っています。',\n ]\n );\n if(strtotime($request->start_date) > strtotime($request->end_date)) {\n $validator->after(function ($validator) {\n $validator->errors()->add('end_date.format', '終了日が開始日より大きい');\n });\n }\n if ($validator->fails()) {\n return redirect(route('push.videos.create'))\n ->withErrors($validator)\n ->withInput();\n }\n\n $data = $request->all();\n // dd($data);\n unset($data['_token']);\n unset($data['thumbnail']);\n unset($data['thumbnail_detail']);\n unset($data['video_create']);\n unset($data['banner']);\n unset($data['slider']);\n if(@$data['related'][0]) {\n $data['related_videos_1'] = @$data['related'][0];\n }\n if(@$data['related'][1]) {\n $data['related_videos_2'] = @$data['related'][1];\n }\n if(@$data['related'][2]) {\n $data['related_videos_3'] = @$data['related'][2];\n }\n // $data['type'] = 1;\n unset($data['related']);\n // dd($data);\n $rs = Video::insertGetId($data);\n // $catehhs = ChannelCategory::where('channel_id',$request->channel_id)->get();\n // $client = new SocketIO('visoftech.com', 9001);\n // $client->setQueryParams([\n // 'token' => 'edihsudshuz',\n // 'id' => '8780',\n // 'cid' => '344',\n // 'cmp' => 2339\n // ]);\n // foreach ($catehhs as $key => $value) {\n // $association[] = $value->category_id;\n // }\n // $data[\"statusCode\"] = 0;\n // $data[\"message\"] = \"\"; \n // $data[\"data\"] = [\n // 'type' => 0,\n // 'association' => $association,\n // ];\n // $rsu = json_encode($data);\n // $success = $client->emit('notify', $rsu);\n if($rs) {\n if($request->thumbnail){\n $path = '/storage/app/'.@$request->file('thumbnail')->store('TVpro/images');\n $vd = Video::find($rs);\n $vd->thumbnail = $path;\n $vd->save();\n }\n if($request->thumbnail_detail){\n $path = '/storage/app/'.@$request->file('thumbnail_detail')->store('TVpro/images');\n $vd = Video::find($rs);\n $vd->thumbnail_detail = $path;\n $vd->save();\n }\n if($request->banner){\n $path = '/storage/app/'.@$request->file('banner')->store('TVpro/images');\n $vd = Video::find($rs);\n $vd->banner = $path;\n $vd->save();\n }\n if($request->video_create){\n $partvd = $request->video_create->path();\n // dd($partvd);\n $folder = md5(date('Y-m-d H:i:s:u'));\n $store_p = 'TVpro/videos/'.$folder.'/';\n\n $path_up = '/storage/app/'.@$request->file('video_create')->store($store_p);\n $path = '/storage/app/TVpro/videos/'.$folder.'/playlist.m3u8';\n $video = str_replace('/storage/app/TVpro/videos/'.$folder.'/', '' , $path_up);\n $video = str_replace('/', '' , $video);\n $video = str_replace($folder, '' , $video);\n // \n $cd = '/var/www/html/storage/app/'.$store_p;\n chmod($cd, 0777);\n\n $command = 'cd '.$cd.' ; /usr/local/bin/bin/ffmpeg -y -i '.$video.' -r 25 -g 25 -c:a libfdk_aac -b:a 128k -c:v libx264 -preset veryfast -b:v 1600k -maxrate 1600k -bufsize 800k -s 640x360 -c:a libfdk_aac -vbsf h264_mp4toannexb -flags -global_header -f ssegment -segment_list playlist.m3u8 -segment_list_flags +live-cache -segment_time 5 output-%04d.ts; sudo chmod -R 777 '.$cd.'; rm '.$cd.$video;\n exec($command.\" 2>&1\", $output);\n\n $vd = Video::find($rs);\n $vd->video = $path;\n $vd->save();\n\n }\n if($request->pdf){\n $path = '/storage/app/'.@$request->file('pdf')->store('TVpro/pdf');\n $vd = Video::find($rs);\n $vd->pdf = $path;\n $vd->save();\n }\n if($request->slider){\n foreach (@$request->slider as $key => $image) {\n $image = '/storage/app/'.$image->store('TVpro/images');\n Slider::insert([\n 'video_id'=>$rs,\n 'image'=>$image\n ]);\n }\n }\n $nofis = Video::find($rs);\n $hiephoi = ChannelCategory::where('channel_id', $nofis->channel_id)->pluck('category_id');\n // foreach ($hiephoi as $keyhh => $valuehh) {\n // # code...\n // }\n $title = 'マイチャンネルに新たなコンテンツが追加されました。';\n $body = $nofis->title;\n $push_data = [\n 'title' => $title,\n 'body' => $body,\n 'type' => 2,\n 'association_id' => $hiephoi,\n 'video_id' => $nofis->id,\n 'content_type' => $nofis->type,\n 'thumbnail_detail' => $nofis->thumbnail_detail\n ];\n\n $users = User::with(['devices'])\n ->whereHas('mypage_channel', function($qr)use($data){\n $qr->where('channel_id', $data['channel_id']);\n })\n ->has('devices')\n ->get();\n\n if(count($users)) {\n foreach ($users as $key => $value) {\n if($value->content) {\n $content_p = json_decode($value->content);\n }else{\n $content_p = [];\n }\n if (array_search($nofis->id, $content_p) == false && array_search($nofis->id, $content_p) !== 0) {\n $content_p[] = $nofis->id;\n }\n \n $datacontent = ['content'=>json_encode(array_merge($content_p))];\n User::where('id', $value->id)->update($datacontent);\n\n foreach ($value->devices as $keyd => $valued) {\n foreach ($hiephoi as $keyhh => $valuehh) {\n $push_data['association_id'] = $valuehh;\n notification_push($valued->token, $title, $push_data, $body);\n }\n \n }\n }\n }\n\n return redirect(route('push.videos.index'));\n }else{\n return back();\n }\n }", "public function store(ContentCreateRequest $request, $category_id)\n {\n $newContent = $request->except(array('_token','checkVideo'));\n $content = new Content();\n $newContent['category_id']=$category_id;\n if (!$request->input('checkVideo') == 'on'){\n $newContent['video'] = null;\n }\n $content = Content::create($newContent);\n\n return redirect()\n ->route('teacher.{category}.content.index', $category_id)\n ->withSuccess('Шинэ агуулга амжилттай нэмэгдлээ.');\n }", "function upload_metas(){\r\n\t\r\n\t\t$cat_id \t\t\t= clean_input($_POST['cat_id']);\r\n\t\t$cat_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_keywords \t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_descriptions \t= clean_input($_POST['cat_meta_description']);\r\n\t\t\r\n\t\tif(isset($_POST['upload'])){\r\n\t\t\r\n\t\t$query = \"INSERT INTO categories WHERE cat_id ='$cat_id' \";\r\n\t\t$result = mysql_query($query) or die(mysql_error());\r\n\t\t\r\n\t\treturn $result;\r\n\t\t}\r\n\t}", "function videoCategoryInsert($category, $idVideo, $connection)\n{\n $query_category = \"INSERT INTO video_con_category (id_category, id_video) VALUES\";\n for ($i = 0; $i < count($category); $i++) {\n $query_category .= \" ('$category[$i]', '$idVideo'),\";\n }\n $query_category = rtrim($query_category, ',');\n $result_category = mysqli_query($connection, $query_category);\n}", "public function store(Request $request)\n {\n $data = $request->validate([\n 'name' => 'required',\n ]);\n\n VideoCategory::create($data);\n\n return back()->with('success', 'تمت الاضافة بنجاح');\n }", "public function store(Request $request)\n {\n $thumbnail = 'http://img.youtube.com/vi/' . $request->thumbnail . '/mqdefault.jpg';\n //dd($thumbnail);\n $datas = new Video();\n $datas->video_title = $request->title;\n $datas->user_id = Auth::user()->id;\n $datas->id_category = $request->category;\n $datas->video_url = $request->urlnew;\n $datas->content = $request->area;\n $datas->key = $request->thumbnail;\n $datas->thumbnail = $thumbnail;\n\n $datas->save();\n\n return redirect()->route('video.index')->withErrors(['success' => 'Success create Video']);\n\n }", "public function store() {\n\t\t$post = new Post;\n\t\t$post->title = Input::get('title');\n\t\t$post->body = Input::get('body');\n\t\t$post->save();\n\n\t\t$post->category()->sync([\n\t\t\tInput::get('category_id'), $post->post_id\n\t\t]);\n\t}", "public function create()\n {\n $categories = Category::where('status',1)->orderBy('name')->get();\n //dd($categories->toArray());\n return view('adminCMS.videos.addVideo',compact('categories'));\n }", "public function storeCategory()\n {\n $this->validate([\n 'name' =>'required',\n 'slug' =>'required|unique:categories'\n ]);\n $category = new Category();\n $category->name = $this->name; \n $category->slug = $this->slug;\n $category->save();\n $this->dispatchBrowserEvent('success');\n //$this->emit('alert', ['type' =>'success', 'message' => 'Operation Successful']);\n //session()->flash('message', 'Category has been saved successfully');\n //$this->dispatchBrowserEvent('hide-form', ['message' => 'Category Added Successfully']);\n }", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "public function postVideo(){\r\n if(!$this->hasLoginCheck())\r\n return;\r\n $blogItem = new BlogItemModel();\r\n $video_url=$_POST['video_url'];\r\n $video_img_path=$_POST['video_img_path'];\r\n $title=$_POST['video_title'];\r\n $desc=$_POST['content'];\r\n $embed_value=$_POST['video_embed_value'];\r\n $tag=$_POST['tag'];\r\n $blogItem->addVideo($video_url,$video_img_path,$title,$desc,$tag,$embed_value);\r\n echo json_encode(array('status'=>'true'));\r\n }", "function addvideo($name, $category, $length)\n\t{\n\t\t$obj = new clsdbaccess();\n\t\t$mysqli = $obj->db_connect();\n\t\t$result ='';\n\n\t\tif(!($stmt = $mysqli->prepare(\"INSERT INTO videoinventory (name, category, length) VALUES (?,?,?)\"))){\n\t\t\techo \"Prepare failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\n\t\tif(!($stmt->bind_param(\"ssi\", $name, $category, $length))){\n\t\t\techo \"Bind failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\n\t\tif(!$stmt->execute()) {\n\t\t\t$result = \"Execute failed: \" . $mysqli->error;\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$result='success';\n\t\t}\t\t\n\t\t$stmt->close();\t\n\t\treturn $result;\n\t}", "public function store(Request $request)\n { \n\n $request->validate([\n 'name' => 'required'\n ]);\n\n $url_video = $request->url_video;\n\n $url_video_array = explode(\"/\", $url_video);\n\n if(Str::contains($url_video, 'youtube')) {\n $url_video_id = $url_video_array[4];\n $url_thumbail = 'https://img.youtube.com/vi/'.$url_video_id.'/0.jpg';\n } \n\n if(Str::contains($url_video, 'vimeo')) {\n $url_video_id = $url_video_array[4];\n $hash = unserialize(file_get_contents(\"https://vimeo.com/api/v2/video/\".$url_video_id.\".php\"));\n $url_thumbail_preview = $hash[0]['thumbnail_large'];\n $url_thumbail = substr_replace( $url_thumbail_preview, \"480x360\", -3);\n } \n\n $video = Video::create([\n\n 'name' => $request->name,\n 'date_public' => $request->date_public,\n 'status' => $request->status,\n 'category_id' => $request->category_id,\n 'url_video' => $url_video,\n 'url_thumbail' => $url_thumbail\n ]);\n\n return redirect()->route('admin.videos.edit', $video)->with('info', 'El video se creó con éxito');\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|max:237|min:230',\n 'category' => 'required',\n 'url' => 'required'\n ]);\n\n $youtube_id = $this->video->getYoutubeEmbedUrl($request->url);\n\n if ($youtube_id == 'error') {\n $error = ['warning'=> 'That url is so wrong! It has to be a valid youtube video link'];\n return redirect()->back()->withErrors($error);\n }\n\n $url = 'http://www.youtube.com/embed/' . $youtube_id . '?autoplay=0';\n\n\n $data = $request->all();\n $data['user_id'] = Auth::user()->id;\n $data['category_id'] = $request->category;\n $data['url'] = $url;\n\n $this->video->create($data);\n $videoUrl = url() . \"/videos/\" . str_replace(\" \", \"-\", $request->title);\n\n return redirect()->back()->with('status', $videoUrl);\n }", "public function save_video( $post_id ) {\n if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n /*\n If autosaving, do nothing\n */\n return;\n }\n if( !isset( $_POST['videoid'] ) || !isset ( $_POST['provider']) || !wp_verify_nonce( $_REQUEST['video_meta_box'], 'video_meta_save' ) ) {\n /*\n If the video ID and provider isn't selected, or the wp_kses is faked, get out\n */\n return;\n }\n if( !current_user_can( 'edit_post' ) ) {\n /*\n If you can't edit a post, get the hell out\n */\n return;\n }\n\n /*\n Update video ID\n */\n $videoid = wp_kses( $_POST['videoid'], '');\n update_post_meta( $post_id, 'videoid', $videoid, '' );\n\n /*\n Update video provider\n */\n $provider = wp_kses ($_POST['provider'], '');\n update_post_meta( $post_id, 'provider', $provider, '');\n\n /*\n Season and Episode database insertion\n */\n $season = wp_kses($_POST['season'], '');\n update_post_meta($post_id, 'season', $season, '');\n\n $episode = wp_kses($_POST['episode'], '');\n update_post_meta($post_id, 'episode', $episode, '');\n /*\n Define Video type name to be inserted into database\n */\n $video_category = wp_kses($_POST['video_category'], '');\n $term = get_term_by('name', $video_category, 'video_category');\n\n if( !empty($term) && !is_wp_error( $term ) ) {\n wp_set_object_terms( $post_id, $term->term_id, 'video_category', false);\n }\n\n /*\n If there is no Featured Image, grab it from youtube\n */\n if( !has_post_thumbnail($post_id)) {\n if($provider == 'youtube') {\n $this->Generate_Featured_Image( $this->fetch_youtube_thumbnail($videoid), $post_id );\n }\n if($provider == 'vimeo') {\n $this->Generate_Featured_Image( $this->fetch_vimeo_thumbnail($videoid), $post_id );\n }\n }\n }", "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpdb->insert_id;\n\t\t} else\n\t\t\t$wpdb->update(FAQBUILDDBCATEGORY,$this->toArray(true),array(\"category_id\"=>$this->category_id),$types,array(\"%d\"));\n\t}", "public function create()\n {\n return view('adminVideo.category.create');\n }", "public function create()\n {\n //\n\n $categories = DB::table('categories')->Select('categoryID', 'categoryName')->paginate();\n\n return view('video.addVideo', compact('categories'));\n }", "public function store() {\n if ($id = Input::get('id')) {\n $category = Category::find($id);\n } else {\n $category = new Category();\n }\n\n $inputs = Input::only(['type', 'parent_id', 'name', 'description',\n 'slug', 'keywords', 'order', 'status', 'template']);\n $rules = [\n 'type' => 'in:subject,application,product',\n 'name' => 'required|min:1',\n 'order' => 'required|numeric',\n ];\n\n $validator = Validator::make($inputs, $rules);\n $validator->sometimes('slug', 'unique:categories,slug', function() use($inputs, $category) {\n return !empty($inputs['slug']) && ($category->slug != $inputs['slug']);\n });\n //todo: 循环继承的问题解决思路\n //在数据库存一个layer的字段,标明改分类的层级,p_id=0的为1层\n //递归n次得到p_id=0则为n层\n //最后对比大小禁止循环继承\n if ($validator->fails()) {\n $messages = $validator->messages()->toArray();\n return $this->msg($messages, 1);\n }\n\n $category->fill($inputs);\n $category->save();\n\n return $this->msg('success', 0);\n }", "public function store()\n {\n $categories = Category::all();\n\n $subcategory = new Subcategory;\n $subcategory->name = request('name');\n foreach($categories as $category){\n if($category->name == request('cat')){\n $subcategory->categories_id = $category->id;\n }\n }\n $subcategory->save();\n\n return redirect('/cms/categories')->with('success', 'Subcategory was added succesfully');\n }", "public function store(Request $request)\n {\n $data = $request->except('_token', 'category_id');\n $data['user_id'] = auth()->user()->id;\n $data['image'] = Storage::put('public/images', $request->image);\n $data['image'] = str_replace('public', 'storage', $data['image']);\n $film = Film::create($data);\n $film->categories()->attach($request->category_id);\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n\n try{\n\n $video = Video::find($id);\n\n $video->title = $request->input('title');\n $video->subtitle = $request->input('subtitle');\n $video->description = $request->input('description');\n $category = Category::find($request->input('category'));\n $tags = json_decode($request->input('tags'),true);\n $video->tags()->detach(); //we need time to attach again this is why this line is here and not inmeduatly bedore attach tags\n $video->categories()->detach();\n if($request->hasFile('thumbnail')){\n $thumbnailFile = $request->file('thumbnail');\n $thumbnailName = 'thumbnail_'.str_slug($request->input('title')).\".\".$thumbnailFile->getClientOriginalExtension();\n $thumbnailFile->move(public_path(\"uploads/videos/\"),$thumbnailName);\n $video->thumbnail = asset(\"uploads/videos/$thumbnailName\");\n }\n if($request->hasFile('video')){\n $videoFile = $request->file('video');\n $videoName = 'video_'.str_slug($request->input('title')).\".\".$videoFile->getClientOriginalExtension();\n $videoFile->move(public_path(\"uploads/videos/\"),$videoName);\n $video->video = asset(\"uploads/videos/$videoName\");\n\n }\n $video->categories()->attach($category->id);\n foreach ($tags as $key => $value) {\n $tagName = $tags[$key]['name'];\n //$tags = Tag::where('name','LIKE',\"%$name%\")->first();\n $tag = Tag::firstOrCreate(['name'=>$tagName]);\n\n $video->tags()->attach($tag->id);\n }\n $video->save();\n\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was updated successfully !!\");\n return redirect()->back();\n\n } catch(\\Exception $e){\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not update the video\");\n Log::warning(\"Can not update Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n\n }", "public function store(Request $request)\n {\n $dataArr = $request->all();\n \n $this->validate($request,[ \n 'cate_id' => 'required', \n 'title' => 'required', \n 'slug' => 'required',\n ],\n [ \n 'cate_id.required' => 'Please choose category', \n 'title.required' => 'Please input title',\n 'slug.required' => 'Please input slug' \n ]); \n \n $dataArr['alias'] = Helper::stripUnicode($dataArr['title']); \n \n $dataArr['created_user'] = Auth::user()->id;\n\n $dataArr['updated_user'] = Auth::user()->id;\n $dataArr['type'] = 1;\n $dataArr['is_hot'] = isset($dataArr['is_hot']) ? 1 : 0; \n $dataArr['is_gg'] = isset($dataArr['is_gg']) ? 1 : 0;\n if($dataArr['is_gg'] == 1){\n $dataArr['encode_link'] = Helper::encodeLink($dataArr['video_url']); \n }\n \n $rs = Articles::create($dataArr);\n\n $object_id = $rs->id;\n\n $this->storeMeta( $object_id, 0, $dataArr);\n // xu ly tags\n if( !empty( $dataArr['tags'] ) && $object_id ){\n \n\n foreach ($dataArr['tags'] as $tag_id) {\n $model = new TagObjects;\n $model->object_id = $object_id;\n $model->tag_id = $tag_id;\n $model->type = 1;\n $model->save();\n }\n }\n\n Session::flash('message', 'Success.');\n\n return redirect()->route('articles.index',['cate_id' => $dataArr['cate_id']]);\n }", "public function store(){\n $query = require 'core/bootstrap.php';\n \n $category = $_POST['category'];\n if(empty($category)){\n Validate::errorValidation('Category\\'s name is required!');\n return back();\n }elseif(strlen($category) < 3){\n Validate::errorValidation('Category\\'s name must have up to 3 characters');\n return back();\n }else{\n\n $query->insert('categories',[\n 'name' => $category\n ]);\n \n Validate::successValidation('Category stored successfully!!!');\n return redirect('categories');\n }\n }", "public function create()\n { \n\n $categories = Category::pluck('name', 'id');\n\n return view('admin.videos.create', compact('categories'));\n }", "public function store(Request $request)\n {\n if ($request->type==\"features\") {\n $validatedData = $request->validate([\n 'title_ar' => 'required|max:100',\n 'title_en' => 'required|max:100',\n 'description_ar' => 'required|max:200',\n 'description_en' => 'required|max:200',\n 'file' => 'required|image|max:1000',\n ]);\n if(isset($request->title_ar) || isset($request->title_en)){\n $title = json_encode([\n 'ar' => $request->title_ar,\n 'en' => $request->title_en,\n ]);\n }\n if(isset($request->title_ar) || isset($request->title_en)){\n $slug = json_encode([\n 'ar' => Str::slug($request->title_ar),\n 'en' => Str::slug($request->title_en),\n ]);\n }\n\n if ($request->file) {\n $fileName = time().'.'.$request->file->extension();\n $request->file->move('uploads/1/'.date('Y/m/'), $fileName);\n $fileName='uploads/1/'.date('Y/m/').$fileName;\n }\n\n $category=new Category;\n $category->type=\"features\";\n $category->name=$title;\n $category->slug=$slug;\n $category->is_admin=1;\n $category->user_id=Auth::id();\n $category->save();\n\n $meta=new Categorymeta;\n $meta->category_id =$category->id;\n $meta->type =\"preview\";\n $meta->content =$fileName;\n $meta->save();\n\n $meta=new Categorymeta;\n $meta->category_id =$category->id;\n $meta->type =\"excerpt\";\n $meta->content =$request->description;\n $meta->save();\n\n// return response()->json(['Features Created']);\n return response()->json([trans('success')]);\n }\n\n if ($request->type==\"widget\") {\n $validatedData = $request->validate([\n 'title_ar' => 'required|max:100',\n 'title_en' => 'required|max:100',\n 'count' => 'required|max:100',\n 'file' => 'required|image|max:1000',\n ]);\n if(isset($request->title_ar) || isset($request->title_en)){\n $title = json_encode([\n 'ar' => $request->title_ar,\n 'en' => $request->title_en,\n ]);\n }\n\n if ($request->file) {\n $fileName = time().'.'.$request->file->extension();\n $request->file->move('uploads/1/'.date('Y/m/'), $fileName);\n $fileName='uploads/1/'.date('Y/m/').$fileName;\n }\n\n $category=new Category;\n $category->type=\"widget\";\n $category->name=$title;\n $category->slug=$request->count;\n $category->is_admin=1;\n $category->user_id=Auth::id();\n $category->save();\n\n $meta=new Categorymeta;\n $meta->category_id =$category->id;\n $meta->type =\"preview\";\n $meta->content =$fileName;\n $meta->save();\n\n// return response()->json(['Widget Created']);\n return response()->json([trans('success')]);\n }\n\n if ($request->type==\"testimonial\") {\n\n if(isset($request->name_ar) || isset($request->name_en)){\n $name = json_encode([\n 'ar' => $request->name_ar,\n 'en' => $request->name_en,\n ]);\n }\n if(isset($request->position_ar) || isset($request->position_en)){\n $position = json_encode([\n 'ar' => $request->position_ar,\n 'en' => $request->position_en,\n ]);\n }\n\n $category=new Category;\n $category->type=\"testimonial\";\n $category->name=$name;\n $category->slug=$position;\n $category->is_admin=1;\n $category->user_id=Auth::id();\n $category->save();\n\n\n\n $meta=new Categorymeta;\n $meta->category_id =$category->id;\n $meta->type =\"excerpt\";\n $meta->content =$request->feedback;\n $meta->save();\n\n\n// return response()->json(['Testimonial Created']);\n return response()->json([trans('success')]);\n }\n\n if ($request->type==\"brand\") {\n $validatedData = $request->validate([\n 'name_ar' => 'required|max:100',\n 'name_en' => 'required|max:100',\n 'file' => 'required|image|max:1000',\n ]);\n\n if ($request->file) {\n $fileName = time().'.'.$request->file->extension();\n $request->file->move('uploads/1/'.date('Y/m/'), $fileName);\n $fileName='uploads/1/'.date('Y/m/').$fileName;\n }\n\n if(isset($request->name_ar) || isset($request->name_en)){\n $name = json_encode([\n 'ar' => $request->name_ar,\n 'en' => $request->name_en,\n ]);\n }\n\n $category=new Category;\n $category->type=\"brand\";\n $category->name=$name;\n $category->is_admin=1;\n $category->user_id=Auth::id();\n $category->save();\n\n $meta=new Categorymeta;\n $meta->category_id =$category->id;\n $meta->type =\"preview\";\n $meta->content =$fileName;\n $meta->save();\n\n// return response()->json(['Brand Created']);\n return response()->json([trans('success')]);\n }\n }", "public function create()\n\t{\n\t\t$compact = [];\n\n\t\t$categories = Category::with('child')->find(1);\n\t\t$compact[] = 'categories';\n\n\t\treturn view('admin.video.create')->with(compact($compact));\n\t}", "public function store()\n {\n $validation = Validator::make([\n 'videoURL' => request('title'),\n 'votes' => '1'\n ],[\n 'videoURL' => 'required',\n 'votes' => 'required|numeric'\n ]);\n\n\n if($validation->passes()){\n DB::table('videos')->insert([\n 'videoURL' => request('title'),\n 'votes' => '1'\n ]);\n\n return redirect('/videos')\n ->with('successStatus', 'Video was added successfully!');\n }\n else{\n return redirect('/videos/new')\n ->withErrors($validation);\n }\n\n\n }", "public function store(Request $request)\n {\n\n $data = new Video;\n\n $data->title = $request->title;\n $data->description = $request->description;\n\n if ($request->file('file')) {\n // file => video\n $file = $request->file('file');\n $fileName = time() . '.' . $file->getClientOriginalExtension();\n $result = $request->file->move('storage/', $fileName);\n $data->file = $fileName;\n }\n $data->save();\n DB::table('group_videos')->insert([\n 'video_id' => $data->id,\n 'group_id' => $request->group,\n ]);\n\n // DB::insert('insert into group_videos (group_id, video_id)\n // values (?, ?)', [6, 6]);\n\n return redirect()->back();\n }", "protected function saveCategoryFromCategory($form){\n $data = $this->getRequest()->getPost();\n //@todo: validate the data\n $form->setData($data);\n if ($form->isValid()) {\n \n $this->category->exchangeArray($form->getData());\n $categoryTable = $this->getServiceLocator()->get(\"Category\\Model\\CategoryTable\");\n $this->category = $categoryTable->saveCategory($this->category);\n \n if($id = $this->category->getId()){\n $this->redirect()->toRoute('category_home');\n }\n }else{\n \n }\n }", "public function store(VideoRequest $request)\n\t{\t\n\t\t$resource = new Resource;\n //dump($request->all());\n\t\t$category_id = $request->input('category_id');//栏目\n $title = rtrim($request->input('title'));//标题\n $content = rtrim($request->input('content'));//内容\n\t\t$path = rtrim($request->input('path'));//视频存放路径\n\t\t$duration = rtrim($request->input('duration'));//视频时长\n\t\t$author = rtrim($request->input('author'));//作者\n $size = $request->input('size');//视频大小\n\t\t\n\t\t//视频,封面公共名字部分\n $name = time().$this->nrand();\n\n //创建文件夹用来存放上传文件\n $dirname = date('Y-m-d' , time());\n if(!is_dir(base_path('public/uploads/videos/'.$dirname))) {\n mkdir(base_path('public/uploads/videos/'.$dirname,0777));\n }\n\n //获取图片\n $cover = $request->file('cover');\n\t\t\n\t\t//$size = $cover->getClientSize();//视频大小\n \n\t\tif($cover->isValid()) {\n //dd($cover->getMimeType());\n switch($cover->getMimeType()){\n case 'image/jpeg':\n $ext = '.jpeg';\n break;\n case 'image/jpg':\n $ext = '.jpg';\n break;\n case 'image/png':\n $ext = '.png';\n break;\n default:\n return back()->withInput()->with('notify_error' , '图片类型不符!');\n }\n $name_cover = $name.$ext;\n\n $cover->move(base_path('public/uploads/videos/'.$dirname) , $name_cover);\n $resource->cover = '/uploads/videos/'.$dirname.'/'.$name_cover;\n }\n\t\t\n $resource->title = $title;\n $resource->content = $content;\n\t\t$resource->path = $path;\n\t\t$resource->duration = $duration;\n\t\t$resource->size = $size;\n\t\t$resource->category_id = $category_id;\n\t\t$resource->type_id = 1;\n\t\t$resource->user_id = Auth::user()->id;\n\t\t$resource->author = $author;\n\t\t\n\t\tif(!$resource->save()) {\n\t\t\treturn back()->withInput()->with('notify_error' , '添加失败!');\n\t\t}\n\t\t\n\t\t$id = Resource::where('path' , $path)->first()->id;\n\t\t\n\t\t//这里是添加提示消息\n\t\t$this->record('create',$id,1);\n\t\t\n\t\treturn redirect('donkey/admin/video/index')->with('notify_success' , '添加成功!');\n \n //获取视频文件\n\n\t}", "public function create_video() {\n $args = array (\n 'labels' => array(\n 'name' => __( 'Videos' ),\n 'singular_name' => __( 'Videos' ),\n 'add_new' => __( 'Add Video' ),\n 'add_new_item' => __( 'Add New Video' ),\n 'edit_item' => __( 'Edit Video' ),\n 'new_item' => __( 'Add New Video' ),\n 'view_item' => __( 'View Video' ),\n 'search_items' => __( 'Search Videos' ),\n 'not_found' => __( 'No Videos Found' ),\n 'not_found_in_trash' => __( 'No Videos found in trash. ' )\n\t ),\n 'has_archive' => true,\n 'menu_icon' => 'dashicons-format-video',\n 'public' => true,\n 'show_ui' => true,\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'rewrite' => true,\n 'menu_position' => 20,\n 'supports' => array('title', 'thumbnail', 'editor'),\n );\n register_post_type('video', $args);\n }", "public function actionCreate()\n {\n $model = new Video();\n \n $post = Yii::$app->request->post();\n if ($post) { \n// $file = UploadedFile::getInstance($model, 'file'); \n// $path = Yii::$app->basePath. \"/../frontend/web/\";\n// $filePath = Yii::$app->basePath. \"/../frontend/web/videos/\";\n \n// if ($file) {\n// $filename = \"videos/\" . time() . rand(1,1000) . '.' . $file->getExtension();\n// $path = $path . $filename;\n \n// if(!file_exists($filePath)){\n// mkdir($filePath);\n// }\n// $file->saveAs($path);\n $url = $path = Yii::$app->params['uploadsUrl'].$post['Video']['video'];\n $header_array = get_headers($url, true);\n $size = $header_array['Content-Length']; \n \n $post['Video']['video'] = $post['Video']['video'];\n $post['Video']['filesize'] = $size;\n $post['Video']['ext'] = explode('.', basename($post['Video']['video']))[1];\n $post['Video']['is_complete'] = '1';\n $post['Video']['product_id'] = empty($post['Video']['product_id']) ? '' : join(',', $post['Video']['product_id']);\n// }\n\n if ($model->load($post) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(StoreCategoryRequest $request)\n {\n $data = $request->all();\n // Make image\n if ($request->hasFile('image')) {\n $upload = $request->file('image');\n if (!$upload->isValid())\n return redirect()->back()->withErrors(['Việc upload ảnh đại diện thất bại, vui lòng thử lại sau.'])->withInput();\n $ext = $upload->getClientOriginalExtension();\n $newFile = str_slug($request->get('title_alias')) . '-' . time() . '.' . $ext;\n $location = public_path('upload/' . with($this->category->getImageFolder()));\n $upload->move($location, $newFile);\n $data['image'] = $newFile;\n }\n // Insert data into database\n $category = $this->category->create($data);\n\n event(new CreatedContentEvent( 'Category', $request, $category ));\n\n $moving_method = $request->input('moving_method');\n // Get parent category info\n if ($request->has('related_id')) {\n $parent = $this->category->find($request->input('related_id'));\n }\n if (isset($parent)) {\n if ($parent)\n $category->$moving_method($parent);\n }\n if ($request->get('submit') == 'save') {\n return redirect()->route('admin::categories.indexSpec', [$request->component])->with('status', trans('notices.create_success_message'));\n } else {\n return redirect()->route('admin::categories.edit', $category->id)->with('status', trans('notices.create_success_message'));\n }\n }", "public function store()\n {\n $this->validate(request(),[\n 'categoryname' => 'required',\n 'description' => 'max:200'\n ]);\n\n $cateName=strtolower(trim(request('categoryname')));\n $testCate=Category::where('name','=',$cateName)->first();\n $categorydes=request('description');\n //if there is no category create new one\n if($testCate==null){\n\n $newcategory=Category::create([\n 'teacher_id' => auth('teacher')->id(),\n 'name' => request('categoryname'),\n 'description' => $categorydes\n ]);\n\n $newcategory->description=$categorydes;\n $newcategory->save();\n session()->flash('message','categoty successfully created');\n return redirect(route('teacher.dashboard'));\n\n }\n else {\n\n session()->flash('message','duplicate category name');\n return redirect()->back();\n\n }\n\n }", "public function postContributedVideoAction() {\n\t\t$userSession= new Container('fo_user');\n\t\t$request\t= $this->getRequest();\n\t\t\n\t\tif(!isset($userSession->userSession['_id']) || trim($userSession->userSession['_id']) == '') {\n\t\t\techo '-1';\n\t\t\tdie();\n\t\t}\n\t\t\n\t\tif($request->isPost()) {\n\t\t\t$formData\t= $request->getPost();\n\t\t\t\n\t\t\tif(isset($formData['contribute_video_url']) && $formData['contribute_video_url'] != '' && \n\t\t\t\tisset($formData['contribute_video_title']) && $formData['contribute_video_title'] != '' && \n\t\t\t\tisset($formData['contribute_video_category']) && $formData['contribute_video_category'] != '') {\n\t\t\t\t$formData['_id']\t\t\t\t= new \\MongoId();\n\t\t\t\t$formData['user_id']\t\t\t= $userSession->userSession['_id'];\n\t\t\t\t$formData['media_title']\t\t= $formData['contribute_video_title'];\n\t\t\t\t$formData['media_title_lower']\t= strtolower($formData['contribute_video_title']);\n\t\t\t\t$formData['media_category']\t\t= $formData['contribute_video_category'];\n\t\t\t\t$formData['media_description']\t= $formData['contribute_video_desc'];\n\t\t\t\t$formData['media_url']\t\t\t= $formData['contribute_video_url'];\n\t\t\t\t$formData['media_tags']\t\t\t= $formData['contribute_video_tags'];\n\t\t\t\t\n\t\t\t\t$youtubeUrl\t= parse_url($formData['media_url'], PHP_URL_QUERY);\n\t\t\t\tparse_str($youtubeUrl, $params);\n\t\t\t $videoId\t= $params['v'];\n\t\t\t\t$feedURL\t= 'https://gdata.youtube.com/feeds/api/videos/' . $videoId;\n\t\t\t\t$entry\t\t= \\simplexml_load_file($feedURL);\n\t\t\t\tif($entry === false) {\n\t\t\t\t\t$time\t= '0';\n\t\t\t\t} else {\n\t\t\t\t\t$video\t= $this->parseVideoEntry($entry);\n\t\t\t\t\t$time\t= sprintf(\"%0.2f\", $video->length/60);\n\t\t\t\t}\n\t\t\t\tif($time <= 10) {\n\t\t\t\t\t$formData['media_length']\t= $time;\n\t\t\t\t\t$results\t= $this->contributeVideo($formData);\n\t\t\t\t\techo \"1\";\t//\tSuccess\n\t\t\t\t} else {\n\t\t\t\t\techo \"3\";\t// Time exceeded\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo \"0\";\t//\timproper request\n\t\t\t}\n\t\t} else {\n\t\t\techo \"0\";\t//\timproper request\n\t\t}\n\t\treturn $this->getResponse();\n\t}", "public function store(Request $request)\n {\n\n $rules = [\n 'title' => 'required|string|min:5|max:150|unique:posts,title',\n 'slug' => 'required|string|min:5|max:15|unique:posts,slug',\n 'summary' => 'required|string|min:10|max:255',\n 'meta_title' => 'required|string|min:5|max:128',\n 'content' => 'required',\n 'image' => 'nullable|image|mimes:png,jpg,gif,jpeg',\n \"published\" => 'nullable|numeric',\n 'categories' => 'nullable',\n ];\n\n $niceNames = [\n 'title' => 'العنوان',\n 'slug' => 'معرف المقال',\n 'summary' => 'الملخص',\n 'meta_title' => 'وصف محرك البحث',\n 'content' => 'الوصف',\n 'image' => 'صورة المقال',\n 'published' => 'الحالة',\n 'categories' => 'الصنف',\n ];\n\n $data = $this->validate($request, $rules, [], $niceNames);\n\n $data['user'] = auth()->user()->name;\n\n $new = new Post();\n $new->fill(Arr::except($data, [\"ckeditor\", 'categories']))->save();\n\n $new->categories()->sync($request->categories);\n\n if ($request->hasFile('image')) {\n // get the extension of image\n $ext = $request->File('image')->getClientOriginalExtension();\n\n $image = 'storage/website/posts/' . $new->id . '/' . time() . '.' . $ext;\n\n // create new folder with the name of video id\n mkdir(public_path('storage/website/posts/' . $new->id));\n\n Image::make($request->image)->resize(380,337)->save(public_path($image));\n\n $new->fill(['image' => $image])->save();\n }\n\n $request->session()->flash('msgSuccess', 'تم اضافة المقال بنجاح');\n return redirect(adminUrl('posts'));\n }", "private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }", "public function storeCategory(array $data): void\n {\n }", "public function store(StoreVideoRequest $request)\n {\n //Input received from the request\n $data=$request->all();\n $rules=[\n 'video' =>'mimes:mpeg,ogg,mp4,webm,3gp,mov,flv,avi,wmv,ts|max:100040|required'];\n $validator = Validator($data,$rules);\n\n\n $row = new Video;\n $input = $request->all();\n\n $file = $request->file('file');\n\n $attr = array(\n 'file' => 'File',\n\n );\n $rules = array(\n 'file' => 'required|mimes:mpeg,ogg,mp4,webm,3gp,mov,flv,avi,wmv,ts|max:100040',\n );\n\n $this->validate($request, $rules);\n $validator = Validator::make($input, $rules);\n $validator->setAttributeNames($attr);\n\n $fileName = $file->getClientOriginalName();\n $uploaded = Storage::putFileAs('public/video', $request->file('file'), $fileName);\n\n\n if($uploaded){\n\n $row->video_name = $fileName;\n $row->title = $request->get('title');\n $row->created_at = Carbon::now();\n $row->save();\n\n }\n $topic = 'test';\n\n fcm()\n ->toTopic(\"test\") // $topic must an string (topic name)\n ->notification([\n 'title' => 'New video has been added ',\n 'body' => 'Check it!!',\n ])\n ->send();\n\n\n //return with successfull message\n return new RedirectResponse(route('admin.videos.index'), ['flash_success' => trans('alerts.backend.videos.created')]);\n }", "public function store(Request $request)\n {\n //\n $request->validate([\n 'name' => 'required',\n 'description' => 'required',\n ]);\n\n VideoType::create($request->all());\n\n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = usermoodle::where('id', $user_id)->first();\n\n $videoTipos = VideoType::all();\n return view('admin.videotype.index', compact('videoTipos', 'usuario'));\n }", "public function category(VideoCategory $videoCategory)\n {\n $page = Input::get('page', 1);\n\n $cat = VideoCategory::where('slug', '=', $videoCategory)->first();\n\n $parent_cat = VideoCategory::where('parent_id', '=', $cat->id)->first();\n\n if (!empty($parent_cat->id)) {\n $parent_cat2 = VideoCategory::where('parent_id', '=', $parent_cat->id)->first();\n if (!empty($parent_cat2->id)) {\n $videos = Video::select($this->getVideoFieldsForFrontend())\n ->where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orWhere('video_category_id', '=', $parent_cat->id)\n ->orWhere('video_category_id', '=', $parent_cat2->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n } else {\n $videos = Video::where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orWhere('video_category_id', '=', $parent_cat->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n }\n } else {\n $videos = Video::where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n }\n\n $data = [\n 'videos' => $videos,\n 'current_page' => $page,\n 'category' => $cat,\n 'page_title' => 'Videos - ' . $cat->name,\n 'page_description' => 'Page ' . $page,\n 'pagination_url' => '/videos/category/' . $videoCategory,\n 'menu' => Menu::orderBy('order', 'ASC')->get(),\n 'video_categories' => VideoCategory::all(),\n 'theme_settings' => config('settings.theme'),\n ];\n\n return view('Theme::video-list', $data);\n }", "public function store()\n\t{\n\t\t$category = new Category(\\Input::except(['options, image']));\n\t\tif (!$category->save()) {\n\t\t\treturn \\Redirect::back()->withInput()->withErrors($category->getErrors());\n\t\t}\n\n\t\tif (\\Input::file('image')) {\n\t\t\tif (!$category->uploadImage(\\Input::file('image'), 'image')) {\n\t\t\t\t$category->delete();\n\t\t\t\treturn \\Redirect::back()->withInput()->withErrors($category->getErrors());\n\t\t\t}\n\t\t}\n\n\t\tif (\\Input::file('image_desc')) {\n\t\t\tif (!$category->uploadImage(\\Input::file('image_desc'), 'image_desc')) {\n\t\t\t\t$category->delete();\n\t\t\t\treturn \\Redirect::back()->withInput()->withErrors($category->getErrors());\n\t\t\t}\n\t\t}\n\n\t\t\\Session::flash('manager_success_message', \\Lang::get('manager.messages.entity_created') .\n\t\t ' <a href=\"' . \\URL::Route('manager.catalog.categories.edit', ['id' => $category->id]) . '\">' . \\Lang::get('buttons.edit') . '</a>');\n\t\treturn \\Redirect::route('manager.catalog.categories.index');\n\t}", "public function addcompanycategory(){\n $data = ['name'=> post('categoryname')];\n $this->Database->insert_data('companycategories',$data);\n flash('green','check',\"Kategoriya uğurla əlavə edildi.\");\n back();\n }", "public function category_videos( $category=null )\n\t{\n\t\t$CI =& get_instance();\n\t\t$this->category = ($category != null) ? $category : $this->category;\n\t\t$this->products_string_to_int();\n\n\t\t$result = $CI->db->where(\"pv.category_id\",$this->category)->from(\"products_category_video AS pv\")->join(\"media_videos AS mv\",\"mv.id = pv.video_id\",\"left\")->get()->result();\n\t\treturn $result;\n\t}", "public function store(Request $request) {\n// echo json_encode($request->input());\n// exit();\n\n\n $this->validate($request, [\n 'category' => 'required|max:255|unique:tbl_file_category'\n ]);\n\n\n $formdata = array(\n 'category' => $request->input('category'),\n );\n\n $types = Tbl_file_category::create($formdata);\n if ($types->fc_id > 0) {\n return redirect('admin/filecategory')->with('success', 'Created Successfully...!');\n } else {\n return redirect('admin/filecategory')->with('error', 'Error occurred. Please try again...!');\n }\n }", "public function store()\n\t{\n\t\t$description = Input::get('description'); \n\t\t$acronym = substr($description, 0, 1);\n\t\t$category = new Category(); \n\t\t$category->language_id = Input::get('language_id'); \n\t\t$category->description = $description;\n\t\t$category->acronym = $acronym;\n\t\t$category->save(); \n\t\treturn Response::json(array('success'=>'Categoria registrada exitosamente')); \n\t}", "public function store()\n\t{\n\t\t$category \t\t= \tInput::get('category');\n\t\t$categoryList \t=\tInput::get('categoryList');\n\t\tif ($category \t== \tnull) : \n\t\t\treturn Redirect::route('admin.categories.index')->with('message-error','همه گزینه ها اجباری است.')->withInput();\n\t\tendif;\n\t\tCategory::setCategory($category,$categoryList);\n\t\treturn Redirect::route('admin.categories.index')->with('message-success','دسته ایجاد شد.');\n\t}", "public function updateVideoCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $videoCategory = VideoCategory::find($id);\n $videoCategory->video_category_name = $request->name;\n $videoCategory->save();\n Session::flash('success','Video Category Updated succcessfully.');\n return redirect()->back()->with('workout',$videoCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function create()\n {\n //\n $user_id = session('user')['id'];\n $category_id = PushUser::find($user_id)->category_id;\n $channels = Channel::whereHas('association', function($qr)use($category_id){\n $qr->where('category_id', $category_id);\n })->where('is_sponser', 1)->pluck('title','id');\n $channel_ids = Channel::whereHas('association', function($qr)use($category_id){\n $qr->where('category_id', $category_id);\n })->where('is_sponser', 1)->pluck('id')->toArray();\n\n $videos = Video::with(['channel'])->whereIn('channel_id', $channel_ids)->pluck('title','id');\n // $videos = Video::pluck('title','id');\n // dd($videos);\n return view('Push::videos.create', compact(['channels','videos']));\n }", "public function post_addvideo()\r\n\t\t{\r\n\t\t\t$retArr = array();\r\n\t\t\t// Scaffolding Code For Single:\r\n\t\t\t$retArr = $this->obj->getBasics();\r\n\r\n\t\t\treturn $retArr;\r\n\t\t}", "public function store(VideoFormRequest $request)\n {\n $dataForm = $request->all();\n\n if(valid_file($request))\n {\n $upload = upload_file($request, 'videos');\n\n if($upload){\n $dataForm['file'] = $upload;\n }\n }\n\n $video = $this->video->create($dataForm)->id;\n\n if(!$video) return redirect('/admin/videos')->with('fail', 'Falha ao salvar o vídeo!');\n\n return redirect('/admin/videos')->with('success', 'Vídeo criado com sucesso!');\n }", "public function add_category() {\n\t $this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(substr($_POST[\"id\"], 4));\n\t\t$this->model->categories = $category;\n\t\tif(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\n\t}", "public function storeVideo(Request $request)\n {\n $this->validate($request,array(\n 'title' => 'required',\n 'video_category_id' => 'required',\n 'video' => 'required|mimes:mp4'\n ));\n\n $video = new Video;\n\n $video->title = $request->title;\n $video->video_category_id = $request->video_category_id;\n\n if ($request->hasFile('video')) {\n $file = $request->file('video');\n $filename = time().'.'.$file->getClientOriginalName();\n /*$location = public_path('file/'.$filename);\n Storage::put($filename,file_get_contents($file));*/\n\n $location = public_path('file/'.$filename);\n Storage::disk('file')->put($filename, file_get_contents($file));\n //Storage::disk('public')->put($filename, file_get_contents($file));\n $video->video = $filename;\n\n }\n\n $video->save();\n\n if($video->save()){\n return redirect()->back()->with('success','Video saved successfully.');\n }\n else{\n return redirect()->back()->with('denger-success','Video is not saved.');\n }\n \n }", "public function store(Request $request)\n {\n// $data = request()->validate([\n// 'name'=>'required|unique:categories'\n// ]);\n\n\n// $Category = new Category();\n// $Category->name = request('name');\n// $Category->save();\n//\n// $Category = Category::all();\n// return view('multiauth::category.index', compact('Category'));\n//\n// Category::create($data);\n// session()->flash('save', 'Category is Add!!!');\n// return back();\n\n\n $c = Category::create($this->my_validate());\n $this->ImageStore($c);\n return redirect('admin/category/index');\n\n }", "public function store(Request $request)\n {\n if ($request->file_link !== null) {\n //Validar con expresiones regulares si es valido.\n $url = $request->file_link;\n $result = [];\n if (preg_match('/youtu\\.?be/', $url)) {\n $category = Category::find($request->category_id);\n $route = $category->category_name;\n if ($category->category_level != 1) {\n while ($category->category_level != 1) {\n $category = Category::find($category->superior_category_id);\n $route = $category->category_name . '/' . $route;\n }\n }\n $file = new File($request->all());\n $file->user_id = Auth::user()->id;\n $patterns = array(\n \"/youtu\\.be\\/([^#\\&\\?]{11})/\", // youtu.be/<id>\n \"/\\?v=([^#\\&\\?]{11})/\", // ?v=<id>\n \"/\\&v=([^#\\&\\?]{11})/\", // &v=<id>\n \"/embed\\/([^#\\&\\?]{11})/\", // embed/<id>\n \"/\\/v\\/([^#\\&\\?]{11})/\" // /v/<id>\n );\n // If any pattern matches, return the ID\n for ($i = 0; $i < count($patterns); $i++) {\n if (preg_match($patterns[$i], $url)) {\n preg_match_all($patterns[$i], $url, $example_array);\n $result = $example_array;\n break;\n }\n }\n\n $idVideo = $result[count($result) - 1][0];\n $homepage = file_get_contents('https://www.googleapis.com/youtube/v3/videos?key=AIzaSyA04eUTmTP3skSMcRXWeXlBNI0luJ2146c&part=snippet&id=' . $idVideo);\n $json = json_decode($homepage);\n //dd($json->items[0]->snippet->title);\n\n\n $file->file_real_name = $json->items[0]->snippet->title;\n $file->storage_type = 2;\n $file->file_extension = 'mp4';\n\n $file->file_name = $category->category_name . '_' . $request->file_year . '.' . $file->file_extension;\n\n $file->file_size = 0;\n $file->user_id = $this->auth->user()->id;\n\n $tags_in = explode(\",\", $request->file_tags);\n $file->file_path = 'https://www.youtube.com/embed/' . $idVideo;\n\n $file->save();\n $file->tag($tags_in);\n } else {\n dd('no paso nada ');\n\n //No se reconocio nada\n }\n } else {\n //==============================MULTIPLE UPLOAD TEST====================================\n //Se sube archivos\n //$files = $request->file;\n //$uploadcount = 0;\n //$file_count = count($files);\n //dd($request->all());\n // start count how many uploaded\n /*foreach ($files as $file_aux) {\n $rules = array('file' => 'required|file|mimes:pdf,doc,docx,ppt,pptx,mp4|max:9000');\n $validator = Validator::make(array('file' => $file_aux), $rules);\n if ($validator->passes()) {\n //Si pasa el validador\n $category = Category::find($request->category_id);\n $route = $category->category_name;\n if ($category->category_level != 1) {\n while ($category->category_level != 1) {\n $category = Category::find($category->superior_category_id);\n $route = $category->category_name . '/' . $route;\n }\n }\n $file = new File($request->all());\n $file->user_id = Auth::user()->id;\n $file->file_real_name = $request->file('file')->getClientOriginalName();\n $file->storage_type = 1;\n $file->file_extension = $request->file('file')->getClientOriginalExtension();\n\n $file->file_name = $category->category_name . '_' . $request->file_year . '.' . $file->file_extension;\n\n $file->file_size = $request->file('file')->getClientSize();\n $file->user_id = $this->auth->user()->id;\n\n $path = Storage::putFileAs($route, $request->file('file'), $file->file_real_name);\n $tags_in = explode(\",\", $request->file_tags);\n\n if ($file->file_extension == 'mp4') {\n $video = Youtube::upload(storage_path('app/' . $path), [\n 'title' => $file->file_real_name,\n 'description' => 'You can also specify your video description here.',\n 'tags' => ['foo', 'bar', 'baz'],\n 'category_id' => 10\n ], 'private');\n $file->file_path = 'https://www.youtube.com/embed/' . $video->getVideoId();\n $file->storage_type = 2;\n $file->save();\n $file->tag($tags_in);\n Storage::delete($route . '/' . $file->file_real_name);\n } else {\n $file->file_path = $path;\n $file->state = 1;\n $file->save();\n $file->tag($tags_in);\n }\n }\n }\n\n if ($uploadcount == $file_count) {\n //uploaded successfully\n } else {\n //error occurred\n }*/\n //===================================== END MULTIPLE=====================================\n $this->validate($request, [\n 'file' => 'required|file|mimes:pdf,doc,docx,ppt,pptx,mp4|max:9000'\n ]);\n $category = Category::find($request->category_id);\n $route = $category->category_name;\n if ($category->category_level != 1) {\n while ($category->category_level != 1) {\n $category = Category::find($category->superior_category_id);\n $route = $category->category_name . '/' . $route;\n }\n }\n $file = new File($request->all());\n $file->user_id = Auth::user()->id;\n $file->file_real_name = $request->file('file')->getClientOriginalName();\n $file->storage_type = 1;\n $file->file_extension = $request->file('file')->getClientOriginalExtension();\n\n $file->file_name = $category->category_name . '_' . $request->file_year . '.' . $file->file_extension;\n\n $file->file_size = $request->file('file')->getClientSize();\n $file->user_id = $this->auth->user()->id;\n\n $path = Storage::putFileAs($route, $request->file('file'), $file->file_real_name);\n $tags_in = explode(\",\", $request->file_tags);\n\n if ($file->file_extension == 'mp4') {\n $video = Youtube::upload(storage_path('app/' . $path), [\n 'title' => $file->file_real_name,\n 'description' => 'You can also specify your video description here.',\n 'tags' => ['foo', 'bar', 'baz'],\n 'category_id' => 10\n ], 'private');\n $file->file_path = 'https://www.youtube.com/embed/' . $video->getVideoId();\n $file->storage_type = 2;\n $file->save();\n $file->tag($tags_in);\n Storage::delete($route . '/' . $file->file_real_name);\n } else {\n $file->file_path = $path;\n $file->state = 1;\n $file->save();\n $file->tag($tags_in);\n }\n }\n\n return redirect()->action('CategoryController@show', ['id' => $request->category_id]);\n }", "function add_categories()\n {\n $url ='/genre/movie/list';\n $data = $this->curl_call($url,1);\n\n $data_added_count = 0;\n foreach (json_decode($data)->genres as $category_data)\n {\n if (Category::find($category_data->id) == null)\n {\n $category = new Category();\n $category->id = $category_data->id;\n $category->name = $category_data->name;\n $category->save();\n $data_added_count++;\n }\n }\n\n return $data_added_count. \" categories added successfully\";\n\n }", "public function materiVideoStore()\n {\n // $dataEnd = end($dataExplode);\n $this->validate(request(), [\n 'nama' => 'required',\n 'deskripsi' => 'required',\n 'link' => 'required'\n ]);\n\n // Materi::create([\n // 'user_id' => request('user_id'),\n // 'kelas_id' => request('kelas_id'),\n // 'nama' => request('nama'),\n // 'jenis' => request('jenis'),\n // 'status' => request('status'),\n // 'deskripsi' => request('deskripsi'),\n // 'link' => $dataEnd\n // ]);\n\n Materi::createMateriVideo();\n\n return back()->with('success');\n }", "public function uploadAction() {\n if (isset($_GET['ul']) || isset($_FILES['Filedata']))\n return $this->_forwardCustom('upload-video', null, null, array('format' => 'json'));\n\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n $this->view->form = $form = new Sitereview_Form_Reviewvideo();\n\n if (!$this->getRequest()->isPost()) {\n if (null !== ($video_id = $this->_getParam('video_id'))) {\n $form->populate(array(\n 'video' => $video_id\n ));\n }\n return;\n }\n\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n $video = $form->saveValues();\n }", "public function indexAction()\n {\n $module = $this->params('module');\n $slug = $this->params('slug');\n\n // Get config\n $config = Pi::service('registry')->config->read($module);\n\n // Get category information from model\n $category = $this->getModel('category')->find($slug, 'slug');\n $category = Pi::api('category', 'video')->canonizeCategory($category);\n\n // Check category\n if (!$category || $category['status'] != 1) {\n $this->getResponse()->setStatusCode(404);\n $this->terminate(__('The category not found.'), '', 'error-404');\n $this->view()->setLayout('layout-simple');\n return;\n }\n // Update Hits\n $this->getModel('category')->increment('hits', ['id' => $category['id']]);\n // category list\n $categoriesJson = Pi::api('category', 'video')->categoryListJson();\n // Check display type\n switch ($category['display_type']) {\n case 'video':\n $template = 'video-angular';\n break;\n\n case 'subcategory':\n // Get info\n $list = [];\n $where = ['status' => 1, 'parent' => $category['id']];\n $order = ['display_order ASC', 'time_create DESC', 'title ASC'];\n $select = $this->getModel('category')->select()->where($where)->order($order);\n $rowSet = $this->getModel('category')->selectWith($select);\n // Make list\n foreach ($rowSet as $row) {\n $list[$row->id] = Pi::api('category', 'video')->canonizeCategory($row);\n }\n // Set view\n $this->view()->assign('list', $list);\n // Set template\n $template = 'category-single';\n break;\n }\n\n // Save statistics\n if (Pi::service('module')->isActive('statistics')) {\n Pi::api('log', 'statistics')->save('video', 'category', $category['id']);\n }\n\n // Set view\n $this->view()->headTitle($category['seo_title']);\n $this->view()->headDescription($category['seo_description'], 'set');\n $this->view()->headKeywords($category['seo_keywords'], 'set');\n $this->view()->setTemplate($template);\n $this->view()->assign('config', $config);\n $this->view()->assign('category', $category);\n $this->view()->assign('categoriesJson', $categoriesJson);\n $this->view()->assign('pageType', 'category');\n }", "public function update(Request $request, $id)\n {\n $data['page_title'] = 'Content';\n $data['categories'] = Category::all()->sortBy('name');\n $data['languages'] = Settings::LANGUAGES;\n $data['genres'] = Settings::GENRES;\n\n $validationData = $request->validate(\n [\n 'category' => ['required'],\n 'name' => ['required', 'string', 'max:255'],\n //'videofile' => 'sometimes|nullable|mimes:mpeg,ogg,mp4,webm,3gp,mov,flv,avi,wmv,ts|max:' . config('constants.MAX_VIDEO_UPLOAD_SIZE'),\n 'file' => 'sometimes|nullable|mimes:png,PNG,jpg,JPG,jpeg,JPEG|max:' . config('constants.MAX_FILE_UPLOAD_SIZE'),\n 'language' => ['required', 'string'],\n 'genres' => ['required', 'string'],\n 'artist' => ['required', 'string'],\n 'castandcrew' => ['required', 'string'],\n 'description' => ['required', 'string'],\n\n ]\n );\n if ($request->hasfile('file')) {\n $image = $request->file('file');\n $image_name = time() . '_' . $image->getClientOriginalName();\n //$image_path = $request->file('file')->storeAs('uploads', $image_name);\n $image_path = 'banner_images/' . $image_name;\n Storage::disk('s3')->put($image_path, file_get_contents($image));\n }\n\n //print($duration);\n $tags = ($request->tags) ? explode(',', $request->tags) : '';\n $display_tags = ($request->display_tags) ? explode(',', $request->display_tags) : '';\n\n $save_data = [\n 'category_id' => $request->category,\n 'name' => $request->name,\n 'language' => $request->language,\n 'genres' => $request->genres,\n //'content_link' => ($video_path) ?? '',\n //'format' => ($video_extension) ?? '',\n 'tags' => json_encode($tags),\n 'display_tags' => json_encode($display_tags),\n //'client_id' => $this->client(),\n 'artist' => $request->artist,\n 'castandcrew' => $request->castandcrew,\n 'description' => $request->description,\n 'updated_by' => Auth::id(),\n ];\n if (isset($image_path))\n $save_data = array_merge($save_data, ['banner_image' => $image_path]);\n //dd($save_data);\n $content = Content::whereId($id)->update($save_data);\n if ($content) {\n return redirect('client/contents/view/' . $id)->with('success', \"Content Update Successfully.\");\n } else {\n return redirect('client/contents/view/' . $id)->with('failure', \"Oops! Content Not Updated.\");\n }\n }", "public function store(VideoRequest $request)\n {\n Video::create($request->all());\n Flash::success('El video se ha creado satisfactoriamente')->important();\n return redirect()->route('shoes.video.index');\n }", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'name' => 'required'\n\t\t);\n\t\t$input = Input::except('_token');\n\t\t$validator = Validator::make($input,$rules);\n\t\tif($validator->fails()) {\n\t\t\treturn Redirect::action('CategoryController@create')\n\t ->withErrors($validator)\n\t ->withInput(Input::except('password'));\n } else {\n\t\t\t$inputCategory = Input::only('name');\n\t\t\t$input['game_id'] = CommonNormal::create($inputCategory);\n\t\t\t// if (Input::get('category_parent_id')) {\n\t\t\t// \tforeach (Input::get('category_parent_id') as $value) {\n\t\t\t// \t\t$input['category_parent_id'] = $value;\n\t\t\t// \t\tCommonNormal::create($input, 'GameRelation');\n\t\t\t// \t}\n\t\t\t// }\n\t\t\treturn Redirect::action('CategoryController@index') ;\n\t\t}\n\t}", "function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->begin( );\r\n\r\n $name = $db->escapeString( $this->Name );\r\n $description = $db->escapeString( $this->Description );\r\n\r\n if ( !isset( $this->ID ) )\r\n {\r\n $db->lock( \"eZImageCatalogue_Category\" );\r\n\r\n $this->ID = $db->nextID( \"eZImageCatalogue_Category\", \"ID\" );\r\n\r\n $db->query( \"INSERT INTO eZImageCatalogue_Category\r\n ( ID, Name, Description, UserID, ParentID, SectionID ) VALUES\r\n ( '$this->ID', '$name', '$description', '$this->UserID', '$this->ParentID', '$this->SectionID' )\" );\r\n $db->unlock();\r\n }\r\n else\r\n {\r\n $db->query( \"UPDATE eZImageCatalogue_Category SET\r\n Name='$name',\r\n Description='$description',\r\n UserID='$this->UserID',\r\n ParentID='$this->ParentID',\r\n SectionID='$this->SectionID' WHERE ID='$this->ID'\" );\r\n }\r\n\r\n\r\n if ( $dbError == true )\r\n $db->rollback( );\r\n else\r\n $db->commit();\r\n\r\n\r\n return true;\r\n }", "public function store(Request $request)\n {\n $request->validate([\n 'name' => 'required',\n 'video' => 'required',\n ]);\n\n $input['video'] = time() . '.' . $request->video->getClientOriginalExtension();\n $request->video->move(public_path('videos-gallery'), $input['video']);\n\n if (Auth::check()) {\n $input['name'] = $request->name;\n $input['public'] = 1;\n $input['fk_owner'] = Auth::id();\n $input['author'] = Auth::user()->name;\n\n Video::create($input);\n\n return redirect()->route('videos.index')->with('success', 'Video created successfully.');\n }\n\n return redirect()->route('videos.index')->with('warning', 'You must be connected.');\n }", "public function save_category_info($data) {\n $this->db->insert('tbl_category', $data);\n }", "public function create()\n {\n $title = 'Create Video';\n $category = Categories::get();\n\n return view('video::create')->withTitle($title)->withCategory($category);\n }", "public function store(Request $request, $category)\n {\n $validatedData = $request->validate([\n 'title' => 'required|max:100|string' ,\n 'body' => 'required|max:1000',\n 'image' => 'mimes:jpeg,bmp,png'\n ]);\n\n $category = Category::findOrFail($category);\n\n $post = new Post;\n $post->title = $validatedData['title'];\n $post->body = $validatedData['body'];\n $post->profile_id = Auth::user()->id;\n $post->category_id = $category->id;\n $post->save();\n\n if ($request->hasFile('image')) {\n $validatedData['image']->store('images','public');\n $photo = new Photo;\n $photo->filename = \"public/images/\".$validatedData['image']->hashName();\n $photo->photoable_id = $post->id;\n $photo->photoable_type = Post::class;\n $photo->save();\n }\n\n $tags = $request->input('tags');\n if($tags != null){\n foreach($tags as $tag){\n $post->tags()->attach($tag);\n }\n }\n \n $profile = $post->profile;\n $profile->score = $profile->score + 10;\n $profile->save();\n \n return redirect()->route('posts.show', ['category' => $category, 'post' => $post])->with('message','Post created!');\n }", "public static function processBulletin($model, $video) {\n if (!empty($video)) {\n if (is_array($video))\n $video = current($video);\n $youtube_id = Upload($video, $model->name, $model->text, 'Animals', 'Tags');\n if (!empty($youtube_id)) {\n $model->youtube_id = $youtube_id;\n $model->save();\n }\n }\n }", "public function get_videocategory()\n\t{\n\t\t$category = array();\n\n\t\t$sql = \"SELECT * FROM \" . $this->table_prefix . \"_video_category ORDER BY weight ASC\";\n\t\t$result = $this->db_cache( $sql, 'id' );\n\n\t\t$category[0] = array(\n\t\t\t'id' => 0,\n\t\t\t'title' => $this->lang('unknow'),\n\t\t\t'keywords' => '',\n\t\t\t'description' => ''\n\t\t);\n\n\t\tif( ! empty( $result ) )\n\t\t{\n\t\t\tforeach( $result as $row )\n\t\t\t{\n\t\t\t\t$category[$row['id']] = array(\n\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t'title' => $row['title'],\n\t\t\t\t\t'keywords' => $row['keywords'],\n\t\t\t\t\t'description' => $row['description']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $category;\n\t}", "public function create()\n {\n // If request is a post\n if ($this->request->is('post')) {\n // Make a new Entity\n $cvs = $this->Cvs->newEntity();\n // get extention from video\n $ext = substr(strtolower(strrchr($this->request->data['video']['name'], '.')), 1);\n $arr_ext = array(\"mp3\", \"mp4\", \"wma\");\n // set a random new video name\n $setNewFileName = time() . \"_\" . rand(000000, 999999);\n\n // if ext uploaded is in allowed arr_ext\n if (in_array($ext, $arr_ext)) {\n // place video in videos map\n move_uploaded_file(($this->request->data['video']['tmp_name']), WWW_ROOT . '/videos/' . $setNewFileName . '.' . $ext);\n // set the new filename in public $video\n $this->video = $setNewFileName . '.' . $ext;\n }\n else {\n $this->Flash->set('Alleen MP4 bestanden zijn toegestaan!', ['key' => 'cv-error', 'params' => ['class' => 'alert alert-success']]);\n }\n\n $cvs = $this->Cvs->patchEntity($cvs, $this->request->data);\n // set user_id to user_id where u logged in with\n $cvs->user_id = $this->Auth->user('id');\n // set video path to the path in $video\n $cvs->video = $this->video;\n\n // if able to save, save the entity in database\n if ($this->Cvs->save($cvs)) {\n $this->Flash->set('De CV is succesvol opgeslagen!', ['key' => 'cv-success', 'params' => ['class' => 'alert alert-success']]);\n return $this->redirect(['action' => 'index']);\n }\n else {\n $this->Flash->set('Er ging iets mis! Controleer of alle velden correct ingevuld zijn.', ['key' => 'cv-error', 'params' => ['class' => 'alert alert-danger']]);\n }\n }\n\n // if user is company, redirect\n if ($this->Auth->user('account_type') === 1) {\n return $this->redirect(['controller' => 'Dashboard', 'action' => 'index']);\n }\n\n // get all the categories and set them in $categories\n $categories = $this->Cvs->Categories->find('list', ['keyField' => 'id', 'valueField' => 'category']);\n\n // set all objects\n $this->set(compact('cvs', 'categories', 'competences'));\n }", "public function import($id, $categories=[]) {\n\n if (count(self::get(['_userId' => $this->user->id(), 'id' => $id])) > 0) {\n $this->error = 'Video already added';\n return false;\n }\n\n $yt = new youtube($this->user->access_token);\n\n if (!$ytv = $yt->video($id)) {\n $this->error = 'Error retrieving video';\n return false;\n }\n\n if ($ytv['status']['privacyStatus'] == 'private') {\n $this->error = 'PRIVATE';\n return false;\n }\n\n $video = new video();\n\n // yt info\n $video->id = $ytv['id'];\n\n // snippet part\n $video->title = $ytv['snippet']['title'];\n $video->description = $ytv['snippet']['description'];\n $video->thumbnails = $ytv['snippet']['thumbnails'];\n $video->tags = $ytv['snippet']['tags'];\n $video->published = $ytv['snippet']['publishedAt'];\n\n // contentDetails part\n $video->duration = $ytv['contentDetails']['duration'];\n // hd or sd, sd videos have smaller thumbnails, hq you can hit maxresdefault.jpg\n $video->quality = $ytv['contentDetails']['definition'];\n\n // statistics part, cast to integer for proper sorting\n $stats = [];\n foreach ($ytv['statistics'] as $key=>$stat) {\n $stats[$key] = (int) $stat;\n } \n $video->stats = $stats;\n\n\n // settings\n $video->approved = false;\n $video->featured = false;\n $video->problem = false;\n $video->solution = false;\n $video->categories = $categories;\n\n // user info\n $video->_userId = $this->user->id();\n\n $video->user = [\n 'name' => $this->user->name,\n 'picture' => $this->user->picture\n ];\n\n $video->save();\n\n return true;\n\n }", "public function postStore()\n\t{\n\t\t$response['status'] = 'error';\n\t\t$response['message'] = trans('categories.not_created');\n\n\t\tif ( ! empty($_POST))\n\t\t{\n\t\t\t$error = FALSE;\n\n\t\t\tif (empty(trim(Input::get('title'))))\n\t\t\t{\n\t\t\t\t$response['message'] = trans('categories.title_required');\n\t\t\t\t$error = TRUE;\n\t\t\t}\n\n\t\t\t$category_level = Input::get('level');\n\t\t\t$parent = Input::get('parent');\n\t\t\tif ( ! empty($category_level) && in_array($category_level, ['1', '2']))\n\t\t\t{\n\t\t\t\tif (empty($parent))\n\t\t\t\t{\n\t\t\t\t\t$response['message'] = trans('categories.parent_required');\n\t\t\t\t\t$error = TRUE;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($error === FALSE)\n\t\t\t{\n\t\t\t\t$data = [\n\t\t\t\t\t'title' => trim(Input::get('title')),\n\t\t\t\t\t'description' => Input::get('description'),\n\t\t\t\t\t'level' => $category_level,\n\t\t\t\t\t'parent' => $parent,\n\t\t\t\t\t'size_group' => Input::get('size_group'),\n\t\t\t\t\t'position' => Input::get('position'),\n\t\t\t\t\t'visible' => Input::get('visible'),\n\t\t\t\t\t'active' => Input::get('active'),\n\t\t\t\t\t'page_title' => Input::get('page_title'),\n\t\t\t\t\t'meta_description' => Input::get('meta_description'),\n\t\t\t\t\t'meta_keywords' => Input::get('meta_keywords'),\n\t\t\t\t];\n\n\t\t\t\tif (($id = Model_Categories::createCategory($data)) > 0)\n\t\t\t\t{\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t//Manage Friendly URL\n\t\t\t\t\t\tModel_Categories::setURL($id, Input::get('friendly_url'));\n\n\t\t\t\t\t\t$response['status'] = 'success';\n\t\t\t\t\t\t$response['message'] = trans('categories.created');\n\t\t\t\t\t\t$response['category_id'] = $id;\n\t\t\t\t\t} catch (Exception $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t$response['message'] = $e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$response['message'] = trans('categories.not_created');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn response()->json($response);\n\t}", "public function ajaxpublish(Request $request)\n {\n // $user = User::find($id);\n $category = Video::find($request->id);\n $category->publish = $request->publish;\n $category->save();\n echo $category->publish; die();\n }", "public function store(Request $request)\n {\n $request->validate([\n 'title'=>'min:3|max:70|required',\n 'content'=>'min:50|required',\n 'categories'=>'required'\n ]);\n\n $user = Auth::user();\n\n $categories = array_values($request->categories);\n\n $article = $user->articles()->create($request->except('categories'));\n\n $article->categories()->attach($categories);\n\n return redirect()->to('/home');\n }", "public function save(){\n\t\t$sql = new Sql();\n\n\t\t$results = $sql->select(\"CALL sp_categories_save(:idcategory, :descategory)\", array(\n\t\t\t\":idcategory\"=>$this->getidcategory(),\n\t\t\t\":descategory\"=>$this->getdescategory()\n\t\t));\n\n\t\t$this->setData($results[0]);\n\n\n\t\tCategory::updateFile();\n\n\t}", "public function store(PostsCreateRequest $request)\n {\n $input = $request->all();\n $user = Auth::user();\n if($request->file('media')){ \n $file = $request->file('media');\n $mediaType=explode('/',$file->getMimeType())[0];\n $name = str_slug($request->input('name')).'_'.time();\n $filePath = $name. '.' . $file->getClientOriginalExtension(); \n \n if($mediaType==\"image\" )\n {\n $file->move('uploads/posts/images', $filePath); \n }\n elseif($mediaType==\"video\")\n {\n $file->move('uploads/posts/video', $filePath); \n }\n else\n {\n return redirect('admin/posts')->with('error');\n }\n }\n\n $post=new Post();\n $post->body=$request->body;\n $post->user_id=Auth::user()->id;\n $post->category_id=$request->category_id;\n $post->save();\n\n if($request->file('media')){\n $Media = new PostMedia();\n $Media->type = $mediaType;\n $Media->path = $filePath;\n $Media->post_id = $post->id;\n $Media->save();\n \n } \n\n return redirect('admin/posts');\n }", "public function store(Request $request)\n {\n \n\n $blogImage = '';\n if($request->media_type==1)\n {\n\n if ($request->hasFile('blog_image')) {\n $this->validate($request, [\n 'blog_image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n ]);\n $categoryPic = $request->file('blog_image');\n $blogImage = time().'.'.$categoryPic->getClientOriginalExtension();\n $destinationPath = public_path('/blogs');\n $categoryPic->move($destinationPath, $blogImage);\n } else {\n $blogImage ='';\n }\n } \n\n $videoUrl ='';\n if($request->media_type==2)\n {\n $videoUrl= $request->video_url;\n } else{\n $videoUrl='';\n }\n\n\n $blogs = new Blogs();\n $blogs->title = $request->title;\n $blogs->author = $request->author;\n $blogs->description = $request->description;\n $blogs->media_type = $request->media_type;\n $blogs->blog_image = $blogImage;\n $blogs->video_url = $videoUrl;\n $result = $blogs->save();\n\n if($result==1)\n {\n return redirect()->route('blogs.index')->with('success','Blog Created Successfully');\n } else {\n return redirect()->back()->with('error','Something Went Wrong Try Again');\n }\n\n\n }", "public function store(Request $request)\n {\n\n $category_name = $request->input('category_name');\n if($request->hasFile('category_image')){\n $image = $request->file('category_image');\n $ext = $image->getClientOriginalExtension();\n $image_name = date('YmdHis').rand(000,999).'.'.$ext;\n $image->move($this->path,$image_name);\n $insert['category_image'] = $image_name;\n }\n $insert['category_name'] = $category_name;\n $insert['created_at'] = date('Y-m-d H:i:s');\n $ids = $this->category->add($insert);\n if($ids > 0){\n $request->session()->flash('notip','<div class=\"alert alert-success\">Data added successful</div>');\n return redirect('/admin/categories');\n }else{\n $request->session()->flash('notip','<div class=\"alert alert-danger\">Add data failed, please try again</div>');\n $request->session()->flash('category_name',$category_name);\n return redirect('/admin/categories/add');\n }\n\n //\n\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'name_en' => 'required|unique:category-description,name|max:255',\n 'name_ar' => 'required|unique:category-description,name|max:255',\n 'description_en' => 'required',\n 'description_ar' => 'required',\n 'slug_en' => 'required|unique:category-description,slug|max:255',\n 'slug_ar' => 'required|unique:category-description,slug|max:255',\n 'meta_title_en'=> 'required|max:255',\n 'meta_title_ar'=> 'required|max:255',\n 'image_cover'=> 'required|image',\n 'status' => 'required'\n ]);\n\n //\n $category = new Category();\n\n $dir = public_path().'/uploads/category/';\n $file = $request->file('image_cover');\n $fileName = str_random(6).'.'.$file->getClientOriginalExtension();\n $file->move($dir , $fileName);\n\n $category->image_url = $fileName;\n $category->status = $request->status ;\n $category->save();\n\n\n\n\n $languages = Language::where('status','=','1')->get();\n\n foreach ($languages as $language){\n $categoryDescription = new CategoryDescription();\n $categoryDescription->name = $request->input('name_'.$language->label);\n $categoryDescription->description = $request->input('description_'.$language->label);\n $categoryDescription->meta_title = $request->input('meta_title_'.$language->label);\n $categoryDescription->meta_description = $request->input('meta_description_'.$language->label);\n $categoryDescription->slug = $request->input('slug_'.$language->label);\n $categoryDescription->lang_id = $language->id;\n $categoryDescription->category_id = $category->id ;\n $categoryDescription->save();\n }\n session()->flash('message' , 'new category added successfully');\n return redirect()->route('categories.index');\n\n }", "private function updateVideo()\n {\n try\n {\n $request = $_POST;\n\n global $cbvid;\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video Id not provided\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n //check if title provided\n if( !isset($request['title']) || $request['title']==\"\")\n throw_error_msg(\"title not provided\");\n else\n $title = mysql_clean($request['title']);\n\n //check if description provided\n if( !isset($request['description']) || $request['description']==\"\")\n throw_error_msg(\"description not provided.\");\n else\n $description = mysql_clean($request['description']);\n\n //check if tags provided\n if(!isset($request['tags']) || $request['tags']==\"\")\n throw_error_msg(\"tags not provided.\");\n else\n $tags = mysql_clean($request['tags']);\n\n //check if tags provided\n if(!isset($request['category']) || $request['category']==\"\")\n {\n throw_error_msg(\"category not provided.\");\n }\n else\n {\n $request['category'] = explode(',',$request['category']); \n $_POST['category'] = $request['category'];\n }\n \n if (isset($request['video_users-user']) || isset($request['video_users-group'])) \n {\n $video_user_ = mysql_clean($request['video_users-user']);\n $video_group_ = mysql_clean($request['video_users-group']);\n\n $request['video_users'] = get_video_users($video_user_,$video_group_,false);\n }\n \n $result = $cbvid->update_video($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $vdetails = $cbvid->get_video_details($request['videoid']);\n $formatted_video = format_videos(array($vdetails));\n\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $formatted_video[0]);\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "function store_addcategory()\r\n{\r\n\tglobal $_user;\r\n\tglobal $dropbox_cnf;\r\n\r\n\t// check if the target is valid\r\n\tif ($_POST['target']=='sent')\r\n\t{\r\n\t\t$sent=1;\r\n\t\t$received=0;\r\n\t}\r\n\telseif ($_POST['target']=='received')\r\n\t{\r\n\t\t$sent=0;\r\n\t\t$received=1;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// check if the category name is valid\r\n\tif ($_POST['category_name']=='')\r\n\t{\r\n\t\treturn get_lang('ErrorPleaseGiveCategoryName');\r\n\t}\r\n\r\n\tif (!$_POST['edit_id'])\r\n\t{\r\n\t\t// step 3a, we check if the category doesn't already exist\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE user_id='\".$_user['user_id'].\"' AND cat_name='\".Database::escape_string($_POST['category_name']).\"' AND received='\".$received.\"' AND sent='\".$sent.\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\r\n\r\n\t\t// step 3b, we add the category if it does not exist yet.\r\n\t\tif (mysql_num_rows($result)==0)\r\n\t\t{\r\n\t\t\t$sql=\"INSERT INTO \".$dropbox_cnf['tbl_category'].\" (cat_name, received, sent, user_id)\r\n\t\t\t\t\tVALUES ('\".Database::escape_string($_POST['category_name']).\"', '\".Database::escape_string($received).\"', '\".Database::escape_string($sent).\"', '\".Database::escape_string($_user['user_id']).\"')\";\r\n\t\t\tapi_sql_query($sql);\r\n\t\t\treturn get_lang('CategoryStored');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn get_lang('CategoryAlreadyExistsEditIt');\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$sql=\"UPDATE \".$dropbox_cnf['tbl_category'].\" SET cat_name='\".Database::escape_string($_POST['category_name']).\"', received='\".Database::escape_string($received).\"' , sent='\".Database::escape_string($sent).\"'\r\n\t\t\t\tWHERE user_id='\".Database::escape_string($_user['user_id']).\"'\r\n\t\t\t\tAND cat_id='\".Database::escape_string($_POST['edit_id']).\"'\";\r\n\t\tapi_sql_query($sql);\r\n\t\treturn get_lang('CategoryModified');\r\n\t}\r\n}", "public function store(CategoryValidate $request)\n {\n //check if file is upload\n $image_name='';\n if($request->hasFile('image')){\n $image_name = time().'.'.$request->image->getClientOriginalExtension();\n $request->image->move(('admin/category/'), $image_name);\n } \n \n $store = new Category; \n\n $store->parent_id=$request->parent_id;\n\n $store->category_name=$request->category_name;\n\n $store->category_type=$request->category_type;\n\n $store->slug=Str::slug($request->category_name);\n\n $store->image=$image_name;\n\n $store->created_by=auth()->user()->id;\n\n $store->status=$request->status; \n\n $store->save();\n\n return redirect()->route('categories.index')\n ->with('success','Category created successfully.');\n }", "public function new_category() {\n\t\t$this->use_layout=false;\n\t\t$cat = new CmsCategory;\n\t\t$cat->name = Request::get(\"cat\");\n\t\t$cat->save();\n\t\tif(!$this->all_categories = $cat->clear()->all()) $this->all_categories=array();\t\t\n\t\t$this->cat_list = $this->render_partial(\"cat_list\");\t\n\t}", "public function create()\n\t{\n\t\t// Validate the data\n\t\tif ($this->form_validation->run())\n\t\t{\n\t\t\t$input = array(\n\t\t\t\t'title' => $this->input->post('title'),\n\t\t\t\t'description' => $this->input->post('description'),\n\t\t\t\t'parent_id' => $this->input->post('parent_id'),\n\t\t\t);\n\t\t\t\n\t\t\tif ( ! empty($_FILES['thumbnail']['name']))\n\t\t\t{\n\t\t\t\tif ( ! self::_upload())\n\t\t\t\t{\n\t\t\t\t\t$this->template->messages = array('error' => $this->upload->display_errors());\n\t\t\t\t\tgoto display;\n\t\t\t\t}\n\n\t\t\t\tif ( ! self::_resize())\n\t\t\t\t{\n\t\t\t\t\t$this->template->messages = array('error' => $this->image_lib->display_errors());\n\t\t\t\t\tgoto display;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$thumbnail = $this->upload->data();\n\t\t\t\t$input['thumbnail'] = $thumbnail['file_name'];\n\t\t\t}\n\t\t\t\n\t\t\t$this->video_channel_m->insert($input)\n\t\t\t\t? $this->session->set_flashdata('success', sprintf(lang('video_channel:add_success'), $this->input->post('title')))\n\t\t\t\t: $this->session->set_flashdata(array('error'=> lang('video_channel:add_error')));\n\n\t\t\tredirect('admin/videos/channels');\n\t\t}\n\n\t\tdisplay:\n\t\t\n\t\t// Loop through each validation rule\n\t\tforeach($this->validation_rules as $rule)\n\t\t{\n\t\t\t$channel->{$rule['field']} = set_value($rule['field']);\n\t\t}\t\n\t\t\t\n\t\t$channels = array(lang('select.none')) + $this->video_channel_m->order_by('title')->where('parent_id', 0)->dropdown('id', 'title');\n\t\t\t\n\t\t$this->template\n\t\t\t->title($this->module_details['name'], lang('video_channel:create_title'))\n\t\t\t->set('channel', $channel)\n\t\t\t->set('channels', $channels)\n\t\t\t->build('admin/channels/form', $this->data);\t\n\t}", "public function store(Request $request)\n {\n $this->validate($request,[\n 'name'=>'required',\n 'image'=>'required|image|mimes:jpeg,png,jpg'\n\n ]);\n\n $image =$request->file('image');\n $slug= str_slug($request->name);\n\n $currentdata= Carbon::now()->toDateString();\n\n\n if(isset($image)){\n $imageName=$slug.'-'.$currentdata.'-'.uniqid().'.'.$image->getClientOriginalExtension();\n\n\n if(!Storage::disk('public')->exists('category')){\n Storage::disk('public')->makeDirectory('category');\n\n }\n\n $category= Image::make($image)->resize(1600,479)->stream();\n Storage::disk('public')->put('category/'.$imageName,$category);\n\n\n\n //slider image\n\n if(!Storage::disk('public')->exists('category/slider')){\n Storage::disk('public')->makeDirectory('category/slider');\n }\n\n\n $categorySlider= Image::make($image)->resize(500,333)->stream();\n\n Storage::disk('public')->put('category/slider/'.$imageName, $categorySlider);\n\n\n }else{\n $imageName=\"default.png\";\n }\n\n\n $categories= new Category();\n $categories->name=$request->name;\n $categories->slug=$slug;\n $categories->image=$imageName;\n $categories->save();\n Toastr::success(\"Tag update successfully\",'success');\n return redirect()->route('admin.category.index');\n\n\n\n\n\n }" ]
[ "0.6457996", "0.6418421", "0.6280149", "0.6258419", "0.62341547", "0.62338513", "0.6215257", "0.6186579", "0.6134619", "0.61315817", "0.61244404", "0.6043199", "0.60421747", "0.6031893", "0.60311496", "0.60204273", "0.6015956", "0.6015519", "0.5985891", "0.59772885", "0.5974751", "0.5949288", "0.59448254", "0.59128785", "0.5879066", "0.5852101", "0.5849617", "0.5842242", "0.58322406", "0.5828376", "0.58092415", "0.5807654", "0.5807586", "0.5799984", "0.57904583", "0.57752067", "0.57720023", "0.57711434", "0.5769931", "0.57519305", "0.57334065", "0.57289976", "0.5722618", "0.5717649", "0.5708708", "0.57084674", "0.5697302", "0.56963485", "0.5693934", "0.56927985", "0.56906015", "0.5689133", "0.56803375", "0.5679511", "0.56769335", "0.56725615", "0.56690013", "0.5668032", "0.5657178", "0.5653943", "0.56486404", "0.5648362", "0.5647452", "0.5646727", "0.56417876", "0.5640447", "0.5634344", "0.56249315", "0.5609698", "0.56064284", "0.5606276", "0.5604953", "0.56037855", "0.55960387", "0.55942297", "0.5587076", "0.5576472", "0.5561911", "0.5560889", "0.5553344", "0.5541257", "0.5531086", "0.5526098", "0.5524729", "0.5512733", "0.5511381", "0.55015504", "0.5501363", "0.549951", "0.5498098", "0.5490595", "0.54895794", "0.54869527", "0.5485653", "0.54835844", "0.5482278", "0.5481201", "0.54794884", "0.5474742", "0.5469698" ]
0.663629
0
/edit message Function for delete
public function deleteMessage(Request $request) { $messageId = $request->messageId; $getMessgeById = Contacts::find($messageId); if($getMessgeById->delete()){ Session::flash('danger','Message deleted successfully'); return redirect()->back(); } else{ Session::flash('danger','sorry ! message could not be deleted.'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function messageDelete(Message $message);", "public function action_delete() {\n\t\t$id = $this->request->param('id');\n\t\tif($id) {\n\t\t\t$message = ORM::factory('Message', $id);\n\t\t\tif($message->loaded()) {\n\t\t\t\ttry {\n\t\t\t\t\t$message->delete();\n\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t$this->_set_msg('Could not delete message because another user is tied to it', 'error');\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->redirect($this->request->referrer());\n\t\t}\n\t\t$this->_set_content('message_delete');\n\t}", "public function action_Delete_Message()\n\t{\n\t\t// load item\n\t\t$item = ORM::factory('Ticket_Message', $this->request->param('id'));\n\n\t\tif ( ! $item->loaded())\n\t\t\t$this->not_found('Could not find ticket message to delete. Already deleted maybe?');\n\n\t\t$ticket_id = $item->ticket->id;\n\n\t\t$item->deleted_at = date('Y-m-d H:i:s');\n\t\t$item->save();\n\n\t\tHTTP::redirect('Ticket/Detail/'.$ticket_id);\n\t}", "function admin_delete($id = null){\r\n\t\tif (!$id) {\r\n $this->Session->setFlash(__('Invalid id for Message', true), 'admin_flash_good');\r\n $this->redirect(array('action' => 'message'));\r\n }\r\n if (!isset($this->params['named']['token']) || ($this->params['named']['token'] != $this->params['_Token']['key'])) {\r\n $blackHoleCallback = $this->Security->blackHoleCallback;\r\n $this->$blackHoleCallback();\r\n }\r\n\t\t$this->data = $this->Message->read(null, $id);\r\n\t\t$mid = $this->data['Message']['receiver_id'];\r\n if ($this->Message->delete($id)) {\r\n $this->Session->setFlash(__('Message deleted', true), 'admin_flash_good');\r\n $this->redirect(array('controller'=>'messages','action' => 'index/'.$mid.''));\r\n }\t\r\n\t}", "function delete($id) {\n $this->message = ORM::factory('message', $id);\n if ( ! $this->message->loaded)\n Event::run('system.404');\n if ( ! $this->message->is_allowed($this->user->id))\n Event::run('system.403');\n \n $this->message->delete($this->user->id);\n url::redirect('messages');\n }", "public function getEventDel($id , $message);", "public function delete() {\n\t\t$message = $this->discussion->message(['id' => $this->request->id]);\n\n\t\tif ($this->discussion->pull_message($message)) {\n\t\t\treturn $this->render(['head' => true, 'status' => 204]);\n\t\t}\n\n\t\treturn $this->render(['head' => true, 'status' => 400]);\n\t}", "public function edit(Message $message) {\n //\n }", "public static function removeMessage() {\n $con = pg_connect(\"host=\".CON_HOST.\" dbname=\".CON_DBNAME.\" user=\".CON_USER.\" password=\".CON_PASSWORD.\"\")\n or die (\"Could not connect to server.\");\n\n if($_REQUEST['id'] > 1) {\n $query = \"UPDATE message SET removed = true WHERE message_id = \". $_REQUEST['id'];\n }\n\n pg_query($con, $query) or die(\"Cannot execute the query.\");\n return true;\n }", "public function edit(Message $message)\n {\n //\n }", "public function edit(Message $message)\n {\n //\n }", "public function edit(Message $message)\n {\n //\n }", "public function edit(Message $message)\n {\n //\n }", "public function edit(Message $message)\n {\n //\n }", "public function edit(Message $message)\n {\n //\n }", "public function edit(Message $message)\n {\n //\n }", "public function edit(Message $message)\n {\n //\n }", "public function edit(Message $message)\n {\n //\n }", "public function edit(Message $message)\n {\n //\n }", "public function edit(Message $message)\n {\n //\n }", "public function edit(Message $message)\n {\n //\n }", "public function actionDelete()\n\t{\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n $userId=Yii::app()->user->id;\n $msgId = array();\n if(isset($_POST[\"check\"])){//批量删除\n $msgId = array_keys($_POST[\"check\"]);\n \n }else{\n $msgId = array($_GET['id']);\n }\n if($msgId){\n foreach($msgId as $value){\n $model = Msg::model()->findbyPk($value);\n if($userId==$model->msg_sendid){\n $model->msg_senddel = Msg::$del['del'];\n $model->update();\n }elseif($userId == $model->msg_revid){\n $model->msg_revdel = Msg::$del['del'];\n $model->update();\n }\n }\n }\n \n header('Location:'.$_SERVER['HTTP_REFERER']);\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n\t}", "function admin_mail_delete( int $message_id ) : mixed\n{\n // Only administrators can delete admin mail\n user_restrict_to_administrators();\n\n // Sanitize the message id\n $message_id = sanitize($message_id, 'int', 0);\n\n // Error: Message ID not found\n if(!database_row_exists('users_private_messages', $message_id))\n return __('users_message_not_found');\n\n // Fetch some data regarding the message\n $dmessage = mysqli_fetch_array(query(\" SELECT users_private_messages.fk_users_recipient AS 'pm_recipient' ,\n users_private_messages.fk_users_sender AS 'pm_sender' ,\n users_private_messages.hide_from_admin_mail AS 'pm_hide'\n FROM users_private_messages\n WHERE users_private_messages.id = '$message_id'\"));\n\n // Error: Can not delete messages hidden from the admin inbox\n if($dmessage['pm_hide'])\n return __('users_message_ownership');\n\n // Error: Message does not belong to user\n if($dmessage['pm_recipient'] && $dmessage['pm_sender'])\n return __('users_message_ownership');\n\n // Hard delete the message\n query(\" DELETE FROM users_private_messages\n WHERE users_private_messages.id = '$message_id' \");\n\n // All went well, return NULL\n return NULL;\n}", "public function getEventdel($id , $message = \"\"){\n if($id >= 0){\n $this->set_id($id);\n $model = $this->get_model_obj()->find( $this->get_id() );\n $array = $this->set_values_to_inputs($model);\n $body = $this->get_form_cud( $this->get_url_this_dele() , $array ,\"disabled\");\n $header = sprintf('<h1><span class=\"glyphicon glyphicon-plus\"></span>Session Delete:</h1>%1$s<hr style=\"border:1px solid #CCCCCC;\">',$message);\n $this->set_content( $header.$body.$this->get_error_message() );\n return $this->index();\n }\n else{\n echo \"You tried to put non positif id \";\n }\n }", "public function editRecordConfirmMessage($editId)\n{\n\n return \"\";\n}", "public function delete_msg($id){\n\n\n\t\t$this->query(\"DELETE FROM `my_cart`.`messege` WHERE `id` = '$id'\");\n\n\t}", "function edit_message() {\n\tglobal $core, $document, $user, $boards, $threads, $posts, $db;\n\n\tif (!isset($_POST['thread_id']) || !isset($_POST['board_id']) || !isset($_POST['post_id']) || !isset($_POST['post_name']) || !isset($_POST['post_message'])) {\n\t\tfatal_error(\"Some or all of the information needed to post a new message are missing. Please try again\");\n\t}\n\n\t//Make fields safe\n\t$postid = make_safe(\"int\",$_POST['post_id']);\n\t$boardid = make_safe(\"int\",$_POST['board_id']);\n\t$threadid = make_safe(\"int\",$_POST['thread_id']);\n\t$postname = make_safe(\"text\",$_POST['post_name']);\n\t$postmessage = make_safe(\"text\",$_POST['post_message']);\n\n\t//Sanity check fields\n\tif (strlen($postname) < 2 || strlen($postmessage) < 10) { \n\t\tfatal_error(\"Your message title or message text is too short. Please try again\");\n\t}\n\tif (!$posts->get_post($postid)) {\n\t\tfatal_error(\"Invalid post specified. Please try again\");\n\t}\n\tif (!$boards->get_board($boardid)) {\n\t\tfatal_error(\"Invalid board specified. Please try again\");\n\t} \n\tif (!$threads->get_thread($threadid)) {\n\t\tfatal_error(\"Invalid thread specified. Please try again\");\n\t}\n\n\t//Now post the message\n\t$posts->edit_post($postid,$postname,$postmessage);\n\n\t//Now go back to the forum\n\t$core->do_redirect(\"showthread.php?t=$threadid\");\t\t\n}", "function private_messages_delete( int $message_id ) : mixed\n{\n // Require users to be logged in to run this action\n user_restrict_to_users();\n\n // Sanitize the data\n $user_id = sanitize(user_get_id(), 'int', 1);\n $message_id = sanitize($message_id, 'int', 0);\n $timestamp = time();\n\n // Error: Message ID not found\n if(!database_row_exists('users_private_messages', $message_id))\n return __('users_message_not_found');\n\n // Fetch some data regarding the message\n $dmessage = mysqli_fetch_array(query(\" SELECT users_private_messages.deleted_by_recipient AS 'pm_deleted_r' ,\n users_private_messages.deleted_by_sender AS 'pm_deleted_s' ,\n users_private_messages.fk_users_recipient AS 'pm_recipient' ,\n users_private_messages.fk_users_sender AS 'pm_sender'\n FROM users_private_messages\n WHERE users_private_messages.id = '$message_id' \"));\n\n // Determine whether user is sender or recipient\n $user_is_sender = ((int)$dmessage['pm_sender'] === $user_id);\n\n // Error: Message is already deleted\n if(($user_is_sender && $dmessage['pm_deleted_s']) || (!$user_is_sender && $dmessage['pm_deleted_r']))\n return __('users_message_predeleted');\n\n // Error: Message does not belong to user\n if((int)$dmessage['pm_recipient'] !== $user_id && (int)$dmessage['pm_sender'] !== $user_id)\n return __('users_message_ownership');\n\n // If both sender and recipient deleted the message, or if the message is sent to self, hard delete it\n if((!$user_is_sender && $dmessage['pm_deleted_s']) || ($user_is_sender && $dmessage['pm_deleted_r']) || ((int)$dmessage['pm_recipient'] === (int)$dmessage['pm_sender']))\n query(\" DELETE FROM users_private_messages\n WHERE users_private_messages.id = '$message_id' \");\n\n // Otherwise soft delete it\n else if($user_is_sender)\n query(\" UPDATE users_private_messages\n SET users_private_messages.deleted_by_sender = 1\n WHERE users_private_messages.id = '$message_id' \");\n else\n query(\" UPDATE users_private_messages\n SET users_private_messages.deleted_by_recipient = 1 ,\n users_private_messages.read_at = '$timestamp'\n WHERE users_private_messages.id = '$message_id' \");\n\n // All went well, return NULL\n return NULL;\n}", "public function messageDelete($id)\n {\n $deletemessage=Messages::find($id)->delete();\n return redirect()->back();\n }", "function delete($id)\r\n {\r\n \r\n // status change \r\n if ($this->chat_model->save(array('status'=>'I'),$id)==TRUE)\r\n {\r\n redirect(site_url('admin/chat/index/?msg_success=Successfully details updated'));\r\n }\r\n else\r\n {\r\n redirect(site_url('admin/chat/index/?msg_error=Unsuccess full opertation'));\r\n\r\n }\r\n \r\n }", "private function act_mdel($raw) {\n\t\treturn \"<a class=\\\"msg-delete\\\" data-done=\\\"0\\\" data-recid=\\\"{$raw['id']}\\\" href=\\\"#\\\">Delete Message</a>\";\n\t}", "function delete($id=\"\")\n { \n $output['success'] = FALSE;\n $ceklogin = $this->cek_session->islogin();\n $output['logged_in'] = $ceklogin;\n $output['message'] = \"fail to sdelete Message\";\n if($ceklogin)\n {\n $this->mongo_db->select_db(\"Users\");\n $this->mongo_db->select_collection(\"Inbox\"); \n $this->mongo_db->remove(array('_id' => $this->mongo_db->mongoid($id)));\n $url = current_url();\n $this->m_user->tulis_log(\"Delete Message User\",$url,\"API Unity\");\n $output['success'] = TRUE;\n $output['message'] = \"Message is deleted\";\n }\n echo json_encode($output);\n }", "function ppmess_delete_commun($message_id, $post_id, $user_logged){\n\t\n\tglobal $wpdb;\t\n\t\n\t// default state: npr. for user_id = 1 and user_id = 2 \"_1_2\" OR \"_2_1\"\n\t$new_status = '__'; // deaktiviranje aktivnosti diskusije za trenutnog korisnika\n\t$search_status = '_' . $user_logged; // trenutni status u bazi ( pocetan vrednost je \"_NUMBER\" - znaci da je diskusija aktuelna za korisnika user_NUMBER )\n\t\t\t\t\t\t\t\t\t\t// ako nema broja NUMBER u koloni show_status diskusija za korisnika NUMBER vise nije aktivna\n\t$new_sent_to = 0;\t\t\t\t\t\t\t\t\t\n\t// get current status for desired communicatiion\n\t$query = \"SELECT show_status FROM {$wpdb->prefix}private_messages WHERE message_id = $message_id AND post_id = $post_id AND message_parent = 0 AND (receiver_id = $user_logged OR sender_id = $user_logged)\";\n\t$current_status = $wpdb->get_results( $query, ARRAY_A );\n\t\n\tif( $wpdb->num_rows == 1 ){\n\t\tforeach($current_status as $status){\n\t\t\t$new_value = str_replace($search_status, $new_status, $status['show_status']); \n\t\t}\n\t}else{\n\t\treturn FALSE;\n\t}\n\t\n\treturn $wpdb->query(\n\t\t$wpdb->prepare(\"UPDATE {$wpdb->prefix}private_messages SET show_status = %s, sent_to = %d WHERE (message_id = %d AND post_id = %d AND message_parent = 0\n\t\t\tAND (receiver_id = %d OR sender_id = %d)) OR (post_id = %d AND message_parent = %d AND (receiver_id = %d OR sender_id = %d))\", \n\t\t\t$new_value, $new_sent_to, $message_id, $post_id, $user_logged, $user_logged, $post_id, $message_id, $user_logged, $user_logged)\n\t);\t\n}", "public function deleted(Edit $edit)\n {\n //\n }", "public function actionDeletemsg(){\n $user_id = \\Yii::$app->user->getID();\n $user = User::findIdentity($user_id);\n $result = true;\n if(isset($_GET['id'])){\n $id = (int) $_GET['id'];\n foreach (Message::find()->where('thread_id = ' . $id . ' AND (from_user = ' . $user_id . ' OR to_user = ' . $user_id . ') AND status != 0')->each() as $message) {\n if($message->status == 1){\n $message->status = $user_id;\n }else{\n $message->status = 0;\n }\n if($message->save()){\n $result = $result || true;\n }\n }\n if($result){\n echo \"true\";\n }else{\n echo \"false\";\n }\n }\n }", "function del()\n\t{\n\t $id = $this->uri->rsegment(3);\n\t $this->_del($id);\n\t\n\t //tạo ra nội dung thông báo\n\t $this->session->set_flashdata('message', 'không tồn tại liên hệ này');\n\t redirect(admin_url('contact'));\n\t}", "function flagForDelete($msg_index) {\n //flag msg for deletion\n imap_delete($this->conn, $msg_index);\n echo \"$msg_index flagged for deletion\";\n }", "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Gou_Service_ForumReply::getForumReply($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$ret = Gou_Service_ForumReply::deleteForumReply($id);\n\t\tif (!$ret) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "function delete_message($chatID, $msgID) {\n file_get_contents(API_URL . \"deleteMessage?chat_id=\" . $chatID . \"&message_id=\" . $msgID);\n}", "function remove_message($db, $id)\n{\n\t$sql = \"DELETE from messages where id = :id\";\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':id'=>$id));\n\treturn;\n}", "function qa_pm_delete($userid, $handle, $cookieid, $message, $box)\n{\n\trequire_once QA_INCLUDE_DIR . 'db/messages.php';\n\n\tqa_db_message_user_hide($message['messageid'], $box);\n\tqa_db_message_delete($message['messageid'], false);\n}", "public function DeleteMsg($id,Request $request)\n {\n $msg = Ajaxis::BtDeleting('Warning!!','Would you like to remove This?','/movimiento/'. $id . '/delete');\n\n if($request->ajax())\n {\n return $msg;\n }\n }", "function warquest_home_comment_delete_do() {\r\n\t\r\n\t/* input */\r\n\tglobal $uid;\r\n\t\r\n\t/* output */\r\n\tglobal $comment;\r\n\tglobal $output;\r\n\t\r\n\tif (warquest_db_comment_delete($uid) == 1) {\r\n\t\t\r\n\t\t$message = t('HOME_MESSAGE_DELETED');\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\t\t\r\n\t\t\r\n\t\t$comment=\"\";\r\n\t\t$uid=0;\r\n\t}\r\n}", "public function deleteMessage(){\n\t\t\n\t\tuser_login_required();\n\n\t\t$messageID = postInt(\"messageID\");\n\n\t\t//Check whether the user own or not conversation message\n\t\tif(!components()->conversations->isOwnerMessage(userID, $messageID))\n\t\t\tRest_fatal_error(401, \"You do not own this conversation message!\");\n\t\t\n\t\tif(!components()->conversations->deleteConversationMessage($messageID))\n\t\t\tRest_fatal_error(500, \"Could not delete conversation message!\");\n\t\t\n\t\treturn array(\"success\" => \"Conversation message has been successfully deleted!\");\n\t}", "public function actionDelete() {}", "public function actionDelete() {}", "public function getDelete($id)\n\t{\n\t\t$bm = MessageModel::find($id);\n\t\t$bm->delete();\n\t\treturn Redirect::to('admin/messages')->with('messages','Data has been deleted');\n\t}", "public function validateDelete ($postArray,$editId) \n{\n $retMesg='';\n return $retMesg;\n\n}", "function delete($id=null) {\n\t\t\t\t\t$id=base64_decode($id);\n\t\t\t\t\t\n\t\t\t\t\t$this->SentBox->id = (int)$id;\n\t\t\t\t\t\n\t\t\t\t\t$this->SentBox->delete($id);\n\t\t\t\t\t\n\t\t\t\t\t//$this->Session->setFlash('The Sent item with id: '.$id.' from SentBox has been Deleted Successfully!!');\n\t\t\t\t\t\n\t\t\t\t\t$this->redirect(array('action'=>'index'));\n\t}", "function Admin_Messages_admin_delete($args)\n{\n // Get parameters from whatever input we need. All arguments to this\n // function should be obtained from pnVarCleanFromInput(), getting them\n // from other places such as the environment is not allowed, as that makes\n // assumptions that will not hold in future versions of PostNuke\n list($mid,\n $objectid,\n $confirmation) = pnVarCleanFromInput('mid',\n 'objectid',\n 'confirmation');\n\n\n // User functions of this type can be called by other modules. If this\n // happens then the calling module will be able to pass in arguments to\n // this function through the $args parameter. Hence we extract these\n // arguments *after* we have obtained any form-based input through\n // pnVarCleanFromInput().\n extract($args);\n\n // At this stage we check to see if we have been passed $objecmid, the\n // generic item identifier. This could have been passed in by a hook or\n // through some other function calling this as part of a larger module, but\n // if it exists it overrides $mid\n //\n // Note that this module couuld just use $objecmid everywhere to avoid all\n // of this munging of variables, but then the resultant code is less\n // descriptive, especially where multiple objects are being used. The\n // decision of which of these ways to go is up to the module developer\n if (!empty($objectid)) {\n $mid = $objectid;\n } \n\n // The user API function is called. This takes the item ID which we\n // obtained from the input and gets us the information on the appropriate\n // item. If the item does not exist we post an appropriate message and\n // return\n $item = pnModAPIFunc('Admin_Messages',\n 'user',\n 'get',\n array('mid' => $mid));\n\n if ($item == false) {\n return pnVarPrepHTMLDisplay(_ADMINMESSAGESNOSUCHITEM);\n }\n\n // Security check - important to do this as early as possible to avoid\n // potential security holes or just too much wasted processing. However,\n // in this case we had to wait until we could obtain the item name to\n // complete the instance information so this is the first chance we get to\n // do the check\n if (!pnSecAuthAction(0, 'Admin_Messages::', \"$item[title]::$mid\", ACCESS_DELETE)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n\n // Check for confirmation. \n if (empty($confirmation)) {\n // No confirmation yet - display a suitable form to obtain confirmation\n // of this action from the user\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('Admin_Messages');\n\n\t // As Admin output changes often, we do not want caching.\n \t$pnRender->caching = false;\n\n // Add the message id\n\t\t$pnRender->assign('mid', $mid);\n\n // Return the output that has been generated by this function\n return $pnRender->fetch('admin_messages_admin_delete.htm');\n }\n\n // If we get here it means that the user has confirmed the action\n\n // Confirm authorisation code. This checks that the form had a valid\n // authorisation code attached to it. If it did not then the function will\n // proceed no further as it is possible that this is an attempt at sending\n // in false data to the system\n if (!pnSecConfirmAuthKey()) {\n pnSessionSetVar('errormsg', _BADAUTHKEY);\n pnRedirect(pnModURL('Admin_Messages', 'admin', 'view'));\n return true;\n }\n\n // The API function is called. Note that the name of the API function and\n // the name of this function are identical, this helps a lot when\n // programming more complex modules. The arguments to the function are\n // passed in as their own arguments array.\n //\n // The return value of the function is checked here, and if the function\n // suceeded then an appropriate message is posted. Note that if the\n // function did not succeed then the API function should have already\n // posted a failure message so no action is required\n if (pnModAPIFunc('Admin_Messages',\n 'admin',\n 'delete',\n array('mid' => $mid))) {\n // Success\n pnSessionSetVar('statusmsg', _ADMINMESSAGESDELETED);\n }\n\n // This function generated no output, and so now it is complete we redirect\n // the user to an appropriate page for them to carry on their work\n pnRedirect(pnModURL('Admin_Messages', 'admin', 'view'));\n \n // Return\n return true;\n}", "public function destroy($message_id)\n {\n if(auth()->user()->hasPermissionTo('Delete Message') OR \n (Gate::allows('Administrator', auth()->user()))){\n $message = $this->model->show($message_id); \n $details= $message->title; \n \n if (($message->delete($message_id))AND ($message->trashed())) {\n return redirect()->back()->with([\n 'success' => \"You Have Deleted $details From The message List Successfully\",\n ]);\n }\n } else{\n return redirect()->back()->with([\n 'error' => \"You Dont have Access To Delete A message\",\n ]);\n }\n }", "public function edit(Messages $messages)\n {\n //\n }", "function deleteMessage($chatID, $message_id) {\n global $bot;\n\n $data = array();\n $data['chat_id'] = $chatID;\n $data['message_id'] = $message_id;\n\n return $bot->TelegramApi(\"deleteMessage\", $data);\n}", "function deleteAction()\r\n\t{\r\n\t\t$data['message'] = \"\";\r\n\t\t$MaNguoiDung = $_GET['MaNguoiDung']; \r\n\r\n\t\t//echo $MaNguoiDung;\r\n\t\tif (isset($MaNguoiDung)) {\r\n\r\n\t\t\t$this->model->load(\"Nguoidung\");\r\n\t\t\t$nguoidung = new Nguoidung_Model();\r\n\t\t\t$nguoidung->delete($MaNguoiDung);\r\n\t\t\t$data['message'] = \"xóa người dùng thành công\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data['message'] = \"không tồn tại mã người dùng\";\r\n\t\t}\r\n\r\n\t\t$this->indexAction($data);\r\n\t\t\r\n\t}", "public function deleteMsg($msg_id) {\n //get proper msg id \n $msg_id_decoded = urldecode($msg_id);\n //delete msg from server who has that spesific ID\n $this->user_model->deleteThisMsg($msg_id_decoded);\n\n redirect('login/home', FALSE);\n }", "public function DeleteMsg($id,Request $request)\n {\n $msg = Ajaxis::MtDeleting('Warning!!','Would you like to remove This?','/project/'. $id . '/delete');\n\n if($request->ajax())\n {\n return $msg;\n }\n }", "function Del_Mess_One($name, $command)\n{\n \n global $cbox_url, $Bot_Name, $Bot_Key;\n \n //Find ID and Del\n $a = file_get_contents($cbox_url . '&sec=main');\n $matches = explode('<tr id=', $a);\n for ($i = 0; $i < count($matches); $i++) {\n $mess = $matches[$i];\n //Get User Name\n preg_match('%<b class=\"(.*)\">(.*)</b>%U', $mess, $user);\n $nick = $user[2];\n \n //Neu name chinh la name can del == > del\n if ($name == $nick) {\n \n if (count(explode($command, $mess)) > 1) {\n //Get ID User\n preg_match('%\"(.*)\">%U', $mess, $id);\n $id_user = $id[1];\n \n $dj = \"DJ Myno\";\n $passdj = \"ken-123\";\n $keydj = Get_Key($cbox_url, $dj, $passdj);\n //Del\n $cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user . '<br>';\n _Get($cbox_url . '&sec=delban&n=' . $dj . '&k=' . $keydj . '&del=' . $id_user);\n }\n }\n }\n}", "abstract public function deleteMessage($messageNo, $mailboxPath=null);", "function _deleteMessage($chatId, $messageId){\n $data = [\n 'chat_id' => $chatId,\n 'message_id' => $messageId\n ];\n \n return Request('deleteMessage', $data);\n}", "public function delete_admin_message($reply_id)\n {\n $reply = Reply::find($reply_id);\n $reply->deleted = 1;\n $reply->save();\n\n return redirect()->to('messages');\n }", "public function post_delete(){\n\t\t\t\n\t\t$data \t= \tFiledb::_rawurldecode(json_decode(stripcslashes(Input::get('data')), true));\n\n\t\tif($data[\"delete\"] == 'delete'){\n\t\t\t\n\t\t\t$status = Users::delete($data[\"id\"]);\n\n\t\t\treturn ($status) ? Utilites::success_message(__('forms.deleted_word')) : Utilites::fail_message(__('forms_errors.undefined'));\n\t\t}\n\t}", "public function delete_command(){\n\t\t$this->layout = 'ajax';\n\t\n\t\tif($this->request->is('post')){\n\t\t\t$command_id = $this->request->data['command_id'];\n\t\n\t\t\t$obj_command = $this->Command->findBy('IDCommand', $command_id);\n\t\t\tif($obj_command->saveField('Status', 0)){\n\t\t\t\techo json_encode(array('success'=>true,'msg'=>__('Eliminado con &eacute;xito.')));\n\t\t\t\texit();\n\t\t\t}else{\n\t\t\t\techo json_encode(array('success'=>false,'msg'=>__('Error inesperado.')));\n\t\t\t\texit();\n\t\t\t}\n\t\t}\n\t\n\t}", "public function deleteAction() {\n \n }", "public function DELETE() {\n #\n }", "public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }", "public function getRequestActionText()\n {\n return t(\"Deletion\");\n }", "function delete($messageID, $user) {\n if ($user->isAdmin) {\n $query = \"DELETE FROM Messages WHERE messageID = ?\";\n if (!$stmt = $this->database->prepare($query)) {\n return false;\n }\n if (!$stmt->bind_param('i', $messageID)) {\n return false;\n }\n\n if ($stmt->execute()){\n $stmt->close();\n return true;\n }\n else{\n $stmt->close();\n return false;\n }\n }\n else{\n $query = \"DELETE FROM Messages WHERE messageID = ? AND userID = ?\";\n if (!$stmt = $this->database->prepare($query)) {\n return false;\n }\n if (!$stmt->bind_param('ii', $messageID, $user->userID)) {\n return false;\n }\n if ($stmt->execute()){\n $stmt->close();\n return true;\n }\n else{\n $stmt->close();\n return false;\n }\n }\n }", "public function destroy($id)\n {\n //\n $message=Message::find($id);\n $message->delete();\n return redirect('s_message')->with('success','تم حذف الطلب بنجاح');\n }", "public function DeleteMsg($id,Request $request)\n {\n $msg = Ajaxis::BtDeleting('Warning!!','Would you like to remove This?','/hase_country/'. $id . '/delete');\n\n if($request->ajax())\n {\n return $msg;\n }\n }", "public function actionRequesttodelete()\n\t{\n\t\tif (!API::getInputDataArray($data, array('userId','postId')))\n\t\t{\n return API::echoJsonError('ERROR: Please provide details to Requesttodelete');\n\t\t}\n\t\t\t \n\t\t$model1 = new RequestDelete();\n\t\t//check if already request to delete\n\t\t$checkdeletedROW = Yii::$app->db->createCommand(\"SELECT count(*) as totreqdel from request_delete WHERE fid = '\".$data['userId'].\"' AND pid = '\".$data['postId'].\"'\")->queryAll();\n \t\t\n\t\t$totreqdelete = 0;\n\t\tforeach($checkdeletedROW as $row)\n\t\t{\n\t\t\t$totreqdelete = $row['totreqdel'];\n\t\t}\n \t\t\t\n\t\tif($totreqdelete==0)\n\t\t{\n\t\t\t$model1 -> fid = $data['userId'];\n\t\t\t$model1 -> pid = $data['postId'];\n\t\t\tif(!$model1 -> save())\n\t\t\t{\n\t\t\t\t$message = \"Error in saving data\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t \n\t\t\t\t$message = $this->getSinglepost($data['postId'],$data['userId']);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$message = \"Already Request sent to delete\";\n\t\t}\n\t\t\n \t\t$returnArray['error'] = 0;\n\t\t$returnArray['data'] = array('message'=>$message);\n\t\t$returnArray['data'] = array('post'=>$message);\n\t\t\n\t\treturn $returnArray;\n\t\t\n\t}", "public function deleteMessage( $id )\n\t{\n\t\t$record = Message::find( $id );\n\t\t$record->delete();\n\t}", "public function deletePreProcessing($postArray,$editId)\n{\n $retMesg='';\n return $retMesg;\n}", "function delEmailHandler1() {\n global $inputs;\n\n $sql = \"DELETE FROM mail WHERE id = \" . $inputs['id'];\n execSql($sql);\n\n formatOutput(true, 'delete success');\n}", "public function delete($sender) {\n\t\t$delete = ($sender ? \"r\" : \"s\") . \"_delete=1\";\n\t\t$statement = Registry::get(\"database\") -> query(\"UPDATE messages SET \" . $delete . \" WHERE id=?\");\n\t\t$statement -> bindParam(1, \t$this -> getId());\n\t\t$statement -> execute();\n\t}", "public function delete(){\n if (empty($this->pad)){\n msg('Your pad is empty.');\n closeNode();\n }else{\n msg('Please send the number of the note you want to delete from your pad :');\n bindNode('deleteNote');\n }\n\n\n }", "public function delete_messages()\n {\n $this->message=array();\n Session::instance()->delete(\"hana_message\");\n }", "function deleteNotif(){\n \t$id = $_POST['notifId'];\n \t$redirect = $_POST['redirect'];\n\t\t$aItem = $this->model('Notification');\n\t\t$aItem = $aItem->find($id);\n\t\t$aItem->viewed = '1';\n\t\t$aItem->update();\n\t\theader(\"location:\" . $redirect);\n }", "public function delete()\n {\n parent::delete();\n $receiptHandle = $this->job->getReceiptHandle();\n $this->mns->deleteMessage($receiptHandle);\n }", "function admin_edit($id = null){\r\n\t$this->set(\"title_for_layout\", __('Edit Message', true));\t\r\n\t\t\r\n\t\t\r\n\t\tif(!$id && empty($this->data)) {\t\t\r\n\t\t\t$this->Session->setFlash('Invalid Message');\r\n\t\t\t$this->redirect(array('action' => 'index'));\r\n\t\t}\r\n\t\t\r\n\t\tif(!empty($this->data)) {\r\n\t\t\t$mid = $this->data['Message']['receiver_id'];\r\n\t\t // validate & save data\r\n\t\t\t $this->Message->set($this->data);\r\n\t\t\t $this->Message->setValidation('admin');\r\n\t\t\t if ($this->Message->validates()) {\t\t\t \t\r\n\t\t\t\tif ($this->Message->save($this->data)) {\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t$this->Session->setFlash(__('The Message has been updated', true), 'admin_flash_good');\r\n\t\t\t\t\t$this->redirect(array('controller'=>'messages', 'action' => 'index/'.$mid.''));\r\n\t\t\t\t} \r\n\t\t\t\telse {\r\n\t\t\t\t\t$this->Session->setFlash(__('Please correct the errors listed below.', true), 'admin_flash_bad');\r\n\t\t\t\t}\r\n\t\t\t} \r\n\t\t\telse {\r\n\t\t\t\t$this->Session->setFlash(__('The Role could not be saved. Please, try again.', true), 'admin_flash_bad');\r\n\t\t\t}\r\n\t\t}\r\n else{\r\n\t\t\t \r\n\t\t\t $this->data = $this->Message->read(null, $id);\r\n\t\t \r\n\t\t }\r\n\t}", "function action_delmessage($messageid) {\n global $wpdb, $out, $admin_user_login;\n // Get message attributes so we can figure out what to do.\n\n //Current provider ID \n $curID = convertToID($admin_user_login);\n \n $query = \"SELECT uf.user_login AS from_login, ut.user_login AS to_login, pm_clear.meta_key AS clear_p, \" .\n\t\t\"pm_delete1.meta_key AS delete_1 , pm_delete2.meta_key AS delete_2, pm_to.post_id AS parent \" .\n\t\t\"FROM {$wpdb->prefix}posts AS p \" .\n\t\t\"JOIN $wpdb->postmeta pm_to \" .\n\t\t\"ON ((p.post_parent = pm_to.post_id AND p.post_parent <> 0) \" .\n\t\t\"OR (p.id = pm_to.post_id AND p.post_parent = 0)) \" .\n\t\t\"AND pm_to.meta_key = '_fep_participants' \" .\n\t\t\"AND pm_to.meta_value <> p.post_author \" .\n\t\t\"LEFT JOIN $wpdb->postmeta AS pm_delete1 \" . \n\t\t\"ON ((pm_delete1.post_id = p.post_parent AND pm_delete1.meta_key = CONCAT('_fep_delete_by_', p.post_author) ) \" . \n\t\t\"OR (pm_delete1.post_id = p.id AND pm_delete1.meta_key = CONCAT('_fep_delete_by_', p.post_author) )) \" . \n\t\t\"LEFT JOIN $wpdb->postmeta AS pm_delete2 \" . \n\t\t\"ON ((pm_delete2.post_id = p.post_parent AND pm_delete2.meta_key = CONCAT('_fep_delete_by_', pm_to.meta_value) ) \" . \n\t\t\"OR (pm_delete2.post_id = p.id AND pm_delete2.meta_key = CONCAT('_fep_delete_by_', pm_to.meta_value) )) \" . \n\t\t\"LEFT JOIN wp_postmeta AS pm_clear \" .\n\t\t\"ON ((pm_clear.post_id = p.post_parent AND pm_clear.meta_key = CONCAT('_oemr_fep_clear_', p.id)) \" .\n\t\t\"OR (pm_clear.post_id = p.id AND pm_clear.meta_key = CONCAT('_oemr_fep_clear_', p.id))) \" .\n\t\t\"LEFT JOIN $wpdb->users AS uf ON uf.ID = p.post_author \" .\n\t\t\"LEFT JOIN $wpdb->users AS ut ON ut.ID = pm_to.meta_value \";\n\t$query2 = $query;\n \n\t$query .= \"WHERE p.id = %d\";\n\n $row = $wpdb->get_row($wpdb->prepare($query, array($messageid)), ARRAY_A);\n if (empty($row)) {\n\t$out['errmsg'] = \"Cannot delete, there is no message with ID $messageid.\";\n\treturn;\n }\n \n $parent = $row['parent'];\n $timestamp = idate(\"U\"); \n \n if ($row['from_login'] == $admin_user_login) {\n\t //clear the record if admin is from\n\t add_post_meta($messageid, '_oemr_fep_clear_' . $messageid, $timestamp);\n }\t \n \n else if ($row['to_login'] == $admin_user_login) {\n\t //clear the record if admin is to\n\t add_post_meta($messageid, '_oemr_fep_clear_' . $messageid, $timestamp);\n } \n \n $query2 .= \"WHERE (p.id = %d OR p.post_parent = %d) AND pm_clear.meta_key IS NULL AND p.post_type <> 'attachment'\";\n \n $row2 = $wpdb->get_row($wpdb->prepare($query2, array($parent, $parent)), ARRAY_A);\n \n if (empty($row2)) {\n\t add_post_meta($parent, '_fep_delete_by_' . $curID, $timestamp);\n }\n\t\t\n\t$row3 = $wpdb->get_row($wpdb->prepare($query, array($parent)), ARRAY_A);\n\t\n if (($row3['delete_1'] !== NULL) && ($row3['delete_2'] !== NULL)) {\n\t$query4 = $wpdb->prepare(\"SELECT ID FROM {$wpdb->prefix}posts \" .\n\t\"WHERE (ID = %d OR post_parent = %d) and post_type = 'fep_message'\", $parent, $parent);\n\t$row4s = $wpdb->get_results($query4, ARRAY_A);\n\tforeach ($row4s as $row4) {\n\t\t$query5 = $wpdb->prepare(\"SELECT ID, post_mime_type, guid \" .\n\t\t\"FROM {$wpdb->prefix}posts \" .\n\t\t\"WHERE post_parent = %d AND post_type = 'attachment'\", $row4['ID']);\n\t\t$row5s = $wpdb->get_results($query5, ARRAY_A);\n\t\tforeach ($row5s as $row5) {\n\t\t\t$url = $row5['guid'];\n\t\t\t$filename = basename($url);\n\t\t\t$path = parse_url($url, PHP_URL_PATH); // just the path part of the URL\n\t\t\t$parts = explode('/', $path); // all the components\n\t\t\tif ( get_option( 'uploads_use_yearmonth_folders' ) ) {\n\t\t\t\t$parts = array_slice($parts, -6); // the last six\n\t\t\t}\telse {\n\t\t\t\t$parts = array_slice($parts, -4); // the last 4\n\t\t\t}\n\t\t\t$path = implode('/', $parts); \n\t\t\t$filepath = ABSPATH . $path;\n\t\t\tunlink($filepath); //Delete the file from the server.\n\t\t\t$wpdb->query($wpdb->prepare(\"DELETE p FROM {$wpdb->prefix}posts AS p WHERE p.id = %d\",$row5['ID'])); \t\t\t\n\t\t}\n\t\t$wpdb->query($wpdb->prepare(\"DELETE p, pm FROM {$wpdb->prefix}posts AS p \" .\n\t\t\"INNER JOIN {$wpdb->prefix}postmeta AS pm ON pm.post_id = p.ID \" .\n\t\t\"WHERE p.ID = %d OR p.post_parent = %d AND pm.post_id = %d\",$row4['ID'],$row4['ID'],$row4['ID']));\n\t}\n } \n}", "public function delete($message_id){\n $message = Message::where('id', '=', $message_id)->firstOrFail();\n // Remove from database\n $message->delete();\n\n Session::flash('success', 'You have correctly removed that message' );\n return back();\n }", "public function actionDeletebasicdefinition()\n {$getMessages=new Get_Message_Cls();\n $nID=$_POST[\"id\"];\n $in_shortname=\"\";\n $in_description=\"\";\n $in_entity=\"\";\n $def_type=\"\"; \n $vAction='D';\n $vStatus=\"\";\n\n $Basic_Definition_Ins_Cmd = Yii::app()->db->createCommand ('call dml_basic_definition(:pnID,\n :pvShort_name,\n :pvDescription,\n :pvEntity_id,\n :pvDFCTG_Definition_type,\n :pvAction,\n :pvStatus \n )'\n );\n \n \n $Basic_Definition_Ins_Cmd->bindParam(\":pnID\",$nID,PDO::PARAM_STR, 15); // bind return parameter must have enter size exc(10)\n $Basic_Definition_Ins_Cmd->bindParam(\":pvShort_name\",$in_shortname,PDO::PARAM_STR, 30); // bind parameter\n $Basic_Definition_Ins_Cmd->bindParam(\":pvDescription\",$in_description,PDO::PARAM_STR, 100); // bind parameter\n $Basic_Definition_Ins_Cmd->bindParam(\":pvEntity_id\",$in_entity,PDO::PARAM_STR, 30); // bind parameter\n $Basic_Definition_Ins_Cmd->bindParam(\":pvDFCTG_Definition_type\",$def_type,PDO::PARAM_STR, 30); // bind parameter\n $Basic_Definition_Ins_Cmd->bindParam(\":pvAction\",$vAction,PDO::PARAM_STR, 15); // bind parameter\n $Basic_Definition_Ins_Cmd->bindParam(\":pvStatus\",$vStatus,PDO::PARAM_STR, 15); // bind parameter\n $Basic_Definition_Ins_Cmd->execute(); \n echo $vStatus;\n $message=$getMessages->Get_Message_Fnc(\"20130\");\n \n Yii::app()->user->setFlash('success',$message ); \n\n \n \n \n }", "public function DeleteMsg($id)\n {\n $msg = Ajaxis::MtDeleting('Warning!!','Would you like to remove This?','/tarifario/'. $id . '/delete/');\n\n if(Request::ajax())\n {\n return $msg;\n }\n }", "function index_delete() {\n $id = $this->delete('id'); // Memanggil data berdasarkan arraynya\n $this->db->where('id', $id);\n $delete = $this->db->delete('telepon'); \n if ($delete) {\n $this->response(array('status' => 'success'), 201);// Jika berhasil maka akan tampil\n } else {\n $this->response(array('status' => 'fail', 502));// Jika gagal maka akan tampil\n }\n }", "public function getMessageDeleteUrl(): string\n {\n return $this->getUrl('webforms/message/delete');\n }", "public function deleteMessages()\n {\n $this->_Database->query(\"DELETE FROM chat WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(time_posted) >= 3200\");\n }", "public static function DeleteMessage(Request $request) {\n if ($request->msg_id) {\n Usermessage::destroy($request->msg_id);\n }\n }", "function chat_delete($info, $itemtype) {\n $object->id = $info;\n $object->itemtype = $itemtype;\n return $object;\n}", "public function destroy($id)\n {\n die('here');\n $message = message::findOrFail($id);\n $deleted_Caslaw_title = $message->title;\n $message->delete();\n\n return redirect()->route('messages.index')->with('message', 'message '. $deleted_Caslaw_title.' Successfully Deleted!');\n }", "public function deleteAction()\n {\n \n }", "function deleteMessage($messageId){\r\n //$GLOBALS['link'] = connect();\r\n mysqli_query($GLOBALS['link'], 'delete from messages where `id`='. $messageId .';')or die(mysqli_error($GLOBALS['link']));\r\n\r\n return mysqli_affected_rows($GLOBALS['link']);\r\n}", "public function DeleteMessage()\r\n\t{\r\n\t\t$network=''; $plan=''; $ret='';\r\n\t\t\r\n\t\tif ($this->input->post('network')) $network = $this->input->post('network');\r\n\t\tif ($this->input->post('plan')) $plan = $this->input->post('plan');\r\n\t\t\r\n\t\t//Check if record exists\r\n\t\t$sql = \"SELECT * FROM subscriber_messages WHERE (TRIM(network)='\".$this->db->escape_str($network).\"') AND (TRIM(plan)='\".$this->db->escape_str($plan).\"')\";\r\n\t\t$query = $this->db->query($sql);\r\n\t\t\t\t\t\r\n\t\tif ($query->num_rows() > 0 )\r\n\t\t{\r\n\t\t\t$this->db->trans_start();\r\n\t\t\t$this->db->delete('subscriber_messages', array('network' => $network,'plan'=>$plan)); \t\t\t\t\r\n\t\t\t$this->db->trans_complete();\r\n\t\t\t\t\t\t\r\n\t\t\t$Msg='';\r\n\r\n\t\t\tif ($this->db->trans_status() === FALSE)\r\n\t\t\t{\r\n\t\t\t\t$Msg=\"Attempted deleting messages for the service plan \".strtoupper($plan.\"(\".$network.\")\").\" but failed.\";\r\n\t\t\t\t$ret = \"Service Plan Messages Record Could Not Be Deleted.\";\r\n\t\t\t}else\r\n\t\t\t{\r\n\t\t\t\t$Msg=\"Messages for the service plan \".strtoupper($plan.\"(\".$network.\")\").\"' has been deleted successfully.\";\t\t\t\t\r\n\t\t\t\t$ret = 'OK';\r\n\t\t\t}\r\n#($Name,$Activity,$Username,$logdate,$ip,$host,$Operation,$LogID)\t\t\t\t\r\n\t\t\t$this->getdata_model->LogDetails($_SESSION['UserFullName'],$Msg,$_SESSION['username'],$_SESSION['LogIn'],$_SESSION['RemoteIP'],$_SESSION['RemoteHost'],'DELETED SERVICE PLAN MESSAGES',$_SESSION['LogID']);\r\n\t\t}else\r\n\t\t{\r\n\t\t\t$ret=\"Could Not Delete Service Plan Messages Record. Record Does Not Exist.\";\r\n\t\t}\r\n\t\t\r\n\t\techo $ret;\r\n\t}", "public function showDeleteMessageAction()\n {\n Flash::addMessage('Your account will be deleted in the next few days by the webmaster.', Flash::INFO);\n\n $this->redirect('/');\n }", "protected function confirmDelete() {\n\t}", "protected function delete_comment_success_message(){\r\n\t\treturn 'Comment deleted.';\r\n\t}", "public function edit($message_id)\n {\n $message = $this->model->with('messageCategory','messageCriteria')->find(decrypt($message_id));\n if($message){\n return view('admin.messages.edit',compact('message'));\n }\n return error('failed!');\n \n }", "public function getDelete(Request $request)\n {\n $id_message = $request->get('id');\n\n $message = Message::findOrFail($id_message);\n $message->delete();\n\n return('Delete successfull!');\n }", "function onDelete($param)\n {\n $key=$param['key'];\n \n // define duas acoes\n $action1 = new TAction(array($this, 'Delete'));\n \n // define os parametros de cada acao\n $action1->setParameter('key', $key);\n \n //encaminha a chave estrangeira\n $action1->setParameter('fk', filter_input(INPUT_GET, 'fk'));\n\n // exibe um dialogo ao usuario\n new TQuestion('Deseja realmente excluir o registro ?', $action1, $action2);\n }", "public function adminDelComm()\n {\n $commID = $_POST['commID'];\n $del = \"DELETE FROM comment_section WHERE comm_id = ?\";\n $do = $this->connect()->prepare($del);\n $do->execute([$commID]);\n }", "function AfterDelete($where, &$deleted_values, &$message, &$pageObject)\n{\n\n\t\t\n\n$do=$deleted_values[\"LvID\"];\n\n$sqldel = \"DELETE FROM indleave WHERE LvID='$do'\";\nCustomQuery($sqldel);\n\n\n;\t\t\n}" ]
[ "0.7668003", "0.72323567", "0.7138693", "0.70651025", "0.70332915", "0.6942195", "0.69413954", "0.6839052", "0.6822671", "0.6808378", "0.6808378", "0.6808378", "0.6808378", "0.6808378", "0.6808378", "0.6808378", "0.6808378", "0.6808378", "0.6808378", "0.6808378", "0.6808378", "0.6763052", "0.67012954", "0.6676104", "0.6657721", "0.6656562", "0.66430503", "0.6598972", "0.6569776", "0.65396434", "0.64624184", "0.6453359", "0.64161587", "0.64158106", "0.6408217", "0.6396085", "0.6384559", "0.6378274", "0.6372516", "0.6365084", "0.63449013", "0.63282555", "0.6323388", "0.63224566", "0.6318489", "0.6318489", "0.63155735", "0.62930083", "0.6279354", "0.62781596", "0.62556124", "0.625507", "0.6246206", "0.6229896", "0.6218188", "0.62125885", "0.6212546", "0.6195285", "0.61949736", "0.6193372", "0.6186612", "0.61783975", "0.6171281", "0.61709243", "0.61667866", "0.6153046", "0.61360514", "0.61186", "0.6117284", "0.6113944", "0.61106306", "0.6110548", "0.6105573", "0.6100182", "0.60837114", "0.6077226", "0.6072259", "0.6069292", "0.60688704", "0.6068086", "0.6067627", "0.60653967", "0.60626334", "0.60625786", "0.6050263", "0.6049366", "0.60467976", "0.60462964", "0.6042666", "0.6041422", "0.60406697", "0.60375303", "0.60358566", "0.6033473", "0.60285896", "0.602838", "0.60257286", "0.60220504", "0.60195214", "0.6018192" ]
0.6757206
22
/edit workout Function for view form
public function editworkout($id) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $workout = Workout::find($id); return view('admin.editworkout')->with('workout',$workout); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Workout $workout)\n {\n //\n }", "public function edit(Workout $workout)\n {\n $logged_user = Auth::user();\n $users = User::all();\n return view('Admin.Workouts.edit',compact('workout','users','logged_user'));\n }", "public function editAction()\n {\n\n $request = $this->getRequest();\n\n $routeMatch = $this->getEvent()->getRouteMatch();\n $id = $routeMatch->getParam('exercise_id', 0);\n\n if ($id <= 0) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $exercise = $this->_exercise->getRow(array('exercise_id' => $id));\n\n if (!$exercise) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $workoutId = $exercise->workout_id;\n\n $workout = $this->_workout->getRow(array('workout_id' => $workoutId));\n\n if (!$workout) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $typeId = $exercise->type_id;\n\n $type = $this->_exerciseType->getRow(array('type_id' => $typeId));\n\n// if (!$type) {\n// return $this->redirect()->toRoute('hi-training/workout/list');\n// }\n\n /**\n * Grid FORM\n */\n $form = new WorkoutExerciseGrid(\n array(\n 'view' => $this->_view,\n )\n );\n\n /**\n * BUILDING Row\n */\n $row = new WorkoutExerciseRow(\n array(\n 'model' => $this->_exercise,\n 'view' => $this->_view,\n )\n );\n\n //\n $row->setRowId($id);\n\n\n\n $row->setFieldOptions('type_id', array(\n 'values' => $this->_exerciseType->getBehaviour('nestedSet')->getResultSetForSelect(),\n 'onchange' => 'exerciseType(this);',\n ));\n $row->setFieldOptions('workout_id', array(\n 'value' => $workoutId,\n ));\n\n $row->addAction(\n 'saveEdit',\n 'submit',\n array(\n 'label' => 'save and continue editing',\n 'class' => 'actionImage',\n// 'image' => $this->_skinUrl . '/img/icons/record/save.png',\n )\n );\n\n //\n $row->build();\n\n //\n $form->addSubForm($row, $row->getName());\n\n //\n $this->_view->headScript()->appendScript(\n $this->_view->render(\n 'workout-exercise/edit.js',\n array(\n 'currentFormType' => $type['form_type'],\n 'back' => $this->url()->fromRoute('hi-training/workout-exercise/list/wildcard', array('workout_id' => $workoutId)),\n 'ajaxFormType' => $this->url()->fromRoute(\n 'hi-training/exercise-type/ajax-form-type/wildcard',\n array('type_id' => '')\n ),\n 'ajaxLastOfType' => $this->url()->fromRoute(\n 'hi-training/workout-exercise/ajax-last-of-type/wildcard',\n array('type_id' => '')\n ),\n )\n )\n );\n\n\n /**\n * POST\n */\n if ($this->getRequest()->isPost()) {\n\n $formData = $this->getRequest()->post()->toArray();\n\n if ($form->isValid($formData)) {\n\n if ( isset($formData['header']['formId'])\n && $formData['header']['formId'] == 'WorkoutExerciseGridForm') {\n\n if (isset($formData['WorkoutExerciseRow']['actions']['save'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $row = $this->_exercise->getRow(array('exercise_id' => $id))\n ->populate($formData['WorkoutExerciseRow']['row']);\n $row->save();\n\n return $this->redirect()->toRoute(\n 'hi-training/workout-exercise/list/wildcard',\n array('workout_id' => $workoutId)\n );\n }\n\n }\n\n if (isset($formData['WorkoutExerciseRow']['actions']['saveAdd'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $row = $this->_exercise->getRow(array('exercise_id' => $id))\n ->populate($formData['WorkoutExerciseRow']['row']);\n $row->save();\n\n return $this->redirect()->toRoute(\n 'hi-training/workout-exercise/add/wildcard',\n array('workout_id' => $workoutId)\n );\n }\n\n }\n\n if (isset($formData['WorkoutExerciseRow']['actions']['saveEdit'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $row = $this->_exercise->getRow(array('exercise_id' => $id))\n ->populate($formData['WorkoutExerciseRow']['row']);\n $row->save();\n\n return $this->redirect()->toRoute(\n 'hi-training/workout-exercise/edit/wildcard',\n array('exercise_id' => $id)\n );\n }\n\n }\n }\n }\n }\n\n return array(\n 'form' => $form,\n 'workout' => $workout,\n 'exercise' => $exercise,\n );\n }", "public function edit($id)\n\t{\n\t\t$this->is_allowed('form_assignmentlist_update');\n\n\t\t$this->data['form_assignmentlist'] = $this->model_form_assignmentlist->find($id);\n\n // Workout By Nadoo V.1.0 \n $this->load->model('model_form_workout');\n $this->data['form_workouts'] = $this->model_form_workout->get(null, null, 0, 0);\n\t\t$this->data['form_workout_counts'] = $this->model_form_workout->count_all(null, null);\n // Workout By Nadoo V.1.0 \n\n\t\t$this->template->title('Form Assignmentlist Update');\n\t\t$this->render('backend/standart/administrator/form_assignmentlist/form_assignmentlist_update', $this->data);\n\t}", "function editWorkOption(){\n\n if($this->session->has_userdata('userId')){\n\n if(! $this->_isUserAdmin()){\n\n $this->deniedAccess();\n }else{\n\n $workOptionId = $this->uri->segment(2);\n $this->Work_option_model->updateWorkOption($workOptionId);\n\n redirect(site_url('manage-work-options'));\n }\n }\n else{\n\n //redirect to home page\n redirect(site_url());\n }\n }", "public function update(Request $request, Workout $workout)\n {\n //\n }", "public function edit(SocialWork $socialWork)\n {\n //\n }", "public function edit(Homework $homework)\n {\n //\n }", "public function edit($id)\n\t{\n\t\t$present_users = \\App\\User::where('category', '!=', 0)->orderBy('created_at', 'desc')->get();\n\t\t\n\t\t$data = \\App\\Work::find($id);\n\t\t$industries = \\App\\Industry::orderBy(\"sort\", 'asc')->get();\n\t\t$work_categories = \\App\\WorkCategory::orderBy('sort', 'asc')->get();\n\t\t$area_provinces = \\App\\AreaProvince::orderBy('sort', 'asc')->get(array('id','code', 'name', 'id'));\n\t\t$area_cities = null;\n\t\t$area_streets = null;\n\t\tif(!empty($data->province))\n\t\t{\n\t\t\t$area_cities = \\App\\AreaCity::where('provincecode', '=', $data->province)->orderBy('sort', 'asc')->get(array('id','code', 'name', 'id'));\n\t\t}\n\t\tif(!empty($data->city))\n\t\t{\n\t\t\t$area_streets = \\App\\AreaStreet::where('citycode', '=', $data->city)->orderBy('sort', 'asc')->get(array('id','code', 'name', 'id'));\n\t\t}\n\t\t\t\n\t\treturn view('admin.works.edit')->with('data', $data)->with('present_users', $present_users)->with('area_provinces', $area_provinces)->with('area_cities', $area_cities)->with('area_streets', $area_streets)->with('work_categories', $work_categories)->with('industries', $industries);\n\t}", "public function editstepsAction(){\n\n\t echo $this->ModelObj->updatesteps($this->Request); exit;\n\n\t}", "public function edit($id)\n\t{\n\t\t$edit_data = CosPcwork::find($id);\n\n\t\treturn view('commission.pcwork_edit')->with('pcwork',$edit_data);\n\t}", "public function addWorkout()\n {\n return view('admin.addworkout');\n }", "function edit()\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n\t\t\t\n\t\t\t//render the edit form\n\t\t\t$view = $this->getView('manage','html');\n\t\t\t\n\t\t\t//load data\n\t\t\t$db->setQuery('select * from #__shbesuche_config');\n\t\t\t$view->config = $db->loadObject();\n\t\t\t$db->setQuery('select * from #__pbbooking_events where id = '.$db->escape(JRequest::getInt('id')));\n\t\t\t$view->event = $db->loadObject();\n\t\t\t$db->setQuery('select * from #__pbbooking_treatments');\n\t\t\t$view->services = $db->loadObjectList();\n\t\t\t$db->setQuery('select * from #__pbbooking_cals');\n\t\t\t$view->cals = $db->loadObjectList();\n\t\t\tif ($view->config->consolidated_view == 1) { \n\t\t\t\t$db->setQuery('select * from #__pbbooking_cals where out_cal = 1');\n\t\t\t\t$view->outcal = $db->loadObject();\n\t\t\t}\n\t\t\t//sort out openign and closing times\n\t\t\t$opening_hours = json_decode($view->config->trading_hours,true);\n\t\t\t$opening_time_arr = str_split($opening_hours[date_create($view->event->dtstart, new DateTimeZone(SHBESUCHE_TIMEZONE))->format('w')]['open_time'],2);\n\t\t\t$closing_time_arr = str_split($opening_hours[date_create($view->event->dtstart, new DateTimeZone(SHBESUCHE_TIMEZONE))->format('w')]['close_time'],2);\n\t\t\t$view->dt_start = date_create($view->event->dtstart,new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$view->dt_end = date_create($view->event->dtstart,new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$view->dt_start->setTime($opening_time_arr[0],$opening_time_arr[1]);\n\t\t\t$view->dt_end->setTime($closing_time_arr[0],$closing_time_arr[1]);\n\t\t\t\n\t\t\t//display the view\n\t\t\t$view->setLayout('edit_event');\n\t\t\tJToolbarHelper::save('edit',Jtext::_('COM_SHBESUCHE_SAVE_CHANGES'));\n\t\t\tJToolbarHelper::trash('delete',Jtext::_('COM_SHBESUCHE_DELETE_EVENT'),false);\n\t\t\tJToolbarHelper::custom('view_ical','view_ics','',Jtext::_('COM_SHBESUCHE_VIEW_ICS'),false);\n\t\t\tJToolbarHelper::cancel();\n\t\t\t$view->display();\n\t\t}\n\t\t\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n\t\t\t$db->setQuery('select * from #__pbbooking_events where id = '.$db->escape(JRequest::getInt('id')));\n\t\t\t$event = $db->loadObject();\n\t\t\t$db->setQuery('select * from #__pbbooking_treatments where id = '.$db->escape($event->service_id));\n\t\t\t$service = $db->loadObject();\n\t\t\t\n\t\t\t$treatment_time = JRequest::getVar('treatment-time');\n\t\t\t$times_arr = str_split($treatment_time,2);\n\t\t\t$dtstart = date_create(JRequest::getVar('date'),new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$dtstart->setTime((int)ltrim($times_arr[0],'0'),(int)ltrim($times_arr[1],'0'),0);\n\t\t\t$dtend = date_create($dtstart->format(DATE_ATOM),new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$dtend->modify('+'.$service->duration.' minutes');\n\t\t\t\n\t\t\t$event->summary = JRequest::getVar('summary');\n\t\t\t$event->description = JRequest::getVar('description');\n\t\t\t$event->dtstart = $dtstart->format('Y-m-d H:i:s');\n\t\t\t$event->dtend = $dtend->format('Y-m-d H:i:s');\n\n\n\t\t\tif ((int)$_POST['reccur'] == 1) {\n\t\t\t\t$event->r_int = JRequest::getVar('interval');\n\t\t\t\t$event->r_freq = JRequest::getVar('frequency');\n\t\t\t\t$event->r_end = JRequest::getVar('recur_end');\n \t\t\t}\t\n\n\t\t\tif (isset($_POST['cal_id'])) $event->cal_id = JRequest::getInt('cal_id');\n\t\t\tif ($db->updateObject('#__pbbooking_events',$event,'id')) {\n\t\t\t\t$this->setRedirect('index.php?option=com_pbbooking&controller=manage&date='.JRequest::getVar('date'),Jtext::_('COM_SHBESUCHE_EDIT_SUCCESS'));\n\t\t\t} else {\n\t\t\t\techo $db->getErrorMsg();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\n\t}", "public function edit(warrenty $warrenty)\n {\n //\n }", "public function edit( )\r\n {\r\n //\r\n }", "public function edit(Paperwork $paperwork)\n {\n $status = $this->status->lists();\n return view('ipaperwork::admin.paperworks.edit', compact('paperwork','status'));\n }", "public function edit() {\n\t\t\t\n\t\t}", "public function edit()\n\t {\n\t\t $app = JFactory::getApplication();\n \n\t\t // Get the previous edit id (if any) and the current edit id.\n\t\t $previousId = (int) $app->getUserState('com_gm_ceiling.edit.project.id');\n\t\t $editId = $app->input->getInt('id', 0);\n \n\t\t // Set the user id for the user to edit in the session.\n\t\t $app->setUserState('com_gm_ceiling.edit.project.id', $editId);\n \n\t\t // Get the model.\n\t\t $model = $this->getModel('Project', 'Gm_ceilingModel');\n \n\t\t /*// Check out the item\n\t\t if ($editId)\n\t\t {\n\t\t\t $model->checkout($editId);\n\t\t }\n \n\t\t // Check in the previous user.\n\t\t if ($previousId && $previousId !== $editId)\n\t\t {\n\t\t\t $model->checkin($previousId);\n\t\t }*/\n \n\t\t // Redirect to the edit screen.\n\t\t $this->setRedirect(JRoute::_('index.php?option=com_gm_ceiling&view=projectform&layout=edit', false));\n\t }", "public function modifyView() {\n $this->object = $this->object->readObject($this->id);\n $uiObjectName = $this->type.'_Ui';\n $uiObject = new $uiObjectName($this->object);\n $values = array_merge($this->object->valuesArray(), $this->values);\n return $uiObject->renderForm(array_merge(\n array('values'=>$values,\n 'action'=>url($this->type.'/modify', true),\n 'class'=>'formAdmin formAdminModify'),\n array('submit'=>array('save'=>__('save'),\n 'saveCheck'=>__('saveCheck')))));\n }", "public function staff_edit(){\n\t\t\n\t\t$is_logged_in = $this->session->userdata('is_logged_in');\n\t\t$this->load->helper('form');\n\t\t\n\t\tif(!empty($is_logged_in) && $is_logged_in == true){\n\n\t\t\t\n\t\t\tif($this->uri->segment(4) != NULL){\n\t\t\t\t\n\t\t\t\t$data['title'] = 'Our Instructors';\n\t\t\t\t$data['details'] = $this->school_model->getStaffbyId($this->uri->segment(4));\n\t\t\t\t\n\t\t\t\t$IsAllowMultiStaff = $this->school_model->IsAllowMultiStaff();\n\t\t\t\t$data['IsAllowMultiStaff'] = $IsAllowMultiStaff;\n\t\t\t\t\n\t\t\t\t$blank_location = array('0' => 'Select Location');\n\t\t\t\t$locations = $this->school_model->getLocations();\n\t\t\t\t\n\t\t\t\t$data['locations'] = $blank_location + $locations;\t\n\n\t\t\t\t//echo '<pre>'; print_r($data); die('yes');\t\n\t\t\n\t\t\t\t\n\t\t\t\tif(isset($_POST['update'])):\n\t\t\t\t\t$this->school_model->updateStaff();\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t$this->load->view(\"admin/school_staff_edit\", $data);\n\t\t\t\n\t\t\t}else{ \n\t\t\t\tredirect(\"admin/school\");\n\t\t\t}\n\t\t}else{ \n\t\t\tredirect(\"admin/login\");\n\t\t}\n\t}", "public function edit($id)\n {\n $workout = Workout::find($id);\n\n return view('admin.workouts.edit', compact('workout'));\n }", "public function edit_watch_p(){\r\n\r\n\t\tif($this->expectsPost(array('watchId'))){\r\n\r\n\t\t\t$watch = $this->watch->getWatch($this->watchId);\r\n\r\n\t\t\tif($watch && $watch->userId == $this->session->userdata('userId')){\r\n\r\n\t\t\t\tarray_push($this->_headerData['javaScripts'],\r\n\t\t\t\t\t\"jquery.easy-autocomplete.min\", \"watch.autocomplete\");\r\n\r\n\t\t\t\tarray_push($this->_headerData['styleSheets'],\r\n\t\t\t\t\t\"easy-autocomplete.min\",\r\n\t\t\t\t\t\"easy-autocomplete.themes.min\"\r\n\t\t\t\t);\r\n\r\n\t\t\t\t$this->_headerData['headerClass'] = 'blue';\r\n\t\t\t\t$this->load->view('header', $this->_headerData);\r\n\t\t\t\t$this->load->view('measure/edit-watch', $watch);\r\n\t\t\t\t$this->load->view('footer');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function edit(CheckOut $checkOut)\n {\n //\n }", "public function edit($id)\n {\n $data = $this->dispatch(new WorkFormFieldModel($id));\n\n return view('admin.works.edit', $data);\n }", "public function edit(OwnMeasurement $ownMeasurement)\n {\n //\n }", "public function edit(Work $work)\n {\n return view('backend.work.edit', compact('work'));\n }", "public function edit($id)\n\t{\n\t\t$work = Work::findOrFail($id); \n\t\t$all_category = Category::where('is_active','1')->pluck('title','id')->all();\n\t\t$tags = Tag::pluck('title','id')->all();\n\t\t$ta = $work->tags()->pluck('tag_id')->all();\n\t\t$all_user = User::where('is_active','1')->pluck('name','id')->all();\n\t\treturn view('admin.work.edit', compact('work','all_category','tags','ta','all_user'));\n\t}", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit($id)\n {\n return view('admin.homework.edit')->with(['homework' => Homework::findOrFail($id)]);\n\n }", "protected function editTaskAction() {}", "public function show(Workout $workout)\n {\n //\n }", "public function edit()\n\t{\n\t\t\n\t}", "public function team_member_edit(){\n\t\t\n\t\t$is_logged_in = $this->session->userdata('is_logged_in');\n\t\t$this->load->helper('form');\n\t\t\n\t\tif(!empty($is_logged_in) && $is_logged_in == true){\n\n\t\t\t\n\t\t\tif($this->uri->segment(4) != NULL){\n\t\t\t\t\n\t\t\t\t$data['title'] = 'Team Members';\n\t\t\t\t$data['details'] = $this->school_model->getMemberbyId($this->uri->segment(4));\n\t\t\t\t\n\t\t\t\t//$IsAllowMultiStaff = $this->school_model->IsAllowMultiStaff();\n\t\t\t\t//$data['IsAllowMultiStaff'] = $IsAllowMultiStaff;\n\t\t\t\t\n\t\t\t\t//$blank_location = array('0' => 'Select Location');\n\t\t\t\t//$locations = $this->school_model->getLocations();\n\t\t\t\t\n\t\t\t\t//$data['locations'] = $blank_location + $locations;\t\n\n\t\t\t\t//echo '<pre>'; print_r($data); die('yes');\t\n\t\t\n\t\t\t\t$this->load->view(\"admin/team_member_edit\", $data);\n\t\t\t\n\t\t\t\tif(isset($_POST['update'])):\n\t\t\t\t\t$this->school_model->update_team();\n\t\t\t\tendif;\n\t\t\t}else{ \n\t\t\t\tredirect(\"admin/school\");\n\t\t\t}\n\t\t}else{ \n\t\t\tredirect(\"admin/login\");\n\t\t}\n\t}", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function edit($id)\n {\n $work = Work::find($id);\n $vac = compact('work');\n return view('admin.work.edit',$vac);\n }", "public function edit($id)\n {\n $rows = $this->rels->getOne($id);\n\n $task = new TaskService();\n $work = new WorkService();\n\n $taskRels = $task->getOne($rows['task_id']);\n\n $workRels = $work->getOne($rows['work_id']);\n\n $childWorkName = $work->getOne($rows['child_work_id']);\n\n $rows['work_name'] = $taskRels['name'];\n $rows['task_name'] = $workRels['name'];\n $rows['child_work_name'] = $childWorkName['name'];\n\n return view('WorkFlow.WorkTask.edit')->with('rows' ,$rows);\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit(Watchlist $watchlist)\n {\n //\n }", "function get_form_edit(){\n\t\t\tif($this->check_session->user_session() && $this->check_session->get_level()==1){\n\t\t\t\t$kode_unit \t= form_prep($this->input->post('kode_unit'));\n\t\t\t\t$data['result_unit'] = $this->unit_model->get_unit($kode_unit);\n\t\t\t\t$this->load->view('form_edit_unit_',$data);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tshow_404('page');\n\t\t\t}\n\t\t}", "public function editAction() {}", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\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 {\n $works_details=Work::findOrFail($id);\n\n $work_type_options = DB::table('worktypes')->distinct()->orderBy('name', 'asc')->lists('name','id');\n $financial_options = DB::table('financial_years as f')\n ->selectRaw('CONCAT(f.years_from, \" - \", f.years_to) as concatname, f.id')\n ->lists('concatname', 'f.id');\n\n $plane_options = DB::table('planes')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $sector_options = DB::table('sectors')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $sub_sector_options = DB::table('subsectors')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $scheme_options = DB::table('schemes')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $district_options = DB::table('districts')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $taluka_options = DB::table('talukas')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $village_options = DB::table('villages')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $officer_options = DB::table('officers')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $administrators_options = DB::table('administrators')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $agency_options = DB::table('users')->where('status', '=', 1)->where('usertype', '=','AGENCY')->distinct()->orderBy('name', 'asc')->lists('name','id');\n $final_officer_options = DB::table('final_officers')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n\n //dd($financial_options);exit;\n return view('users.pages.works.work_edit',['final_officer_options'=>$final_officer_options,'agency_options'=>$agency_options,'works_details'=>$works_details,'administrators_options'=>$administrators_options,'officer_options'=>$officer_options,'village_options'=>$village_options,'taluka_options'=>$taluka_options,'district_options'=>$district_options,'scheme_options'=>$scheme_options,'sub_sector_options'=>$sub_sector_options,'sector_options'=>$sector_options,'plane_options'=>$plane_options,'work_type_options'=>$work_type_options,'financial_options'=>$financial_options]);\n\n\n }", "public function edit(tbl_project $tbl_project)\n {\n //\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() {\n\t\t\n\t\t$data = array(\n\t\t\t'user_id' => $this->_user_id,\n\t\t\t'date' => $this->_date,\n\t\t\t'time_of_day' => $this->_time_of_day,\n\t\t\t'type_id' => $this->_type_id,\n\t\t\t'route_id' => $this->_route_id,\n\t\t\t'distance' => $this->_distance,\n\t\t\t'time' => $this->_time,\n\t\t\t'shoe_id' => $this->_shoe_id,\n\t\t\t'quality' => $this->_quality,\n\t\t\t'effort' => $this->_effort,\n\t\t\t'weather_ids' => $this->_weather_ids,\n\t\t\t'temperature' => $this->_temperature,\n\t\t\t'notes' => $this->_notes,\n\t\t\t'field' => $this->_field,\n\t\t\t'placement' => $this->_placement,\n\t\t\t'group_min_age' => $this->_group_min_age,\n\t\t\t'group_max_age' => $this->_group_max_age,\n\t\t\t'group_age_size' => $this->_group_age_size,\n\t\t\t'group_age_placement' => $this->_group_age_placement,\n\t\t\t'group_gender_size' => $this->_group_gender_size,\n\t\t\t'group_gender_placement' => $this->_group_gender_placement,\n\t\t\t'active' => $this->_active\t\t\t\n\t\t);\n\t\t$this->db->where('id',$this->_id);\n\t\t$this->db->update($this->_table,$data);\n\t\t\n\t\treturn true;\n\t}", "public function edit($id)\n {\n $work = Work::find($id);\n $this->authorize('update', $work);\n return view('works.edit')->with('work', $work);\n }", "public function edit()\n {\n \n \n }", "public function edit() {\n }", "public function edit(ViewUnits $viewUnits)\n {\n //\n }", "public function showEdit()\n {\n\n }", "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()\n {\n //\n }", "public function edit(TravelProgramme $travelProgramme)\n {\n //\n }", "public function edit()\n {\n \n }", "public function edit($id)\n {\n $item = Work::findOrFail($id);\n\n return view('pages.admin.works.edit', ['item' => $item]);\n }", "public function edit($id)\n {\n //\n $warehouseoutitem = warehouseoutitem::findOrFail($id);\n $warehouseouthead_id = $warehouseoutitem->warehouseouthead_id;\n return view('inventory.warehouseoutitems.edit', compact('warehouseoutitem','warehouseouthead_id'));\n }", "public function edit($sp_id)\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "function edit()\n { \n if( $this->input->post('wiki') !== null )\n {\n $data['title'] = 'Edit Detachment Wiki';\n \n $data['wiki'] = $this->wiki_model->get_wiki($this->input->post('wiki'));\n\n $this->load->view('templates/header', $data);\n $this->load->view('pages/editwiki.php');\n $this->load->view('templates/footer'); \n }\n else\n {\n show_error('The wiki you are trying to edit does not exist.');\n }\n }", "public function edit($id)\n {\n //\n //find record of given id\n $edit_form = Assignatory::find($id);\n\n if($edit_form->kind == 'R'){\n $records = Assignatory::all()->where('kind', '=', 'R');\n }elseif ($edit_form->kind == 'AA') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'AA');\n }elseif ($edit_form->kind == 'C') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'C');\n }elseif ($edit_form->kind == 'A') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'A');\n }\n \n $dept = Office::all();\n \n\n //show edit form and pass the info to it\n return View('signatory.editsignatory', compact('edit_form','records','dept')); \n }", "abstract protected function renderEdit();", "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 edit(){\n\t\t$this->OnlyAdmin();\n\t\tif($this->input->get()){\n\t\t\t$ticket = $this->TicketModel->Get($this->input->get('t_id'));\n\t\t\t$this->loadView('edit/ticket', array('ticket'=> $ticket), true);\n\t\t}else if($this->input->post()){\n\t\t\t$this->TicketModel->Edit($this->input->post());\n\t\t\tredirect('index.php/ticket/lists');\n\t\t}\n\t}", "public function edit(Working $board)\n {\n //\n $data = $board->where('id',$board->id)\n ->get();\n return view('tasks.modify', [\n 'tasks'\t=> $data\n ]);\n }", "public function edit(Town $town)\n {\n //\n }", "public function getEditForm();", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit($id)\n\t{\n\t\t//\n $employees = Employee::All();\n $peoples = array();\n foreach ($employees as $employee) {\n $peoples[$employee->id] = array(\n $employee->name,\n $employee->alpha,\n $employee->firstalpha,\n );\n }\n $data = array(\n 'employees' => $employees,\n 'peoples' => $peoples,\n 'workday' => Workday::find($id),\n );\n\t\treturn view('admin.workdays.edit', $data);\n\t}", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit(Office $office)\n {\n //\n }", "public function edit_stories_form(){\r\r\n\t\tif ($this->checkLogin('A') == ''){\r\r\n\t\t\tredirect('admin');\r\r\n\t\t}else {\r\r\n\t\t\t$this->data['heading'] = 'Edit Stories';\r\r\n\t\t\t$stories_id = $this->uri->segment(4,0);\r\r\n\t\t\t$condition = array('id' => $stories_id);\r\r\n\t\t\t$this->data['stories_details'] = $this->stories_model->get_all_details(COUNTRY_LIST,$condition);\r\r\n\t\t\tif ($this->data['stories_details']->num_rows() == 1){\r\r\n\t\t\t\t$this->load->view('admin/stories/edit_stories',$this->data);\r\r\n\t\t\t}else {\r\r\n\t\t\t\tredirect('admin');\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t}", "public function action_edit()\n\t{\n\t\t$view = View::factory('story/incomplete');\n\t\t$this->response->body($view);\n\t}", "public function display_edit_form(){\n echo \"<form action='../../Controllers/charity_controller.class.php?action=update' method='post'>\";\n echo \"<input type='hidden' name='id' value=\".$this->id.\" />\";\n echo \"Name: <input type='text' name='name' value=\".$this->name.\" /><br />\";\n echo \"Description: <textarea name='description'>\".$this->description.\"</textarea><br />\";\n echo \"<input type='submit' value='Update' />\";\n echo \"</form>\";\n }", "public function edit($id_ep)\n { \n\n $modifie_employer=DB::table('empl')\n ->select('*')\n ->where('id_ep',$id_ep)\n ->first();\n $manage_modifie_employer=view('admin.employer.edit')\n ->with('Employer',$modifie_employer);\n return view('admin.home')\n ->with('employer.edit',$manage_modifie_employer); \n }", "function pa_edit() {\n\t\t\t\t$edit_pid = (int)UTIL::get_post('edit_pid');\n\t\t\t\t\n\t\t\t\t//-- haben wir keine edit-id, gibts eine seiten-tabelle zur auswahl\n\t\t\t\tif (!$edit_pid) {\n\t\t\t\t\techo 'error: no pid';\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$form = MC::create('form');\n\t\t\t\t$form->init('page', 'mod_page');\n\t\t\t\t$form->add_hidden('edit_pid', $edit_pid);\n\t\t\t\t\n\t\t\t\t// hatten wir fehler\n\t\t\t\tif ($this->get_var('error')) {\n\t\t\t\t\t$form->set_values($this->get_var('data'));\n\t\t\t\t\t$form->set_error_fields($this->get_var('error'));\n\t\t\t\t}\t\n\t\t\t\telse {\n\t\t\t\t\t// frisch aus db lesen\n\t\t\t\t\t$sql = 'SELECT * FROM '.$this->mod_tbl.' WHERE id='.$edit_pid;\n\t\t\t\t\t$res = $this->DB->query($sql);\n\t\t\t\t\t$data = $res->r();\n\t\t\t\t\t$form->set_values($data);\n\t\t\t\t}\n\n\t\t\t\t$this->set_var('path', $this->_get_path_print($edit_pid));\n\t\t\t\t$this->set_var('form', $form);\n\t\t\t\t\n\t\t\t\t$this->OPC->generate_view($this->tpl_dir.'pa_edit.php');\n\n\t\t\t}", "public function edit() {\n\t\t$data['pagetitle'] = 'Dashboard - Edit Posts';\n\n\t\t$data['postid'] = $viewmodel->getPostById($postid['id'] );\n\t\tView::renderAdminTemplate($data, \"App/Views/admin/edit/index.php\") ;\n\t}", "public function edit() {\n\n }", "public function edit(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$user = $this->_map_posted_data();\n\t\t\t\t$user->set_user_id($_POST['id']);\n\t\t\t\t$this->userrepository->update($user);\n\t\t\t\theader(\"Location: index.php/admin/index/edit\");\n\t\t\t}else{\n\t\t\t\t$view_page = \"adminusersview/edit\";\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$user = $this->userrepository->get_by_id($id);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\theader(\"Location: index.php/admin/index\");\n\t\t\t\t}\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t}\n\t\t}", "public function edit()\n { \n }", "public function editAction(){\n return new ViewModel(array( \n \"knight\" => $this->getKnight(),\n \"knights\" => $this->knights));\n }", "public function edit(postulation $postulation)\n {\n //\n }", "public function Edit()\n\t{\n\t\t\n\t}", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }" ]
[ "0.80508626", "0.73693895", "0.73143905", "0.6848007", "0.6839009", "0.676065", "0.6614971", "0.65978134", "0.65829295", "0.6567484", "0.6566879", "0.6536641", "0.6518289", "0.65043056", "0.6472796", "0.64682436", "0.64351326", "0.6429146", "0.64191914", "0.64113206", "0.6406733", "0.6395917", "0.6393888", "0.6381781", "0.63816965", "0.6380556", "0.6357001", "0.6345566", "0.63120973", "0.63030976", "0.6290808", "0.62833226", "0.6276968", "0.62668675", "0.62620074", "0.6259832", "0.6246421", "0.6246421", "0.6244172", "0.623476", "0.62333995", "0.622798", "0.62278897", "0.6219756", "0.6217609", "0.6212469", "0.61988014", "0.6195854", "0.6195014", "0.61927295", "0.61843127", "0.6172151", "0.6165524", "0.6162251", "0.61593235", "0.6143892", "0.61425555", "0.61413324", "0.6139801", "0.61388654", "0.61388654", "0.61388654", "0.61388654", "0.61388654", "0.61388654", "0.61388654", "0.61388654", "0.61388654", "0.61388654", "0.61388654", "0.61388654", "0.61383903", "0.6135177", "0.6127501", "0.6121471", "0.6119416", "0.6119352", "0.6118541", "0.6108279", "0.61054486", "0.61051065", "0.61047715", "0.61047715", "0.61047715", "0.6103021", "0.6097898", "0.6092169", "0.6091037", "0.60837173", "0.6081416", "0.6079979", "0.60754365", "0.6070589", "0.6067951", "0.60672855", "0.6063177", "0.6058411", "0.6055459", "0.6055459", "0.6055459" ]
0.7222739
3
/edit workout Function for update data form
public function updateworkout(Request $request) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $this->validate($request,array( 'name' => 'required', 'details' => 'required', 'set1' => 'required', 'set3' => 'required', 'set2' => 'required' )); $id = $request->id; $workout = Workout::find($id); $workout->title = $request->name; $workout->description = $request->details; $workout->category = $request->category; $workout->set1 = $request->set1; $workout->set2 = $request->set2; $workout->set3 = $request->set3; if ($request->hasFile('image')) { $file = $request->file('image'); $filename = time().'.'.$file->getClientOriginalName(); /*$location = public_path('file/'.$filename); Storage::put($filename,file_get_contents($file));*/ $location = public_path('file/'.$filename); Storage::disk('file')->put($filename, file_get_contents($file)); //Storage::disk('public')->put($filename, file_get_contents($file)); $workout->image = $filename; } $workout->save(); Session::flash('success','Workout Updated succcessfully.'); return redirect()->back()->with('workout',$workout); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Workout $workout)\n {\n //\n }", "public function update(Request $request, Workout $workout)\n {\n //\n }", "public function editAction()\n {\n\n $request = $this->getRequest();\n\n $routeMatch = $this->getEvent()->getRouteMatch();\n $id = $routeMatch->getParam('exercise_id', 0);\n\n if ($id <= 0) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $exercise = $this->_exercise->getRow(array('exercise_id' => $id));\n\n if (!$exercise) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $workoutId = $exercise->workout_id;\n\n $workout = $this->_workout->getRow(array('workout_id' => $workoutId));\n\n if (!$workout) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $typeId = $exercise->type_id;\n\n $type = $this->_exerciseType->getRow(array('type_id' => $typeId));\n\n// if (!$type) {\n// return $this->redirect()->toRoute('hi-training/workout/list');\n// }\n\n /**\n * Grid FORM\n */\n $form = new WorkoutExerciseGrid(\n array(\n 'view' => $this->_view,\n )\n );\n\n /**\n * BUILDING Row\n */\n $row = new WorkoutExerciseRow(\n array(\n 'model' => $this->_exercise,\n 'view' => $this->_view,\n )\n );\n\n //\n $row->setRowId($id);\n\n\n\n $row->setFieldOptions('type_id', array(\n 'values' => $this->_exerciseType->getBehaviour('nestedSet')->getResultSetForSelect(),\n 'onchange' => 'exerciseType(this);',\n ));\n $row->setFieldOptions('workout_id', array(\n 'value' => $workoutId,\n ));\n\n $row->addAction(\n 'saveEdit',\n 'submit',\n array(\n 'label' => 'save and continue editing',\n 'class' => 'actionImage',\n// 'image' => $this->_skinUrl . '/img/icons/record/save.png',\n )\n );\n\n //\n $row->build();\n\n //\n $form->addSubForm($row, $row->getName());\n\n //\n $this->_view->headScript()->appendScript(\n $this->_view->render(\n 'workout-exercise/edit.js',\n array(\n 'currentFormType' => $type['form_type'],\n 'back' => $this->url()->fromRoute('hi-training/workout-exercise/list/wildcard', array('workout_id' => $workoutId)),\n 'ajaxFormType' => $this->url()->fromRoute(\n 'hi-training/exercise-type/ajax-form-type/wildcard',\n array('type_id' => '')\n ),\n 'ajaxLastOfType' => $this->url()->fromRoute(\n 'hi-training/workout-exercise/ajax-last-of-type/wildcard',\n array('type_id' => '')\n ),\n )\n )\n );\n\n\n /**\n * POST\n */\n if ($this->getRequest()->isPost()) {\n\n $formData = $this->getRequest()->post()->toArray();\n\n if ($form->isValid($formData)) {\n\n if ( isset($formData['header']['formId'])\n && $formData['header']['formId'] == 'WorkoutExerciseGridForm') {\n\n if (isset($formData['WorkoutExerciseRow']['actions']['save'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $row = $this->_exercise->getRow(array('exercise_id' => $id))\n ->populate($formData['WorkoutExerciseRow']['row']);\n $row->save();\n\n return $this->redirect()->toRoute(\n 'hi-training/workout-exercise/list/wildcard',\n array('workout_id' => $workoutId)\n );\n }\n\n }\n\n if (isset($formData['WorkoutExerciseRow']['actions']['saveAdd'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $row = $this->_exercise->getRow(array('exercise_id' => $id))\n ->populate($formData['WorkoutExerciseRow']['row']);\n $row->save();\n\n return $this->redirect()->toRoute(\n 'hi-training/workout-exercise/add/wildcard',\n array('workout_id' => $workoutId)\n );\n }\n\n }\n\n if (isset($formData['WorkoutExerciseRow']['actions']['saveEdit'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $row = $this->_exercise->getRow(array('exercise_id' => $id))\n ->populate($formData['WorkoutExerciseRow']['row']);\n $row->save();\n\n return $this->redirect()->toRoute(\n 'hi-training/workout-exercise/edit/wildcard',\n array('exercise_id' => $id)\n );\n }\n\n }\n }\n }\n }\n\n return array(\n 'form' => $form,\n 'workout' => $workout,\n 'exercise' => $exercise,\n );\n }", "function editWorkOption(){\n\n if($this->session->has_userdata('userId')){\n\n if(! $this->_isUserAdmin()){\n\n $this->deniedAccess();\n }else{\n\n $workOptionId = $this->uri->segment(2);\n $this->Work_option_model->updateWorkOption($workOptionId);\n\n redirect(site_url('manage-work-options'));\n }\n }\n else{\n\n //redirect to home page\n redirect(site_url());\n }\n }", "public function edit($id)\n\t{\n\t\t$this->is_allowed('form_assignmentlist_update');\n\n\t\t$this->data['form_assignmentlist'] = $this->model_form_assignmentlist->find($id);\n\n // Workout By Nadoo V.1.0 \n $this->load->model('model_form_workout');\n $this->data['form_workouts'] = $this->model_form_workout->get(null, null, 0, 0);\n\t\t$this->data['form_workout_counts'] = $this->model_form_workout->count_all(null, null);\n // Workout By Nadoo V.1.0 \n\n\t\t$this->template->title('Form Assignmentlist Update');\n\t\t$this->render('backend/standart/administrator/form_assignmentlist/form_assignmentlist_update', $this->data);\n\t}", "public function edit(Workout $workout)\n {\n $logged_user = Auth::user();\n $users = User::all();\n return view('Admin.Workouts.edit',compact('workout','users','logged_user'));\n }", "public function edit(Homework $homework)\n {\n //\n }", "public function editworkout($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = Workout::find($id);\n return view('admin.editworkout')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function Specialities_Update(){\n\t\t\n\t\t//when click on button\n\t\tif(isset($_POST['updatesp'])){\n\t\t\t\n\t\t\t\t// get id move to variable\n\t\t\t$get_id = $_GET['Edit'];\n\t\t\t\n\t\t\t//values for Specialities table\n\t\t\t$values = \"specialitie_name='\".$_POST['sp'].\"'\";\n\t\t\t\n\t\t // update Specialities from table\n\t\t $this->Update('specialities',$values,\"where id='$get_id'\",'Specialities?m');\n\t\t} // ifisset close\n\t}", "function editBuildingHandler() {\n global $inputs;\n\n $res = updateDb('building', [\n 'building_name' => $inputs['name'], \n 'address' => $inputs['address'],\n 'description' => $inputs['desc'],\n 'area' => $inputs['area']],\n ['id' => $inputs['id']]);\n\n formatOutput(true, 'update success', $res);\n}", "public function update(Request $request, Homework $homework)\n {\n //\n }", "function settingsupdate() {\n $this->auth(WL_ADM_LEVEL);\n $wl_id = $this->session->userdata('wl_id');\n $wl_data = $this->m_white_label->getById($wl_id);\n foreach ($_POST as $key=>$value) {\n if($key != 'save'){\n $data[$key] = $this->input->post($key);\n }\n }\n if($this->m_settings->update($wl_id, $data)){\n $this->m_settings->createSettingsFile($wl_id, $wl_data);\n $this->advsettings(2); \n }else{\n echo 'error';\n }\n }", "function AfterEdit(&$values,$where,&$oldvalues,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n\n$attend_id=$values['attend_id'];\n\n//select shecdule ID from timetable\n$sql_at= \"SELECT scheduleID,courseID,date,(end_time-start_time) AS hour FROM schedule_timetable WHERE id='$attend_id'\";\n$query_at=db_query($sql_at,$conn);\n$row_at=db_fetch_array($query_at);\n\n$scheduleID=$row_at['scheduleID'];\n\n//select related schedule id from schedule\n$sql_at2= \"SELECT programID,batchID,groupID FROM schedule WHERE scheduleID='$scheduleID'\";\n$query_at2=db_query($sql_at2,$conn);\n$row_at2=db_fetch_array($query_at2);\n\n$program=$row_at2['programID'];\n$batch=$row_at2['batchID'];\n$class=$row_at2['groupID'];\n\n//update program , batch, class to student_attendance table\n$date=$row_at['date'];\n$hour=$row_at['hour'];\n$course=$row_at['courseID'];\n$id=$keys['id'];\n$sql_up= \"Update student_attendance set programID ='$program', batchID='$batch',class='$class',course='$course',date='$date',hour='$hour' where id='$id'\";\n$query_up=db_exec($sql_up,$conn);\n\n//query the total hour for this module\n$sql_th= \"SELECT total_hour FROM program_course WHERE programID='$program' && CourseID=$course\";\n$query_th=db_query($sql_th,$conn);\n$row_th=db_fetch_array($query_th);\n\n$totalhour=$row_th['total_hour'];\n//the percentage wight of absentee ( $hour/$totalhour)\n$weight_absent=($hour/$totalhour*100);\n\n//query current attendance status for this student, program , module\n$studentID=$values['StudentID'];\n$sql_at3=\"SELECT Attendance FROM student_course WHERE StudentID=$studentID AND programID=$program AND CourseID=$course\";\n$query_at3=db_query($sql_at3,$conn);\n$row_at3=db_fetch_array($query_at3);\n\n$current_attendance=$row_at3['Attendance'];\n//update student_course attendance\n\n$net_attendance=$current_attendance-$weight_absent;\n\n$sql_ups= \"Update student_course SET Attendance='$net_attendance' where StudentID='$studentID' && programID='$program' && CourseID=$course\";\n$query_ups=db_exec($sql_ups,$conn);\n;\t\t\n}", "public function update($id)\n\t{\n\t\t$message = [\n\t\t\t'required'\t=> 'กรุณาใส่ข้อมูล',\n\t\t\t'unique'\t=> 'ข้อมูลซ้ำ',\n\t\t\t'numeric'\t=> 'ต้องเป็นตัวเลขเท่านั้น',\n\t\t\t'max'\t\t=> 'ข้อมูลเกิน :max ตัวอักษร'\n\t\t];\n\n\n\t\t$rules = array(\n\t\t\t'emp_code'\t \t=> 'required|Max:6',\n\t\t\t'work_date'\t\t=> 'required',\n\t\t\t\n\t\t);\n\n\t\t$validator = Validator::make(Request::all(), $rules,$message);\n\n\t\tif ($validator->passes())\n\t\t{\n\t\t\t\n\t\t\t\n\t\t\t$data_pc = array(\n\t\t\t\t'emp_code' => Request::get('emp_code'),\t\t\t\n\t\t\t\t'work_date' => Request::get('work_date'),\n\t\t\t\t'work_type' => Request::get('work_type'),\n\t\t\t\t'pc_type' => Request::get('pc_type'),\n\t\t\t\t'created_by' => Auth::user()->username,\n\t\t\t\t'updated_by' => Auth::user()->username\n\t\t\t);\n\n\n\t\t\t$pc \t=CosPcwork::find($id);\n\t\t\t$pc->update($data_pc);\n\n\t\t\t//dd($data_entity);\n\t\t\t\n\n\t\t\t/* ********** Save Data ************ */\t\n\n\n\t\t\t// Reload Table Data\n\t\t\t$data_pc = array(\n\t\t\t\t'pcwork' \t\t=> CosPcwork::where('cust_code',Auth::user()->current_cust_code_logon)->where('emp_code', Request::get('emp_code'))->orderBy('work_date', 'asc')->get(),\n\t\t\t\t'refresh'\t\t=> true\n\t\t\t);\n\t\n\t\t\treturn view('commission.pcwork_table')->with($data_pc);\n\t\t\t\n\n\t\t}\n\t\telse{\n\t\t\t\n\n\t\t\t$edit_data = array(\n\t\t\t\t'emp_code' => Request::get('emp_code'),\t\t\t\n\t\t\t\t'work_date' => Request::get('work_date'),\n\t\t\t\t'work_type' => Request::get('work_type'),\n\t\t\t\t'pc_type' => Request::get('pc_type'),\n\t\t\t);\n\n\t\t\t//dd($edit_data);\n\n\t\t\tif( Request::ajax() ) \n\t\t\t{\n\n\t\t\t\treturn view('commission.pcwork_edit')->withErrors($validator)->with('pcwork' ,$edit_data);\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\t}", "public function edit(SocialWork $socialWork)\n {\n //\n }", "function update()\n {\n $id = $_POST['id'];\n $name = $_POST['wname'];\n if($name == null)\n {\n header(\"Location:../view/sparklingwine_view.php\");\n }\n else\n {\n $sparklingwine = new SparklingWine();\n $sparklingwine->update($id,$name); \n header(\"Location:../view/sparklingwine_view.php\");\n }\n }", "public function update_person() {\n $fdata = $this->input->post();\n unset($fdata['submit']);\n $where = array(\"admin_id\" => $this->admin_lib->admin_id, \"person_id\" => $fdata['person_id']);\n $this->person_db->update_person($where, $fdata);\n redirect(\"p_list/index\");\n }", "public function edit($id)\n\t{\n\t\t$present_users = \\App\\User::where('category', '!=', 0)->orderBy('created_at', 'desc')->get();\n\t\t\n\t\t$data = \\App\\Work::find($id);\n\t\t$industries = \\App\\Industry::orderBy(\"sort\", 'asc')->get();\n\t\t$work_categories = \\App\\WorkCategory::orderBy('sort', 'asc')->get();\n\t\t$area_provinces = \\App\\AreaProvince::orderBy('sort', 'asc')->get(array('id','code', 'name', 'id'));\n\t\t$area_cities = null;\n\t\t$area_streets = null;\n\t\tif(!empty($data->province))\n\t\t{\n\t\t\t$area_cities = \\App\\AreaCity::where('provincecode', '=', $data->province)->orderBy('sort', 'asc')->get(array('id','code', 'name', 'id'));\n\t\t}\n\t\tif(!empty($data->city))\n\t\t{\n\t\t\t$area_streets = \\App\\AreaStreet::where('citycode', '=', $data->city)->orderBy('sort', 'asc')->get(array('id','code', 'name', 'id'));\n\t\t}\n\t\t\t\n\t\treturn view('admin.works.edit')->with('data', $data)->with('present_users', $present_users)->with('area_provinces', $area_provinces)->with('area_cities', $area_cities)->with('area_streets', $area_streets)->with('work_categories', $work_categories)->with('industries', $industries);\n\t}", "public function update($workorder_id) {\n if (!in_array('updateWorkorder', $this->permission)) {\n redirect('dashboard', 'refresh');\n }\n\n if (!$workorder_id) {\n redirect('dashboard', 'refresh');\n }\n\n $this->form_validation->set_rules('nomor_wo', 'Nomor WO', 'trim|required');\n $this->form_validation->set_rules('wo_name', 'Nama WO', 'trim|required');\n // $this->form_validation->set_rules('channel_name', 'Nama Channel', 'trim|required');\n // $this->form_validation->set_rules('produk_name', 'Nama Produk', 'trim|required');\n $this->form_validation->set_rules('marketing_name', 'Store', 'trim|required');\n $this->form_validation->set_rules('bobot', 'Bobot', 'trim|required');\n $this->form_validation->set_rules('input_date', 'Tanggal Input', 'trim|required');\n $this->form_validation->set_rules('deadline', 'Deadline', 'trim|required');\n $this->form_validation->set_rules('catatan', 'catatan', 'trim|required');\n $this->form_validation->set_rules('backend', 'backend', 'trim|required');\n $this->form_validation->set_rules('frontend', 'frontend', 'trim|required');\n $this->form_validation->set_rules('qa', 'qa', 'trim|required');\n\n if ($this->form_validation->run() == TRUE) {\n // true case\n\n $data = array(\n 'nomor_wo' => $this->input->post('nomor_wo'),\n 'wo_name' => $this->input->post('wo_name'),\n 'channel_name' => json_encode($this->input->post('channel')),\n 'produk_name' => json_encode($this->input->post('produk')),\n 'marketing_name' => $this->input->post('marketing_name'),\n 'bobot' => $this->input->post('bobot'),\n 'input_date' => $this->input->post('input_date'),\n 'deadline' => $this->input->post('deadline'),\n 'catatan' => $this->input->post('catatan'),\n 'backend_days' => $this->input->post('backend'),\n 'frontend_days' => $this->input->post('frontend'),\n 'qa_days' => $this->input->post('qa'),\n );\n\n\n if ($_FILES['workorder_image']['size'] > 0) {\n $upload_image = $this->upload_image();\n $upload_image = array('lampiran' => $upload_image);\n\n $this->model_workorder->update($upload_image, $workorder_id);\n }\n\n $update = $this->model_workorder->update($data, $workorder_id);\n if ($update == true) {\n $this->session->set_flashdata('success', 'Successfully updated');\n redirect('workorder/', 'refresh');\n } else {\n $this->session->set_flashdata('errors', 'Error occurred!!');\n redirect('workorder/update/' . $workorder_id, 'refresh');\n }\n } else {\n // attributes \n $attribute_data = $this->model_attributes->getActiveAttributeData();\n\n $attributes_final_data = array();\n foreach ($attribute_data as $k => $v) {\n $attributes_final_data[$k]['attribute_data'] = $v;\n\n $value = $this->model_attributes->getAttributeValueData($v['id']);\n\n $attributes_final_data[$k]['attribute_value'] = $value;\n }\n\n // false case\n $this->data['attributes'] = $attributes_final_data;\n $this->data['channel'] = $this->model_channel->getActiveChannel();\n $this->data['produk'] = $this->model_produk->getActiveProduk();\n\n\n $workorder_data = $this->model_workorder->getWorkorderData($workorder_id);\n $this->data['workorder_data'] = $workorder_data;\n $this->render_template('workorder/edit', $this->data);\n }\n }", "function index_g_and_o_update(){\n\t\t$this->load->model('Da_evs_set_form_g_and_o','dsfg');\n\t\t$index_level = $this->input->post(\"index_level\"); // index level of G&O form\n\t\t$index_ranges = $this->input->post(\"index_ranges\"); // indeax range of G&O form\n\t\t$pos_id = $this->input->post(\"pos_id\"); //position id\n\t\t$year_id = $this->input->post(\"year_id\"); //year id\n\t\t\n\t\t$this->dsfg->sfg_pay_id = $year_id;\n\t\t$this->dsfg->sfg_index_level = $index_level;\n\t\t$this->dsfg->sfg_index_ranges = $index_ranges;\n\t\t$this->dsfg->sfg_pos_id = $pos_id;\n\t\t$this->dsfg->update();\n\n\t}", "public function modelDoEdit(){\n\t\t\t$maphongban = isset($_GET[\"maphongban\"])&&is_numeric($_GET[\"maphongban\"])?$_GET[\"maphongban\"]:0;\n\t\t\t$tenphongban = $_POST[\"tenphongban\"];\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//chuan bi truy van\n\t\t\t$query = $conn->prepare(\"update phongban set tenphongban=:ten where maphongban=:ma\");\n\t\t\t$query->execute(array(\"ten\"=>$tenphongban,\"ma\"=>$maphongban));\n\t\t}", "public function edit($data){\n\t\t$this->db->where('id_pinjam',$data['id_pinjam']);\n\t\t$this->db->update('pinjam_uang', $data);\n\n\t}", "public function edit($id)\n {\n $works_details=Work::findOrFail($id);\n\n $work_type_options = DB::table('worktypes')->distinct()->orderBy('name', 'asc')->lists('name','id');\n $financial_options = DB::table('financial_years as f')\n ->selectRaw('CONCAT(f.years_from, \" - \", f.years_to) as concatname, f.id')\n ->lists('concatname', 'f.id');\n\n $plane_options = DB::table('planes')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $sector_options = DB::table('sectors')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $sub_sector_options = DB::table('subsectors')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $scheme_options = DB::table('schemes')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $district_options = DB::table('districts')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $taluka_options = DB::table('talukas')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $village_options = DB::table('villages')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $officer_options = DB::table('officers')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $administrators_options = DB::table('administrators')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n $agency_options = DB::table('users')->where('status', '=', 1)->where('usertype', '=','AGENCY')->distinct()->orderBy('name', 'asc')->lists('name','id');\n $final_officer_options = DB::table('final_officers')->where('status', '=', 1)->distinct()->orderBy('name', 'asc')->lists('name','id');\n\n //dd($financial_options);exit;\n return view('users.pages.works.work_edit',['final_officer_options'=>$final_officer_options,'agency_options'=>$agency_options,'works_details'=>$works_details,'administrators_options'=>$administrators_options,'officer_options'=>$officer_options,'village_options'=>$village_options,'taluka_options'=>$taluka_options,'district_options'=>$district_options,'scheme_options'=>$scheme_options,'sub_sector_options'=>$sub_sector_options,'sector_options'=>$sector_options,'plane_options'=>$plane_options,'work_type_options'=>$work_type_options,'financial_options'=>$financial_options]);\n\n\n }", "function company_settingsupdate() {\n $this->auth(COMP_ADM_LEVEL);\n $company_id = $this->uri->segment(3);\n foreach ($_POST as $key=>$value) {\n if($key != 'save'){\n $data[$key] = $this->input->post($key);\n }\n }\n if($this->m_company_settings->update($company_id, $data)){\n $this->companyadmin(7);\n }else{\n echo 'error';\n }\n }", "public function changeWork($request){\n if($request->duty)\n $this->duty = $request->duty;\n if($request->user_id)\n $this->user_id = $request->user_id;\n if($request->project_id)\n $this->project_id = $request->project_id;\n\n $this->save();\n }", "public function edit(warrenty $warrenty)\n {\n //\n }", "public function edit()\n {\n $dayId = $this->uri->segment(3);\n \n if ($_POST) {\n \n $this->load->model(\"Eggproductiondata\", 'production');\n \n if ($_POST['pieces'] && $_POST['egg_types']) {\n \n for ($i = 0; $i < sizeof($_POST['pieces']); $i++) {\n \n $data = array('piece'=>$_POST['pieces'][$i]);\n echo $this->production->update($data, array('egg_production_day_id'=>$dayId, 'egg_type_id'=>$_POST['egg_types'][$i]));\n }\n \n echo 1;\n } else {\n echo 0;\n }\n } else {\n \n echo 0;\n }\n \n die;\n }", "public function edit_watch(){\r\n\t\tif($this->expectsPost(array('watchId','brand', 'name', 'yearOfBuy',\r\n\t\t\t'serial', 'caliber'))){\r\n\r\n\t\t\tif ($this->watch->editWatch($this->session->userdata('userId'),\r\n\t\t\t\t\t\t$this->watchId,\r\n\t\t\t\t\t\t$this->brand, $this->name,\r\n\t\t\t\t\t\t$this->yearOfBuy, $this->serial,\r\n\t\t\t\t\t\t$this->caliber)) {\r\n\r\n\t\t\t\t$this->_bodyData['success'] = 'Watch successfully updated!';\r\n\r\n\t\t\t}\r\n\r\n\t\t\t$this->constructMeasurePage();\r\n\t\t}\r\n\t}", "public function edit(CheckOut $checkOut)\n {\n //\n }", "public function edit() {\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_GET['id']))\n return call('pages', 'error404');\n\n \n $schools= School::find($_GET['id']);\n require_once('views/school/edit.php');\n\n\n if (isset($_POST['mail']) and $_POST['mail']!= \"\")\n {\n $schools = School::update_mail($_GET['id'],$_POST['mail']); \n }\n \n if (isset($_POST['street']) and $_POST['street']!= \"\")\n {\n $schools = School::update_street($_GET['id'],$_POST['street']); \n } \n\n if (isset($_POST['town']) and $_POST['town']!= \"\")\n {\n $schools = School::update_town($_GET['id'],$_POST['town']); \n }\n\n if (isset($_POST['continent']) and $_POST['continent']!= \"\")\n {\n $schools = School::update_continent($_GET['id'],$_POST['continent']); \n }\n\n if (isset($_POST['postcode']) and $_POST['postcode']!= \"\")\n {\n $schools = School::update_postcode($_GET['id'],$_POST['postcode']); \n }\n\n if (isset($_POST['phone_num']) and $_POST['phone_num']!= \"DEFAULT\")\n {\n $schools = School::update_phone_num($_GET['id'],$_POST['phone_num']); \n }\n\n if (isset($_POST['director']) and $_POST['director']!= \"\")\n {\n $schools = School::update_director($_GET['id'],$_POST['director']); \n } \n\n print_r($_POST); \n\n if (isset($_POST['password'])){\n\n if (isset($_POST['password']) and $_POST['password']!= \"DEFAULT\")\n {\n $schools = School::update_password($_GET['id'],$_POST['password']); \n } \n }\n \n }", "function update_itinerary($pid) {\n $i_trip_name = $_POST['trip_name'];\n $i_region_name = $_POST['region_name'];\n $i_price_include = $_POST['price_include'];\n $i_price_exclude = $_POST['price_exclude'];\n $i_equipment = $_POST['equipment'];\n $i_itinerary_detail = $_POST['itinerary_detail'];\n $i_faqs = $_POST['faqs'];\n $i_highlight = $_POST['highlight'];\n $i_video_link = $_POST['video_link'];\n $sql = \"UPDATE itinerary SET trip_id='$i_trip_name',region_id='$i_region_name',price_include='$i_price_include',price_exclude='$i_price_exclude',equipment='$i_equipment',itinerary_detail='$i_itinerary_detail',faqs='$i_faqs',\n\t\t\thighlight='$i_highlight',video_link='$i_video_link' WHERE id='$pid'\";\n $this->mysqli->query($sql);\n if ($this->mysqli->error) {\n echo $this->mysqli->error;\n } else {\n echo \"<script type='text/javascript'>alert('Itinerary updated successfully')</script>\";\n }\n }", "function editApprentice() {\n\t\t\t\t\tif ($_POST['updateDelete'] == 'update') {\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* params(0) represents the apprentice name passed via the URL */\n\t\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\t\n\t\t\t\t\t\t$apprentice->update_attributes(array('name'\t\t\t => $_POST['inputName'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'cohort'\t\t => $_POST['inputCohort'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'address'\t\t => $_POST['inputAddress'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'city'\t\t\t => $_POST['inputCity'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'telephone'\t => $_POST['inputTelephone'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'school'\t\t => $_POST['inputSchool'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'graduation'\t => $_POST['inputGraduation'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'workexperience' => $_POST['inputWorkExperience'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'visa'\t\t\t => $_POST['inputVisa'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'veteran'\t\t => $_POST['inputVeteran'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'unix_linux'\t => $_POST['inputUnixLinux'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'sql'\t\t\t => $_POST['inputSql'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'git'\t\t\t => $_POST['inputGit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'wordpress'\t => $_POST['inputWordpress'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'drupal'\t\t => $_POST['inputDrupal'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'python'\t\t => $_POST['inputPython'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'svn'\t\t\t => $_POST['inputSVN'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'objective_c'\t => $_POST['inputObjectiveC'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'ruby_rails'\t => $_POST['inputRuby'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'c_plusplus'\t => $_POST['inputCPlusPlus'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'dot_net'\t\t => $_POST['inputNet'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'php'\t\t\t => $_POST['inputPHP'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'html_css'\t\t => $_POST['inputHtmlCss'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'java'\t\t\t => $_POST['inputJava'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'javascript'\t => $_POST['inputJavascript'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'comments'\t\t => $_POST['inputComments'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'email'\t\t => $_POST['inputEmail'])\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if ($_POST['updateDelete'] == 'delete') {\n\t\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\t$apprentice->delete();\n\t\t\t\t\t}\n\n\t\t\t\t\t$success = new h2o('views/happySuccess.html');\n\t\t\t\t\techo $success->render();\n\t\t\t\t}", "public function staff_edit(){\n\t\t\n\t\t$is_logged_in = $this->session->userdata('is_logged_in');\n\t\t$this->load->helper('form');\n\t\t\n\t\tif(!empty($is_logged_in) && $is_logged_in == true){\n\n\t\t\t\n\t\t\tif($this->uri->segment(4) != NULL){\n\t\t\t\t\n\t\t\t\t$data['title'] = 'Our Instructors';\n\t\t\t\t$data['details'] = $this->school_model->getStaffbyId($this->uri->segment(4));\n\t\t\t\t\n\t\t\t\t$IsAllowMultiStaff = $this->school_model->IsAllowMultiStaff();\n\t\t\t\t$data['IsAllowMultiStaff'] = $IsAllowMultiStaff;\n\t\t\t\t\n\t\t\t\t$blank_location = array('0' => 'Select Location');\n\t\t\t\t$locations = $this->school_model->getLocations();\n\t\t\t\t\n\t\t\t\t$data['locations'] = $blank_location + $locations;\t\n\n\t\t\t\t//echo '<pre>'; print_r($data); die('yes');\t\n\t\t\n\t\t\t\t\n\t\t\t\tif(isset($_POST['update'])):\n\t\t\t\t\t$this->school_model->updateStaff();\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t$this->load->view(\"admin/school_staff_edit\", $data);\n\t\t\t\n\t\t\t}else{ \n\t\t\t\tredirect(\"admin/school\");\n\t\t\t}\n\t\t}else{ \n\t\t\tredirect(\"admin/login\");\n\t\t}\n\t}", "function update_workman($id,$params)\n {\n $this->db->where('id',$id);\n return $this->db->update('workman',$params);\n }", "public function update() {\n\n //GETS TASK, DEPENDING ON TASK ID (ID)\n $data=Tasks::find(request('task_id'));\n\n //GETS REQUEST AND REPLACES TASK TITLE & DESCRIPTION\n $data->task=request('task');\n $data->description=request('description');\n\n //SAVES DB\n $data->save();\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$data->NotepadID\");\n }", "public function edit(OwnMeasurement $ownMeasurement)\n {\n //\n }", "function UpdateToDB()\n\t{\n\t\tif(isset($_GET['job_id']))\n\t\t{\n\t\t\t//Initializing variables with the user inputs\n\t\t\t$Id = $_GET['job_id'];\n\t\t\t$IndustryType = $_GET['job_industry_type'];\n\t\t\t\n\t\t\tif(!empty($Id))\n\t\t\t{\t\t\t\t\n\t\t\t\t//Query which is going to execute to for database manipulation\n\t\t\t\t$query =\"UPDATE job_details SET industry_type='$IndustryType' WHERE id='$Id'\";\n\t\t\t\t$query_run = mysql_query($query);\n\t\t\t}\n\t\t}\t\n\t}", "function editWine() {\n\t\tif (isset($_SESSION['wine_name_long'])) {\n\t\t\t$wineIdx = getWineRecIndex(\n\t\t\t\t\t\tbase64_decode($_SESSION['wine_name_long'])\n\t\t\t\t\t);\n\t\t\t//add the wines into an array\n\t\t\t$editWine = [\n\t\t\t\t\"name\" => $_POST['wine_name'],\n\t\t\t\t\"image\" => $_POST['wine_image'],\n\t\t\t\t\"origin\" => $_POST['wine_origin'],\n\t\t\t\t\"desc\" => $_POST['wine_desc'],\n\t\t\t\t\"price\" => $_POST['wine_price']\n\t\t\t];\n\t\t\t//get the existing wines\n\t\t\t$wines = getWines();\n\n\t\t\t//get the contents of the wine file\n\t\t\t$writeFile = fopen('data/wines.json', \"w\");\n\t\t\t//replace the current record with the new record\n\t\t\t$wines[$wineIdx] = $editWine;\n\t\t\t//convert userRecord to JSON\n\t\t\t$winesJson = json_encode($wines,JSON_PRETTY_PRINT);\n\t\t\t//write JSON string to file\n\t\t\tfwrite($writeFile, $winesJson);\n\t\t\t//close file\n\t\t\tfclose($writeFile);\n\n\t\t\t//redirect to homepage\n\t\t\theader('Location: index.php');\t\n\t\t}\n\t}", "function edit_kitchen_data()\n {\n $this->form_validation->set_rules('kitchen_id','kitchen_id','required');\n $this->form_validation->set_rules('kitchen_name','kitchen_name','required');\n $this->form_validation->set_rules('kitchen_type','kitchen_type','required');\n $this->form_validation->set_rules('kitchen_address1','kitchen_address1','required');\n $this->form_validation->set_rules('kitchen_address2','kitchen_address2','required');\n $this->form_validation->set_rules('kitchen_address3','kitchen_address3','required');\n $this->form_validation->set_rules('state','state','required');\n $this->form_validation->set_rules('city','city','required');\n $this->form_validation->set_rules('zipcode','zipcode','required');\n\n if($this->form_validation->run())\n {\n \n $kitchen_data = array(\n \"k_id\" => $this->input->post(\"kitchen_id\"),\n \"k_name\" => $this->input->post(\"kitchen_name\"),\n \"kitchen_type\" => $this->input->post(\"kitchen_type\"),\n \"k_address1\" => $this->input->post(\"kitchen_address1\"),\n \"k_address2\" => $this->input->post(\"kitchen_address2\"),\n \"k_address3\" => $this->input->post(\"kitchen_address3\"),\n \"state\" => $this->input->post(\"state\"),\n \"city\" => $this->input->post(\"city\"),\n \"zipcode\" => $this->input->post(\"zipcode\")\n );\n \n if($this->input->post('update'))\n {\n \n $get_update = $this->update_model->update_kitchen_register($this->input->post(\"khidden_id\"),$kitchen_data);\n if($get_update)\n {\n \n echo \"<script> alert('kitchen data updated'); </script>\";\n echo \"<script>window.location.href='\".base_url().\"Superadmin/manage_kitchen/';</script>\";\n }\n }\n }\n else\n {\n if($this->session->has_userdata('admin_id'))\n {\n $id = $this->input->post(\"khidden_id\");\n $data['user_data'] = $this->select_model->select_user($this->backend_table,$this->admin_id);\n \n $data['kicthen_reg_id'] = $this->select_model->kicthen_reg_id($id);\n $this->load->view('headers/superadmin_home_header',$data);\n $this->load->view('products/new_kitchen',$data);\n $this->load->view('headers/footer');\n }\n else\n {\n $this->error_403();\n }\n }\n }", "public function editstepsAction(){\n\n\t echo $this->ModelObj->updatesteps($this->Request); exit;\n\n\t}", "public function actionUpdate() //update value from default page to DB\n {\n\n\n $model = $this->findModel($_POST['ExamRoomDetail']['rooms_detail_date'],\n $_POST['ExamRoomDetail']['rooms_detail_time'],\n $_POST['ExamRoomDetail']['rooms_id']\n );\n if(isset($_POST)) {\n $model->load(Yii::$app->request->post());\n $update = $model;\n $update->exam_room_status = $_POST['ExamRoomDetail']['exam_room_status'];\n $update->save();\n }\n\n }", "public function edit() {\n\t\t\n\t\t$data = array(\n\t\t\t'user_id' => $this->_user_id,\n\t\t\t'date' => $this->_date,\n\t\t\t'time_of_day' => $this->_time_of_day,\n\t\t\t'type_id' => $this->_type_id,\n\t\t\t'route_id' => $this->_route_id,\n\t\t\t'distance' => $this->_distance,\n\t\t\t'time' => $this->_time,\n\t\t\t'shoe_id' => $this->_shoe_id,\n\t\t\t'quality' => $this->_quality,\n\t\t\t'effort' => $this->_effort,\n\t\t\t'weather_ids' => $this->_weather_ids,\n\t\t\t'temperature' => $this->_temperature,\n\t\t\t'notes' => $this->_notes,\n\t\t\t'field' => $this->_field,\n\t\t\t'placement' => $this->_placement,\n\t\t\t'group_min_age' => $this->_group_min_age,\n\t\t\t'group_max_age' => $this->_group_max_age,\n\t\t\t'group_age_size' => $this->_group_age_size,\n\t\t\t'group_age_placement' => $this->_group_age_placement,\n\t\t\t'group_gender_size' => $this->_group_gender_size,\n\t\t\t'group_gender_placement' => $this->_group_gender_placement,\n\t\t\t'active' => $this->_active\t\t\t\n\t\t);\n\t\t$this->db->where('id',$this->_id);\n\t\t$this->db->update($this->_table,$data);\n\t\t\n\t\treturn true;\n\t}", "public function actionUpdate($id,$div_id,$emp_id)\n\t{\n\t\t/*print_r($_POST);\n\t\texit;*/\n\t\t$model=$this->loadModel($id);\n\t\tif($model->employer_id==$emp_id)\n\t \t{\n\t \t $post_id = $id;\n\t\t $post_value = isset($_REQUEST['value'])?$_REQUEST['value']:'';\n\t \n\t\t /****Post Title******/\n\t\t \n\t\t if($div_id == 'employer_title')\n\t\t\t{\n\t\t\t\t/*$emp_data = Posting::model()->get_post('title','',' title=\"'.$post_value.'\"');\n\t\t\t\t\n\t\t\t\tif(count($emp_data) > 0)\n\t\t\t\t{\n\t\t\t\t\techo 'Title Already exists';\n\t\t\t\t\treturn false;\n\t\t\t\t}else{*/\n\t\t\t\t\t$model->title=$post_value;\n\t\t\t\t//}\n\t\t\t}\n\t\t\n\t\t/*****Post Skills******/\n\t\t\n\t\t\tif($div_id == 'employer_skills')\n\t\t\t{\n\t\t\t\t$typeahead_string='';\n\t\t\t\tfor($i=0; $i< count($post_value); $i++)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$skill_id=Skill::model()->search_skill(ltrim($post_value[$i],'<br>')).\",\";\n\t\t\t\t\t\n\t\t\t\t\t$typeahead_string .= $skill_id;\n\t\t\t\t}\n\t\t\t\t\t$skill_list = rtrim($typeahead_string, \", \");\n\t\t\t\t\t$model->skill_id = trim(addslashes(strip_tags($skill_list)));\n\t\t\t} \n\t\t\n\t\t/*****Post Industry******/\n\t\t\n\t\t\t if($div_id == 'employer_industry')\n\t\t\t{\n\t\t\t\tif(count($post_value) >1)\n\t\t\t\t{\n\t\t\t\t\techo 'Please enter one industry ';\n\t\t\t\t\treturn false;\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$job_data= JobType::model()->get_job('id','','title=\"'.$post_value[0].'\"');\n\t\t\t\t\n\t\t\t\t\tif(count($job_data) > 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$model->job_type_id=$job_data[0]['id'];\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t $rows = Yii::app()->db->createCommand()->insert('job_type',array(\n\t\t\t\t\t\t\t'title'=>$post_value,\n\t\t\t\t\t\t\t'status'=>'1',\n\t\t\t\t\t\t));\t\t\t\t\t\n\t\t\t\t\t\t $job_id=Yii::app()->db->getLastInsertID();\n\t\t\t\t\t\t $model->job_type_id=$job_id;\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t\t\n\t\t\n\t\t/*****Post Description******/\n\t\t\n\t\t\tif($div_id == 'employer_description')\n\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$model->description = addslashes(htmlspecialchars($post_value));\n\t\t\t\t\t\n\t\t\t} \n\t\t\tif($div_id=='employer_facebook')\n\t\t\t{\n\t\t\t\t/*$facebook=explode('.',$post_value);\n\t\t\t\tif($facebook[1]=='facebook')\n\t\t\t\t{*/\n\t\t\t\t\t$model->facebook_id = addslashes(htmlspecialchars($post_value));\n\t\t\t\t/*}else\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\techo 'Please enter Facebook url';\n\t\t\t\t\treturn false;\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t\tif($div_id == 'employer_twitter')\n\t\t\t{\n\t\t\t\t/*$twitter=explode('.',$post_value);\n\t\t\t\tif($twitter[1]=='twitter')\n\t\t\t\t{*/\n\t\t\t\t\t\n\t\t\t\t\t$model->twitter_id = addslashes(htmlspecialchars($post_value));\n\t\t\t\t/*}else\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\techo 'Please enter Twitter url';\n\t\t\t\t\treturn false;\n\t\t\t\t}\t*/\t\t\n\t\t\t}\n\t\t\n\t\t\tif($div_id == 'employer_linkedin')\n\t\t\t{\n\t\t\t\t/*$linkedin=explode('.',$post_value);\n\t\t\t\tif($linkedin[1]=='linkedin')\n\t\t\t\t{*/\n\t\t\t\t $model->linkedin_id = addslashes(htmlspecialchars($post_value));\n\t\t\t\t/*}else\n\t\t\t\t{\n\t\t\t\t\techo 'Please enter Linkedin url';\n\t\t\t\t\treturn false;\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t} \n\t\t\n\t\t\t\n\t\t\t\tif($model->save())\n\t\t\t\t\techo 1;\n\t\t\t\t/*else\n\t\t\t\t $errores = $model->getErrors();\n\t\t\t\t print_r($errores);*/\n\t\t\t\t \n\t } \n\t}", "function edit()\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n\t\t\t\n\t\t\t//render the edit form\n\t\t\t$view = $this->getView('manage','html');\n\t\t\t\n\t\t\t//load data\n\t\t\t$db->setQuery('select * from #__shbesuche_config');\n\t\t\t$view->config = $db->loadObject();\n\t\t\t$db->setQuery('select * from #__pbbooking_events where id = '.$db->escape(JRequest::getInt('id')));\n\t\t\t$view->event = $db->loadObject();\n\t\t\t$db->setQuery('select * from #__pbbooking_treatments');\n\t\t\t$view->services = $db->loadObjectList();\n\t\t\t$db->setQuery('select * from #__pbbooking_cals');\n\t\t\t$view->cals = $db->loadObjectList();\n\t\t\tif ($view->config->consolidated_view == 1) { \n\t\t\t\t$db->setQuery('select * from #__pbbooking_cals where out_cal = 1');\n\t\t\t\t$view->outcal = $db->loadObject();\n\t\t\t}\n\t\t\t//sort out openign and closing times\n\t\t\t$opening_hours = json_decode($view->config->trading_hours,true);\n\t\t\t$opening_time_arr = str_split($opening_hours[date_create($view->event->dtstart, new DateTimeZone(SHBESUCHE_TIMEZONE))->format('w')]['open_time'],2);\n\t\t\t$closing_time_arr = str_split($opening_hours[date_create($view->event->dtstart, new DateTimeZone(SHBESUCHE_TIMEZONE))->format('w')]['close_time'],2);\n\t\t\t$view->dt_start = date_create($view->event->dtstart,new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$view->dt_end = date_create($view->event->dtstart,new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$view->dt_start->setTime($opening_time_arr[0],$opening_time_arr[1]);\n\t\t\t$view->dt_end->setTime($closing_time_arr[0],$closing_time_arr[1]);\n\t\t\t\n\t\t\t//display the view\n\t\t\t$view->setLayout('edit_event');\n\t\t\tJToolbarHelper::save('edit',Jtext::_('COM_SHBESUCHE_SAVE_CHANGES'));\n\t\t\tJToolbarHelper::trash('delete',Jtext::_('COM_SHBESUCHE_DELETE_EVENT'),false);\n\t\t\tJToolbarHelper::custom('view_ical','view_ics','',Jtext::_('COM_SHBESUCHE_VIEW_ICS'),false);\n\t\t\tJToolbarHelper::cancel();\n\t\t\t$view->display();\n\t\t}\n\t\t\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n\t\t\t$db->setQuery('select * from #__pbbooking_events where id = '.$db->escape(JRequest::getInt('id')));\n\t\t\t$event = $db->loadObject();\n\t\t\t$db->setQuery('select * from #__pbbooking_treatments where id = '.$db->escape($event->service_id));\n\t\t\t$service = $db->loadObject();\n\t\t\t\n\t\t\t$treatment_time = JRequest::getVar('treatment-time');\n\t\t\t$times_arr = str_split($treatment_time,2);\n\t\t\t$dtstart = date_create(JRequest::getVar('date'),new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$dtstart->setTime((int)ltrim($times_arr[0],'0'),(int)ltrim($times_arr[1],'0'),0);\n\t\t\t$dtend = date_create($dtstart->format(DATE_ATOM),new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$dtend->modify('+'.$service->duration.' minutes');\n\t\t\t\n\t\t\t$event->summary = JRequest::getVar('summary');\n\t\t\t$event->description = JRequest::getVar('description');\n\t\t\t$event->dtstart = $dtstart->format('Y-m-d H:i:s');\n\t\t\t$event->dtend = $dtend->format('Y-m-d H:i:s');\n\n\n\t\t\tif ((int)$_POST['reccur'] == 1) {\n\t\t\t\t$event->r_int = JRequest::getVar('interval');\n\t\t\t\t$event->r_freq = JRequest::getVar('frequency');\n\t\t\t\t$event->r_end = JRequest::getVar('recur_end');\n \t\t\t}\t\n\n\t\t\tif (isset($_POST['cal_id'])) $event->cal_id = JRequest::getInt('cal_id');\n\t\t\tif ($db->updateObject('#__pbbooking_events',$event,'id')) {\n\t\t\t\t$this->setRedirect('index.php?option=com_pbbooking&controller=manage&date='.JRequest::getVar('date'),Jtext::_('COM_SHBESUCHE_EDIT_SUCCESS'));\n\t\t\t} else {\n\t\t\t\techo $db->getErrorMsg();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\n\t}", "function AfterEdit(&$values,$where,&$oldvalues,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid= $keys['proid'];\n$date=$values['bill_date'];\n$amount=$values['amount'];\n$item=$values['item'];\n$bill_no=$values['bill_no'];\n\n\n$sql_update=\"UPDATE student_billing SET \nitem='$item',amount='$amount',amount_balance='$amount',\ndate='$date',\nbill_no='$bill_no'\nWHERE proid='$proid'\";\ndb_exec($sql_update,$conn);\n\n;\t\t\n}", "function updatePoi(){\n\t\t$data['id'] = $this->uri->segment(4);\n\t\tif($data['id']){\n\t\t\t$data['poi'] = $this->pois_model->getPoi($data['id']);\n\t\t}\n\t\t$this->load->view('pois/form_update', $data);\n\t}", "public function edit_staff_pin_put ()\r\n {\r\n $staff_id = $this->uri->segment(3);\r\n $this->form_validation->set_data($this->put());\r\n if($this->put('check_mail') == 1)\r\n {\r\n $this->form_validation->set_rules('pin', 'PIN No', 'trim|numeric|required|max_length[6]|min_length[6]');\r\n $this->form_validation->set_rules('confirm_pin_no', 'Pin Confirmation', 'trim|required|matches[pin]');\r\n }\r\n else\r\n {\r\n $this->form_validation->set_rules('reset_pin', 'Reset No', 'trim|required');\r\n }\r\n if ($this->form_validation->run() == FALSE)\r\n { \r\n $set_message = strip_tags(validation_errors());\r\n $this->response_error_message('error',$set_message);\r\n }\r\n else\r\n {\r\n $table = STAFF_TB;\r\n $table_prefix = '';\r\n $function_name = $this->getFunctionName ( __FUNCTION__ );\r\n $columns = 'reset_pin,pin';\r\n $params = array();\r\n $params['table'] = $table;\r\n $params['function_name'] = $function_name;\r\n $params['columns'] = $columns;\r\n $params['table_prefix'] = $table_prefix;\r\n $params['id'] = $staff_id;\r\n $params['id_col'] = 'staff_id';\r\n $params['success_message'] = COMMON_STAFF_UPDATE;\r\n $this->_update_common_table($params);\r\n }\r\n }", "public function edit_watch_p(){\r\n\r\n\t\tif($this->expectsPost(array('watchId'))){\r\n\r\n\t\t\t$watch = $this->watch->getWatch($this->watchId);\r\n\r\n\t\t\tif($watch && $watch->userId == $this->session->userdata('userId')){\r\n\r\n\t\t\t\tarray_push($this->_headerData['javaScripts'],\r\n\t\t\t\t\t\"jquery.easy-autocomplete.min\", \"watch.autocomplete\");\r\n\r\n\t\t\t\tarray_push($this->_headerData['styleSheets'],\r\n\t\t\t\t\t\"easy-autocomplete.min\",\r\n\t\t\t\t\t\"easy-autocomplete.themes.min\"\r\n\t\t\t\t);\r\n\r\n\t\t\t\t$this->_headerData['headerClass'] = 'blue';\r\n\t\t\t\t$this->load->view('header', $this->_headerData);\r\n\t\t\t\t$this->load->view('measure/edit-watch', $watch);\r\n\t\t\t\t$this->load->view('footer');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function submissionDetailsEdit2(){\r\n\t\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t\t\t$data_id = $this->input->post(\"data_id\");\r\n\t\t\t$details = $this->AB->list_of_admission_form3($data_id);\r\n\r\n\t\t\t$data[\"data_id\"] = $details;\r\n\t\t\t\r\n\r\n\t\t\t$grade_id = (int)$details[\"Grade_id\"];\r\n\t\t\t$Batch_id = (int)$details[\"Batch_id\"];\r\n\t\t\t\r\n\t\t\t$data[\"formBatchDetails\"] = $this->AB->getGradeFormBatch($grade_id);\r\n\r\n\t\t\t\r\n\t\t\t$data[\"school_lists\"] = $this->AB->school_id();\r\n\t\t\t$data[\"grade_lists\"] = $this->AB->grade_id();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->load->model('gs_admission/submission_model', 'SM');\r\n\t\t\t$data[\"slotInfo\"] = $this->SM->getSlots($Batch_id,$data_id);\r\n\r\n\t\t\t$this->load->view('gs_admission/submission/form_only',$data);\r\n\t\t}", "public function update(Request $request, SaleProduct $saleProduct)\n {\n $viewData['pageTitle'] = 'Add Workshop'; \n $viewData['product'] = Product::pluck('product_name', 'id');\n $viewData['service'] = Service::pluck('service_name', 'id');\n $viewData['model_select'] = Modal::pluck('model_name', 'id');\n $viewData['brand_select'] = Brand::pluck('brand_name', 'id');\n $viewData['ServiceType'] = ServiceType::pluck('service_type_name', 'id');\n $viewData['registered_vehicle_select'] = VehicleDetail::pluck('vehicle_reg_number', 'vehicle_reg_number');\n $viewData['customerNameSelect'] = Customer::pluck('customer_name', 'id');\n $viewData['header_link'] = HeaderLink::where(\"menu_id\",'3')->select(\"link_title\",\"link_name\")->orderBy('id','desc')->get();\n // This if condition for fill detail for update otherwise for save and update \n \n if ($request->isMethod('post')){\n $getFormAutoFillup = array(); \n if(isset($request->id) && $request->id != null) \n {\n if ($request->isMethod('post')){\n $PartyManage= request()->except(['_token','service_id','product_id','service_quantity','product_quantity','service_type','service_price','product_price','workshop_product_brand','workshop_product_model','workshop_service_brand','workshop_service_model','service_type_id']);\n // $PartyManage['is_workshop']=0;\n // $PartyManage['is_complete']=1;\n \n if(Workshop::where([['id', '=', $request->id]])->update($PartyManage)){\n $workshopProductData= WorkshopProduct::where('workshop_id','=',$request->id)->get();\n foreach ($workshopProductData as $key => $value) {\n $stock_out=$value['product_quantity'];\n $product_id=$value['product_id'];\n $stock_available=$value['stock_available'];\n \n $productDetail=Product::whereId($product_id)->first()->toArray();\n $productStockOut=$productDetail['stock_out'];\n $productStockAvailable=$productDetail['stock_available'];\n $productManame['stock_out']=$productStockOut-$stock_out;\n $productManame['stock_available']=$productStockAvailable+ $stock_available;\n Product::where([['id', '=',$product_id]])->update($productManame);\n }\n\n WorkshopProduct::where('workshop_id',$request->id)->forceDelete();\n for($i=0; $i < count($request->product_id); $i++){\n\n $WorkshopProduct= new WorkshopProduct();\n $WorkshopProduct->workshop_id = $request->id;\n $WorkshopProduct->product_id = $request->product_id[$i];\n $WorkshopProduct->product_quantity = $request->product_quantity[$i];\n $WorkshopProduct->product_price = $request->product_price[$i];\n $WorkshopProduct->workshop_product_brand = $request->workshop_product_brand[$i];\n $WorkshopProduct->workshop_product_model = $request->workshop_product_model[$i]; \n $WorkshopProduct->save();\n\n $productDetail=Product::whereId($request->product_id[$i])->first()->toArray();\n $productStockOut=$productDetail['stock_out'];\n if($productStockOut==null)\n {\n $productStockOut=0;\n }\n $productStockAvailable=$productDetail['stock_available'];\n $productManame['stock_out']=$productStockOut+$request->product_quantity[$i];\n $productManame['stock_available']=$productStockAvailable-$request->product_quantity[$i];\n Product::where([['id', '=',$request->product_id[$i]]])->update($productManame);\n\n } \n if($request->is_complete==1)\n {\n // Mail::to($request->email)->send(new SendMailToCustomer($request->id));\n // SendEMailJob::dispatch($request->email,$request->id)\n // ->delay(now()->addSeconds(5));\n }\n \n $request->session()->flash('message.level', 'success');\n $request->session()->flash('message.content', ' updated Successfully!');\n }\n }\n $viewData['workshopId'] = $request->id;\n return redirect('/SaiAutoCare/sale/edit/'.$request->id);\n }\n }\n}", "public function edit()\n {\n $postInformation = $this->input->post();\n $dataArray = array();\n foreach ($postInformation as $key => $value) {\n if ($key != \"lessonId\" and $key != \"moduleId\" && $key != \"file\") {\n $dataArray[\"dataToUpdate\"][$key] = $value;\n }\n }\n $dataArray[\"lessonId\"] = $this->input->post(\"lessonId\");\n $resultEditLesson = $this->Lesson_Model->edit($dataArray);\n echo json_encode($resultEditLesson);\n }", "public function edit( )\r\n {\r\n //\r\n }", "function update_edit_details_by_user($post) {\n $last_tgram_id = $this->mdl_common->save_tgram_by_user($post);\n if ($last_tgram_id) {\n $post['tgrmid'] = $last_tgram_id;\n }\n\n $this->mdl_common->save_pm_by_user($post);\n\n\n $edit_data = array(\n 'tgrmid' => $post['tgrmid'],\n 'tgram_id' => $post['tgram_id'],\n 'account_name' => $post['account_name'],\n 'received_date' => $post['received_date'],\n 'revision' => $post['revision'],\n 'account_type_id' => $post['account_type_id'],\n 'pm_id' => $post['pm_id'],\n 'pages_worked' => $post['pages_worked'],\n 'plp' => $post['plp'],\n 'billing_hour' => $post['billing_hour'],\n 'total_hour' => $post['billing_hour'],\n 'actual_hour' => $post['billing_hour'],\n 'comments' => $post['comments'],\n 'user_id' => $post['user_id'],\n 'submit_time' => date(\"Y-m-d G:i:s\", time())\n );\n\n $this->db->where('id', $post['edit_id']);\n $this->db->update('tbl_edit', $edit_data);\n\n\n if ($post['plp'] == 'Yes') {\n\n $plp_data = array(\n 'tgrmid' => $post['tgrmid'],\n 'tgram_id' => $post['tgram_id'],\n 'account_name' => $post['account_name'],\n 'cid' => $post['cid'],\n 'error_details_plp' => $post['error_details_plp'],\n 'received_date' => $post['received_date'],\n 'account_type_id' => $post['plp_account_type'],\n 'pm_id' => $post['pm_id'],\n 'billing_hour' => $post['billing_hour_plp'],\n 'total_hour' => $post['billing_hour_plp'],\n 'actual_hour' => $post['billing_hour_plp'],\n 'comments' => $post['comments_plp'],\n 'user_id' => $post['user_id'],\n 'submit_time' => date(\"Y-m-d G:i:s\", time())\n );\n $this->db->where('id', $post['plp_id']);\n $this->db->update('tbl_plp', $plp_data);\n }\n\n return 1;\n }", "public function actionUpdate() {}", "public function actionUpdate() {}", "public function travel_conditions_edit() {\n\t\t$id = $this->uri->segment(4);\n\t\tCheckAdminLoginSession();\t\t\n\t\t$post_data = $this->input->post();\n\t\t$checked_password = $this->input->post('checked_password');\n\t\tif(!empty($post_data)) { \n\t\t\t$this->form_validation->set_error_delimiters('<span class=\"text-danger\">', '</span>');\n\t\t\t$this->form_validation->set_rules('name', 'Name', 'required');\t\t\n\t\t\t$this->form_validation->set_rules('amount', 'Amount', 'required|numeric');\t\n\t\t\t$this->form_validation->set_rules('company_id', 'Company', 'required');\t\t\n\t\t\t$this->form_validation->set_rules('branch_id', 'Branch', 'required');\t\t\n\t\t\t$this->form_validation->set_rules('risque_id', 'Risque', 'required');\t\t\n\t\t\t$this->form_validation->set_rules('description', 'Description', 'required');\t\t\n\t\t\t\t\t\t\t\t\n\t\t\tif($this->form_validation->run() == FALSE) { } else {\t\t\t\n\t\t\t\t$data = array(\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t'name' => $this->input->post('name'),\n\t\t\t\t\t'amount' => $this->input->post('amount'),\n\t\t\t\t\t'company_id' => $this->input->post('company_id'),\t\t\n\t\t\t\t\t'branch_id' => $this->input->post('branch_id'),\n\t\t\t\t\t'risque_id' => $this->input->post('risque_id'),\n\t\t\t\t\t'description' => $this->input->post('description'),\n\t\t\t\t\t'status' => $this->input->post('status'),\n\t\t\t\t\t'modified_date' => date(\"Y-m-d H:i:s\"),\n\t\t\t\t);\n\n\t\t\t\t$id = $this->admin_model->setUpdateData($this->travel,$data,$id);\n\t\t\t\t$this->session->set_flashdata('message','Your Travel Examination has been update successfully');\n\t\t redirect('admin/travel-conditions/lists','refresh');\n\t\t }\n }\n\t\t$data['dataCollection'] = $this->admin_model->getDataCollectionByID($this->travel,$id);\n\t\t$this->load->view('admin/include/head');\n\t\t$this->load->view('admin/include/header');\n\t\t$this->load->view('admin/include/sidebar');\n\t\t$this->load->view('admin/travel/condition_edit',$data);\n\t\t$this->load->view('admin/include/footer');\n\t\t$this->load->view('admin/include/foot');\n\t}", "public function index_onUpdateForm()\n\t{\n\t\t$record_id = post('record_id');\n\t\tparent::update($record_id);\n\t\t$this->controller->vars['record_id'] = $record_id;\n\t\treturn $this->makePartial('update');\n\t}", "function edit_labresults()\r\n {\r\n\t\t$this->load->model('morders_wdb');\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n\t\t$data['user_rights'] = $this->mthirra->get_user_rights($_SESSION['username']);\r\n $data['now_id'] = time();\r\n $data['now_date'] = date(\"Y-m-d\",$data['now_id']);\r\n $data['now_time'] = date(\"H:i\",$data['now_id']);\r\n\t \t\r\n if(count($_POST)) {\r\n // User has posted the form\r\n if(isset($_POST['lab_package_id'])) { \r\n $data['lab_package_id'] = $_POST['lab_package_id'];\r\n }\r\n if(isset($_POST['supplier_id'])) { \r\n $data['supplier_id'] = $_POST['supplier_id'];\r\n } else {\r\n $data['supplier_id'] = \"none\";\r\n }\r\n $data['form_purpose'] = $_POST['form_purpose'];\r\n $data['patient_id'] = $_POST['patient_id'];\r\n $data['summary_id'] = $_POST['summary_id'];\r\n $data['lab_order_id'] = $_POST['lab_order_id'];\r\n $data['order_info'] = $this->memr_rdb->get_patcon_lab($data['summary_id'],$data['lab_order_id']);\r\n $data['lab_package_id'] = $data['order_info'][0]['lab_package_id'];\r\n $data['package_name'] = $data['order_info'][0]['package_name'];\r\n $data['supplier_id'] = $data['order_info'][0]['supplier_id'];\r\n $data['supplier_name'] = $data['order_info'][0]['supplier_name'];\r\n $data['sample_required']= $data['order_info'][0]['sample_required'];\r\n $data['sample_date'] = $data['order_info'][0]['sample_date'];\r\n $data['sample_time'] = $data['order_info'][0]['sample_time'];\r\n $data['fasting'] = $data['order_info'][0]['fasting'];\r\n $data['urgency'] = $data['order_info'][0]['urgency'];\r\n $data['sample_ref'] = $data['order_info'][0]['sample_ref'];\r\n $data['remarks'] = $data['order_info'][0]['remarks'];\r\n $data['summary_result'] = $_POST['summary_result'];\r\n $data['result_date'] = $_POST['result_date'];\r\n $data['result_ref'] = $_POST['result_ref'];\r\n $data['num_of_tests'] = $_POST['num_of_tests'];\r\n\t\t\t//$data['package_info'] = $this->memr_rdb->get_one_lab_package($data['lab_package_id']);\r\n $data['package_info'] = $this->memr_rdb->get_one_lab_results($data['lab_order_id']);\r\n\t\t\tif(count($data['package_info']) > 0){\r\n\t\t\t\tfor($i=1; ($i <= $data['num_of_tests']); $i++){\r\n\t\t\t\t\t$varname_result = \"test_result_\".$i;\r\n\t\t\t\t\t$varname_normal = \"test_normal_\".$i;\r\n\t\t\t\t\t$varname_remark = \"test_remark_\".$i;\r\n\t\t\t\t\t$data['package_info'][$i-1][$varname_result]\t=\t$_POST[\"test_result_\".$i];\r\n\t\t\t\t\t$data['package_info'][$i-1][$varname_normal]\t=\t$_POST[\"test_normal_\".$i];\r\n\t\t\t\t\t$data['package_info'][$i-1][$varname_remark]\t=\t$_POST[\"test_remark_\".$i];\r\n\t\t\t\t\t//echo $data[$varname_result];\r\n\t\t\t\t} //end for($i=1; ($i <= $data['num_of_test']); $i++)\r\n\t\t\t\t$data['num_of_tests'] = count($data['package_info']);\r\n\t\t\t} //endif(count($data['package_info']) == $data['num_of_tests'])\r\n if(isset($_POST['close_order'])) { \r\n\t\t\t\t$data['close_order'] \t\t\t= $_POST['close_order'];//TRUE;\r\n\t\t\t} else {\r\n\t\t\t\t$data['close_order'] \t\t\t= \"FALSE\";\t\t\t\t\r\n\t\t\t}\r\n } else {\r\n // First time form is displayed\r\n $data['form_purpose'] = $this->uri->segment(3);\r\n $data['patient_id'] = $this->uri->segment(4);\r\n $data['summary_id'] = $this->uri->segment(5);\r\n $data['lab_order_id'] = $this->uri->segment(6);\r\n $patient_id = $this->uri->segment(4);\r\n //$data['patient_id'] = $patient_id;\r\n if ($data['form_purpose'] == \"new_labresults\") {\r\n //echo \"new_lab\";\r\n $data['lab_package_id'] = \"none\";\r\n $data['supplier_id'] = \"none\";\r\n $data['sample_date'] = $data['now_date'];\r\n $data['sample_time'] = $data['now_time'];\r\n $data['fasting'] = \"\";\r\n $data['urgency'] = \"\";\r\n $data['sample_ref'] = \"\";\r\n $data['summary_result'] = \"Pending\";\r\n $data['remarks'] = \"\";\r\n $data['lab_order_id'] = \"new_lab\";\r\n\t\t\t\t$data['package_info'][0]['sample_required'] = \"N/A\";\r\n $data['result_ref'] = \"\";\r\n $data['num_of_tests'] = 0;\r\n } elseif ($data['form_purpose'] == \"edit_labresults\") {\r\n //echo \"Edit diagnosis\";\r\n $data['order_info'] = $this->memr_rdb->get_patcon_lab($data['summary_id'],$data['lab_order_id']);\r\n $data['lab_package_id'] = $data['order_info'][0]['lab_package_id'];\r\n $data['package_name'] = $data['order_info'][0]['package_name'];\r\n $data['supplier_id'] = $data['order_info'][0]['supplier_id'];\r\n $data['supplier_name'] = $data['order_info'][0]['supplier_name'];\r\n $data['sample_required']= $data['order_info'][0]['sample_required'];\r\n $data['sample_date'] = $data['order_info'][0]['sample_date'];\r\n $data['sample_time'] = $data['order_info'][0]['sample_time'];\r\n $data['fasting'] = $data['order_info'][0]['fasting'];\r\n $data['urgency'] = $data['order_info'][0]['urgency'];\r\n $data['sample_ref'] = $data['order_info'][0]['sample_ref'];\r\n $data['summary_result'] = $data['order_info'][0]['summary_result'];\r\n $data['remarks'] = $data['order_info'][0]['remarks'];\r\n $data['result_reviewed_by'] = $data['order_info'][0]['result_reviewed_by'];\r\n $data['result_date'] = $data['order_info'][0]['result_date'];\r\n $data['result_ref'] = $data['order_info'][0]['result_ref'];\r\n\t\t\t\t$data['package_info'] = $this->memr_rdb->get_one_lab_results($data['lab_order_id']);\r\n\t\t\t\t$data['num_of_tests'] = count($data['package_info']);\r\n\t\t\t\tif($data['fasting'] == 1){\r\n\t\t\t\t\t$data['fasting'] \t=\t\"Yes\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$data['fasting'] \t=\t\"No\";\r\n\t\t\t\t}\r\n\t\t\t\tif($data['urgency'] == 1){\r\n\t\t\t\t\t$data['urgency'] \t=\t\"Yes\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$data['urgency'] \t=\t\"No\";\r\n\t\t\t\t}\r\n } //endif ($data['form_purpose'] == \"new_lab\")\r\n } //endif(count($_POST))\r\n\t\t$data['title'] = \"Edit Lab Results\";\r\n\t\t$data['patient_info'] = $this->memr_rdb->get_patient_demo($data['patient_id']);\r\n $data['patcon_info'] = $this->memr_rdb->get_patcon_details($data['patient_id'],$data['summary_id']);\r\n //$data['lab_list'] = $this->memr_rdb->get_patcon_lab($data['summary_id']);\r\n $data['init_location_id'] = $_SESSION['location_id'];\r\n $data['init_clinic_name'] = NULL;\r\n $data['now_id'] = time();\r\n $data['now_date'] = date(\"Y-m-d\",$data['now_id']);\r\n //$data['init_patient_id'] = $patient_id;\r\n\r\n //$data['packages_list']= $this->memr_rdb->get_lab_packages_list();\r\n\t\t//$data['package_info'] = $this->memr_rdb->get_one_lab_package($data['lab_package_id']);\r\n\r\n\t\t$this->load->vars($data);\r\n // Run validation\r\n\t\tif ($this->form_validation->run('edit_lab_result') == FALSE){\r\n\t\t //$this->load->view('ehr_patient/emr_edit_patient_html');\t\t\t\r\n if ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_ehr_ovrvw_wap\";\r\n $new_sidebar= \"ehr/sidebar_ehr_patients_ovrvw_wap\";\r\n //$new_body = \"ehr/ehr_orders_edit_labresults_wap\";\r\n $new_body = \"ehr/ehr_indv_edit_labresults_html\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n } else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_ovrvw_html\";\r\n $new_sidebar= \"ehr/sidebar_ehr_patients_ovrvw_html\";\r\n $new_body = \"ehr/ehr_indv_edit_labresults_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n }\r\n if($data['user_rights']['section_orders'] < 100){\r\n $new_body = \"ehr/ehr_access_denied_html\";\r\n }\r\n $this->load->view($new_header);\t\t\t\r\n $this->load->view($new_banner);\t\t\t\r\n $this->load->view($new_sidebar);\t\t\t\r\n $this->load->view($new_body);\t\t\t\r\n $this->load->view($new_footer);\t\t\t\r\n } else {\r\n //echo \"\\nValidated successfully.\";\r\n //echo \"<pre>\";\r\n //print_r($data);\r\n //echo \"</pre>\";\r\n // Existing lab order record\r\n $upd_lab_array['lab_order_id'] = $data['lab_order_id'];\r\n $upd_lab_array['summary_result'] = $data['summary_result'];\r\n $upd_lab_array['result_status'] = \"Received\";\r\n if($data['close_order'] == \"TRUE\") {\r\n //echo \"Change status \".$data['close_order'];\r\n $upd_lab_array['result_status'] \t = \"Received\"; // To consider to use \"Reviewed\"\r\n $upd_lab_array['result_reviewed_by'] \t= $_SESSION['staff_id'];\r\n $upd_lab_array['result_reviewed_date'] = $data['now_date'];\r\n }\r\n $upd_lab_array['invoice_status'] = \"Unknown\";\r\n $upd_lab_array['recorded_timestamp'] = $data['now_id'];\r\n $upd_lab_array['reply_method'] = \"THIRRA\";\r\n //$ins_lab_array['invoice_detail_id']= $data['invoice_detail_id']; //N/A\r\n $upd_lab_array['result_date'] = $data['result_date'];\r\n $upd_lab_array['result_ref'] = $data['result_ref'];\r\n $upd_lab_data = $this->morders_wdb->update_lab_order($upd_lab_array);\r\n if($data['num_of_tests'] > 0){\r\n for($j=1; $j <= $data['num_of_tests']; $j++){\r\n $varname_result = \"test_result_\".$j;\r\n $varname_normal = \"test_normal_\".$j;\r\n $varname_remark = \"test_remark_\".$j;\r\n $upd_test_array['lab_result_id']\t=\t$data['package_info'][$j-1]['lab_result_id'];\r\n $upd_test_array['lab_order_id']\t\t=\t$upd_lab_array['lab_order_id'];\r\n //$upd_test_array['sort_test']\t\t=\t$data['package_info'][$j-1]['sort_test'];\r\n //$upd_test_array['lab_package_test_id']\t=\t$data['lab_package_id'];\r\n $upd_test_array['result_date']\t\t=\t$data['result_date'];\r\n $upd_test_array['date_recorded']\t=\t$data['now_date'];\r\n $upd_test_array['result']\t\t =\t$data['package_info'][$j-1][$varname_result];\r\n //$upd_test_array['loinc_num']\t\t=\t$data['package_info'][$j-1]['loinc_num'];\r\n $upd_test_array['normal_reading']\t=\t$data['package_info'][$j-1][$varname_normal];\r\n $upd_test_array['staff_id']\t =\t$_SESSION['staff_id'];\r\n $upd_test_array['result_remarks']\t=\t$data['package_info'][$j-1][$varname_remark];\r\n //$ins_test_array['abnormal_flag']\t\t=\t$data['package_info'][$j-1]['abnormal_flag'];\r\n if($data['offline_mode']){\r\n $upd_test_array['synch_out'] = $data['now_id'];\r\n }//endif($data['offline_mode'])\r\n $upd_test_data = $this->morders_wdb->update_lab_result($upd_test_array);\r\n $data['now_id']++;\r\n }\r\n $this->session->set_flashdata('data_activity', 'Lab result updated.');\r\n }//endif($data['num_of_tests'] > 0)\r\n $new_page = base_url().\"index.php/ehr_individual_history/list_history_lab/\".$data['patient_id'];\r\n header(\"Status: 200\");\r\n header(\"Location: \".$new_page);\r\n\r\n } // endif ($this->form_validation->run('edit_lab_order') == FALSE)\r\n\r\n\r\n }", "public function edit(tbl_project $tbl_project)\n {\n //\n }", "public function update(Request $request, Workout $workout)\n {\n $request->validate($this->validationData());\n $requested_data = $request->all();\n $workout->update($requested_data);\n\n return redirect()->route('admin.workouts.index', $workout);\n }", "public function edit() {\n\t\t\t\n\t\t}", "public function edit($id){\t\n\t\tif($this->input->post('step')=='1'){\n\t\t\t\n\t\t\t$data = array(\n\t\t\t\t'name'=> $this->input->post('name'),\t\t\t\n\t\t\t\t'owner'=> $this->input->post('owner'),\t\t\n\t\t\t\t'address_line'=>$this->input->post('address_line'),\n\t\t\t\t'zip' =>$this->input->post('zip'),\n\t\t\t\t'fax'=>$this->input->post('fax'),\n\t\t\t\t'website'=>$this->input->post('website'),\n\t\t\t\t'working_start'=>$this->input->post('working_start'),\n\t\t\t\t'working_end'=>$this->input->post('working_end'),\n\t\t\t\t'since'=>$this->input->post('since'),\n\t\t\t\t'no_of_employees'=>$this->input->post('no_of_employees'),\n\t\t\t\t'email'=>$this->input->post('email')\n\t\t );\n\t\t}\n\t\tif($this->input->post('step')=='2'){\n\t\t\t\n\t\t\t$data = array(\n\t\t\t\t'description'=> $this->input->post('description'),\t\t\t\n\t\t );\n\t\t}\n\t\tif($this->input->post('step')=='3'){\n\t\t\t$other_info=array('facebook_url'=>$this->input->post('facebook_url'),'googleplus_url'=>$this->input->post('googleplus_url'),'twitter_url'=>$this->input->post('twitter_url'),'linkedin_url'=>$this->input->post('linkedin_url'),'youtube_url'=>$this->input->post('youtube_url'),'whatsup_contact_number'=>$this->input->post('whatsup_contact_number'));\n\t\t\t$other_info=serialize($other_info);\n\t\t\t$data = array(\t\n\t\t\t\t'other_info'=>$other_info\n\t\t\t);\n\t\t}\n\t\tif($this->input->post('step')=='4'){\n\t\t\t$city_id='0';\n\t\t\t$area_id='0';\n\t\t\tif($this->input->post('city')){\t\n\t\t\t\t$city_id=$this->cities_model->cityFindOrSave($this->input->post('city'));\n\t\t\t}\t\n\t\t\tif($this->input->post('area')){\n\t\t\t\t$area_id=$this->areas_model->areaFindOrSave($this->input->post('area'),$city_id);\n\t\t\t}\n\t\t\t$data = array(\n\t\t\t\t'city_name'=> $this->input->post('city_name'),\n\t\t\t\t'area_name'=> $this->input->post('area_name'),\n\t\t\t\t'city_id'=> $city_id,\t\t\t\t\n\t\t\t\t'area_id'=> $area_id,\n 'latitude'=> $this->input->post('latitude'),\n\t\t\t\t'longitude'=> $this->input->post('longitude')\t\n\t\t );\n\t\t}\n\t\tif($this->input->post('step')=='5'){\n\t\t\t$data = array(\n\t\t\t\t'description'=> $this->input->post('description'),\t\t\t\n\t\t );\n\t\t}\n\t\t$this->db->where('id', $id);\n\t\t$this->db->update('advertisements', $data);\n\t}", "function Avi_Update(){\n\t\t\n\t\t\n\t\t//when click on button\n\t\tif(isset($_POST['avibtnupdate'])){\n\t\t\t\n\t\t\t//move id into variable\n\t\t\t$get_id = $_GET['Edit'];\n\t\t\t\n\t\t\t//values for table \n\t\t\t$values = \"monday='\".$_POST['monstart'].\" - \".$_POST['monend'].\"',tuesday='\".$_POST['tustart'].\" - \".$_POST['tuend'].\"',wednesday='\".$_POST['wedstart'].\" - \".$_POST['wedend'].\"',thursday='\".$_POST['thustart'].\" - \".$_POST['thuend'].\"',friday='\".$_POST['fristart'].\" - \".$_POST['friend'].\"',saturday='\".$_POST['satstart'].\" - \".$_POST['satend'].\"',sunday='\".$_POST['sunstart'].\" - \".$_POST['sunend'].\"',user_id='\".$_POST['doctor'].\"',date=NOW()\";\n\t\t\t\n\t\t\t//Update From Avialibalility table\n\t\t\t$this->Update('availability',$values,\" where id='$get_id' \",'Availability?List&m');\n\t\t\t\n\t\t\t\n\t\n\t\t} // ifisset close\n\t\t\n\t}", "function modifyJob() {\n $title = htmlspecialchars(trim($_POST['title']), ENT_QUOTES);\n $description = str_replace(array(\"\\r\\n\", \"\\n\", \"\\r\"), \"<br />\", htmlspecialchars(trim($_POST['description']), ENT_QUOTES));\n $status = $_POST['status'];\n $salary = htmlspecialchars(trim($_POST['salary']), ENT_QUOTES);\n $measure = $_POST['measure'];\n $category = implode(\" \", $_POST['category']);\n $location = implode(\" \", $_POST['location']);\n $pk = $_POST['pk'];\n $date = date('Y-m-d');\n \n connectDatabase();\n \n queryDatabase(\"UPDATE job SET title = '$title',\n description = '$description',\n inserted = '$date',\n fk_category = '$category',\n fk_location = '$location',\n status = '$status',\n salary = '$salary',\n measure = '$measure'\n WHERE pk = $pk\");\n\n header('Location: ' . HOME . 'member.php?feedback=15');\n}", "public function quickEdit() {\n if ($this->request->is('post')) {\n $rq_data = $this->request->data;\n $type = $rq_data['type'];\n\n if ($type == 2) {\n $ids = $rq_data['id'];\n $input = $rq_data['input'];\n $now = date('Y-m-d H:i:s');\n if ($this->Team->updateAll(array('name' => \"'$input'\", 'cdate' => \"'$now'\"), array('Team.id' => $ids))) {\n $this->Session->setFlash(__('プロジェクトのアップデートに成功しました。'), 'alert-box', array('class' => 'alert-success'));\n } else {\n $this->Session->setFlash(__('プロジェクトをアップデートすることはできません。'), 'alert-box', array('class' => 'alert-danger'));\n }\n } elseif ($type == 3) {\n $id = $rq_data['id'];\n $input = $rq_data['input'];\n $cr_data = $rq_data['cr_data'];\n $cr_date = date('Y-m-d H:i:s');\n// $this->Management->query(\"UPDATE management SET team_id = {$id}, update_date = '{$cr_date}' WHERE id = {$input}\");\n\n if ($this->Management->updateAll(array('team_id' => $id, 'update_date' => \"'{$cr_date}'\"), array('id' => $input))) {\n $this->Session->setFlash(__('プロジェクトのアップデートに成功しました。'), 'alert-box', array('class' => 'alert-success'));\n } else {\n $this->Session->setFlash(__('プロジェクトをアップデートすることはできません。'), 'alert-box', array('class' => 'alert-danger'));\n }\n } elseif ($type == 5) {\n $id = $rq_data['id'];\n $input = $rq_data['input'];\n if ($this->Team->save(array('id' => $id, 'code' => $input))) {\n $this->Session->setFlash(__('プロジェクトのアップデートに成功しました。'), 'alert-box', array('class' => 'alert-success'));\n } else {\n $this->Session->setFlash(__('プロジェクトをアップデートすることはできません。'), 'alert-box', array('class' => 'alert-danger'));\n }\n } elseif ($type == 6) {\n $ids = $rq_data['ids'];\n foreach ($ids as $v_id) {\n $visible = $this->Team->find('first', array(\n 'conditions' => array('id' => $v_id),\n 'fields' => array('valid')\n ));\n $status = ($visible['Team']['valid'] == 1) ? 0 : 1;\n\n if ($this->Team->save(array('id' => $v_id, 'valid' => $status))) {\n $this->Session->setFlash(__('プロジェクトのアップデートに成功しました。'), 'alert-box', array('class' => 'alert-success'));\n } else {\n $this->Session->setFlash(__('プロジェクトをアップデートすることはできません。'), 'alert-box', array('class' => 'alert-danger'));\n }\n }\n }\n\n echo json_encode(1);\n exit;\n }\n }", "function edit_instruction_ehs() {\n\t\t\tinclude_once(\"template/therapistEHS/therapistArray.php\");\n\n\t\t\tif( $this->value('update') == \"update\" && $this->value('id') != \"\"){\n\n\t\t\t\t$where = \" plan_treatment_id = '{$this->value('id')}' \";\n\n\t\t\t\t$updateArr = $this->fillForm($instructionFormArray,true);\n\n\t\t\t\tif($this->update($this->config['table']['plan_treatment'],$updateArr,$where)){\n\n\t\t\t\t\t$_SESSION['edit_record'][] = $this->value('id');\n\n\t\t\t\t\t?>\n\n\t\t\t\t\t<script language=\"javascript\" >\n\n\t\t\t\t\t\twindow.close();\n\n\t\t\t\t\t\twindow.opener.location.href = \"index.php?action=customize_instruction_ehs&plan_id=<?php echo $this->get_field($this->value('id'),\"plan_treatment\",\"plan_id\") ?>&edit_instruction=1\";\n\n\t\t\t\t\t</script>\n\n\t\t\t\t\t<?php\t\n\n\t\t\t\t\t\n\n\t\t\t\t}\n\n\t\t\t\t//echo \"shail\";exit;\n\n\t\t\t\t$row = $this->fillForm($instructionFormArray,true);\n\n\t\t\t\tif(is_array($row)){\n\n\t\t\t\t\t$row['plan_treatment_id'] = $this->value('id');\n\n\t\t\t\t\t$row['lrboption'] = $this->build_select_option($this->config['lrb'],$row['lrb']);\n\n\t\t\t\t\t$mainRegion = $this->build_template($this->get_template(\"edit_instruction\"),$row);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\telse{\n\n\t\t\t\t$query = \"select pt.plan_treatment_id,pl.plan_name,pt.treatment_order,pt.treatment_id,trt.treatment_name,\n\n\t\t\t\t\t\t\tpt.instruction,pt.benefit,pt.sets,pt.reps,pt.hold,pt.lrb,pt.plan_id from plan_treatment pt\n\n\t\t\t\t\t\t\tinner join treatment trt on pt.treatment_id = trt.treatment_id \n\n\t\t\t\t\t\t\tinner join plan pl on pl.plan_id = pt.plan_id \n\n\t\t\t\t\t\t\twhere pt.plan_treatment_id = '{$this->value('id')}' \";\n\n\t\t\t\t$result = $this->execute_query($query);\t\t\t\t\t\t\t\t \t\n\n\t\t\t\tif(is_resource($result)){\n\n\t\t\t\t\tif($row = $this->fetch_array($result)){\n\n\t\t\t\t\t\t$row['lrboption'] = $this->build_select_option($this->config['lrb'],$row['lrb']);\n\n\t\t\t\t\t\t$mainRegion = $this->build_template($this->get_template(\"edit_instruction\"),$row);\n\n\t\t\t\t\t}\n\n\t\t\t\t}\t\n\n\t\t\t\telse{\n\n\t\t\t\t\t$mainRegion = \"Record Not found.\";\n\n\t\t\t\t}\n\n\t\t\t}\t\n\n\t\t\t$replace['mainRegion'] = $mainRegion;\n\n\t\t\t$replace['browserTitle'] = \"Edit Instruction\";\n\t\t\t \n\t\t\t$replace['get_satisfaction'] = $this->get_satisfaction();\n \n // Personalized GUI \n //Label \n $DefaultInstructions=$_SESSION['providerLabel']['Default Instructions']!=''?$_SESSION['providerLabel']['Default Instructions']:'Default Instructions';\n $BenefitofTreatment=$_SESSION['providerLabel']['Benefit of Treatment']!=''?$_SESSION['providerLabel']['Benefit of Treatment']:'Benefit of Treatment'; \n\n \n //Label\n $replace['labelDefaultInstructions']=$DefaultInstructions;\n $replace['labelBenefitofTreatment']=$BenefitofTreatment;\n\n // Fields\n $displayFieldSets='';\n $displayFieldReps='';\n $displayFieldHold='';\n $displayFieldLRB='';\n \n $SetsDisplay=$_SESSION['providerField']['Sets']!=''?$_SESSION['providerField']['Sets']:'1';\n $RepsDisplay=$_SESSION['providerField']['Reps']!=''?$_SESSION['providerField']['Reps']:'1';\n $HoldDisplay=$_SESSION['providerField']['Hold']!=''?$_SESSION['providerField']['Hold']:'1';\n $LRBDisplay=$_SESSION['providerField']['LRB']!=''?$_SESSION['providerField']['LRB']:'1';\n \n if($SetsDisplay=='0'){\n $displayFieldSets='none'; \n }\n if($RepsDisplay=='0'){\n $displayFieldReps='none'; \n }\n if($HoldDisplay=='0'){\n $displayFieldHold='none'; \n }\n if($LRBDisplay=='0'){\n $displayFieldLRB='none'; \n }\n \n $replace['displayFieldLRB']=$displayFieldLRB;\n $replace['displayFieldReps']=$displayFieldReps;\n $replace['displayFieldHold']=$displayFieldHold;\n $replace['displayFieldSets']=$displayFieldSets;\n \n\n\t\t\t \n\t\t\t$this->output = $this->build_template($this->get_template(\"main\"),$replace);\t\t\t\n\n\t\t}", "public function edit()\n\t {\n\t\t $app = JFactory::getApplication();\n \n\t\t // Get the previous edit id (if any) and the current edit id.\n\t\t $previousId = (int) $app->getUserState('com_gm_ceiling.edit.project.id');\n\t\t $editId = $app->input->getInt('id', 0);\n \n\t\t // Set the user id for the user to edit in the session.\n\t\t $app->setUserState('com_gm_ceiling.edit.project.id', $editId);\n \n\t\t // Get the model.\n\t\t $model = $this->getModel('Project', 'Gm_ceilingModel');\n \n\t\t /*// Check out the item\n\t\t if ($editId)\n\t\t {\n\t\t\t $model->checkout($editId);\n\t\t }\n \n\t\t // Check in the previous user.\n\t\t if ($previousId && $previousId !== $editId)\n\t\t {\n\t\t\t $model->checkin($previousId);\n\t\t }*/\n \n\t\t // Redirect to the edit screen.\n\t\t $this->setRedirect(JRoute::_('index.php?option=com_gm_ceiling&view=projectform&layout=edit', false));\n\t }", "public function edit_reservation($id) {\r\n\r\n\r\n if(isset($_POST['reserve_update'])){\r\n\r\n $reserve_date_update = $_POST['reserve_date'];\r\n $reserve_time_update = $_POST['reserve_time'];\r\n if(isset($_POST['number-of-people'])) {\r\n $reserve_table_update = $_POST['number-of-people'];\r\n } else {\r\n echo \"\";\r\n }\r\n if(!empty($reserve_date_update) && !empty($reserve_time_update) && !empty($reserve_table_update)) {\r\n $conn = $this->conn();\r\n $sql = \"UPDATE reservation SET reserve_date = ? , reserve_time = ?, reserve_table = ? WHERE reserve_id = $id\";\r\n $stmt = $conn->prepare($sql);\r\n $stmt->execute([$reserve_date_update, $reserve_time_update, $reserve_table_update ]);\r\n $this->header('usersetting');\r\n } else {\r\n echo \"<script> alert('Your reservation form is empty. Please write it correctly.')</script>\";\r\n }\r\n \r\n }\r\n\r\n }", "public function update($id) {\r\n\r\n //if save button was clicked, get the data sent via post\r\n if ($this->input->server('REQUEST_METHOD') === 'POST') {\r\n\r\n //form validation\r\n $this->form_validation->set_rules('opportunity_title', 'Title', 'trim|required|xss_clean');\r\n $this->form_validation->set_rules('opportunity_location', 'Location', 'trim|required|xss_clean');\r\n\r\n //if the form has passed through the validation\r\n if ($this->form_validation->run()) {\r\n $data_to_store = array(\r\n 'opportunity_title' => $this->input->post('opportunity_title'),\r\n 'opportunity_location' => $this->input->post('opportunity_location'),\r\n 'opportunity_sub_location' => $this->input->post('opportunity_sub_location'),\r\n 'opportunity_description' => $this->input->post('opportunity_description')\r\n );\r\n\r\n //if the insert has returned true then we show the flash message\r\n if ($this->Opportunity_model->update($id, $data_to_store)) {\r\n $this->session->set_flashdata('flash_message', TRUE);\r\n redirect('admin/opportunities');\r\n } else {\r\n $this->session->set_flashdata('flash_message', FALSE);\r\n }\r\n } else {\r\n $this->session->set_flashdata('flash_message', FALSE);\r\n }\r\n }\r\n\r\n $opportunities = $this->Opportunity_model->find_by_id($id);\r\n\r\n\r\n $data['opportunity'] = $opportunities == null ? [] : $opportunities[0];\r\n\r\n //load the view\r\n $data['content'] = 'admin/opportunities/edit';\r\n $this->load->view('includes/admin_template', $data);\r\n }", "function update_office_info()\n {\n $this->model->update_office_info();\n }", "public function edit(List_Extra_Siswa $list_Extra_Siswa)\n {\n //\n }", "public function update($work)\n {\n $id = $work['id'];\n $name = $work['name'];\n $startingDate = date('Y-m-d', strtotime($work['startingDate']));\n $endingDate = date('Y-m-d', strtotime($work['endingDate']));\n $status = $work['status'];\n $sql_update = \"UPDATE `works` SET `name`='$name', `starting_date`='$startingDate', `ending_date`='$endingDate', `status`='$status' WHERE `id`='$id'\";\n\n return mysqli_query($this->database, $sql_update);\n }", "function wpgmza_b_pro_edit_poly($mid) {\n global $wpgmza_tblname_maps;\n global $wpdb;\n\n if ($_GET['action'] == \"edit_poly\" && isset($mid)) {\n $mid = sanitize_text_field($mid);;\n $res = wpgmza_get_map_data($mid);\n $pol = wpgmza_b_return_poly_options(sanitize_text_field($_GET['poly_id']));\n\n echo \"\n \n\n <div class='wrap'>\n <h1>WP Google Maps</h1>\n <div class='wide'>\n\n <h2>\".__(\"Edit Polygon\",\"wp-google-maps\").\"</h2>\n <form action='?page=wp-google-maps-menu&action=edit&map_id=\".esc_attr($mid).\"' method='post' id='wpgmaps_edit_poly_form'>\n <input type='hidden' name='wpgmaps_map_id' id='wpgmaps_map_id' value='\".esc_attr($mid).\"' />\n <input type='hidden' name='wpgmaps_poly_id' id='wpgmaps_poly_id' value='\".esc_attr($_GET['poly_id']).\"' />\n \n <table class='wpgmza-listing-comp' style='width:30%;float:left; height:400px;'>\n <tr>\n <td>\".__(\"Name\",\"wp-google-maps\").\"</td><td><input type=\\\"text\\\" value=\\\"\".esc_attr(stripslashes($pol->polyname)).\"\\\" name=\\\"poly_name\\\" /></td>\n </tr>\n <tr>\n <td>\".__(\"Title\",\"wp-google-maps\").\"</td><td><input disabled type=\\\"text\\\" value=\\\"\".__(\"Pro version only\",\"wp-google-maps\").\"\\\" /><i><a href='\".wpgm_pro_link(\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=polygons\").\"' title='\".__(\"Pro Version\",\"wp-google-maps\").\"'>\".__(\"Get the Pro add-on\",\"wp-google-maps\").\"</a></i></td>\n </tr>\n <tr>\n <td>\".__(\"Link\",\"wp-google-maps\").\"</td><td><input disabled type=\\\"text\\\" value=\\\"pro version only\\\" /></td> \n </tr>\n <tr>\n <td>\".__(\"Line Color\",\"wp-google-maps\").\"</td><td><input id=\\\"poly_line\\\" name=\\\"poly_line\\\" type=\\\"text\\\" class=\\\"color\\\" value=\\\"\".esc_attr($pol->linecolor).\"\\\" /></td> \n </tr>\n <tr>\n <td>\".__(\"Line Opacity\",\"wp-google-maps\").\"</td><td><input id=\\\"poly_line_opacity\\\" name=\\\"poly_line_opacity\\\" type=\\\"text\\\" value=\\\"\".esc_attr($pol->lineopacity).\"\\\" /> (0 - 1.0) example: 0.5 for 50%</td> \n </tr>\n <tr>\n <td>\".__(\"Fill Color\",\"wp-google-maps\").\"</td><td><input id=\\\"poly_fill\\\" name=\\\"poly_fill\\\" type=\\\"text\\\" class=\\\"color\\\" value=\\\"\".esc_attr($pol->fillcolor).\"\\\" /></td> \n </tr>\n <tr>\n <td>\".__(\"Opacity\",\"wp-google-maps\").\"</td><td><input id=\\\"poly_opacity\\\" name=\\\"poly_opacity\\\" type=\\\"text\\\" value=\\\"\".esc_attr($pol->opacity).\"\\\" /> (0 - 1.0) example: 0.5 for 50%</td> \n </tr>\n <tr>\n <td>\".__(\"On Hover Line Color\",\"wp-google-maps\").\"</td><td><input disabled type=\\\"text\\\" value=\\\"\".__(\"Pro version only\",\"wp-google-maps\").\"\\\"/></td> \n </tr>\n <tr>\n <td>\".__(\"On Hover Fill Color\",\"wp-google-maps\").\"</td><td><input disabled type=\\\"text\\\" value=\\\"\".__(\"Pro version only\",\"wp-google-maps\").\"\\\"/></td> \n </tr>\n <tr>\n <td>\".__(\"On Hover Opacity\",\"wp-google-maps\").\"</td><td><input disabled type=\\\"text\\\"value=\\\"\".__(\"Pro version only\",\"wp-google-maps\").\"\\\" /></td> \n </tr>\n \n </table>\n \n <div class='wpgmza_map_seventy'> \n <div id=\\\"wpgmza_map\\\" >&nbsp;</div>\n <p>\n <ul style=\\\"list-style:initial;\\\" class='update-nag update-blue update-slim update-map-overlay'>\n \n <li style=\\\"margin-left:30px;\\\">Click on the map to insert a vertex.</li>\n <li style=\\\"margin-left:30px;\\\">Click on a vertex to remove it.</li>\n <li style=\\\"margin-left:30px;\\\">Drag a vertex to move it.</li>\n </ul>\n </p>\n </div>\n \n\n <p style='clear: both;' >Polygon data:<br /><textarea name=\\\"wpgmza_polygon\\\" id=\\\"poly_line_list\\\" style=\\\"width:90%; height:100px; border:1px solid #ccc; background-color:#FFF; padding:5px; overflow:auto;\\\"></textarea>\n <!-- <p style='clear: both;' >Polygon data (inner):<br /><textarea name=\\\"wpgmza_polygon_inner\\\" id=\\\"poly_line_list_inner\\\" style=\\\"width:90%; height:100px; border:1px solid #ccc; background-color:#FFF; padding:5px; overflow:auto;\\\">\".$pol->innerpolydata.\"</textarea> -->\n <p class='submit'><a href='javascript:history.back();' class='button button-secondary' title='\".__(\"Cancel\").\"'>\".__(\"Cancel\").\"</a> <input type='submit' name='wpgmza_edit_poly' class='button-primary' value='\".__(\"Save Polygon\",\"wp-google-maps\").\" &raquo;' /></p>\n\n </form>\n </div>\n\n\n </div>\n\n\n\n \";\n\n }\n\n\n\n}", "public function edit($scope) {\n\n $modifiedby_id = $_SESSION[\"loggedid\"];\n \n $query = \"UPDATE scope SET scp_number='$scope->scp_number',description='$scope->description',dept_id='$scope->dept_id',section_id='$scope->section_id',unit_id='$scope->unit_id',\n \t\t\tmodifiedby_id='$modifiedby_id' WHERE id=\" . \"'$scope->id'\";\n\n $result=mysqli_query($this->plink, $query);\n if (!$result) {\n $this->ERROR_MSG = $this->ERROR_MSG.'Error: ' . mysqli_error($this->plink) . \"<br>\";\n return $this->ERROR_MSG;\n }\n // close connection\n mysqli_close($this->plink);\n $url = \"../view/scopeView.php?id=$scope->id\";\n\n redirect($url);\n }", "public function update(Request $request, $id)\n {\n $Workshift = WorkShift::findOrFail($id);\n $Workshift->update($request->all());\n// dd($request->duallistbox_demo2);\n $EmployeeWorkshift_ID = Employee::find($request->duallistbox_demo2);\n $Workshift->Employees()->sync($EmployeeWorkshift_ID);\n\n return redirect('/administration/work-shift');\n }", "function update_office_pick_up_details()\r\n\t{\r\n\t\t$this->erpm->auth();\r\n\t\t\r\n\t\tif(!$_POST)\r\n\t\t{\r\n\t\t\tredirect('admin/view_manifesto_sent_log');\r\n\t\t}\r\n\t\t\t\r\n\t\t$office_pick_ups=$this->input->post('office_pick_up');\r\n\t\t$manifesto_id=$this->input->post('manifesot_id');\r\n\t\t$param=array();\r\n\t\t$param['office_pickup_empid']=implode(',',$office_pick_ups);\r\n\t\t\r\n\t\t$is_array=0;\r\n\t\t$is_array=stripos($manifesto_id,',');\r\n\t\tif($is_array > 0)\r\n\t\t{\r\n\t\t\tforeach(explode(',',$manifesto_id) as $id)\r\n\t\t\t{\r\n\t\t\t\t$this->db->where(\"id\",$id);\r\n\t\t\t\t$this->db->update('pnh_m_manifesto_sent_log',$param);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t\t$this->db->where(\"id\",$manifesto_id);\r\n\t\t\t\t$this->db->update('pnh_m_manifesto_sent_log',$param);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$this->session->set_flashdata(\"erp_pop_info\",\"Office pick up updated\");\r\n\t\t\r\n\t\tredirect($_SERVER['HTTP_REFERER']);\r\n\t\t\r\n\t}", "public function Add_Edit_Weight()\n\t{\n\n\t\t$wtId = strip_tags($this->input->post('WeightId'));\n\t\t$min=strip_tags($this->input->post('minweight'));\n\t\t$max=strip_tags($this->input->post('maxweight'));\n\t\t\n\t\t\n\t\t$col['min'] = $min;\n\t\t$col['max'] = $max;\n\t\t//$col['DateTime'] = date('d-m-Y H:i:s'); \n \n\t\tif($wtId == '') \n\t\t{ \n\t\t\tif($this->db->insert('weightchart',$col)) \n\t\t\t{ \n\t\t\t\treturn $this->session->set_flashdata('success','Stonetype Added Succesfully');\n\t\t\t} \n\t\t\telse\n\t\t\t\treturn $this->session->set_flashdata('error','Stonetype Added Failed');\n\t\t}\n\t\telse \n\t\t\t$this->db->where('$wtId',$StoneId); \n\t\t\t$this->db->update('weightchart',$col); \n\t\t\treturn $this->session->set_flashdata('success','Stonetype Update Succesfully');\n\n\t}", "public function editdata_4(){\n\t\t$id_soal_tpa = $this->input->post('id_soal_tpa');\n\t\t$soal = $this->input->post('soal');\n\t\t$opsi_a = $this->input->post('opsi_a');\n\t\t$opsi_b = $this->input->post('opsi_b');\n\t\t$opsi_c = $this->input->post('opsi_c');\n\t\t$opsi_d = $this->input->post('opsi_d');\n\t\t$opsi_e = $this->input->post('opsi_e');\n\t\t$jawaban = $this->input->post('jawaban');\n\n\t\t$data = array(\n\t\t\t'soal' => $soal,\n\t\t\t'opsi_a' => $opsi_a,\n\t\t\t'opsi_b' => $opsi_b,\n\t\t\t'opsi_c' => $opsi_c,\n\t\t\t'opsi_d' => $opsi_d,\n\t\t\t'opsi_e' => $opsi_e,\n\t\t\t'jawaban' => $jawaban\n\t\t);\n\n\t\t$where = array(\n\t\t\t'id_soal_tpa' => $id_soal_tpa\n\t\t);\n\n\t\t$this->Mdl_soal->update_data($where,$data,'tb_soal_tpa');\n\t\t$this->session->set_flashdata('msg_update','Data Berhasil Diedit');\n\t\tredirect('Soal/Soal_tpa/Soal_tpa_4');\n\t}", "public function editdata_3(){\n\t\t$id_soal_tpa = $this->input->post('id_soal_tpa');\n\t\t$soal = $this->input->post('soal');\n\t\t$opsi_a = $this->input->post('opsi_a');\n\t\t$opsi_b = $this->input->post('opsi_b');\n\t\t$opsi_c = $this->input->post('opsi_c');\n\t\t$opsi_d = $this->input->post('opsi_d');\n\t\t$opsi_e = $this->input->post('opsi_e');\n\t\t$jawaban = $this->input->post('jawaban');\n\n\t\t$data = array(\n\t\t\t'soal' => $soal,\n\t\t\t'opsi_a' => $opsi_a,\n\t\t\t'opsi_b' => $opsi_b,\n\t\t\t'opsi_c' => $opsi_c,\n\t\t\t'opsi_d' => $opsi_d,\n\t\t\t'opsi_e' => $opsi_e,\n\t\t\t'jawaban' => $jawaban\n\t\t);\n\n\t\t$where = array(\n\t\t\t'id_soal_tpa' => $id_soal_tpa\n\t\t);\n\n\t\t$this->Mdl_soal->update_data($where,$data,'tb_soal_tpa');\n\t\t$this->session->set_flashdata('msg_update','Data Berhasil Diedit');\n\t\tredirect('Soal/Soal_tpa/Soal_tpa_3');\n\t}", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n //$model_glass = new PersonalPlan();\n\n if ($model->load(Yii::$app->request->post())) {\n\n //$model->\n $model->save();\n\n $div_ass = ExecDivAssignment::findOne(['job_id' => $model->id]);\n $div_ass->div_id = $model->executor_div_id;\n $div_ass->sector_id = $model->executor_sector_id;\n //$div_ass->master_div_id = $div_ass->div_id;\n $div_ass->save();\n\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n $model->executor_div_id = $this->findExecDiv($id);\n $model->executor_sector_id = $this->findExecSector($id);\n return $this->render('graphic/update', [\n 'model' => $model,\n //'back_url'=>Yii::$app->request->getUrl(),\n ]);\n }", "public function update()\n\t{\n\t\t$redirect =\"\";\n\t\t$uri3=$this->input->post('uri3');\n\t\t$uri4=$this->input->post('uri4');\n\t\tif($this->input->post('saveOnly'))\n\t\t{\n\t\t\t$redirect=\"kelompokprakerin/edit/\".$uri3.\"/\".$uri4;\n\t\t}else\n\t\t{\n\t\t\t$redirect=\"kelompokprakerin\";\n\t\t}\n\t\t$data = array(\n\t\t\t'kelompokprakerin_id'\t\t\t=>$this->input->post('kelompokprakerin_id'),\n\t\t\t'nama_kelompokprakerin'\t\t=>$this->input->post('nama_kelompokprakerin'),\n\t\t\t'pimpinan_kelompokprakerin'\t=>$this->input->post('pimpinan_kelompokprakerin'),\n\t\t\t'jenis_kelompokprakerin_id'\t=>$this->input->post('jenis_kelompokprakerin_id'),\n\t\t\t'alamat_kelompokprakerin'\t\t=>$this->input->post('alamat_kelompokprakerin'),\n\t\t\t'no_tlp'\t\t\t\t=>$this->input->post('no_tlp'),\n\t\t);\n\t\t$kelompokprakerin_id= $this->input->post('kelompokprakerin_id');\n\t\t\t$this->primary_model->updateData('kelompokprakerin_id',$kelompokprakerin_id,'tb_kelompokprakerin',$data);\n\t\t\tredirect($redirect);\n\t\t\n\t\n\t}", "function _edit_update() {\n\t\t$tpaket = $_POST;\n\t\tunset($tpaket['tpaket_header']['id_tpaket_header']);\n\t\tunset($tpaket['button']);\n\t\t// end of assign variables and delete not used variables\n\n\t\t$count = count($tpaket['tpaket_detail']['id_tpaket_h_detail']) - 1;\n\n\t\t// check, at least one product quantity entered\n\t\t$quantity_exist = FALSE;\n\n\t\tfor($i = 1; $i <= $count; $i++) {\n\t\t\tif(empty($tpaket['tpaket_detail']['quantity'][$i])) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$quantity_exist = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif($quantity_exist == FALSE)\n\t\t\tredirect('tpaket/edit_error/Anda belum memasukkan data detail. Mohon ulangi');\n\n \tif(isset($_POST['button']['save']) || isset($_POST['button']['approve'])) {\n\n\t\t\t$this->db->trans_start();\n\n \t\t\t$this->session->set_userdata('tpaket_detail', $tpaket['tpaket_detail']);\n\n $id_tpaket_header = $this->uri->segment(3);\n $postingdate = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);\n\n \t\t\t$data = array (\n \t\t\t\t'id_tpaket_header' => $id_tpaket_header,\n \t\t\t\t'posting_date' => $postingdate,\n \t\t\t);\n\t\t\t\t/*$sirah= $id_tpaket_header;\n\t\t\t\t$ti=\"SELECT * FROM t_tpaket_detail_paket WHERE id_tpaket_header='$sirah'\";\n\t\t\t\t$tq=mysql_query($ta);\n\t\t\t\t$count1=mysql_num_rows($tq);*/\n \t\n\t\t\t $this->m_tpaket->tpaket_header_update($data);\n $edit_tpaket_header = $this->m_tpaket->tpaket_header_select($id_tpaket_header);\n\n \t\t\tif ($this->m_tpaket->tpaket_header_update($data)) {\n $input_detail_success = FALSE;\n \t\t\t if($this->m_tpaket->tpaket_details_delete($id_tpaket_header) && $this->m_tpaket->batch_delete($id_tpaket_header) ) {\n \t//\tfor($i = 1; $i <= $count; $i++) {\n \t\t\t\t\tif((!empty($tpaket['tpaket_detail']['quantity'][$i]))&&(!empty($tpaket['tpaket_detail']['material_no'][$i]))) {\n\n \t\t\t\t\t\t/*$tpaket_detail['id_tpaket_header'] = $id_tpaket_header;\n \t\t\t\t\t\t$tpaket_detail['quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n \t\t\t\t\t\t$tpaket_detail['id_tpaket_h_detail'] = $tpaket['tpaket_detail']['id_tpaket_h_detail'][$i];\n\n \t\t\t\t\t\t$tpaket_detail['material_no'] = $tpaket['tpaket_detail']['material_no'][$i];\n \t\t\t\t\t\t$tpaket_detail['material_desc'] = $tpaket['tpaket_detail']['material_desc'][$i];\n \t\t\t\t\t\t$tpaket_detail['uom'] = $tpaket['tpaket_detail']['uom'][$i];*/\n\n $tpaket_to_approve['item'][$i] = $tpaket_detail['id_tpaket_h_detail'];\n $tpaket_to_approve['material_no'][$i] = $tpaket_detail['material_no'];\n $tpaket_to_approve['quantity'][$i] = $tpaket_detail['quantity'];\n $tpaket_to_approve['uom'][$i] = $tpaket_detail['uom'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t//\n\t\t\t\t\t\t$tpaket_detail['id_tpaket_header'] = $id_tpaket_header;\n\t\t\t\t\t\t$batch['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t$tpaket_detail['quantity'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$tpaket_detail['qty'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$batch['Quantity'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$tpaket_detail['id_tpaket_h_detail'] = 1;\n\t\t\t\t\t\t$batch['BaseLinNum'] = 1;\n \t\t\t\t\t\t$tpaket_detail['material_no'] = $tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$batch['ItemCode'] = $tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$item=$tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$date=date('ymd');\n\t\t\t\t\t\t$whs=$this->session->userdata['ADMIN']['plant'];\n\t\t\t\t\t\t$q=\"SELECT * FROM m_batch WHERE ItemCode = '$item' AND Whs ='$whs'\";\n\t\t\t\t\t\t$cek=\"SELECT BATCH,MAKTX FROM m_item WHERE MATNR = '$item'\";\n\t\t\t\t\t\t$cek1=mysql_query($cek);\n\t\t\t\t\t\t$ra=mysql_fetch_array($cek1);\n\t\t\t\t\t\t$b=$ra['BATCH'];\n\t\t\t\t\t\t$tq=mysql_query($q);\n\t\t\t\t\t\t$count1=mysql_num_rows($tq) + 1;\n\t\t\t\t\t\tif ($count1 > 9 && $count1 < 100)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dg=\"0\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dg=\"00\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$num=$item.$date.$dg.$count1;\n\t\t\t\t\t\tif ($count1 < 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$batch['BatchNum'] = $num;\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$batch['BaseType'] = 4;\n\t\t\t\t\t\t$tpaket_detail['num'] = $num;\n\t\t\t\t\t\t$batch['Createdate'] = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);\n \t\t\t\t\t\t$tpaket_detail['material_desc'] = $ra['MAKTX'];\n \t\t\t\t\t\t$tpaket_detail['uom'] = $tpaket['tpaket_detail']['uom'][1];\n\t\t\t\t\t\tif ($b=='Y')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$batch_in=$this->m_tpaket->batch_insert($batch);\n\t\t\t\t\t\t\tif ($count1 < 2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmysql_query(\"INSERT INTO m_batch () VALUES ('$item','$num','$batch[Quantity]','$whs')\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t/*\t$batch['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t$batch['Quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n\t\t\t\t\t\t$batch['BaseLinNum'] = $tpaket['tpaket_detail']['id_tpaket_h_detail'][$i];\n \t\t\t\t\t\t$batch['ItemCode'] = $tpaket['tpaket_detail']['material_no'][$i];\n\t\t\t\t\t\t$batch['BatchNum'] = $tpaket['tpaket_detail']['num'][$i];\n\t\t\t\t\t\t$batch['BaseType'] = 4;\n\t\t\t\t\t\t$batch['Createdate'] = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);*/\n\n if($id_tpaket_detail = $this->m_tpaket->tpaket_detail_insert($tpaket_detail)) {\n /* if($item_pakets = $this->m_mpaket->mpaket_details_select_by_item_paket($tpaket_detail['material_no'])) {\n if($item_pakets !== FALSE) {\n \t\t$k = 1;\n unset($item_paket);\n \t\tforeach ($item_pakets->result_array() as $object['temp']) {\n \t\t\tforeach($object['temp'] as $key => $value) {\n \t\t\t\t$item_paket[$key][$k] = $value;\n \t\t\t}\n \t\t\t$k++;\n \t\t\tunset($object['temp']);\n \t\t}\n \t }*/\n\t\t\t\t\t\t\t\t\t// echo \"$batch[BaseEntry],$batch[Quantity],$batch[BaseLinNum],$batch[ItemCode],$batch[BatchNum],$b <br>\";\n\t\t\t\t\t//\techo $tpaket_detail['id_tpaket_header'].\",\".$tpaket_detail['quantity'].\",\".$tpaket_detail['material_no'].\",\".$tpaket_detail['num'];\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t// $c_item_paket = count($item_paket['id_mpaket_h_detail']);\n \t\t\tfor($i = 1; $i <= $count; $i++) {\n $tpaket_detail_paket['id_tpaket_h_detail_paket'] = $i;\n\t\t\t\t\t\t\t $batch1['BaseLinNum'] =$i;\n $tpaket_detail_paket['id_tpaket_detail'] = $id_tpaket_detail;\n $tpaket_detail_paket['id_tpaket_header'] = $id_tpaket_header;\n\t\t\t\t\t\t\t $batch1['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t\t $batch1['BaseType'] = 4;\n\t\t\t\t\t\t\t $batch1['ItemCode'] = $tpaket['tpaket_detail']['material_detail'][$i];\n\t\t\t\t\t\t\t $qq=\"SELECT * FROM m_batch WHERE ItemCode = '$batch1[ItemCode]' AND Whs ='$whs'\";\n\t\t\t\t\t\t\t $cekQQ=mysql_query($qq);\n\t\t\t\t\t\t\t $rQ=mysql_num_rows($cekQQ);\n\t\t\t\t\t\t\t $num_detail=$tpaket['tpaket_detail']['num'][$i];\n\t\t\t\t\t\t\t $date=date('ymd');\n\t\t\t\t\t\t\t $cekq=\"SELECT BATCH,MAKTX FROM m_item WHERE MATNR = '$batch1[ItemCode]'\";\n\t\t\t\t\t\t\t $cekr=mysql_query($cekq);\n\t\t\t\t\t\t\t $rai=mysql_fetch_array($cekr);\n\t\t\t\t\t\t\t $tpaket_detail_paket['material_desc'] = $rai['MAKTX'];\n\t\t\t\t\t\t\t $bet=$ra['MAKTX'];\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $batch1['Createdate'] =$batch['Createdate'] ;\n $tpaket_detail_paket['material_no_paket'] = $tpaket_detail['material_no'];\n $tpaket_detail_paket['material_no'] = $tpaket['tpaket_detail']['material_detail'][$i];\n\t\t\t\t\t\t\t $tpaket_detail_paket['material_desc'] = $item_paket['material_desc'][$i];\n $tpaket_detail_paket['quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n\t\t\t\t\t\t\t $batch1['Quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n $tpaket_detail_paket['uom'] = $tpaket['tpaket_detail']['detail_uom'][$i];\n\t\t\t\t\t\t\t $tpaket_detail_paket['num'] = $num_detail;\n\t\t\t\t\t\t\t $tpaket_detail_paket['quantity_total'] = $tpaket['tpaket_detail']['quantity'][$i] * $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t\t if ($num_detail != \"\" && $bet == 'Y')\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t $batch1['BatchNum'] = $num_detail;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \t\t$count1=$rQ + 1;\n\t\t\t\t\t\t\t\t\t\tif ($count1 > 9 && $count1 < 100)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$dg=\"0\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$dg=\"00\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$num=$batch1['ItemCode'].$date.$dg.$count1;\n\t\t\t\t\t\t\t\t\t\t\t$batch1['BatchNum'] = $num;\n\t\t\t\t\t\t\t\t\t\t\tmysql_query(\"INSERT INTO m_batch () VALUES ('$batch1[ItemCode]','$batch1[BatchNum]','$batch1[Quantity]','$whs')\");\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// echo \"$batch1[BaseEntry],$batch1[Quantity],$batch1[BaseLinNum],$batch1[ItemCode],$batch1[BatchNum],$b <br>\";\n\t\t\t\t\t\t\t if ($batch1['Quantity'] != \"\" && $bet=='Y')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->m_tpaket->batch_insert($batch1);\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 if($this->m_tpaket->tpaket_detail_paket_insert($tpaket_detail_paket)) {\n $input_detail_success = TRUE;\n \t\t\t\t\t } else {\n $input_detail_success = FALSE; } } }\n \n \t else {\n $input_detail_success = FALSE;\n\t\t\t\t\t\t\t\t //echo \"aaaaaaaaaaaaaaaaa\";\n \t}\n// \t\t\t\t\t\tif($this->m_tpaket->tpaket_detail_insert($tpaket_detail))\n// $input_detail_success = TRUE;\n \t\t\t\t\t}\n\n \t \t//}\n }\n }\n\n\t\t\tif (($input_detail_success == TRUE) && (isset($_POST['button']['approve']))) {\n $internal_order = $this->m_tpaket->tpaket_internal_order_select();\n $tpaket_to_approve['plant'] = $edit_tpaket_header['plant'];\n $tpaket_to_approve['internal_order'] = $internal_order['internal_order'];\n $tpaket_to_approve['storage_location'] = $this->session->userdata['ADMIN']['storage_location'];\n $tpaket_to_approve['posting_date'] = date('Ymd',strtotime($edit_tpaket_header['posting_date']));\n $tpaket_to_approve['id_tpaket_header'] = $id_tpaket_header;\n $tpaket_to_approve['plant'] = $edit_tpaket_header['plant'];\n $tpaket_to_approve['id_tpaket_plant'] = $edit_tpaket_header['id_tpaket_plant'];\n $tpaket_to_approve['id_user_input'] = $this->session->userdata['ADMIN']['admin_id'];\n $tpaket_to_approve['web_trans_id'] = $this->l_general->_get_web_trans_id($edit_tpaket_header['plant'],$edit_tpaket_header['posting_date'],\n $edit_tpaket_header['id_tpaket_plant'],'17');\n\t\t\t/* $approved_data = $this->m_tpaket->sap_tpaket_header_approve($tpaket_to_approve);\n \t\t\tif((!empty($approved_data['material_document'])) && ($approved_data['material_document'] !== '') &&\n (!empty($approved_data['material_document_out'])) && ($approved_data['material_document_out'] !== '')) {\n \t\t\t $tpaket_no = $approved_data['material_document'];\n \t\t\t $tpaket_no_out = $approved_data['material_document_out'];*/\n \t\t\t\t$data = array (\n \t\t\t\t\t'id_tpaket_header'\t=>$id_tpaket_header,\n \t\t\t\t\t'material_doc_no'\t=>\t$tpaket_no,\n \t\t\t\t\t'material_doc_no_out'\t=>\t$tpaket_no_out,\n \t\t\t\t\t'status'\t=>\t'2',\n \t\t\t\t\t'id_user_approved'\t=>\t$this->session->userdata['ADMIN']['admin_id'],\n \t\t\t\t);\n \t\t\t\t$tpaket_header_update_status = $this->m_tpaket->tpaket_header_update($data);\n \t\t\t\t $approve_data_success = TRUE;\n\t\t\t\t/*} else {\n\t\t\t\t $approve_data_success = FALSE;\n\t\t\t\t}*/\n }\n\n \t\t\t$this->db->trans_complete();\n if(isset($_POST['button']['save'])) {\n if ($input_detail_success == TRUE) {\n \t\t\t $this->l_general->success_page('Data Transaksi Paket berhasil diubah', site_url('tpaket/browse'));\n } else {\n \t\t\t $this->jagmodule['error_code'] = '006'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Transaksi Paket tidak berhasil diubah', site_url($this->session->userdata['PAGE']['next']));\n }\n } else if(isset($_POST['button']['approve']))\n if($approve_data_success == TRUE) {\n \t\t\t $this->l_general->success_page('Data Transaksi Paket berhasil diapprove', site_url('tpaket/browse'));\n } else {\n \t\t $this->jagmodule['error_code'] = '007'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Transaksi Paket tidak berhasil diapprove.<br>\n Pesan Kesalahan dari sistem SAP : '.$approved_data['sap_messages'], site_url($this->session->userdata['PAGE']['next']));\n }\n\n\t\t}\n\t}", "public function edit($id)\n\t{\n\t\t$edit_data = CosPcwork::find($id);\n\n\t\treturn view('commission.pcwork_edit')->with('pcwork',$edit_data);\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required',\n ]);\n\n $workout = Workout::find($id);\n $workout->name = $request->get('name');\n $workout->description = $request->get('description');\n $workout->save();\n \n return back()\n ->with('success', 'Workout actualizado correctamente');\n }", "public function editdata(){\n\t\t$id_soal_tpa = $this->input->post('id_soal_tpa');\n\t\t$soal = $this->input->post('soal');\n\t\t$opsi_a = $this->input->post('opsi_a');\n\t\t$opsi_b = $this->input->post('opsi_b');\n\t\t$opsi_c = $this->input->post('opsi_c');\n\t\t$opsi_d = $this->input->post('opsi_d');\n\t\t$opsi_e = $this->input->post('opsi_e');\n\t\t$jawaban = $this->input->post('jawaban');\n\n\t\t$data = array(\n\t\t\t'soal' => $soal,\n\t\t\t'opsi_a' => $opsi_a,\n\t\t\t'opsi_b' => $opsi_b,\n\t\t\t'opsi_c' => $opsi_c,\n\t\t\t'opsi_d' => $opsi_d,\n\t\t\t'opsi_e' => $opsi_e,\n\t\t\t'jawaban' => $jawaban\n\t\t);\n\n\t\t$where = array(\n\t\t\t'id_soal_tpa' => $id_soal_tpa\n\t\t);\n\n\t\t$this->Mdl_soal->update_data($where,$data,'tb_soal_tpa');\n\t\t$this->session->set_flashdata('msg_update','Data Berhasil Diedit');\n\t\tredirect('Soal/Soal_tpa/');\n\t}", "public function actionUpdate($id = null, $data = null) {\n if (!empty($data)) {\n $id = Yii::$app->EncryptDecrypt->Encrypt('decrypt', $data);\n }\n\n $model = $this->findModel($id);\n\n $model->setScenario('update');\n $other_info = StaffOtherInfo::findOne(['staff_id' => $model->id]);\n $staff_edu = StaffInfoEducation::findOne(['staff_id' => $model->id]);\n $staff_previous_employer = StaffPerviousEmployer::findAll(['staff_id' => $model->id]);\n $staff_interview_first = StaffEnquiryInterviewFirst::findOne(['staff_id' => $model->id]);\n $staff_interview_second = StaffEnquiryInterviewSecond::findOne(['staff_id' => $model->id]);\n $staff_interview_third = StaffEnquiryInterviewThird::findOne(['staff_id' => $model->id]);\n $staff_family = \\common\\models\\StaffEnquiryFamilyDetails::findAll(['staff_id' => $model->id]);\n $staff_salary = StaffSalary::findOne(['staff_id' => $model->id]);\n if (!empty($model) && !empty($other_info) && !empty($staff_edu) && !empty($staff_interview_first) && !empty($staff_interview_second) && !empty($staff_interview_third) && !empty($staff_salary)) {\n if ($model->load(Yii::$app->request->post()) && Yii::$app->SetValues->Attributes($model) && $other_info->load(Yii::$app->request->post()) && $staff_edu->load(Yii::$app->request->post()) && $staff_interview_first->load(Yii::$app->request->post()) && $staff_interview_second->load(Yii::$app->request->post()) && $staff_interview_third->load(Yii::$app->request->post()) && $staff_salary->load(Yii::$app->request->post())) {\n $model->dob = date('Y-m-d H:i:s', strtotime(Yii::$app->request->post()['StaffInfo']['dob']));\n $other_info->load(Yii::$app->request->post());\n $other_info->current_from = date('Y-m-d', strtotime(Yii::$app->request->post()['StaffOtherInfo']['current_from']));\n $other_info->current_to = date('Y-m-d', strtotime(Yii::$app->request->post()['StaffOtherInfo']['current_to']));\n $staff_interview_second->contact_verified_date = date('Y-m-d', strtotime($staff_interview_second->contact_verified_date));\n $staff_interview_second->alt_contact_verified_date = date('Y-m-d', strtotime($staff_interview_second->alt_contact_verified_date));\n $staff_interview_second->verified_date_1 = date('Y-m-d', strtotime($staff_interview_second->verified_date_1));\n $staff_interview_second->verified_date_2 = date('Y-m-d', strtotime($staff_interview_second->verified_date_2));\n $staff_interview_second->verified_date_3 = date('Y-m-d', strtotime($staff_interview_second->verified_date_3));\n $staff_interview_third->expected_date_of_joining = date('Y-m-d', strtotime($staff_interview_third->expected_date_of_joining));\n $staff_interview_third->interviewed_date = date('Y-m-d', strtotime($staff_interview_third->interviewed_date));\n $staff_salary->date_of_salary = date('Y-m-d', strtotime($staff_salary->date_of_salary));\n\n if (isset($staff_edu->timing) && $staff_edu->timing != '') {\n $staff_edu->timing = implode(',', $staff_edu->timing);\n }\n\n\n if (isset($model->area_interested) && $model->area_interested != '') {\n $model->area_interested = implode(',', $model->area_interested);\n }\n\n if (!empty(Yii::$app->request->post()['StaffInfo']['designation']))\n $model->designation = implode(\",\", Yii::$app->request->post()['StaffInfo']['designation']);\n\n if ($model->validate() && $other_info->validate() && $staff_interview_first->validate() && $staff_interview_second->validate() && $staff_interview_third->validate() && $staff_edu->validate() && $staff_salary->validate() && $staff_edu->save() && $model->save() && $other_info->save() && $staff_interview_first->save() && $staff_interview_second->save() && $staff_interview_third->save() && $staff_salary->save()) {\n $model->username = Yii::$app->request->post()['StaffInfo']['username'];\n $model->post_id = Yii::$app->request->post()['StaffInfo']['post_id'];\n $model->save();\n $this->AddLanguage($model, $staff_interview_first, $staff_interview_third);\n $this->Imageupload($model);\n $this->AddFamily($model);\n $this->AddOtherInfo($model, Yii::$app->request->post(), $other_info);\n Yii::$app->getSession()->setFlash('success', 'Updated Successfully');\n return $this->redirect(array('index'));\n }\n }\n\n return $this->render('_staff_form', [\n 'model' => $model,\n 'staff_edu' => $staff_edu,\n 'other_info' => $other_info,\n 'staff_previous_employer' => $staff_previous_employer,\n 'staff_interview_first' => $staff_interview_first,\n 'staff_interview_second' => $staff_interview_second,\n 'staff_interview_third' => $staff_interview_third,\n 'staff_family' => $staff_family,\n 'staff_salary' => $staff_salary\n ]);\n } else {\n throw new \\yii\\web\\HttpException(400, 'Error code:1002', 405);\n }\n }", "public function edit()\n\t{\n\t\t//\n\t}", "public function team_member_edit(){\n\t\t\n\t\t$is_logged_in = $this->session->userdata('is_logged_in');\n\t\t$this->load->helper('form');\n\t\t\n\t\tif(!empty($is_logged_in) && $is_logged_in == true){\n\n\t\t\t\n\t\t\tif($this->uri->segment(4) != NULL){\n\t\t\t\t\n\t\t\t\t$data['title'] = 'Team Members';\n\t\t\t\t$data['details'] = $this->school_model->getMemberbyId($this->uri->segment(4));\n\t\t\t\t\n\t\t\t\t//$IsAllowMultiStaff = $this->school_model->IsAllowMultiStaff();\n\t\t\t\t//$data['IsAllowMultiStaff'] = $IsAllowMultiStaff;\n\t\t\t\t\n\t\t\t\t//$blank_location = array('0' => 'Select Location');\n\t\t\t\t//$locations = $this->school_model->getLocations();\n\t\t\t\t\n\t\t\t\t//$data['locations'] = $blank_location + $locations;\t\n\n\t\t\t\t//echo '<pre>'; print_r($data); die('yes');\t\n\t\t\n\t\t\t\t$this->load->view(\"admin/team_member_edit\", $data);\n\t\t\t\n\t\t\t\tif(isset($_POST['update'])):\n\t\t\t\t\t$this->school_model->update_team();\n\t\t\t\tendif;\n\t\t\t}else{ \n\t\t\t\tredirect(\"admin/school\");\n\t\t\t}\n\t\t}else{ \n\t\t\tredirect(\"admin/login\");\n\t\t}\n\t}", "public function edit(Watchlist $watchlist)\n {\n //\n }", "public function edit($sp_id)\n {\n //\n }", "public function edit(PaintJob $paintJob)\n {\n //\n }", "public function editdata_2(){\n\t\t$id_soal_tpa = $this->input->post('id_soal_tpa');\n\t\t$soal = $this->input->post('soal');\n\t\t$opsi_a = $this->input->post('opsi_a');\n\t\t$opsi_b = $this->input->post('opsi_b');\n\t\t$opsi_c = $this->input->post('opsi_c');\n\t\t$opsi_d = $this->input->post('opsi_d');\n\t\t$opsi_e = $this->input->post('opsi_e');\n\t\t$jawaban = $this->input->post('jawaban');\n\n\t\t$data = array(\n\t\t\t'soal' => $soal,\n\t\t\t'opsi_a' => $opsi_a,\n\t\t\t'opsi_b' => $opsi_b,\n\t\t\t'opsi_c' => $opsi_c,\n\t\t\t'opsi_d' => $opsi_d,\n\t\t\t'opsi_e' => $opsi_e,\n\t\t\t'jawaban' => $jawaban\n\t\t);\n\n\t\t$where = array(\n\t\t\t'id_soal_tpa' => $id_soal_tpa\n\t\t);\n\n\t\t$this->Mdl_soal->update_data($where,$data,'tb_soal_tpa');\n\t\t$this->session->set_flashdata('msg_update','Data Berhasil Diedit');\n\t\tredirect('Soal/Soal_tpa/Soal_tpa_2');\n\t}", "public function saveEditTraining2($form, $refid)\n {\n $umg = $this->staff_id;\n $staff_dept_code = \"(select sm_dept_code from ims_hris.staff_main where sm_staff_id = '$umg')\";\n $enter_date = \"date_trunc('second', NOW()::timestamp)\";\n\n $data = array(\n \"th_type\" => $form['type'],\n \"th_category\" => $form['category'],\n \"th_level\" => $form['level'],\n \"th_training_title\" => $form['training_title'],\n \"th_training_desc\" => $form['training_description'],\n \"th_training_venue\" => $form['venue'],\n //\"TH_TRAINING_COUNTRY\" => $form['country'],\n //\"TH_TRAINING_STATE\" => $form['state'],\n \"th_total_hours\" => $form['total_hours'],\n //\"th_training_fee\" => $form['fee'],\n \"th_internal_external\" => $form['internal_external'],\n \"th_sponsor\" => $form['sponsor'],\n //\"th_max_participant\" => $form['participants'],\n \"th_open\" => $form['online_application'],\n // \"TH_COMPETENCY_CODE\" => $form['competency_code'],\n\n // organizer info\n // \"th_organizer_level\" => $form['organizer_level'],\n \"th_organizer_name\" => $form['organizer_name'],\n\n // completion info\n \"th_evaluation_compulsory\" => $form['evaluation_compulsary'],\n \"th_attendance_type\" => $form['attendance_type'],\n \"th_print_certificate\" => $form['print_certificate'],\n\n \"th_enter_by\" => $umg,\n );\n\n if(empty($form['country'])) {\n $this->db->set(\"th_training_country\", NULL, true);\n } else {\n $this->db->set(\"th_training_country\", $form['country'], true);\n }\n\n if(empty($form['state'])) {\n $this->db->set(\"th_training_state\", NULL, true);\n } else {\n $this->db->set(\"th_training_state\", $form['state'], true);\n }\n\n if(empty($form['fee'])) {\n $this->db->set(\"th_training_fee\", NULL, true);\n } else {\n $this->db->set(\"th_training_fee\", $form['fee'], true);\n }\n\n if(empty($form['participants'])) {\n $this->db->set(\"th_max_participant\", NULL, true);\n } else {\n $this->db->set(\"th_max_participant\", $form['participants'], true);\n }\n\n if(empty($form['th_organizer_level'])) {\n $this->db->set(\"th_organizer_level\", NULL, true);\n } else {\n $this->db->set(\"th_organizer_level\", $form['th_organizer_level'], true);\n }\n\n $this->db->set(\"th_dept_code\", $staff_dept_code, false);\n $this->db->set(\"th_enter_date\", $enter_date, false);\n\n if(!empty($form['date_from'])){\n $date_from = \"to_date('\".$form['date_from'].\"', 'DD/MM/YYYY')\";\n $this->db->set(\"th_date_from\", $date_from, false);\n }\n\n if(!empty($form['date_to'])){\n $date_to = \"to_date('\".$form['date_to'].\"', 'DD/MM/YYYY')\";\n $this->db->set(\"th_date_to\", $date_to, false);\n }\n\n if(!empty($form['closing_date'])){\n $closing_date = \"to_date('\".$form['closing_date'].\"', 'DD/MM/YYYY')\";\n $this->db->set(\"th_apply_closing_date\", $closing_date, false);\n }\n\n // if(!empty($form['evaluation_period_from'])){\n // $evaluation_period_from = \"to_date('\".$form['evaluation_period_from'].\"', 'DD/MM/YYYY')\";\n // $this->db->set(\"TH_EVALUATION_DATE_FROM\", $evaluation_period_from, false);\n // }\n\n // if(!empty($form['evaluation_period_to'])){\n // $evaluation_period_to = \"to_date('\".$form['evaluation_period_to'].\"', 'DD/MM/YYYY')\";\n // $this->db->set(\"TH_EVALUATION_DATE_TO\", $evaluation_period_to, false);\n // }\n\n if(!empty($form['evaluation_period_from'])){\n $evaluation_period_from = \"to_date('\".$form['evaluation_period_from'].\"', 'DD/MM/YYYY')\";\n $this->db->set(\"th_evaluation_date_from\", $evaluation_period_from, false);\n } else {\n $this->db->set(\"th_evaluation_date_from\", NULL, true);\n }\n\n if(!empty($form['evaluation_period_to'])){\n $evaluation_period_to = \"to_date('\".$form['evaluation_period_to'].\"', 'DD/MM/YYYY')\";\n $this->db->set(\"th_evaluation_date_to\", $evaluation_period_to, false);\n } else {\n $this->db->set(\"th_evaluation_date_to\", NULL, true);\n }\n\n $this->db->where(\"th_ref_id\", $refid);\n\n return $this->db->update(\"ims_hris.training_head\", $data);\n }", "public function update(Request $request, qlsv_worktask $qlsv_worktask, $id)\n {\n date_default_timezone_set(\"Asia/Ho_Chi_Minh\");\n $validatedData = $request->validate(\n [\n 'tenworktask' => 'required',\n\n\n ],\n\n [\n 'required' => 'Không được để trống',\n 'min' => 'Không được nhỏ hơn :min',\n 'max' => 'Không được lớn hơn :max',\n 'integer' => 'Chỉ được nhập số'\n // 'integer' => ':attribute Chỉ được nhập số'\n ]\n );\n $worktaske = qlsv_worktask::find($id);\n\n $worktaske->tenworktask = $request->request->get(\"tenworktask\");\n $worktaske->thutu = $request->request->get(\"thutu\");\n $worktaske->id_monhoc = $request->request->get(\"id_monhoc\");\n $worktaske->updated_at = Carbon::now();\n $worktaske->save();\n\n $worktaskdetail = new qlsv_worktaskdetail();\n\n $ten = $request->request->get(\"ten\");\n\n $worktaskdetail = DB::table(\"qlsv_worktaskdetails\")->where('id_worktask', $worktaske->id)->get();\n\n foreach ($worktaskdetail as $wdt) {\n DB::table('qlsv_worktaskdetails')->where('id', $wdt->id)->delete();\n }\n for ($i = 0; $i < count($ten); $i++) {\n\n if ($ten[$i] != null) {\n $worktaskdetail = new qlsv_worktaskdetail();\n $worktaskdetail->ten = $ten[$i];\n $worktaskdetail->id_worktask = $worktaske->id;\n //$worktaskdetail->sothutu=$i+1;\n $worktaskdetail->nguoitao = \"haubeo\";\n $worktaskdetail->nguoisua = \"haubeo\";\n $worktaskdetail->updated_at = Carbon::now();\n $worktaskdetail->deleted_at = 0;\n $worktaskdetail->save();\n }\n }\n return redirect('/worktask/mon/' . $worktaske->id_monhoc);\n }", "public function update_opportunity() {\n\t\tif($this->session->userdata('uid')){\n\t\t\ttry {\n\t\t\t\t$given_data = array(\n\t\t\t\t\t'files' \t\t=> $_FILES,\n\t\t\t\t\t'stage_closed_date' => $this->input->post('stage_closed_date'),\n\t\t\t\t\t'stage_value' \t=> $this->input->post('stage_value'),\n\t\t\t\t\t'stage_numbers' => $this->input->post('stage_numbers'),\n\t\t\t\t\t'stage_rate'\t=> $this->input->post('stage_rate'),\n\t\t\t\t\t'stage_score'\t=> $this->input->post('stage_score'),\n\t\t\t\t\t'stage_customer_code'=>$this->input->post('stage_customer_code'),\n\t\t\t\t\t'stage_priority'=> $this->input->post('stage_priority'),\n\t\t\t\t\t'stage_remarks' => $this->input->post('stage_remarks'),\n\t\t\t\t\t'opportunity_id'=> $this->input->post('opportunity_id'),\n\t\t\t\t\t'lead_cust_id' \t=> $this->input->post('lead_cust_id'),\n\t\t\t\t\t'stage_id' \t\t=> $this->input->post('stage_id'),\n\t\t\t\t\t'cycle_id' \t\t=> $this->input->post('cycle_id'),\n\t\t\t\t\t'sell_type' \t=> $this->input->post('sell_type'),\n\t\t\t\t\t'mapping_id'\t=> uniqid(rand()),\n\t\t\t\t\t'user_id'\t\t=> $this->session->userdata('uid'),\n\t\t\t\t\t'contact_list'\t=> $this->input->post('contact_list')\n\t\t\t\t);\n\t\t\t\tif (($given_data['stage_closed_date'] == '0000-00-00') || ($given_data['stage_closed_date'] == '')) {\n\t\t\t\t\t$given_data['stage_closed_date'] = null;\n\t\t\t\t}\n\t\t\t\t$upload = $this->upload_file($given_data);\n\t\t\t\tif ($upload == 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n $opp_data= $this->opp_sales->stage_owner($given_data['opportunity_id']); // gets all data from opportunity details\n $stage_manager_owner_id=$opp_data[0]->stage_manager_owner_id;\n\t\t\t\t$log_attr_data = array(\n\t\t\t\t\t'mapping_id' => $given_data['mapping_id'],\n\t\t\t\t\t'opportunity_id'=> $given_data['opportunity_id'],\n\t\t\t\t\t'stage_id'=> $given_data['stage_id'],\n\t\t\t\t\t'user_id'=> $given_data['user_id'],\n 'opp_numbers'=>$stage_manager_owner_id,\n\t\t\t\t\t'opp_close_date'=> $given_data['stage_closed_date'],\n\t\t\t\t\t'oppo_rate' => $given_data['stage_rate'],\n\t\t\t\t\t'oppo_score' => $given_data['stage_score'],\n\t\t\t\t\t'oppo_customer_code' => $given_data['stage_customer_code'],\n\t\t\t\t\t'oppo_priority' => $given_data['stage_priority'],\n\t\t\t\t\t'timestamp'=> date('Y-m-d H:i:s'),\n\t\t\t\t\t'remarks'=> $given_data['stage_remarks']\n\t\t\t\t);\n\t\t\t\t$this->opp_common->log_attr($log_attr_data);\n\n\n\t\t\t\t$oppo_attr = $this->opp_common->fetch_oppoAttr($given_data['opportunity_id']);\n\t\t\t\tif ($oppo_attr == null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$changed_attr = array();\n\t\t\t\t/*if ($oppo_attr[0]->numbers != $given_data['stage_numbers']) {\n\t\t\t\t\t$changed_attr['opportunity_numbers'] = $given_data['stage_numbers'];\n\t\t\t\t}*/\n\t\t\t\tif ($oppo_attr[0]->close_date != $given_data['stage_closed_date']) {\n\t\t\t\t\t$changed_attr['opportunity_date'] = $given_data['stage_closed_date'];\n\t\t\t\t}\n\t\t\t /*\tif ($oppo_attr[0]->value != $given_data['stage_value']) {\n\t\t\t\t\t$changed_attr['opportunity_value'] = $given_data['stage_value'];\n\t\t\t\t}*/\n\t\t\t\tif ($oppo_attr[0]->rate != $given_data['stage_rate']) {\n\t\t\t\t\t$changed_attr['opportunity_rate'] = $given_data['stage_rate'];\n\t\t\t\t}\n\t\t\t\tif ($oppo_attr[0]->score != $given_data['stage_score']) {\n\t\t\t\t\t$changed_attr['opportunity_score'] = $given_data['stage_score'];\n\t\t\t\t}\n\t\t\t\tif ($oppo_attr[0]->customer_code != $given_data['stage_customer_code']) {\n\t\t\t\t\t$changed_attr['opportunity_customer_code'] = $given_data['stage_customer_code'];\n\t\t\t\t}\n\t\t\t\tif ($oppo_attr[0]->priority != $given_data['stage_priority']) {\n\t\t\t\t\t$changed_attr['opportunity_priority'] = $given_data['stage_priority'];\n\t\t\t\t}\n\t\t\t\tif ($oppo_attr[0]->stage != $given_data['stage_id']) {\n\t\t\t\t\t$changed_attr['opportunity_stage'] = $given_data['stage_id'];\n\t\t\t\t}\n\t\t\t\t$this->opp_common->updateOpportunity($changed_attr, $given_data['opportunity_id']);\n\n\t\t\t\t$log_trans_data = array(\n\t\t\t\t\t'mapping_id' => $given_data['mapping_id'],\n\t\t\t\t\t'opportunity_id'=> $given_data['opportunity_id'],\n\t\t\t\t\t'lead_cust_id' => $given_data['lead_cust_id'],\n\t\t\t\t\t'from_user_id'=> $given_data['user_id'],\n\t\t\t\t\t'to_user_id'=> $given_data['user_id'],\n\t\t\t\t\t'cycle_id' => $given_data['cycle_id'],\n\t\t\t\t\t'stage_id' => $given_data['stage_id'],\n\t\t\t\t\t'module' => 'sales',\n\t\t\t\t\t'action' => 'updated',\n\t\t\t\t\t'timestamp'=> date('Y-m-d H:i:s'),\n\t\t\t\t\t'sell_type' => $given_data['sell_type'],\n\t\t\t\t\t'remarks' => $given_data['stage_remarks'],\n\t\t\t\t);\n\t\t\t\t$updateStatus=$this->opp_common->map_opportunity(array(0 => $log_trans_data));\n\t\t\t\t$finalArray = array('errors' => array(), 'status' => $updateStatus);\n\t\t\t\techo(json_encode($finalArray));\n\t\t\t} catch (LConnectApplicationException $e) {\n\t\t\t\techo $this->exceptionThrower($e);\n\t\t\t}\n\t\t}else{\n\t\t\tredirect('indexController');\n\t\t}\n\t}", "public function update(){\n\t\techo $sql = \"update \".self::$tablename.\" set title=\\\"$this->title\\\",description=\\\"$this->description\\\",skills=\\\"$this->skills\\\",area_id=$this->area_id,jobtype_id=$this->jobtype_id,jobperiod_id=$this->jobperiod_id,duration=$this->duration,is_public=$this->is_public,is_finished=$this->is_finished,created_at=$this->created_at where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update(){\n\t\t\t$matk = $_POST['matk'];\n\t\t\t$tentk = $_POST['tentk'];\n\t\t\t$pass = $_POST['pass'];\n\t\t\t$fullname = $_POST['fullname'];\n\n\t\t\t$post = array(\n\t\t\t\t'matk' => $matk,\n\t\t\t\t'tentk' => $tentk,\n\t\t\t\t'pass' => $pass,\n\t\t\t\t'fullname' => $fullname,\n\t\t\t);\n\n\t\t\trequire_once('model/model.php');\n\t\t\t$Model = new Model();\n\t\t\t$update = $Model -> updateData($post);\n\n\t\t\trequire_once('view/View.php');\n\t\t\t$View = new View();\n\t\t\t$View ->alertupdate($update);\n\t\t}", "function modOpp(){\n $o_id = $_POST['o_id'];\n $o_type = $_REQUEST['oType'];\n $ap_d = $_POST['app_dead'];\n $s_d = $_POST['start_date'];\n $o_gpa = $_POST['req1'];\n $o_recom = $_POST['req2'];\n $m_email = $_SESSION['username'];\n $o_desc = $_POST['desc'];\n\n $sql = \"UPDATE Opportunity SET O_ID ='\".$o_id.\"',OType = '\".$o_type.\"',OStart = '\".$s_d.\"',OApp_dealine = '\".$ap_d.\"',OGPA = '\".$o_gpa.\"',\n OReccommendation ='\".$o_recom.\"',MEmail = '\".$m_email.\"' ,ODescription = '\".$o_desc.\"' WHERE O_ID ='\".$o_id.\"';\";\n\n mysql_query($sql);\n header('Location:opporView.php');\n}", "function getUpdatePoi(){\n\t\t$data = array(\n\t\t\t\t'lng' \t\t=> $this->input->post('lng'),\n\t\t\t\t'lat' \t\t=> $this->input->post('lat'),\n\t\t\t\t'nombre_poi'=> $this->input->post('nombre_poi'),\n\t\t\t\t'txt_rep'\t=> $this->input->post('txt_rep'),\n\t\t\t\t'direccion'\t=> $this->input->post('direccion'),\n\t\t\t\t'id_usuario'=> $this->input->post('id_usuario'),\n\n\t\t\t\t//'id_categoria'=> $this->input->post('id_categoria')\n\t\t\t);\n\t\t$this->pois_model->updatePoi($this->uri->segment(4), $data);\n\t\t$this->index();\n\t}", "public function updateExercises(Request $request, $id)\n {\n $request->validate([\n 'exercise_id' => 'required',\n ]);\n\n $workoutPlan = new WorkoutPlan;\n $workoutPlan->exercise_id = $request->get('exercise_id');\n $workoutPlan->workout_id = $id;\n $workoutPlan->save();\n \n return back()\n ->with('success', 'Workout actualizado correctamente');\n }" ]
[ "0.7855642", "0.71702427", "0.68421155", "0.67637235", "0.6645977", "0.66050977", "0.6550126", "0.6468668", "0.64681077", "0.6451119", "0.6420449", "0.63583255", "0.6338572", "0.6337156", "0.63365304", "0.6304288", "0.62667406", "0.6264342", "0.6256334", "0.62559503", "0.62535757", "0.62519515", "0.624389", "0.6238047", "0.62377346", "0.6229753", "0.6229657", "0.62235165", "0.62209946", "0.621299", "0.62100273", "0.62053776", "0.6205154", "0.6190118", "0.61854815", "0.6166069", "0.61522585", "0.6146747", "0.6146565", "0.61430544", "0.6139387", "0.61144865", "0.61101717", "0.61089915", "0.6108466", "0.6102717", "0.6101139", "0.6085367", "0.6083508", "0.6061451", "0.60611415", "0.6056373", "0.6055984", "0.6054172", "0.6054172", "0.6048974", "0.60357517", "0.603077", "0.6029179", "0.6028052", "0.6025877", "0.6021824", "0.60205984", "0.601952", "0.60137093", "0.6013319", "0.6007078", "0.59980106", "0.5991863", "0.5989074", "0.59876627", "0.59874475", "0.5986523", "0.59811586", "0.5980299", "0.5972816", "0.5971143", "0.5970227", "0.59623396", "0.5961256", "0.5957797", "0.5956586", "0.5951038", "0.5943834", "0.5940607", "0.5939515", "0.59389526", "0.59378076", "0.5935331", "0.5935149", "0.59348464", "0.59305274", "0.5925487", "0.5922607", "0.5918781", "0.59176475", "0.59176195", "0.5917022", "0.59103304", "0.5906203" ]
0.62677014
16
/edit workout Function for delete
public function deleteWorkout(Request $request) { $id = $request->workoutid; $getWorkout = Workout::find($id); if($getWorkout->delete()){ return redirect()->back()->with('danger','Workout Deleted successfully'); } else{ return redirect()->back()->with('danger','Sorry! Workout is not deleted'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteWorklog(){\n\n }", "function delete_entry($entryID) {\r\n $this->db->where('id', $entryID);\r\n $this->db->delete('workHours');\r\n }", "function delete_workman($id)\n {\n return $this->db->delete('workman',array('id'=>$id));\n }", "public function edit(Workout $workout)\n {\n //\n }", "public function actionRemovewl(){\n\t\t\n $connection=yii::app()->db;\n\t\t $sqluodate=\"UPDATE memberplot SET WLSTATUS='0',WLDATE='' WHERE plot_id='\".$_GET['id'].\"'\";\n\t\t$sqlresult=$connection->createCommand($sqluodate);\n\t\t$sqlresult->execute();\n\t\t\t\t$connection = Yii::app()->db; \n\t\t$temp_projects_array = Yii::app()->session['projects_array'];\n\t\t$num_of_projects_counter = count($temp_projects_array);\t\n\t\t$num_of_projects_counter2 = $num_of_projects_counter;\n\t\t$sql1 = \"select * from projects where\";\n\t\t$num_of_projects_counter--;\n\t\twhile($num_of_projects_counter>-1)\n\t\t{\n\t\t\t$sql2[$num_of_projects_counter] = \" id=\".Yii::app()->session['projects_array'][$num_of_projects_counter]['project_id'];\n\t\t\t$num_of_projects_counter--;\n\t\t}\n\t\t\n\t\t$sql_project = $sql1;\n\t\t$sql_project = $sql_project.implode(' or',$sql2);\n\t\t$result_projects = $connection->createCommand($sql_project)->query() or mysql_error();\n\t\t$this->render('defaulter_list',array('projects'=>$result_projects));\n\t\t\n\t\t\t\t\t}", "public function delete()\n {\n echo '客户要求减少一个需求' . PHP_EOL;\n }", "public function delete(){\n\t $this->model->clear()->filter(array('preview_master_id' => WaxUrl::get(\"id\")))->delete();\n\t parent::delete();\n\t}", "public function deleteAction()\n {\n $request = $this->getRequest();\n\n $routeMatch = $this->getEvent()->getRouteMatch();\n $id = $routeMatch->getParam('exercise_id', 0);\n\n if ($id <= 0) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $exercise = $this->_exercise->getRow(array('exercise_id' => $id));\n\n if (!$exercise) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $workoutId = $exercise->workout_id;\n\n $exercise->delete();\n\n return $this->redirect()->toRoute('hi-training/workout-exercise/list/wildcard', array('workout_id' => $workoutId));\n\n }", "public function destroy(qlsv_worktask $qlsv_worktask, $id)\n {\n date_default_timezone_set(\"Asia/Ho_Chi_Minh\");\n $worktask1 = qlsv_worktask::find($id);\n $thutu = $worktask1->thutu;\n $dsworktask = DB::table(\"qlsv_worktasks\")\n ->where('id_monhoc', $worktask1->id_monhoc)\n ->where('deleted_at', 0)->get();\n //dd( $worktask1);\n if ($thutu == 1) {\n\n foreach ($dsworktask as $dsw) {\n $dsw->thutu = $dsw->thutu - 1;\n $worktask = qlsv_worktask::find($dsw->id);\n $worktask->thutu = $dsw->thutu;\n $worktask->save();\n }\n } else {\n if ($thutu == count($dsworktask)) {\n } else {\n\n for ($i = $thutu; $i < count($dsworktask); $i++) {\n $dsworktask[$i]->thutu = $dsworktask[$i]->thutu - 1;\n $worktask = qlsv_worktask::find($dsworktask[$i]->id);\n $worktask->thutu = $dsworktask[$i]->thutu;\n $worktask->save();\n }\n }\n }\n\n\n $worktask1->deleted_at = 1;\n $worktask1->save();\n return response()->json(['_typeMessage' => 'deleteSuccess']);\n //return redirect('/worktask/index');\n }", "function delete() {\n\t\t$sql = \"DELETE FROM \".$this->hr_db.\".hr_person_detail\n\t\t\t\tWHERE psd_ps_id=?\";\n\t\t$this->hr->query($sql, array($this->psd_ps_id));\n\t}", "public function delete_mnt_record()\r\n {\r\n $mnt_id = $this->input->get('mnt_id');\r\n echo $this->maintenance_model->delete_record($mnt_id);\r\n\r\n }", "function delete_from_stopout_list($data)\n\t{\n\t return $this->db->where('number',$data['number'])\n\t\t\t->where('fsb',$data['fsb'])\n\t\t\t->where('md',$data['md'])\n\t\t\t->where('action',$data['action'])\n\t\t\t->delete('pamm_stopout_list');\n\t}", "public function deleting()\n {\n # code...\n }", "function deleteworksheet($id){\n\t \t// $data = array('status' => 'inactive');\n\t \t$this->db->where('w_id', id_clean($id));\n\t\t$this->db->delete('pof_worksheet');\t\n\t }", "public function deleteAction(){\n //farewell brave knight, your cosmo will stay with us forever...\n $this->getDM()->remove($this->getKnight());\n $this->getDM()->flush();\n //go back to home (indexAction) to show the grid of knights\n $this->redirect()->toRoute(\"home\");\n }", "public function deleted(Edit $edit)\n {\n //\n }", "function deleteEntry() \n { \n\t parent::deleteEntry();\n\n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['reg_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['reg_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['reg_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \t \n \n }", "function delete() ;", "function delete() ;", "public function index_delete(){\n\t\t\n\t\t}", "function do_delete(){\n\t\t// remove from fieldset:\n\t\t$fieldset = jcf_fieldsets_get( $this->fieldset_id );\n\t\tif( isset($fieldset['fields'][$this->id]) )\n\t\t\tunset($fieldset['fields'][$this->id]);\n\t\tjcf_fieldsets_update( $this->fieldset_id, $fieldset );\n\t\t\n\t\t// remove from fields array\n\t\tjcf_field_settings_update($this->id, NULL);\n\t}", "public function Do_delete_Example1(){\n\n\t}", "public function actionDelete() {}", "public function actionDelete() {}", "function delete()\n {\n }", "public function do_delete_record()\n {\n $v_list_delete = get_post_var('hdn_item_id_list','');\n $this->model->do_delete_record($v_list_delete);\n }", "function delete() \n {\n \n }", "function delete()\r\n {\r\n\r\n }", "public function delete_extraproduct(){\n if($this->uri->segment(3) == \"temp\"){\n $id = $this->uri->segment(4);\n $result = MU_Model::deletedRecordById(\"temp_table\",array(\"ID\" => $id));\n }else{\n $id = $this->uri->segment(3);\n $result = MU_Model::deletedRecordById(\"extra_acti\",array(\"extraproduct_id\" => $id));\n }\n if($result) echo 't';\n }", "public function action_delete_entry(): int {\n\t\treturn (int) ( new CRUD( $this->table->get_table_definition() ) )->delete_oldest_item();\n\t}", "function deleteEntry() \n { \n\t parent::deleteEntry();\n\n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['registration_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['registration_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['registration_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \t \n \n }", "private function actionListDelete() {\n $put_vars = $this->actionListPutConvert();\n $this->loadModel($put_vars['id'])->delete();\n }", "function deleteUnsaveNode()\n {\n //vymaze az po 2 hodinach ak sa nezmeni stav\n $list = $this->getFluent()->where(\"status = 'not_in_system' AND add_date < ( NOW() - 60*2 )\")->fetchAll();\n\n if (!empty($list)) {\n\n foreach ($list as $l) {\n\n $this->delete($l['id_node']);\n\n $module_name = $this->context->getService('ModuleContainer')->fetch($l['id_type_module'])->service_name;\n\n $this->context->getService($module_name)->delete($l['id_node']);\n }\n }\n }", "function DeleteToDB()\n\t{\n\t\tif(isset($_GET['job_id']))\n\t\t{\n\t\t\t//Initializing variables with the user inputs\n\t\t\t$Id = $_GET['job_id'];\n\t\t\t\n\t\t\tif(!empty($Id))\n\t\t\t{\t\t\t\t\n\t\t\t\t//Query which is going to execute to for database manipulation\n\t\t\t\t$query =\"DELETE FROM job_details WHERE id='$Id'\";\n\t\t\t\t$query_run = mysql_query($query);\n\t\t\t}\n\t\t}\t\n\t}", "public function deleteAction()\r\n {\r\n $id = $this->getRequest()->getParam('id');\r\n $model = Mage::getModel('thetailor_workgroup/workflow');\r\n \r\n if ($id) {\r\n // Load record\r\n $model->load($id);\r\n \r\n // Check if record is loaded\r\n if (!$model->getId()) {\r\n Mage::getSingleton('adminhtml/session')->addError($this->__('This workflow no longer exists.'));\r\n $this->_redirect('*/*/');\r\n \r\n return;\r\n } else {\r\n try { \r\n $model->setId($id)->delete();\r\n \r\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The workflow was successfully deleted.'));\r\n $this->_redirect('*/*/');\r\n } catch (Exception $e) {\r\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n $this->_redirect('*/*/edit', array('id' => $id));\r\n }\r\n }\r\n }\r\n }", "public function delete_W($nopeg) {\n\t\t$this->db->where('nopeg', $nopeg)\n\t\t\t\t ->delete('baru_warrior');\n\t}", "function m_giftWrapDelete()\n\t{\n\t\tif(isset($this->request['id']) && !empty($this->request['id']))\n\t\t{\t\t\t\n\t\t\t\t$this->obDb->query = \"DELETE FROM \".GIFTWRAPS.\" WHERE iGiftwrapid_PK =\".$this->request['id'];\n\t\t\t\t$this->obDb->updateQuery();\n\t\t}\n\t\t$this->libFunc->m_mosRedirect(SITE_URL.\"sales/adminindex.php?action=promotions.giftwrap.home&msg=3\");\t\n\t}", "function deletePoi(){\n\t\t$id = $this->uri->segment(4);\n\t\tif($id){\n\t\t\t$this->pois_model->deletePoi($id);\n\t\t}\n\t\t$this->index();\n\t}", "public function remove() {\n\n //GETS TASK RECORD WITH REQUEST TASK ID (ID)\n $task = Tasks::findorfail(request('TaskID'));\n\n //DELETES TASK RECORD FROM DB\n $task->delete();\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$task->NotepadID\");\n }", "function trash() { \n\t\t$adsdetail = JRequest::get('POST');\n\t\t$model = $this->getModel('showads');\n\t\t$model->statusChange($adsdetail);\n\t}", "function delete() {\n\n }", "protected function delete() {\n\t}", "function deleteData()\n{\n global $myDataGrid;\n global $f;\n global $tbl;\n $arrKeys = [];\n foreach ($myDataGrid->checkboxes as $strValue) {\n $arrKeys['id'][] = $strValue;\n }\n if ($tbl->deleteMultiple($arrKeys)) {\n $myDataGrid->message = $tbl->strMessage;\n $f->setValues('step', getDataListRecruitmentProcessTypeStep(null, true));\n } else {\n $myDataGrid->errorMessage = \"Failed to delete data \" . $tbl->strEntityName;\n }\n}", "public function travel_conditions_delete() {\n\t\tCheckAdminLoginSession();\n\t\t$id=$this->uri->segment(4);\n\t\t$this->admin_model->dataDelete($this->travel,$id);\n\t\t$this->session->set_flashdata('message','Your Travel Condition has been deleted successfully');\n redirect('admin/travel-conditions/lists','refresh');\n\t}", "function deleteDataInfo()\n {\n $formPost=array();\n $formPost[deleted]=1;\n \n foreach($this->piVars['selectionList'] as $idVal)\n {\n $GLOBALS['TYPO3_DB']->exec_UPDATEquery($this->tableName,'uid='.$idVal,$formPost);\n }\n return $this->showListings();\n }", "public function deleteProgram(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = Program::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Program Deleted successfully');\n }\n else{\n return redirect()->back()->with('danger','Sorry! Program is not deleted');\n }\n }", "public function adminDelComm()\n {\n $commID = $_POST['commID'];\n $del = \"DELETE FROM comment_section WHERE comm_id = ?\";\n $do = $this->connect()->prepare($del);\n $do->execute([$commID]);\n }", "function edithistory_delete()\n{\n\tglobal $db, $mybb, $user;\n\t$db->update_query(\"edithistory\", array('uid' => 0), \"uid='{$user['uid']}'\");\n}", "public function delOperator(){\n\t\tif($this->input->post('opId') and !empty($this->input->post('opId'))){\n\t\t\t// delete row where opId match\n\t\t\t$tbl=$this->session->userdata('prefix').'fsft_touroperator';\n\t\t\t$result=$this->Common_model->delete($tbl, array('id'=> $this->input->post('opId')));\n\t\t\tif($result>0){ // in case when record successfully deleted\n\t\t\t\techo 'OK::Tour Operator has been deleted Successfully::success';\n\t\t\t} else {\n\t\t\t\techo 'OK::Tour Operator Not Deleted. Try again::error';\n\t\t\t}\n\t\t} // end of if\n\t}", "function AfterDelete($where, &$deleted_values, &$message, &$pageObject)\n{\n\n\t\t$delete_jobfile_sql = \"DELETE FROM jobfile WHERE \".$where;\n//unlink($_SESSION[\"output_dir\"].\"\\\\test_alex\\\\\");\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n;\t\t\n}", "public function DELETE() {\n #\n }", "public function delete (){\n\n $table = new simple_table_ops();\n $table->set_id_column('timetable_id');\n $table->set_table_name('timetables');\n $table->delete();\n\n header(\"Location: http://\".WEBSITE_URL.\"/index.php?controller=timetable&action=show&submit=yes&timetable_period_id={$_GET['timetable_period_id']}\");\n }", "function delete(&$db,$DemandID,$DemandType,$StockID) { //####DELETE_DELETE_DELETE_DELETE_DELETE_DELETE_####\n\n// If wanted to have a Confirm routine before did actually deletion, could check if\n// deletion = \"yes\"; if it did, display link that redirects back to this page\n// like this - <a href=\" ' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?&delete=confirm&StockID=' . \"$StockID\" . ' \">\n// that sets delete=confirm. If delete=confirm, do actually deletion.\n// This deletes an individual record by DemandID if called from a listall that shows\n// edit/delete or deletes all of a particular demand type if press Delete Demand Type button.\n\t$where = \" \";\n\tif ($DemandType) {\n\t\t$where = \" WHERE mrpdemandtype ='\" . $DemandType . \"'\";\n\t}\n\tif ($DemandID) {\n\t\t$where = \" WHERE demandid ='\" . $DemandID . \"'\";\n\t}\n\t$sql=\"DELETE FROM mrpdemands\n\t\t $where\";\n\t$result = DB_query($sql);\n\tif ($DemandID) {\n\t\tprnMsg(_('The MRP demand record for') .' '. $StockID .' '. _('has been deleted'),'succes');\n\t} else {\n\t\tprnMsg(_('All records for demand type') .' '. $DemandType .' ' . _('have been deleted'),'succes');\n\t}\n\tunset ($DemandID);\n\tunset ($StockID);\n\tdisplay($db,$stockID,$DemandID);\n\n}", "function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n\n /* Get a lecture that this subtask is related to. */\n $lectureBean = new LectureBean ($this->id, $this->_smarty, \"\", \"\");\n $lectureBean->assignSingle();\n }", "public function undeleteAction(){\n\t}", "function delete() {\n }", "function edithistory_delete_post($pid)\n{\n\tglobal $db, $mybb;\n\t$db->delete_query(\"edithistory\", \"pid='{$pid}'\");\n}", "public function del(){\n\t\t$this->OnlyAdmin();\n\t\tif($this->input->post()){\n\t\t$this->TicketModel->delet($this->input->post());\n\t\tredirect('index.php/ticket/lists');}\n\t}", "function delete()\n {\n }", "public function remove() {\n if (!in_array('deleteWorkorder', $this->permission)) {\n redirect('dashboard', 'refresh');\n }\n\n $workorder_id = $this->input->post('workorder_id');\n\n $response = array();\n if ($workorder_id) {\n $delete = $this->model_workorder->remove($workorder_id);\n if ($delete == true) {\n $response['success'] = true;\n $response['messages'] = \"Successfully removed\";\n } else {\n $response['success'] = false;\n $response['messages'] = \"Error in the database while removing the workorder information\";\n }\n } else {\n $response['success'] = false;\n $response['messages'] = \"Refersh the page again!!\";\n }\n\n echo json_encode($response);\n }", "public function delete_info($i_id)\r\n { \r\n }", "function delete()\n{\n $data = [$_GET['id']];\n $succes = changeDB('DELETE FROM projecten WHERE id = ?', $data);\n if ($succes) {\n return page_show(\"project verwijderen gelukt\");\n }\n\n return page_show(\"project verwijderen gefaald\");\n\n\n}", "public function delete_info($i_id) {\n \n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "function PersonalData_Deleted($row) {\n\n\t//echo \"PersonalData Deleted\";\n}", "public function deleteEmployeeWorkingTime() {\n try {\n if (!($this->employeeWorkingTime instanceof Base_Model_ObtorLib_App_Core_Employee_Entity_EmployeeWorkingTime)) {\n throw new Base_Model_ObtorLib_App_Core_Employee_Exception(\" EmployeeWorkingTime workingtime Entity not initialized\");\n } else {\n return $this->delete('id =' . (int) $this->employeeWorkingTime->getId());\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Employee_Exception($ex);\n }\n }", "function deleteJob() {\n $job = $_POST['job'];\n \n if (count($job) > 1) {\n $default = 1;\n\n foreach ($job as $value) {\n if ($default == 1)\n $pk = $value;\n else {\n $pk .= \" OR pk = $value\";\n }\n \n $default++;\n }\n } else {\n $pk = array_shift($job);\n }\n\n connectDatabase();\n\n $result = queryDatabase(\"UPDATE job\n SET active = 0\n WHERE pk = $pk\");\n header('Location: ' . HOME . 'member.php?feedback=10');\n}", "public function annimalDelAction()\n {\n }", "public function delete($where = null, array $markers = []);", "function delete_office_info()\n {\n if(session::check_permission('XOA_THONG_TIN',0) == FALSE)\n {\n die('Bạn không có quyền thực hiện chức năng này !!!');\n }\n \n $this->model->delete_office_info();\n }", "function hard_delete(Request $request, $id){\n // hero's info data\n $landview = Landview::findOrFail($id);\n // hero professions data\n $profession = Landview_profession::where('landview_id', $landview->id)->get();\n\n // hero's info data deleted\n $landview->forceDelete();\n\n // hero's profession data deleted\n foreach ($profession as $prof) {\n $prof->forceDelete();\n }\n\n // hero thumbnail picture deleting\n if($landview->landview_image != 'landview_image_default.jpg'){\n $picture_location = 'public/uploads/landview_image/'.$landview->landview_image;\n unlink(base_path($picture_location));\n }\n\n return redirect()->route('landview')->with('lv_deleted', 'You have deleted an existing information from your landview information table');\n }", "public function destroy()\n {\n try {\n $medSupID = array();\n foreach (Input::all() as $key) {\n $medSupID = $key;\n }\n\n UsedMedSupply::whereIn('medSupplyUsedID', $medSupID)->update(['isDeleted' => 1]);\n\n\n } catch (Exception $e) {\n\n }\n }", "function deleteTerritoryMap() {\n\n $this->load->model('territory/territory_model');\n $territory_has_division_id = $this->input->get('id_territory_has_division1');\n $id_territory = $this->input->get('territory_idd2');\n $deleteTerritoryMap = $this->territory_model->deleteTerritoryMap1($territory_has_division_id);\n redirect(\"territory/drawIndexTerritoryManage?territory_idd2=$id_territory\");\n }", "function PersonalData_Deleted($row) {\r\n\r\n\t//echo \"PersonalData Deleted\";\r\n}", "public function destroymagzinearticle() {\n $rightId = 77;\n $currentChannelId = $this->rightObj->getCurrnetChannelId($rightId);\n if (!$this->rightObj->checkRights($currentChannelId, $rightId))\n return 'You are not authorized to access.';\n /* Right mgmt end */\n\n\n if (isset($_GET['option'])) {\n $id = $_GET['option'];\n }\n $delArr = explode(',', $id);\n\n foreach ($delArr as $d) {\n $valid = '0';\n \n $deleteAl = [\n 'm_f'=> 0,\n 'm_lw'=> 0,\n 'm_eicn'=>0,\n 'status' => $valid,\n 'updated_at' => date('Y-m-d H:i:s')\n ];\n DB::table('magazine_list')\n ->where('a_id', $d)\n ->update($deleteAl);\n \n \n\n }\n return 'success';\n }", "function deleteWine() {\n\t\tif (isset($_GET['wine'])) {\n\t\t\t//get the index of the wine\n\t\t\t$wineIdx = getWineRecIndex(\n\t\t\t\t\t\tbase64_decode($_GET['wine'])\n\t\t\t\t\t);\n\t\t\t//get the existing wines\n\t\t\t$wines = getWines();\n\n\t\t\t//get the contents of the wine file\n\t\t\t$writeFile = fopen('data/wines.json', \"w\");\n\t\t\t//delete the record from the array using the index\n\t\t\tarray_splice($wines, $wineIdx, 1);\n\t\t\t//convert userRecord to JSON\n\t\t\t$winesJson = json_encode($wines,JSON_PRETTY_PRINT);\n\t\t\t//write JSON string to file\n\t\t\tfwrite($writeFile, $winesJson);\n\t\t\t//close file\n\t\t\tfclose($writeFile);\n\t\t}\n\t}", "public function DELETE() {\n\t\t$this->scriptForceHint('DELETE');\n\t}", "public function delete() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::update(FALSE, ['isdeleted', 'deletedtime', 'deleteduser']);\n }", "public function delete()\r\n\t{\r\n\t}", "public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "public function deleteAction() {\n \n }", "function row_delete()\n\t{\n\t $this->db->where('id', $id);\n\t $this->db->delete('testimonials'); \n\t}", "function teamdelete(){\n $this->auth(COMP_ADM_LEVEL);\n $team_id = $this->uri->segment(3);\n $contest_id = urldecode($this->uri->segment(4));\n $this->m_key->removeTeam($team_id);\n $this->m_team->delete($team_id, $contest_id);\n $this->teams($contest_id);\n }", "public function deleteworkoutcategory(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = Category::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Workout Category Deleted successfully');\n }\n else{\n return redirect()->back()->with('danger','Sorry! Workout Category is not deleted');\n }\n }", "function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}", "function delete() {\n $cids = JRequest::getVar('cid', array(0), 'post', 'array');\n\n $row = & $this->getTable(\"ssprojects\");\n\n if (count($cids)) {\n foreach ($cids as $cid) {\n\n /* if (!$row->delete( $cid )) {\n $this->setError( $row->getErrorMsg() );\n return false;\n } */\n $db = $this->_db;\n $db->BeginTrans();\n if (!$row->delete($cid)) {\n $this->setError($row->getErrorMsg());\n $db->RollbackTrans();\n return false;\n } else {\n $q = \"delete from #__ssunits where ProjectID = '\" . $cid . \"'\";\n $db->setQuery($q);\n $db->query();\n if ($db->getErrorNum()) {\n $db->RollbackTrans();\n $this->setError(\"error deleting related units\");\n return false;\n }\n $db->CommitTrans();\n }\n }//foreach\n }\n return true;\n }", "public function actionDeleteEntryAttachement()\n {\n\n }", "public function RemoveWorkerAtWorkshop()\n {\n if(Request::ajax()) \n {\n // Getting all post data\n $data = Input::all();\n try\n { \n $worker = Worker::where('username',$data[\"worker_username\"])->get();\n \n $worker[0]->workshop_level_3()->wherePivot('date', '=', $data[\"date\"])->wherePivot('isMorning', '=', $data[\"ismorning\"])->detach($data[\"workshop_level_3\"]);\n return response(200);\n }\n catch(\\Exception $er)\n { \n return response(\" Une erreur est intervenue\" ,400);\n } \n }\n else\n return response($default_general_error_message,500);\n \n }", "public function delete()\n\t{\n\t}", "public static function delete() {\n\n\n\t\t}", "public function remove()\n\t{\n\t\t$this->todo = 3 ;\n\t}", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "function AfterDelete($where, &$deleted_values, &$message, &$pageObject)\n{\n\n\t\t\n\n$do=$deleted_values[\"LvID\"];\n\n$sqldel = \"DELETE FROM indleave WHERE LvID='$do'\";\nCustomQuery($sqldel);\n\n\n;\t\t\n}", "public function deletenutration(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = Nutration::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Nutration Deleted successfully');\n }\n else{\n return redirect()->back()->with('danger','Sorry! Nutration is not deleted');\n }\n }", "public function del()\n {\n }", "public function delete()\n\t{\n\t\t$selection = $this->input->post('selection');\n\t\t$ignore = implode('|', array_diff($this->ignore_list, $selection));\n\t\t$this->member->ignore_list = $ignore;\n\t\t$this->member->save();\n\n\t\tee()->functions->redirect(ee('CP/URL')->make($this->index_url, $this->query_string));\n\t}", "function DeleteNote($note){\r\n $statement = new DeleteStatement(\"job_note\");\r\n\t\t\t$statement->where(\"id\", $note->getId());\r\n $statement->executeStatement();\r\n }", "public function destroy($id)\n {\n $workout = Workout::find($id);\n $workout->delete();\n $workoutPlans = WorkoutPlan::select('id')->where('workout_id', '=', $id)->get();\n WorkoutPlan::whereIn('id',$workoutPlans)->delete();\n $trainingPlanDetail = TrainingPlanDetail::select('id')->where('workout_id', '=', $id)->get();\n TrainingPlanDetail::whereIn('id',$trainingPlanDetail)->delete();\n\n return back()\n ->with('success','Workout eliminado correctamente');\n }" ]
[ "0.67456985", "0.63389087", "0.6332227", "0.6252248", "0.6217238", "0.6122122", "0.6102628", "0.605384", "0.59912604", "0.59836406", "0.59804535", "0.5974781", "0.5966493", "0.5956046", "0.59432197", "0.59420574", "0.5908118", "0.5903832", "0.5903832", "0.5902733", "0.5902004", "0.5901462", "0.5871034", "0.5871034", "0.58500695", "0.5847329", "0.58411884", "0.5824066", "0.5817487", "0.580203", "0.5796059", "0.57921374", "0.57870424", "0.5786091", "0.57773226", "0.5770145", "0.5766962", "0.5764708", "0.57603097", "0.57580394", "0.5752172", "0.5741916", "0.5736782", "0.5734239", "0.57339007", "0.5729511", "0.57293814", "0.5725107", "0.5721851", "0.571784", "0.57158685", "0.57097334", "0.57074845", "0.5704339", "0.57026887", "0.5701157", "0.5697774", "0.56954235", "0.56886566", "0.56752443", "0.56743085", "0.56708455", "0.56696904", "0.56696117", "0.56689835", "0.56671286", "0.5664557", "0.5654023", "0.56536937", "0.5647217", "0.56445485", "0.5640234", "0.5639847", "0.5634353", "0.5633328", "0.5632837", "0.5629732", "0.56292045", "0.56217664", "0.56193054", "0.56182206", "0.56163013", "0.56123215", "0.5609944", "0.5607717", "0.5607496", "0.5606387", "0.56039083", "0.56004924", "0.559828", "0.55978876", "0.5597781", "0.5595282", "0.55936587", "0.559091", "0.5587954", "0.55877405", "0.55872756", "0.558618", "0.55849445" ]
0.6510778
1
/edit program Function for view form
public function editProgram($id) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $workout = Program::find($id); $categories = ProgramCategory::all(); //dd($workout); return view('admin.editprogram')->with('workout',$workout)->with('programCategories',$categories); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit() {\n\t\t\t\n\t\t}", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit( )\r\n {\r\n //\r\n }", "public function edit()\n\t{\n\t\t\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()\n\t{\n\t\t\n\t}", "function pa_edit() {\n\t\t\t\t$edit_pid = (int)UTIL::get_post('edit_pid');\n\t\t\t\t\n\t\t\t\t//-- haben wir keine edit-id, gibts eine seiten-tabelle zur auswahl\n\t\t\t\tif (!$edit_pid) {\n\t\t\t\t\techo 'error: no pid';\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$form = MC::create('form');\n\t\t\t\t$form->init('page', 'mod_page');\n\t\t\t\t$form->add_hidden('edit_pid', $edit_pid);\n\t\t\t\t\n\t\t\t\t// hatten wir fehler\n\t\t\t\tif ($this->get_var('error')) {\n\t\t\t\t\t$form->set_values($this->get_var('data'));\n\t\t\t\t\t$form->set_error_fields($this->get_var('error'));\n\t\t\t\t}\t\n\t\t\t\telse {\n\t\t\t\t\t// frisch aus db lesen\n\t\t\t\t\t$sql = 'SELECT * FROM '.$this->mod_tbl.' WHERE id='.$edit_pid;\n\t\t\t\t\t$res = $this->DB->query($sql);\n\t\t\t\t\t$data = $res->r();\n\t\t\t\t\t$form->set_values($data);\n\t\t\t\t}\n\n\t\t\t\t$this->set_var('path', $this->_get_path_print($edit_pid));\n\t\t\t\t$this->set_var('form', $form);\n\t\t\t\t\n\t\t\t\t$this->OPC->generate_view($this->tpl_dir.'pa_edit.php');\n\n\t\t\t}", "public function showEdit()\n {\n\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit() {\n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n \n }", "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()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n { \n }", "public function edit()\n { }", "abstract protected function renderEdit();", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function edit()\n {\n //\n }", "public function edit() {\n\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function getEditForm();", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n //\n\t\treturn 'ini halaman edit';\n }", "public function editAction() {}", "function edit() {\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->getDefaultViewForm();\n\n\t\tif (!$view) {\n\t\t\tthrow new Exception('Edit task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t// Hint the view that it's not a listing, but a form (KenedoView::display() uses it to set the right template file)\n\t\t$view->listing = false;\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 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 edit_toko(){\n\t}", "public function editForm(): void\n {\n $this->articleId = $_GET['id'];\n $query = $this->articleModel->displayOneArticle($this->articleId);\n $editArticle = $query->fetch();\n\n $this->title = $editArticle['title'];\n $this->content = $editArticle['content'];\n $this->category = $editArticle['category'];\n }", "function edit()\n\t{\n $data = JRequest::get( 'post' );\n\n $datas = JRequest::get( 'get' );\n $data['task']=isset($data['task'])?$data['task']:'';\n $datas['task']=isset($datas['task'])?$datas['task']:'';\n if($data['task']=='edit' || $datas['task'] =='edit'){\n JRequest::setVar( 'view', 'test' );\n JRequest::setVar( 'layout', 'default_edit');\n JRequest::setVar('hidemainmenu', 1);\n parent::display();\n }\n else{\n\t\tJRequest::setVar( 'view', 'test' );\n\t\tJRequest::setVar( 'layout', 'form');\n\t\tJRequest::setVar('hidemainmenu', 1);\n\t\tparent::display();\n }\n }", "function index()\n {\n $this->_view_edit('view');\n }", "protected function editar()\n {\n }", "function a_edit() {\n\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t$u=new Gestionnaire($id);\n\t\textract($u->data);\t\n\t\trequire $this->gabarit;\n\t}", "public function editar(){\n $cedula = $_GET['cedula'];\n //2. usar el modelo para traer de la BD el estudiante\n $estudiante = $this->model->buscarEstudiante($cedula);\n //3. llamar a la vista de editar\n require_once 'view/include/header.php';\n require_once 'view/estudiante/editar.php';\n require_once 'view/include/footer.php';\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\t{\n\n // Make sure we're not the trying to edit the default program.\n if( $id == 1 ) {\n Session::flash('action_success', false);\n Session::flash('action_message', 'You cannot modify the default program.');\n return Redirect::action('AdminProgramController@index');\n }\n\n $program = Program::find($id);\n\n if( is_null($program) ) {\n Session::flash('action_success', false);\n Session::flash('action_message', 'The specified program could not be fond.');\n\n return Redirect::action('AdminProgramController@index');\n }\n\n $programOptions = $program->programOptions()->get();\n\n return View::make('admin.program.edit')->with('program', $program)->with('programOptions', $programOptions);\n\n\t}", "public function modifyView() {\n $this->object = $this->object->readObject($this->id);\n $uiObjectName = $this->type.'_Ui';\n $uiObject = new $uiObjectName($this->object);\n $values = array_merge($this->object->valuesArray(), $this->values);\n return $uiObject->renderForm(array_merge(\n array('values'=>$values,\n 'action'=>url($this->type.'/modify', true),\n 'class'=>'formAdmin formAdminModify'),\n array('submit'=>array('save'=>__('save'),\n 'saveCheck'=>__('saveCheck')))));\n }", "function editPage($app)\n\t{\n\t// \t$app->post\t\n\t}", "public function getEdit()\n\t{\n\t}", "public function edit()\n {\n return \"Ini Halaman Edit\";\n }", "public function edit()\n {\n if (!isset($_GET['id'])) {\n call('pages', 'error');\n return;\n }\n\n $project = Project::find($_GET['id']);\n require_once('views/projects/edit.php');\n }", "function displayEditScreen()\t{\t \n\t\t// We handle here Edit mode or Preview Mode\n\t\t// Edit Mode : User can edit fields\n\t\t// Preview Mode : user can only see fields\t\n\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('displayEditScreen'=>'on'));\n\t\t$exporttype=$this->piVars['exporttype'];\n\t\t$print=$this->piVars['print'];\n\t\t$printerName=$this->piVars['printername'];\n\t\t$printServerName=$this->piVars['printservename'];\n\t\tif ($exporttype == 'PDF') $exporttype = \"PDFDET\";\n\t\t$this->conf['cmdmode']='edit';\t\n\t\t// We handle here Edit mode or Preview Mode\n\t \t// Edit Mode : User can edit fields\n\t \t// Preview Mode : user can only see fields\t \n\t \t//$this->markerArray['###BACK_URL###'] = \"\";\n\t \t\n\t\t//We handle backurl...\n\t\t/*if ($this->conf['edit.']['backPagePid'] && !$this->conf['no_action']) {\n\t\t\t$this->backURL=$this->pi_getPageLink($this->conf['edit.']['backPagePid']);\n\t\t\tif (!strpos($this->backURL,'?')) $this->backURL.='?';\n\t\t\t$this->markerArray['###BACK_URL###'] = $this->backURL;\n\t\t}*/\n\t\t// If editing is enabled\n\t\tif ($this->conf['edit'] || $this->preview || $this->conf['list'] )\t{\t\n\t\t\t// hack for lists in second plugin ... to be checked.., Will not work if we want to edit in second plugin ...\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('Edit or preview'=>'on'));\n\t\t\t$uid=$this->dataArr[$this->conf['uidField']]?$this->dataArr[$this->conf['uidField']]:$this->recUid;\n \t\t\tif ($this->conf['list.']['rUJoinField']=='uid' && $uid){\n \t\t\t\t\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('UIDFIELD'=>$this->conf['uidField'].' : '.$this->recUid));\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('dataArr'=>$this->dataArr[$this->conf['uidField']]));\n\t\t\t\t$origArr = $this->metafeeditlib->getRawRecord($this->theTable,$uid,$this->conf);\n\t\t\t\tif (!$origArr) die(__METHOD__.\":Detail mode and no id given for $this->theTable,$uid\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('editMode'=>'on'));\n\n\t\t\t// here we handle foreign tables not the best way , we should work on join tables especially if we handle lists...\n\t\t\t\n\t\t\tif ($this->conf['foreignTables'] && is_array($origArr)) {\n\t\t\t\t\n\t\t\t\t//MM not implemented\n\t\t\t\t//Not MM\n\t\t\t\t\n\t\t\t\t$FTRels=t3lib_div::trimexplode(',',$this->conf['foreignTables']);\n\t\t\t\tforeach($FTRels as $FTRel) {\n\t\t\t\t\t$FTable=$GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['foreign_table'];\n\t\t\t\t\t$FTUid=$origArr[$FTRel];\n\t\t\t\t\t// what if multiple ???\n\t\t\t\t\t// what if editmenu list ???\n\t\t\t\t\tif ($FTUid) {\n\t\t\t\t\t\t //on recup l'id de l'enregistrement a associer\n\t\t\t\t\t\tif ($GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['MM']) { //si on est dans une MM faut d'abord recup les id de la table MM\n\t\t\t\t\t\t\t$MMT = $GLOBALS['TCA'][$this->theTable]['columns'][$FTRel]['config']['MM'];\n\t\t\t\t\t\t\t$LTUid=$origArr[\"uid\"];\n\t\t\t\t\t\t\t$MMTreq = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('*',$this->theTable,$MMT,$FTable,'AND '.$this->theTable.'.uid='.$origArr['uid']);\n\t\t\t\t\t\t\t$resu=$GLOBALS['TYPO3_DB']->sql_num_rows($MMTreq);\n\t\t\t\t\t\t\tif ($resu>=1) {\n\t\t\t\t\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($MMTreq)) {\n\t\t\t\t\t\t\t\t\tforeach($row as $key =>$val) $origArr[$FTRel.'.'.$key]=$val;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// originally there only these 2 lines in this condition (if ($FTUid) )\n\t\t\t\t\t\t\t$FTorigArr = $GLOBALS['TSFE']->sys_page->getRawRecord($FTable, $FTUid);\n\t\t\t\t\t\t\tif (is_array($FTorigArr)) foreach($FTorigArr as $key =>$val) $origArr[$FTRel.'.'.$key]=$val;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$FTCA=$GLOBALS['TCA'][$FTable]['columns'];\n\t\t\t\t\t\t//krumo ($FTCA);\n\t\t\t\t\t\tif (is_array($FCTA)) foreach($FTCA as $key=>$val) {\n\t\t\t\t\t\t\tif (in_array(substr($FTCA,0,11),array('--div--;Tab','--fsb--;FSB','--fse--;FSE'))) continue;\n\t\t\t\t\t\t\t$this->markerArray['###FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###FIELD_EVAL_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###EVAL_ERROR_FIELD_'.$FTRel.'_'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$FTRel.'.'.$key.'###']='';\n\t\t\t\t\t\t\t$this->markerArray['###CSS_ERROR_FIELD_'.$FTRel.'_'.$key.'###']='';\n\t\t\t\t\t\t} \n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//<CBY> We go to detail mode directly if editUnique is true and there is only one elment to edit.\n\t\t\t$DBSELECT=$this->metafeeditlib->DBmayFEUserEditSelectMM($this->theTable,$GLOBALS['TSFE']->fe_user->user, $this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$mmTable,$this->conf).$GLOBALS['TSFE']->sys_page->deleteClause($this->theTable);\n\n\t\t\t$TABLES=$mmTable?$this->theTable.','.$mmTable:$this->theTable;\n\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>$origArr));\n\t\t\tif (!is_array($origArr)&&$this->conf['editUnique']) {\n\t\t\t\t$lockPid = ($this->conf['edit.']['menuLockPid'] && $this->conf['pid'])? ' AND pid='.intval($this->thePid) : '';\n\t\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', $TABLES, '1 '.$lockPid.$DBSELECT);\n\t\t\t\tif ($this->conf['debug']) \techo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDITUNIQUE TEST'=>$GLOBALS['TYPO3_DB']->SELECTquery('*', $TABLES, '1 '.$lockPid.$DBSELECT)));\n\t\t\t\t$resu=$GLOBALS['TYPO3_DB']->sql_num_rows($res);\n\t\t\t\tif ($resu>=1)\t{\n \t\t\t\t\twhile($menuRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $menuRow[$this->conf['uidField']]);\n\t\t\t\t\t\t$this->recUid=$menuRow[$this->conf['uidField']];\n\t\t\t\t\t\t$this->conf['recUid']=$this->recUid;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t}\n\t\t\t// <CBY>\n\t\t\t$this->markerArray['###REC_UID###']=$this->recUid;\n\t\t\t//if ($GLOBALS['TSFE']->loginUser || $this->aCAuth($origArr))\t{\t// Must be logged in OR be authenticated by the aC code in order to edit\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ( $this->aCAuth($origArr)&& $this->conf['requireLogin'])||!$this->conf['requireLogin'])\t{\n\t\t\t\t// Must be logged in OR be authenticated by the aC code in order to edit\n\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>\"No login\"));\n\t\t\t\n\t\t\t\t// We come from ??\n\t\t\t\tif (is_array($origArr) && !($this->conf['inputvar.']['BACK'] && $this->conf['inputvar.']['cameFromBlog']))\t{\n\t\t\t\t\tif ($this->conf['blogData']) $this->preview=1; \n\t\t\t\t\t// we check if edit or preview mode is allowed ...\n\t\t\t\t\tif (!$this->conf['edit'] && !$this->preview )\t{\t// If editing is enabled\n\t\t\t\t\t\t$content.='meta_feedit : feadminlib.inc, Edit-option is not set and Preview-option is not set in TypoScript';\n\t\t\t\t\t\treturn $content;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($this->conf['disableEdit'] && !$this->preview )\t{\t// If editing is enabled\n\t\t\t\t\t\t$content.='meta_feedit : feadminlib.inc, Edit-option disabled and Preview-option is not set in TypoScript';\n\t\t\t\t\t\treturn $content;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t\n\t\t\t\t\t\t// Display the form, if access granted.\n\t\t\t\t\t\tif ($this->conf['debug']) echo Tx_MetaFeedit_Lib_ViewArray::viewArray(array('EDIT'=>\"User may edit\"));\n\t\t\t\t\t\tif \t($this->conf['evalFunc'])\t{\n\t\t\t\t\t\t\t$origArr = $this->userProcess('evalFunc',$origArr);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->markerArray = $this->setfixed($this->markerArray, $this->conf['setfixed.'], $origArr);\n\t\t\t\t\t\t$content=$this->displayEditForm($origArr,$this->conf,$exporttype,$print,$printerName,$printServerName);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Else display error, that you could not edit that particular record...\t\n\t\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_NO_PERMISSIONS###');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// If the recUid did not select a record, we display a menu of records. (eg. if no recUid)\n\t\t\t\t\t// we check if list mode is allowed ...\n\t\t\t\t\tif (!$this->conf['list'])\t{\t// If editing is enabled\n\t\t\t\t\t\t\t$content.='List-option is not set in TypoScript';\n\t\t\t\t\t\t return $content;\n\t\t\t\t\t}\n\t\t\t\t\t//$content=($this->conf['general.']['listMode']==2)?$this->metafeeditgrid->displayGridScreen($TABLES,$DBSELECT,$this->conf):$this->displayListScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\tswitch($this->conf['general.']['listMode']) {\n\t\t\t\t\t\tcase 2 :\n\t\t\t\t\t\t\t$content=$this->metafeeditgrid->displayGridScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1 :\n\t\t\t\t\t\t\t\t//$content=$this->metafecalendar->displayCalendarScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\t$cal=t3lib_div::makeInstance('tx_metafeedit_calendar');\n\t\t\t\t\t\t $cal->initObj($this->metafeeditlib,$this->cObj);\n\t\t\t\t\t\t\t$content=$cal->displayCalendarScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault :\n\t\t\t\t\t\t\t$content=$this->displayListScreen($TABLES,$DBSELECT,$this->conf);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Finally this is if there is no login user. This must tell that you must login. Perhaps link to a page with create-user or login information.\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_AUTH###');\n\t\t\t}\n\t\t} else {\n\t\t\t$content.='Display Edit Screen : Edit-option , Preview-option or List-option is not set in TypoScript';\n\t\t}\n\t\treturn $content;\n\t}", "function show_edit()\n\t{\n\t\treturn '';\n\t}", "function edit(){\n\t\t$arr = $this->uri->uri_to_assoc(3);\n\t\t$data['arr'] = $arr['id'];\n\t\t\n\t\t/* membuat value */\n\t\t$this->user->setID($arr['id']);\n\n\t\t/* fungsi ambil data */\n\t\t$result = $this->user->ambil_data();\n\n\t\t/* data dropdown */\n\t\t$data['role'] = role_dropdown();\n\t\t$data['result'] = $result;\n\n\t\t/* load view */\n\t\t$this->template->write_view('edit', $data);\n\t}", "function showApprentice() {\n\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\n\t\t\t\t\t$editForm = new h2o('views/editApprentice.html');\n\t\t\t\t\techo $editForm->render(compact('apprentice'));\n\t\t\t\t}", "public function editar()\n {\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Activity_Service_ShareQq::get(intval($id));\n\t\t$this->assign('info', $info);\n\t}", "public function add_edit_form(){\n\n $_id = $_GET['id']; \n $tblName = $this->get_tbl_name();\n\n $source = DB::table($tblName)->where('id',$_id)->get();\n\n $source_first = $source[0];\n\n // mhtml::dump($source_first);\n\n\n $struct = $this->struct;\n\n mhtml::startForm(\"edit\",\"backend_edit.php\");\n\n // loop througth fields\n foreach ($this->edit as $key => $field) {\n\n $kind = $struct[$field] ;\n if($kind == 'string') {$kind = 'text' ;} \n $value = $source_first[$field];\n\n mhtml::field($this->virtual_names[$field],$field,$kind,$value);\n\n }\n\n // add secret field for password\n if(isset($this->edit_secret)){\n if($this->edit_secret == true ){\n\n Logger::warn(\"we use one secret only on secret[0] in secret array in model\");\n $virtual_pass = $this->virtual_names[$this->secret[0]];\n mhtml::field($virtual_pass,$this->secret[0],'password');\n\n }\n }\n\n \n\n\n\n\n // mhtml::field('user name ','user_name','text',\"mohammed\");\n // mhtml::field('passwording','password','password');\n // mhtml::field('age','age','number');\n\n mhtml::field_id_model();\n\n mhtml::submitForm();\n\n mhtml::endForm();\n\n }", "public function editView() {\n $this->template()->addTplFile('edit.phtml');\n $this->setTinyMCE($this->formEdit->text, 'advanced');\n $this->setTinyMCE($this->formEdit->textPanel, 'advanced', array('height' => 300));\n if(isset($this->formEdit->textFooter)){\n $this->setTinyMCE($this->formEdit->textFooter, 'advanced', array('height' => 300));\n }\n Template_Module::setEdit(true);\n }", "public function getEditInput();", "public function display_edit_form(){\n echo \"<form action='../../Controllers/charity_controller.class.php?action=update' method='post'>\";\n echo \"<input type='hidden' name='id' value=\".$this->id.\" />\";\n echo \"Name: <input type='text' name='name' value=\".$this->name.\" /><br />\";\n echo \"Description: <textarea name='description'>\".$this->description.\"</textarea><br />\";\n echo \"<input type='submit' value='Update' />\";\n echo \"</form>\";\n }", "public function edit()\n\t{\n\t\tJRequest::setVar( 'view', 'player' );\n\t\tJRequest::setVar( 'layout', 'form' );\n\t\tJRequest::setVar('hidemainmenu', 1);\n\t \t \n\t\tparent::display();\n\t}", "public function edit(){\n $factura = parent::find($_GET['id']);\n require_once 'views/employee/layouts/header.php';\n require_once 'views/employee/factura/edit.php';\n require_once 'views/employee/layouts/footer.php';\n\n }", "public function editstepsAction(){\n\n\t echo $this->ModelObj->updatesteps($this->Request); exit;\n\n\t}", "protected function actionEdit() {\r\n\r\n //try 1: get the object type and names based on the current object\r\n $objInstance = class_objectfactory::getInstance()->getObject($this->getSystemid());\r\n if($objInstance != null) {\r\n $strObjectTypeName = uniSubstr($this->getActionNameForClass(\"edit\", $objInstance), 4);\r\n if($strObjectTypeName != \"\") {\r\n $strType = get_class($objInstance);\r\n $this->setCurObjectClassName($strType);\r\n $this->setStrCurObjectTypeName($strObjectTypeName);\r\n }\r\n }\r\n\r\n //try 2: regular, oldschool resolving based on the current action-params\r\n $strType = $this->getCurObjectClassName();\r\n\r\n if(!is_null($strType)) {\r\n\r\n $objEdit = new $strType($this->getSystemid());\r\n $objForm = $this->getAdminForm($objEdit);\r\n $objForm->addField(new class_formentry_hidden(\"\", \"mode\"))->setStrValue(\"edit\");\r\n\r\n return $objForm->renderForm(getLinkAdminHref($this->getArrModule(\"modul\"), \"save\".$this->getStrCurObjectTypeName()));\r\n }\r\n else\r\n throw new class_exception(\"error editing current object type not known \", class_exception::$level_ERROR);\r\n }", "public function edit($id)\n {\n $program = Programs::find($id);\n $highlights = Highlight::orderBy('id' , 'DESC')->get();\n $pages_programs = Pages::where('parent_id','>',0)->get();\n $related_programs_collection = DB::table('programs_related')->where('programs_id', $id)->get();\n return view('admin.programs.edit',compact('program','highlights','pages_programs','related_programs_collection'));\n }", "public function editAction()\r\n {\r\n }", "function a_edit() {\n\t\tif (isset($_POST[\"btSubmit\"])) {\n\t\t\t$_POST['use_passw']=password_hash($_POST['use_passw'], PASSWORD_DEFAULT);\n\t\t\t$u=new User();\n\t\t\t$u->chargerDepuisTableau($_POST);\n\t\t\t$u->sauver();\n\t\t\theader(\"location:index.php?m=documents\");\n\t\t} else {\t\t\t\t\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$u=new User($id);\n\t\t\textract($u->data);\t\n\t\t\trequire $this->gabarit;\n\t\t}\n\t}", "public function annimalEditAction()\n {\n }", "public function editAction() {\n# process the edit form.\n# check the post data and filter it.\n\t\tif(isset($_POST['cancel'])) {\n\t\t\tAPI::Redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t$input_check = $this->_model->check_input($_POST);\n\t\tif(is_array($input_check)) {\n\t\t\tAPI::Error($input_check);\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t// all hooks will stack their errors onto the API::Error stack\n\t\t// but WILL NOT redirect.\n\t\tAPI::callHooks(self::$module, 'validate', 'controller', $_POST);\n\t\tif(API::hasErrors()) {\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\n\t\t$this->_model->set_data($_POST);\n\n\t\t// auto call the hooks for this module/action\n\t\tAPI::callHooks(self::$module, 'save', 'controller');\n\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\n\n\t}", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Gc_Service_OrderShow::getOrderShow(intval($id));\n\t\n\t\t//状态\n\t\t$this->assign('ordershow_status', $this->ordershow_status);\n\t\t\n\t\t//渠道\n\t\tlist(,$ordershow_channel) = Gc_Service_OrderChannel::getAllOrderChannel();\n\t\t$ordershow_channel = Common::resetKey($ordershow_channel, 'id');\n\t\t$this->assign('ordershow_channel', $ordershow_channel);\n\t\t\t\t\n\t\t$this->assign('info', $info);\n\t}", "public function edit()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $data = array(\n 'title' => 'edit',\n 'tacgia' => $tacgia\n );\n\n // Load view\n $this->view->load('tacgias/edit', $data);\n }", "function show_edit()\n\t{\n\t\t$this->tpl->set_var('name', '_f_'.$this->name);\n\t\t$this->tpl->set_var('description', $this->description);\n\t\t$this->tpl->set_var('error', $this->error);\n\t\t$this->tpl->set_var('select', html_build_date($this->name, $this->value));\n\t\t\n\n\t\t$out = $this->tpl->process('temp', 'avcDate_edit');\n\n\t\t$this->tpl->drop_var('name');\n\t\t$this->tpl->drop_var('description');\n\t\t$this->tpl->drop_var('select');\n\t\t$this->tpl->drop_var('error');\n\n\t\treturn $out;\n\t}", "function doEdit()\n {\n global $_POST;\n$regs=explode(\":::\",$_POST[\"DROWS\"]);\n$id= $regs[0];\n if (strlen($id) <= 0)\n {\n echo \"Nao existe valores a serem editados\";\n echo \"<a href=./cadastra.php>Voltar</a> \";\n exit();\n }\n$result = lookup($id);\n\n presentInputForm(\n mysql_result($result, 0, \"id\"),\n mysql_result($result, 0, 1),\n mysql_result($result, 0, 2),\n mysql_result($result, 0, 3),\n mysql_result($result, 0, 4),\n mysql_result($result, 0, 5),\n mysql_result($result, 0, 6),\n mysql_result($result, 0, 7),\n mysql_result($result, 0, 8),\n mysql_result($result, 0, 9),\n mysql_result($result, 0, 10),\n mysql_result($result, 0, 11),\n\"E\");\n }", "public function modelDoEdit(){\n\t\t\t$maphongban = isset($_GET[\"maphongban\"])&&is_numeric($_GET[\"maphongban\"])?$_GET[\"maphongban\"]:0;\n\t\t\t$tenphongban = $_POST[\"tenphongban\"];\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//chuan bi truy van\n\t\t\t$query = $conn->prepare(\"update phongban set tenphongban=:ten where maphongban=:ma\");\n\t\t\t$query->execute(array(\"ten\"=>$tenphongban,\"ma\"=>$maphongban));\n\t\t}", "public function actionEdit(){\n\t\t$form = $_POST;\n\t\t$id = $form['id'];\n\t\tunset($form['id']);\n\t\tunset($form['submit_']);\n\t\tif($form['active'] == 'on'){\n\t\t\t$form['active'] = 1;\n\t\t}\n\t\t$db = $this->context->getService('database');\n\t\t$db->exec('UPDATE core_pages SET ? WHERE id = ?', $form, $id);\n\t\t$this->redirect('pages:');\n\t}", "public function edit(Run $run)\n {\n //\n }", "public function edit(Run $run)\n {\n //\n }", "protected function editView_form(){\n $output_path = './resources/views/'. $this->solveName($this->commandObj->argument('model_B'), config('CrudDscaffold.app_name_rules.app_route')). '/';\n $output_filename = '_form.blade.php';\n\n //replace word\n $pattern = '#(.*)<label for=\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id-field\">(.*)_id</label>(.*){!! Form::text\\(\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id\", null,(.*)#s';\n $replacement = '\\1<label for=\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id-field\">\\2_'. $this->relation_display_column. '</label>\\3{!! Form::select(\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.name_name')).'_id\", $list[\"'.\n $this->solveName($this->commandObj->argument('model_A'), config('CrudDscaffold.app_name_rules.app_model_class')).'\"], null,\\4';\n\n //output(use OutputTrait)\n $this->outputReplace( $output_path, $output_filename, $pattern, $replacement, $debug = $this->debug );\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "public function editView() {\n Template_Module::setFullWidth(true);\n $this->edit = true;\n $this->addView();\n // cestak obrázků\n $this->imagePath = $this->category()->getModule()->getDataDir(true);\n }", "public function edit($id)\n {\n $prog = Program::find($id);\n return view('programs.update')\n ->with('prog', $prog);\n }", "public function edit() {\n\t\t$data['pagetitle'] = 'Dashboard - Edit Posts';\n\n\t\t$data['postid'] = $viewmodel->getPostById($postid['id'] );\n\t\tView::renderAdminTemplate($data, \"App/Views/admin/edit/index.php\") ;\n\t}", "public function editAction() {\n $model = new Application_Model_Compromisso();\n //busco no banco o quem eu quero editar\n $comp = $model->find($this->_getParam('id'));\n // renderiso uma view com os dados\n $this->view->assign(\"compromisso\", $comp);\n }", "public function edit() {\n $data['individual'] = $this->individual();\n $data['menus'] = $this->allmenus();\n $data['pages'] = $this->allpages();\n $this->load->view('Dashboard/header');\n $this->load->view('Menu/edit', $data);\n $this->load->view('Dashboard/footer');\n }", "public function edit($id) {\n\t\t//\n\t\tvar_dump ( \"edit--\" . $id );\n\t\treturn view ( 'app.web.flowscript' );\n\t}", "function doedit(){\r\n\t\tif(!isset($this->post['editsubmit'])){\r\n\t\t\t$did=isset($this->get[2])?$this->get[2]:'';\r\n\t\t\tif(!is_numeric($did)){\r\n\t\t\t\t$this->message($this->view->lang['docIdMustNum'],'BACK');\r\n\t\t\t}\r\n\t\t\t$focus=$this->db->fetch_by_field('focus','did',$did);\r\n\t\t\t$focus['time']=$this->date($focus['time']);\r\n\t\t\t$this->view->assign(\"focus\",$focus);\r\n\t\t\t$this->view->display(\"admin_focus_content\");\r\n\t\t}else{\r\n\t\t\t$did=isset($this->post['did'])?$this->post['did']:'';\r\n\t\t\tif(!is_numeric($did)){\r\n\t\t\t\t$this->message($this->view->lang['docIdMustNum'],'BACK');\r\n\t\t\t}\r\n\t\t\t$summary=_string::hiconv($this->post['summary']);\r\n\t\t\t$image=_string::hiconv($this->post['image']);\r\n\t\t\t$order=$this->post['displayorder'];\r\n\t\t\t$type=$this->post['doctype'];\r\n\t\t\tif(is_numeric($order)&&$_ENV['doc']->save_focus_content($did,$summary,$image,$order,$type)){\r\n\t\t\t\t$this->cache->removecache('data_'.$GLOBALS['theme'].'_index');\r\n\t\t\t\t$this->message($this->view->lang['docEditSuccess'],\"index.php?admin_focus-edit-$did\");\r\n\t\t\t}else{\r\n\t\t\t\t$this->message($this->view->lang['docEditFail'],'BACK');\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function editAction()\n {\n \n $id = $this->_request->getParam(\"id\");\n \n // Get object from form Request\n $request_info=array();\n // Get value from Request POST\n $body = $this->_request->getParam(\"desc\");\n // to send Id to database\n $request_info['id']=$id;\n $request_info['desc']=$body;\n // Get object from model Requests\n $request_model=new Application_Model_Requests();\n // Calling edit request function to edit data\n $request_model->editRequest($request_info);\n // redirect to list Request\n // $this->redirect(\"Requests/list\");\n\n\t \n \n \n \n }", "public function edit()\n {\n return view('commonmodule::edit');\n }" ]
[ "0.77361465", "0.7735269", "0.7657936", "0.76560456", "0.7548568", "0.7519377", "0.7501396", "0.738717", "0.7372835", "0.7372835", "0.7341182", "0.7268468", "0.7268117", "0.72655356", "0.72494566", "0.72494566", "0.72494566", "0.72395515", "0.72395515", "0.72395515", "0.7184409", "0.7181188", "0.7169778", "0.71686363", "0.71686363", "0.71686363", "0.71686363", "0.71686363", "0.71686363", "0.71686363", "0.71686363", "0.71686363", "0.71686363", "0.71686363", "0.71686363", "0.71647406", "0.7151268", "0.7120463", "0.7117531", "0.7114392", "0.70949274", "0.7079343", "0.7079343", "0.7079343", "0.7079343", "0.707782", "0.7065975", "0.7018701", "0.7000466", "0.6957617", "0.6919259", "0.68567896", "0.6856458", "0.6854252", "0.68430024", "0.684219", "0.6817185", "0.6817059", "0.68142384", "0.68106735", "0.6809633", "0.6806113", "0.6805719", "0.67839664", "0.67837954", "0.67806864", "0.67770416", "0.67357916", "0.67350036", "0.67335606", "0.67320365", "0.6730573", "0.6727042", "0.6723833", "0.6710872", "0.67035127", "0.66969097", "0.66937363", "0.6686021", "0.66752124", "0.6667921", "0.6662802", "0.6651984", "0.6632187", "0.66315866", "0.6630284", "0.6626206", "0.6624383", "0.6600421", "0.6600421", "0.6599426", "0.6592875", "0.6572837", "0.6570834", "0.65706915", "0.65646935", "0.6560609", "0.65583587", "0.6557178", "0.65562904", "0.6553209" ]
0.0
-1
/edit program Function for update data form
public function updateProgram(Request $request) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $this->validate($request,array( 'name' => 'required', 'details' => 'required', 'set1' => 'required', 'set3' => 'required', 'set2' => 'required', )); $id = $request->id; $program = Program::find($id); $program->title = $request->name; $program->description = $request->details; $program->category = $request->category; $program->set1 = $request->set1; $program->set2 = $request->set2; $program->set3 = $request->set3; if ($request->hasFile('image')) { $file = $request->file('image'); $filename = time().'.'.$file->getClientOriginalName(); /*$location = public_path('file/'.$filename); Storage::put($filename,file_get_contents($file));*/ $location = public_path('file/'.$filename); Storage::disk('file')->put($filename, file_get_contents($file)); //Storage::disk('public')->put($filename, file_get_contents($file)); $program->image = $filename; } $program->save(); Session::flash('success','Program Updated succcessfully.'); return redirect()->back()->with('workout',$program); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit()\n\t{\n\t\t//\n\t}", "public function edit() {\n\t\t\t\n\t\t}", "public function edit()\n\t{\n\t\t\n\t}", "public function edit( )\r\n {\r\n //\r\n }", "function doEdit()\n {\n global $_POST;\n$regs=explode(\":::\",$_POST[\"DROWS\"]);\n$id= $regs[0];\n if (strlen($id) <= 0)\n {\n echo \"Nao existe valores a serem editados\";\n echo \"<a href=./cadastra.php>Voltar</a> \";\n exit();\n }\n$result = lookup($id);\n\n presentInputForm(\n mysql_result($result, 0, \"id\"),\n mysql_result($result, 0, 1),\n mysql_result($result, 0, 2),\n mysql_result($result, 0, 3),\n mysql_result($result, 0, 4),\n mysql_result($result, 0, 5),\n mysql_result($result, 0, 6),\n mysql_result($result, 0, 7),\n mysql_result($result, 0, 8),\n mysql_result($result, 0, 9),\n mysql_result($result, 0, 10),\n mysql_result($result, 0, 11),\n\"E\");\n }", "public function update(){\n\t\t\t$matk = $_POST['matk'];\n\t\t\t$tentk = $_POST['tentk'];\n\t\t\t$pass = $_POST['pass'];\n\t\t\t$fullname = $_POST['fullname'];\n\n\t\t\t$post = array(\n\t\t\t\t'matk' => $matk,\n\t\t\t\t'tentk' => $tentk,\n\t\t\t\t'pass' => $pass,\n\t\t\t\t'fullname' => $fullname,\n\t\t\t);\n\n\t\t\trequire_once('model/model.php');\n\t\t\t$Model = new Model();\n\t\t\t$update = $Model -> updateData($post);\n\n\t\t\trequire_once('view/View.php');\n\t\t\t$View = new View();\n\t\t\t$View ->alertupdate($update);\n\t\t}", "public function modelDoEdit(){\n\t\t\t$maphongban = isset($_GET[\"maphongban\"])&&is_numeric($_GET[\"maphongban\"])?$_GET[\"maphongban\"]:0;\n\t\t\t$tenphongban = $_POST[\"tenphongban\"];\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//chuan bi truy van\n\t\t\t$query = $conn->prepare(\"update phongban set tenphongban=:ten where maphongban=:ma\");\n\t\t\t$query->execute(array(\"ten\"=>$tenphongban,\"ma\"=>$maphongban));\n\t\t}", "function editCondoHandler()\t{\t\n global $inputs;\n\n updateDb('condo',[\t\n 'name' => $inputs['name'],\t\n 'area' => $inputs['area'],\t\n 'cost' => $inputs['cost'],\t\n ], [\t\n 'id' => $inputs['id']\t\n ]);\n\n formatOutput(true, 'update success');\t\n}", "function edit_info()\n\t{\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Невозможно определить ID языка\");\n\t\t}\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'languages', 'where' => \"lid='\".$this->ipsclass->input['id'].\"'\" ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\tif ( ! $row = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Невозможно найти язык по введенному ID\");\n\t\t}\n\n\t\t$final['lname'] = stripslashes($_POST['lname']);\n\n\t\tif (isset($_POST['lname']))\n\t\t{\n\t\t\t$final['lauthor'] = stripslashes($_POST['lauthor']);\n\t\t\t$final['lemail'] = stripslashes($_POST['lemail']);\n\t\t}\n\n\t\t$this->ipsclass->DB->do_update( 'languages', $final, \"lid='\".$this->ipsclass->input['id'].\"'\" );\n\n\t\t$this->rebuild_cache();\n\n\t\t$this->ipsclass->admin->done_screen(\"Языковой модуль обновлен\", \"Управление языками\", \"{$this->ipsclass->form_code}\" );\n\n\t}", "function update(){\n\t\t\t\t$servername = \"localhost\";\n\t\t\t\t$username = \"root\";\n\t\t\t\t$password = \"\";\n\t\t\t\t$dbname = \"CS230\";\n\t\t\t\t//Variables for holding entity data\n\t\t\t\t$i = $_POST['i'];\n\t\t\t\t$cr = $_POST['creator'];\n\t\t\t\t$ti = $_POST['title'];\n\t\t\t\t$ty = $_POST['type'];\n\t\t\t\t$id = $_POST['identifier'];\n\t\t\t\t$da = $_POST['date'];\n\t\t\t\t$la = $_POST['language'];\n\t\t\t\t$de = $_POST['description'];\n\t\t\t\t$conn = mysqli_connect($servername, $username, $password, $dbname);\n\t\t\t\t\tif($conn){\n\t\t\t\t\t//echo \"Connection OK\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tdie(\"The Connection has failed: \" .mysqli_connect_error());\n\t\t\t\t\t}\n\t\t\t\t$sql = \"UPDATE eBook_MetaData SET creator='$cr', title='$ti', type='$ty', identifier='$id', date='$da', language='$la', description='$de' WHERE id='$i'\";\n\t\t\t\t\t$data = mysqli_query($conn, $sql);\n\n\t\t\t\t\tif(!$data){\n\t\t\t\t\t\techo \"error\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo \"data updated\";\n\t\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$conn = null;\n\t\t\t\t}", "function editBuildingHandler() {\n global $inputs;\n\n $res = updateDb('building', [\n 'building_name' => $inputs['name'], \n 'address' => $inputs['address'],\n 'description' => $inputs['desc'],\n 'area' => $inputs['area']],\n ['id' => $inputs['id']]);\n\n formatOutput(true, 'update success', $res);\n}", "public function Edit()\n\t{\n\t\t\n\t}", "function EditDataPromosi()\n\t{\n\t\tinclude '../../koneksi/koneksi.php';\n\n\t\t//inisialisasi\n\t\t$id_promosi = $_POST['id_promosi'];\n\t\t$status = $_POST['status'];\n\t\t\n\t\t//update ke tabel promosi\n\t\t$sql = \"UPDATE promosi SET status = ?, id_pegawai = ? WHERE id_promosi = ?\";\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->bind_param('sii', $status, $id_pegawai, $id_promosi);\n\t\tif($stmt->execute()){\n\t\t\t$_SESSION['status_operasi_promosi'] = \"berhasil_memperbaharui\";\n\t\t}else{\n\t\t\t$_SESSION['status_operasi_promosi'] = \"gagal_memperbaharui\";\n\t\t}\n\t\t$stmt->close();\n\t}", "function updateField() {\n DATABASE::INIT_TABLE($this->database, $this->table);\n $fname = $this->urlParam('fname');\n $fvalue = $this->urlParam('fvalue');\n $id = $this->urlParam('id');\n DATABASE::UPDATE($this->table, [$fname], [$fvalue], $id);\n }", "function editCondoHandler1() {\n global $inputs;\n\n updateDb('condo',[\n 'name' => $inputs['name'],\n 'area' => $inputs['area'],\n 'cost' => $inputs['cost'],\n ], [\n 'id' => $inputs['id']\n ]);\n\n updateDb('condo_building',[\n 'building_id' => $inputs['building_id']\n ], [\n 'condo_id' => $inputs['id']\n ]);\n\n formatOutput(true, 'update success');\n}", "public function update()\n {\n\n $id = null;\n $velo_id = null;\n $description = null;\n $image = null;\n\n if (!empty($_POST['id']) && ctype_digit($_POST['id'])) {\n $id = $_POST['id'];\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n if (!empty($_POST['image']) && $_POST['image'] != \"\") {\n $image = htmlspecialchars($_POST['image']);\n }\n\n if (!empty($_POST['description'])) {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!$id || !$image || !$description) {\n die(\"formulaire mal rempli $id, $image, $description\");\n }\n\n $voyage_to_edit = $this->model->find($id, $this->modelName);\n\n if (!$voyage_to_edit) {\n die(\"Does Not Exist\");\n }\n\n $this->model->edit($id, $description, $image);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "function pa_edit() {\n\t\t\t\t$edit_pid = (int)UTIL::get_post('edit_pid');\n\t\t\t\t\n\t\t\t\t//-- haben wir keine edit-id, gibts eine seiten-tabelle zur auswahl\n\t\t\t\tif (!$edit_pid) {\n\t\t\t\t\techo 'error: no pid';\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$form = MC::create('form');\n\t\t\t\t$form->init('page', 'mod_page');\n\t\t\t\t$form->add_hidden('edit_pid', $edit_pid);\n\t\t\t\t\n\t\t\t\t// hatten wir fehler\n\t\t\t\tif ($this->get_var('error')) {\n\t\t\t\t\t$form->set_values($this->get_var('data'));\n\t\t\t\t\t$form->set_error_fields($this->get_var('error'));\n\t\t\t\t}\t\n\t\t\t\telse {\n\t\t\t\t\t// frisch aus db lesen\n\t\t\t\t\t$sql = 'SELECT * FROM '.$this->mod_tbl.' WHERE id='.$edit_pid;\n\t\t\t\t\t$res = $this->DB->query($sql);\n\t\t\t\t\t$data = $res->r();\n\t\t\t\t\t$form->set_values($data);\n\t\t\t\t}\n\n\t\t\t\t$this->set_var('path', $this->_get_path_print($edit_pid));\n\t\t\t\t$this->set_var('form', $form);\n\t\t\t\t\n\t\t\t\t$this->OPC->generate_view($this->tpl_dir.'pa_edit.php');\n\n\t\t\t}", "public function edit()\n {\n \n }", "private function update_form()\n\t{\n\t\t$this->title = sprintf(lang('update_title'), $this->installed_version, $this->version);\n\t\t$vars['action'] = $this->set_qstr('do_update');\n\t\t$this->set_output('update_form', $vars);\n\t}", "function Avi_Update(){\n\t\t\n\t\t\n\t\t//when click on button\n\t\tif(isset($_POST['avibtnupdate'])){\n\t\t\t\n\t\t\t//move id into variable\n\t\t\t$get_id = $_GET['Edit'];\n\t\t\t\n\t\t\t//values for table \n\t\t\t$values = \"monday='\".$_POST['monstart'].\" - \".$_POST['monend'].\"',tuesday='\".$_POST['tustart'].\" - \".$_POST['tuend'].\"',wednesday='\".$_POST['wedstart'].\" - \".$_POST['wedend'].\"',thursday='\".$_POST['thustart'].\" - \".$_POST['thuend'].\"',friday='\".$_POST['fristart'].\" - \".$_POST['friend'].\"',saturday='\".$_POST['satstart'].\" - \".$_POST['satend'].\"',sunday='\".$_POST['sunstart'].\" - \".$_POST['sunend'].\"',user_id='\".$_POST['doctor'].\"',date=NOW()\";\n\t\t\t\n\t\t\t//Update From Avialibalility table\n\t\t\t$this->Update('availability',$values,\" where id='$get_id' \",'Availability?List&m');\n\t\t\t\n\t\t\t\n\t\n\t\t} // ifisset close\n\t\t\n\t}", "public function editForm(): void\n {\n $this->articleId = $_GET['id'];\n $query = $this->articleModel->displayOneArticle($this->articleId);\n $editArticle = $query->fetch();\n\n $this->title = $editArticle['title'];\n $this->content = $editArticle['content'];\n $this->category = $editArticle['category'];\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "function Update() {\n\t\t$updateHotel \t\t= $this->hotelObj->DoUpdateHotel($_POST['hotelId'], $_POST['hotelNama'], $_POST['kotaKode'], $_POST['hotelAlamat'], $_POST['hotelPhone'], $_POST['hotelHarga'], $_POST['hotelFasilitas'], $_POST['hotelKeterangan']);\n\t\t$deleteRelClient \t= $this->hotelObj->DoDeleteRelClient($_POST['hotelId']);\n\n\t\t$processData = $updateHotel && $deleteRelClient;\n\t\tif (!empty($_POST['clientId'])) {\n\t\t\tforeach ($_POST['clientId'] as $contact) {\n\t\t\t\t$addRelClient = $this->hotelObj->DoAddRelClient($_POST['hotelId'], $contact);\n\t\t\t}\n\t\t\t$processData = $processData && $addRelClient;\n\t\t}\n\n\t\tif ($processData == true) {\n $this->SendAlert('Pengubahan data Berhasil Dilakukan', 'Hotel', $this->cssDone);\n\t\t\treturn $this->PageView;\n\t\t\t//echo \"berhasil\"; exit;\n\t\t} else {\n $this->SendAlert('Gagal Mengubah Data', 'InputHotel', $this->cssFail);\n\t\t\treturn $this->PageInput;\n\t\t\t//echo \"gagal\"; exit;\n\t\t}\n\t}", "function updateData(){\n //get values from form\n $bookid = textboxValue(\"book_id\");\n $bookname = textboxValue(\"book_name\");\n $bookpublisher = textboxValue(\"book_publisher\");\n $bookprice = textboxValue(\"book_price\");\n //echo($bookid.'|'.$bookname.'|'.$bookpublisher.'|'.$bookprice);\n // if fields not empty then create query and update DATABASE\n if($bookid && $bookname && $bookpublisher && $bookprice){\n $sql = \"\n UPDATE books SET book_name='$bookname',book_publisher='$bookpublisher',book_price='$bookprice' WHERE id='$bookid';\n \";\n if(mysqli_query($GLOBALS['con'],$sql)){\n TextNode(\"success\",\"Data successfully updated.\");\n } else {\n TextNode(\"error\",\"An error occurred updating data.\");\n }\n }else {\n TextNode(\"error\",\"You cannot have empty fields.\");\n }\n}", "function AfterEdit(&$values,$where,&$oldvalues,&$keys,$inline,&$pageObject)\n{\n\n\t\tglobal $conn;\n$proid= $keys['proid'];\n$date=$values['bill_date'];\n$amount=$values['amount'];\n$item=$values['item'];\n$bill_no=$values['bill_no'];\n\n\n$sql_update=\"UPDATE student_billing SET \nitem='$item',amount='$amount',amount_balance='$amount',\ndate='$date',\nbill_no='$bill_no'\nWHERE proid='$proid'\";\ndb_exec($sql_update,$conn);\n\n;\t\t\n}", "function _edit_update() {\n\t\t$tpaket = $_POST;\n\t\tunset($tpaket['tpaket_header']['id_tpaket_header']);\n\t\tunset($tpaket['button']);\n\t\t// end of assign variables and delete not used variables\n\n\t\t$count = count($tpaket['tpaket_detail']['id_tpaket_h_detail']) - 1;\n\n\t\t// check, at least one product quantity entered\n\t\t$quantity_exist = FALSE;\n\n\t\tfor($i = 1; $i <= $count; $i++) {\n\t\t\tif(empty($tpaket['tpaket_detail']['quantity'][$i])) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$quantity_exist = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif($quantity_exist == FALSE)\n\t\t\tredirect('tpaket/edit_error/Anda belum memasukkan data detail. Mohon ulangi');\n\n \tif(isset($_POST['button']['save']) || isset($_POST['button']['approve'])) {\n\n\t\t\t$this->db->trans_start();\n\n \t\t\t$this->session->set_userdata('tpaket_detail', $tpaket['tpaket_detail']);\n\n $id_tpaket_header = $this->uri->segment(3);\n $postingdate = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);\n\n \t\t\t$data = array (\n \t\t\t\t'id_tpaket_header' => $id_tpaket_header,\n \t\t\t\t'posting_date' => $postingdate,\n \t\t\t);\n\t\t\t\t/*$sirah= $id_tpaket_header;\n\t\t\t\t$ti=\"SELECT * FROM t_tpaket_detail_paket WHERE id_tpaket_header='$sirah'\";\n\t\t\t\t$tq=mysql_query($ta);\n\t\t\t\t$count1=mysql_num_rows($tq);*/\n \t\n\t\t\t $this->m_tpaket->tpaket_header_update($data);\n $edit_tpaket_header = $this->m_tpaket->tpaket_header_select($id_tpaket_header);\n\n \t\t\tif ($this->m_tpaket->tpaket_header_update($data)) {\n $input_detail_success = FALSE;\n \t\t\t if($this->m_tpaket->tpaket_details_delete($id_tpaket_header) && $this->m_tpaket->batch_delete($id_tpaket_header) ) {\n \t//\tfor($i = 1; $i <= $count; $i++) {\n \t\t\t\t\tif((!empty($tpaket['tpaket_detail']['quantity'][$i]))&&(!empty($tpaket['tpaket_detail']['material_no'][$i]))) {\n\n \t\t\t\t\t\t/*$tpaket_detail['id_tpaket_header'] = $id_tpaket_header;\n \t\t\t\t\t\t$tpaket_detail['quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n \t\t\t\t\t\t$tpaket_detail['id_tpaket_h_detail'] = $tpaket['tpaket_detail']['id_tpaket_h_detail'][$i];\n\n \t\t\t\t\t\t$tpaket_detail['material_no'] = $tpaket['tpaket_detail']['material_no'][$i];\n \t\t\t\t\t\t$tpaket_detail['material_desc'] = $tpaket['tpaket_detail']['material_desc'][$i];\n \t\t\t\t\t\t$tpaket_detail['uom'] = $tpaket['tpaket_detail']['uom'][$i];*/\n\n $tpaket_to_approve['item'][$i] = $tpaket_detail['id_tpaket_h_detail'];\n $tpaket_to_approve['material_no'][$i] = $tpaket_detail['material_no'];\n $tpaket_to_approve['quantity'][$i] = $tpaket_detail['quantity'];\n $tpaket_to_approve['uom'][$i] = $tpaket_detail['uom'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t//\n\t\t\t\t\t\t$tpaket_detail['id_tpaket_header'] = $id_tpaket_header;\n\t\t\t\t\t\t$batch['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t$tpaket_detail['quantity'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$tpaket_detail['qty'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$batch['Quantity'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$tpaket_detail['id_tpaket_h_detail'] = 1;\n\t\t\t\t\t\t$batch['BaseLinNum'] = 1;\n \t\t\t\t\t\t$tpaket_detail['material_no'] = $tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$batch['ItemCode'] = $tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$item=$tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$date=date('ymd');\n\t\t\t\t\t\t$whs=$this->session->userdata['ADMIN']['plant'];\n\t\t\t\t\t\t$q=\"SELECT * FROM m_batch WHERE ItemCode = '$item' AND Whs ='$whs'\";\n\t\t\t\t\t\t$cek=\"SELECT BATCH,MAKTX FROM m_item WHERE MATNR = '$item'\";\n\t\t\t\t\t\t$cek1=mysql_query($cek);\n\t\t\t\t\t\t$ra=mysql_fetch_array($cek1);\n\t\t\t\t\t\t$b=$ra['BATCH'];\n\t\t\t\t\t\t$tq=mysql_query($q);\n\t\t\t\t\t\t$count1=mysql_num_rows($tq) + 1;\n\t\t\t\t\t\tif ($count1 > 9 && $count1 < 100)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dg=\"0\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dg=\"00\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$num=$item.$date.$dg.$count1;\n\t\t\t\t\t\tif ($count1 < 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$batch['BatchNum'] = $num;\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$batch['BaseType'] = 4;\n\t\t\t\t\t\t$tpaket_detail['num'] = $num;\n\t\t\t\t\t\t$batch['Createdate'] = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);\n \t\t\t\t\t\t$tpaket_detail['material_desc'] = $ra['MAKTX'];\n \t\t\t\t\t\t$tpaket_detail['uom'] = $tpaket['tpaket_detail']['uom'][1];\n\t\t\t\t\t\tif ($b=='Y')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$batch_in=$this->m_tpaket->batch_insert($batch);\n\t\t\t\t\t\t\tif ($count1 < 2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmysql_query(\"INSERT INTO m_batch () VALUES ('$item','$num','$batch[Quantity]','$whs')\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t/*\t$batch['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t$batch['Quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n\t\t\t\t\t\t$batch['BaseLinNum'] = $tpaket['tpaket_detail']['id_tpaket_h_detail'][$i];\n \t\t\t\t\t\t$batch['ItemCode'] = $tpaket['tpaket_detail']['material_no'][$i];\n\t\t\t\t\t\t$batch['BatchNum'] = $tpaket['tpaket_detail']['num'][$i];\n\t\t\t\t\t\t$batch['BaseType'] = 4;\n\t\t\t\t\t\t$batch['Createdate'] = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);*/\n\n if($id_tpaket_detail = $this->m_tpaket->tpaket_detail_insert($tpaket_detail)) {\n /* if($item_pakets = $this->m_mpaket->mpaket_details_select_by_item_paket($tpaket_detail['material_no'])) {\n if($item_pakets !== FALSE) {\n \t\t$k = 1;\n unset($item_paket);\n \t\tforeach ($item_pakets->result_array() as $object['temp']) {\n \t\t\tforeach($object['temp'] as $key => $value) {\n \t\t\t\t$item_paket[$key][$k] = $value;\n \t\t\t}\n \t\t\t$k++;\n \t\t\tunset($object['temp']);\n \t\t}\n \t }*/\n\t\t\t\t\t\t\t\t\t// echo \"$batch[BaseEntry],$batch[Quantity],$batch[BaseLinNum],$batch[ItemCode],$batch[BatchNum],$b <br>\";\n\t\t\t\t\t//\techo $tpaket_detail['id_tpaket_header'].\",\".$tpaket_detail['quantity'].\",\".$tpaket_detail['material_no'].\",\".$tpaket_detail['num'];\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t// $c_item_paket = count($item_paket['id_mpaket_h_detail']);\n \t\t\tfor($i = 1; $i <= $count; $i++) {\n $tpaket_detail_paket['id_tpaket_h_detail_paket'] = $i;\n\t\t\t\t\t\t\t $batch1['BaseLinNum'] =$i;\n $tpaket_detail_paket['id_tpaket_detail'] = $id_tpaket_detail;\n $tpaket_detail_paket['id_tpaket_header'] = $id_tpaket_header;\n\t\t\t\t\t\t\t $batch1['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t\t $batch1['BaseType'] = 4;\n\t\t\t\t\t\t\t $batch1['ItemCode'] = $tpaket['tpaket_detail']['material_detail'][$i];\n\t\t\t\t\t\t\t $qq=\"SELECT * FROM m_batch WHERE ItemCode = '$batch1[ItemCode]' AND Whs ='$whs'\";\n\t\t\t\t\t\t\t $cekQQ=mysql_query($qq);\n\t\t\t\t\t\t\t $rQ=mysql_num_rows($cekQQ);\n\t\t\t\t\t\t\t $num_detail=$tpaket['tpaket_detail']['num'][$i];\n\t\t\t\t\t\t\t $date=date('ymd');\n\t\t\t\t\t\t\t $cekq=\"SELECT BATCH,MAKTX FROM m_item WHERE MATNR = '$batch1[ItemCode]'\";\n\t\t\t\t\t\t\t $cekr=mysql_query($cekq);\n\t\t\t\t\t\t\t $rai=mysql_fetch_array($cekr);\n\t\t\t\t\t\t\t $tpaket_detail_paket['material_desc'] = $rai['MAKTX'];\n\t\t\t\t\t\t\t $bet=$ra['MAKTX'];\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $batch1['Createdate'] =$batch['Createdate'] ;\n $tpaket_detail_paket['material_no_paket'] = $tpaket_detail['material_no'];\n $tpaket_detail_paket['material_no'] = $tpaket['tpaket_detail']['material_detail'][$i];\n\t\t\t\t\t\t\t $tpaket_detail_paket['material_desc'] = $item_paket['material_desc'][$i];\n $tpaket_detail_paket['quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n\t\t\t\t\t\t\t $batch1['Quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n $tpaket_detail_paket['uom'] = $tpaket['tpaket_detail']['detail_uom'][$i];\n\t\t\t\t\t\t\t $tpaket_detail_paket['num'] = $num_detail;\n\t\t\t\t\t\t\t $tpaket_detail_paket['quantity_total'] = $tpaket['tpaket_detail']['quantity'][$i] * $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t\t if ($num_detail != \"\" && $bet == 'Y')\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t $batch1['BatchNum'] = $num_detail;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \t\t$count1=$rQ + 1;\n\t\t\t\t\t\t\t\t\t\tif ($count1 > 9 && $count1 < 100)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$dg=\"0\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$dg=\"00\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$num=$batch1['ItemCode'].$date.$dg.$count1;\n\t\t\t\t\t\t\t\t\t\t\t$batch1['BatchNum'] = $num;\n\t\t\t\t\t\t\t\t\t\t\tmysql_query(\"INSERT INTO m_batch () VALUES ('$batch1[ItemCode]','$batch1[BatchNum]','$batch1[Quantity]','$whs')\");\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// echo \"$batch1[BaseEntry],$batch1[Quantity],$batch1[BaseLinNum],$batch1[ItemCode],$batch1[BatchNum],$b <br>\";\n\t\t\t\t\t\t\t if ($batch1['Quantity'] != \"\" && $bet=='Y')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->m_tpaket->batch_insert($batch1);\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 if($this->m_tpaket->tpaket_detail_paket_insert($tpaket_detail_paket)) {\n $input_detail_success = TRUE;\n \t\t\t\t\t } else {\n $input_detail_success = FALSE; } } }\n \n \t else {\n $input_detail_success = FALSE;\n\t\t\t\t\t\t\t\t //echo \"aaaaaaaaaaaaaaaaa\";\n \t}\n// \t\t\t\t\t\tif($this->m_tpaket->tpaket_detail_insert($tpaket_detail))\n// $input_detail_success = TRUE;\n \t\t\t\t\t}\n\n \t \t//}\n }\n }\n\n\t\t\tif (($input_detail_success == TRUE) && (isset($_POST['button']['approve']))) {\n $internal_order = $this->m_tpaket->tpaket_internal_order_select();\n $tpaket_to_approve['plant'] = $edit_tpaket_header['plant'];\n $tpaket_to_approve['internal_order'] = $internal_order['internal_order'];\n $tpaket_to_approve['storage_location'] = $this->session->userdata['ADMIN']['storage_location'];\n $tpaket_to_approve['posting_date'] = date('Ymd',strtotime($edit_tpaket_header['posting_date']));\n $tpaket_to_approve['id_tpaket_header'] = $id_tpaket_header;\n $tpaket_to_approve['plant'] = $edit_tpaket_header['plant'];\n $tpaket_to_approve['id_tpaket_plant'] = $edit_tpaket_header['id_tpaket_plant'];\n $tpaket_to_approve['id_user_input'] = $this->session->userdata['ADMIN']['admin_id'];\n $tpaket_to_approve['web_trans_id'] = $this->l_general->_get_web_trans_id($edit_tpaket_header['plant'],$edit_tpaket_header['posting_date'],\n $edit_tpaket_header['id_tpaket_plant'],'17');\n\t\t\t/* $approved_data = $this->m_tpaket->sap_tpaket_header_approve($tpaket_to_approve);\n \t\t\tif((!empty($approved_data['material_document'])) && ($approved_data['material_document'] !== '') &&\n (!empty($approved_data['material_document_out'])) && ($approved_data['material_document_out'] !== '')) {\n \t\t\t $tpaket_no = $approved_data['material_document'];\n \t\t\t $tpaket_no_out = $approved_data['material_document_out'];*/\n \t\t\t\t$data = array (\n \t\t\t\t\t'id_tpaket_header'\t=>$id_tpaket_header,\n \t\t\t\t\t'material_doc_no'\t=>\t$tpaket_no,\n \t\t\t\t\t'material_doc_no_out'\t=>\t$tpaket_no_out,\n \t\t\t\t\t'status'\t=>\t'2',\n \t\t\t\t\t'id_user_approved'\t=>\t$this->session->userdata['ADMIN']['admin_id'],\n \t\t\t\t);\n \t\t\t\t$tpaket_header_update_status = $this->m_tpaket->tpaket_header_update($data);\n \t\t\t\t $approve_data_success = TRUE;\n\t\t\t\t/*} else {\n\t\t\t\t $approve_data_success = FALSE;\n\t\t\t\t}*/\n }\n\n \t\t\t$this->db->trans_complete();\n if(isset($_POST['button']['save'])) {\n if ($input_detail_success == TRUE) {\n \t\t\t $this->l_general->success_page('Data Transaksi Paket berhasil diubah', site_url('tpaket/browse'));\n } else {\n \t\t\t $this->jagmodule['error_code'] = '006'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Transaksi Paket tidak berhasil diubah', site_url($this->session->userdata['PAGE']['next']));\n }\n } else if(isset($_POST['button']['approve']))\n if($approve_data_success == TRUE) {\n \t\t\t $this->l_general->success_page('Data Transaksi Paket berhasil diapprove', site_url('tpaket/browse'));\n } else {\n \t\t $this->jagmodule['error_code'] = '007'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Transaksi Paket tidak berhasil diapprove.<br>\n Pesan Kesalahan dari sistem SAP : '.$approved_data['sap_messages'], site_url($this->session->userdata['PAGE']['next']));\n }\n\n\t\t}\n\t}", "function Specialities_Update(){\n\t\t\n\t\t//when click on button\n\t\tif(isset($_POST['updatesp'])){\n\t\t\t\n\t\t\t\t// get id move to variable\n\t\t\t$get_id = $_GET['Edit'];\n\t\t\t\n\t\t\t//values for Specialities table\n\t\t\t$values = \"specialitie_name='\".$_POST['sp'].\"'\";\n\t\t\t\n\t\t // update Specialities from table\n\t\t $this->Update('specialities',$values,\"where id='$get_id'\",'Specialities?m');\n\t\t} // ifisset close\n\t}", "protected function editar()\n {\n }", "public function edit($data=array()) {\n foreach ($data as $campo=>$valor) {\n $$campo = $valor;\n }\n \n $this->parametros = array($banc_codigo,$banc_nombre);\n $this->sp = \"str_consultaBanco_upd\";\n $this->executeSPAccion();\n if($this->filasAfectadas>0){\n $this->mensaje=\"Banco modificado exitosamente\";\n }else{\n $this->mensaje=\"No se ha actualizado el banco\";\n }\n }", "protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }", "public function edit()\n {\n \n \n }", "public function edit() {\n }", "function update()\n{\n $data = $_POST;\n $data['id'] = $_GET['id'];\n // We willen de button niet in de db hebben\n unset($data['Opslaan']);\n $succes = changeDB('UPDATE projecten set `name`=:name,`description` = :description,`date`=:date,`price`= :price WHERE id = :id',$data);\n if ($succes) {\n return index(\"update gelukt\");\n }\n return index(\"update gefaald\");\n\n}", "function absenrich_update(){\r\n\t\t//POST variable here\r\n\t\t$gudang_id=trim(@$_POST[\"gudang_id\"]);\r\n\t\t$gudang_nama=trim(@$_POST[\"gudang_nama\"]);\r\n\t\t$gudang_nama=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_nama);\r\n\t\t$gudang_nama=str_replace(\"'\", '\"',$gudang_nama);\r\n\t\t$gudang_lokasi=trim(@$_POST[\"gudang_lokasi\"]);\r\n\t\t$gudang_lokasi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_lokasi);\r\n\t\t$gudang_lokasi=str_replace(\"'\", '\"',$gudang_lokasi);\r\n\t\t$gudang_keterangan=trim(@$_POST[\"gudang_keterangan\"]);\r\n\t\t$gudang_keterangan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_keterangan);\r\n\t\t$gudang_keterangan=str_replace(\"'\", '\"',$gudang_keterangan);\r\n\t\t$gudang_aktif=trim(@$_POST[\"gudang_aktif\"]);\r\n\t\t$gudang_aktif=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_aktif);\r\n\t\t$gudang_aktif=str_replace(\"'\", '\"',$gudang_aktif);\r\n\t\t$gudang_creator=trim(@$_POST[\"gudang_creator\"]);\r\n\t\t$gudang_creator=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_creator);\r\n\t\t$gudang_creator=str_replace(\"'\", '\"',$gudang_creator);\r\n\t\t$gudang_date_create=trim(@$_POST[\"gudang_date_create\"]);\r\n\t\t$absenrich_updater=trim(@$_POST[\"absenrich_updater\"]);\r\n\t\t$absenrich_updater=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$absenrich_updater);\r\n\t\t$absenrich_updater=str_replace(\"'\", '\"',$absenrich_updater);\r\n\t\t$gudang_date_update=trim(@$_POST[\"gudang_date_update\"]);\r\n\t\t$gudang_revised=trim(@$_POST[\"gudang_revised\"]);\r\n\t\t$result = $this->m_absensi_enrichment->absenrich_update($gudang_id ,$gudang_nama ,$gudang_lokasi ,$gudang_keterangan ,$gudang_aktif ,$gudang_creator ,$gudang_date_create ,$absenrich_updater ,$gudang_date_update ,$gudang_revised );\r\n\t\techo $result;\r\n\t}", "public function add_edit_form(){\n\n $_id = $_GET['id']; \n $tblName = $this->get_tbl_name();\n\n $source = DB::table($tblName)->where('id',$_id)->get();\n\n $source_first = $source[0];\n\n // mhtml::dump($source_first);\n\n\n $struct = $this->struct;\n\n mhtml::startForm(\"edit\",\"backend_edit.php\");\n\n // loop througth fields\n foreach ($this->edit as $key => $field) {\n\n $kind = $struct[$field] ;\n if($kind == 'string') {$kind = 'text' ;} \n $value = $source_first[$field];\n\n mhtml::field($this->virtual_names[$field],$field,$kind,$value);\n\n }\n\n // add secret field for password\n if(isset($this->edit_secret)){\n if($this->edit_secret == true ){\n\n Logger::warn(\"we use one secret only on secret[0] in secret array in model\");\n $virtual_pass = $this->virtual_names[$this->secret[0]];\n mhtml::field($virtual_pass,$this->secret[0],'password');\n\n }\n }\n\n \n\n\n\n\n // mhtml::field('user name ','user_name','text',\"mohammed\");\n // mhtml::field('passwording','password','password');\n // mhtml::field('age','age','number');\n\n mhtml::field_id_model();\n\n mhtml::submitForm();\n\n mhtml::endForm();\n\n }", "public function actionUpdate() {}", "public function actionUpdate() {}", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function editAction() {\n# process the edit form.\n# check the post data and filter it.\n\t\tif(isset($_POST['cancel'])) {\n\t\t\tAPI::Redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t$input_check = $this->_model->check_input($_POST);\n\t\tif(is_array($input_check)) {\n\t\t\tAPI::Error($input_check);\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t// all hooks will stack their errors onto the API::Error stack\n\t\t// but WILL NOT redirect.\n\t\tAPI::callHooks(self::$module, 'validate', 'controller', $_POST);\n\t\tif(API::hasErrors()) {\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\n\t\t$this->_model->set_data($_POST);\n\n\t\t// auto call the hooks for this module/action\n\t\tAPI::callHooks(self::$module, 'save', 'controller');\n\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\n\n\t}", "function action_update()\n {\n $record = $this->m_node->updateRecord();\n\n if ($this->m_postvars['atkcancel']==\"\")\n { \n\n // just before we validate the record we call the preUpdate() to check if the record needs to be modified\n $this->m_node->preUpdate($record);\n\n $this->m_node->validate($record, \"update\");\n\n $error = count($record['atkerror']) > 0;\n foreach (array_keys($record) as $key)\n $error = $error || (is_array($record[$key]) && count($record[$key]['atkerror']) > 0);\n\n if ($error)\n {\n $this->m_node->m_action=\"edit\";\n $page = &$this->getPage();\n $edithandler = $this->m_node->getHandler(\"edit\");\n $page->addContent($edithandler->invoke(\"editPage\", $record));\n }\n else\n {\n if(!$this->m_node->updateDb($record))\n {\n $this->m_node->m_db->rollback();\n if($this->m_node->m_db->getErrorType()==\"user\")\n {\n triggerError($record, 'Error', $this->m_node->m_db->getErrorMsg(), '', '');\n $this->m_node->m_action=\"edit\";\n $page = &$this->getPage();\n $edithandler = $this->m_node->getHandler(\"edit\");\n $page->addContent($edithandler->invoke(\"editPage\", $record));\n }\n else\n {\n $location = $this->m_node->feedbackUrl(\"update\",ACTION_FAILED, $record, $this->m_node->m_db->getErrorMsg());\n $this->m_node->redirect($location);\n }\n }\n else\n {\n $this->m_node->m_db->commit(); \n \n if ($this->m_postvars['atknoclose']==\"\")\n {\n // 'save and close' was clicked\n $location = $this->m_node->feedbackUrl(\"update\", ACTION_SUCCESS, $record, \"\");\n $this->m_node->redirect($location);\n }\n else\n {\n // 'save' was clicked\n $page = &$this->getPage();\n // $this->m_action=\"edit\";\n //update succesful, pk value might be changed so update m_orgkey\n $record[\"atkprimkey\"] = $this->m_node->primaryKey($record);\n \n if ($this->m_node->hasFlag(NF_LOCK))\n { \n $locked = true;\n }\n \n //$this->setOrgKeyValue($record);\n $this->m_node->m_action = \"edit\"; \n $edithandler = $this->m_node->getHandler(\"edit\");\n $editpage = $edithandler->invoke(\"editPage\", $record, $locked);\n $screen = $this->m_node->renderActionPage(\"edit\", $editpage);\n $page->addContent($screen);\n }\n\n }\n }\n }\n else\n {\n // Cancel was pressed\n $location = $this->m_node->feedbackUrl(\"update\", ACTION_CANCELLED, $record);\n $this->m_node->redirect($location);\n }\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 edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "abstract public function updateData();", "public function Do_update_Example1(){\n\n\t}", "public function editUser()\n {\n\n $this->displayAllEmployees();\n $new_data = [];\n $id = readline(\"Unesite broj ispred zaposlenika čije podatke želite izmjeniti: \");\n\n $this->displayOneEmployees( $id);\n\n foreach ( $this->employeeStorage->getEmployeeScheme() as $key => $singleUser) { //input is same as addUser method\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key);\n\n while (!$validate)\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, '.', '');\n }\n\n $new_data[$key] = $userInput;\n\n }\n $this->employeeStorage->updateEmployee($id, $new_data); //sends both id and data to updateEmployee so the chosen employee can be updated with new data\n\n echo \"\\033[32m\". \"## Izmjene za \". $new_data['name'].\" \". $new_data['lastname'].\" su upisane! \\n\\n\".\"\\033[0m\";\n\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function editdata(){\n\t\t$id_soal_tpa = $this->input->post('id_soal_tpa');\n\t\t$soal = $this->input->post('soal');\n\t\t$opsi_a = $this->input->post('opsi_a');\n\t\t$opsi_b = $this->input->post('opsi_b');\n\t\t$opsi_c = $this->input->post('opsi_c');\n\t\t$opsi_d = $this->input->post('opsi_d');\n\t\t$opsi_e = $this->input->post('opsi_e');\n\t\t$jawaban = $this->input->post('jawaban');\n\n\t\t$data = array(\n\t\t\t'soal' => $soal,\n\t\t\t'opsi_a' => $opsi_a,\n\t\t\t'opsi_b' => $opsi_b,\n\t\t\t'opsi_c' => $opsi_c,\n\t\t\t'opsi_d' => $opsi_d,\n\t\t\t'opsi_e' => $opsi_e,\n\t\t\t'jawaban' => $jawaban\n\t\t);\n\n\t\t$where = array(\n\t\t\t'id_soal_tpa' => $id_soal_tpa\n\t\t);\n\n\t\t$this->Mdl_soal->update_data($where,$data,'tb_soal_tpa');\n\t\t$this->session->set_flashdata('msg_update','Data Berhasil Diedit');\n\t\tredirect('Soal/Soal_tpa/');\n\t}", "function editApprentice() {\n\t\t\t\t\tif ($_POST['updateDelete'] == 'update') {\n\t\t\t\t\t\t\n\t\t\t\t\t\t/* params(0) represents the apprentice name passed via the URL */\n\t\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\t\n\t\t\t\t\t\t$apprentice->update_attributes(array('name'\t\t\t => $_POST['inputName'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'cohort'\t\t => $_POST['inputCohort'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'address'\t\t => $_POST['inputAddress'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'city'\t\t\t => $_POST['inputCity'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'telephone'\t => $_POST['inputTelephone'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'school'\t\t => $_POST['inputSchool'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'graduation'\t => $_POST['inputGraduation'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'workexperience' => $_POST['inputWorkExperience'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'visa'\t\t\t => $_POST['inputVisa'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'veteran'\t\t => $_POST['inputVeteran'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'unix_linux'\t => $_POST['inputUnixLinux'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'sql'\t\t\t => $_POST['inputSql'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'git'\t\t\t => $_POST['inputGit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'wordpress'\t => $_POST['inputWordpress'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'drupal'\t\t => $_POST['inputDrupal'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'python'\t\t => $_POST['inputPython'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'svn'\t\t\t => $_POST['inputSVN'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'objective_c'\t => $_POST['inputObjectiveC'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'ruby_rails'\t => $_POST['inputRuby'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'c_plusplus'\t => $_POST['inputCPlusPlus'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'dot_net'\t\t => $_POST['inputNet'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'php'\t\t\t => $_POST['inputPHP'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'html_css'\t\t => $_POST['inputHtmlCss'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'java'\t\t\t => $_POST['inputJava'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'javascript'\t => $_POST['inputJavascript'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'comments'\t\t => $_POST['inputComments'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'email'\t\t => $_POST['inputEmail'])\n\t\t\t\t\t\t);\n\t\t\t\t\t} else if ($_POST['updateDelete'] == 'delete') {\n\t\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\t$apprentice->delete();\n\t\t\t\t\t}\n\n\t\t\t\t\t$success = new h2o('views/happySuccess.html');\n\t\t\t\t\techo $success->render();\n\t\t\t\t}", "function a_edit() {\n\t\tif (isset($_POST[\"btSubmit\"])) {\n\t\t\t$_POST['use_passw']=password_hash($_POST['use_passw'], PASSWORD_DEFAULT);\n\t\t\t$u=new User();\n\t\t\t$u->chargerDepuisTableau($_POST);\n\t\t\t$u->sauver();\n\t\t\theader(\"location:index.php?m=documents\");\n\t\t} else {\t\t\t\t\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$u=new User($id);\n\t\t\textract($u->data);\t\n\t\t\trequire $this->gabarit;\n\t\t}\n\t}", "public function edit($data){\n\t\t$this->db->where('id_pinjam',$data['id_pinjam']);\n\t\t$this->db->update('pinjam_uang', $data);\n\n\t}", "public function editar(){\n\t\t\n\t\t$this->form_validation->set_rules('resposta', 'RESPOSTA', 'trim');\n\t\tif ($this->form_validation->run()==TRUE):\n\t\t$dados = elements(array('resposta'), $this->input->post());\n\t\t$this->Comentarios->do_update($dados, array('id_comentario'=>$this->input->post('idcomentario')));\n\t\tendif;\n\t\tset_tema('titulo', 'Resposta de Coment&aacute;rio');\n\t\tset_tema('conteudo', load_modulo('Comentarios', 'editar'));\n\t\tload_template();\n\t}", "function formUpdate($Titulo, $Editar, $Games, $Review='', $id){\n $this->Smarty->assign('Titulo', $Titulo); //Titulo es la variable, y $Titulo contiene el valor que esta toma.\n $this->Smarty->assign('Review', $Review);\n $this->Smarty->assign('Games', $Games); //Games tambien funciona como Game cuando estoy editando solo 1 juego.\n $this->Smarty->assign('Editar', $Editar);\n $this->Smarty->assign('id', $id);\n $this->Smarty->display('templates/update.tpl');\n }", "public function editdata_4(){\n\t\t$id_soal_tpa = $this->input->post('id_soal_tpa');\n\t\t$soal = $this->input->post('soal');\n\t\t$opsi_a = $this->input->post('opsi_a');\n\t\t$opsi_b = $this->input->post('opsi_b');\n\t\t$opsi_c = $this->input->post('opsi_c');\n\t\t$opsi_d = $this->input->post('opsi_d');\n\t\t$opsi_e = $this->input->post('opsi_e');\n\t\t$jawaban = $this->input->post('jawaban');\n\n\t\t$data = array(\n\t\t\t'soal' => $soal,\n\t\t\t'opsi_a' => $opsi_a,\n\t\t\t'opsi_b' => $opsi_b,\n\t\t\t'opsi_c' => $opsi_c,\n\t\t\t'opsi_d' => $opsi_d,\n\t\t\t'opsi_e' => $opsi_e,\n\t\t\t'jawaban' => $jawaban\n\t\t);\n\n\t\t$where = array(\n\t\t\t'id_soal_tpa' => $id_soal_tpa\n\t\t);\n\n\t\t$this->Mdl_soal->update_data($where,$data,'tb_soal_tpa');\n\t\t$this->session->set_flashdata('msg_update','Data Berhasil Diedit');\n\t\tredirect('Soal/Soal_tpa/Soal_tpa_4');\n\t}", "public function updateForm(){\n $new = $this->model->getNew();\n $this->view->updateForm($new);\n }", "public function edit1()\n\t{\n \t// $table_form5->tanggapan_audit = $request->auditi;\n \t// $table_form5->rencana_perbaikan = $request->perbaikan;\n \t// $table_form5->save();\n\n\t\t// $table_form5 = \\App\\Ptpp::findOrFail($request->idd);\n\t\t$table_form5->update($request->all());\n\n\t\treturn back()->with('sukses', 'Data sukses ditambahkan');;\n\t}", "public function edit(ProData $proData)\n {\n //\n }", "function edit_info($page, $id, $edit) {\r\n \r\n $this->db->where('id', $id);\r\n $this->db->update($page, $edit);\r\n }", "public function update()\n\t{\n\t\t$crud = $this->crud->find($_POST['id']);\n\t\t$curd->data([\n\t\t\t'first_name' => $_POST['first_name'],\n\t\t\t'last_name' => $_POST['last_name'],\n\t\t]);\n\t\t$crud->update();\n\t\t$this->redirect('crud');\n\t}", "function update()\n {\n $this->dbInit();\n if ( isset( $this->ID ) )\n {\n query( \"UPDATE Grp set Name='$this->Name', Description='$this->Description',\n\t\tUserAdmin='$this->UserAdmin',\n \t\tUserGroupAdmin='$this->UserGroupAdmin',\n\t\tPersonTypeAdmin='$this->PersonTypeAdmin',\n\t\tCompanyTypeAdmin='$this->CompanyTypeAdmin',\n\t\tPhoneTypeAdmin='$this->PhoneTypeAdmin',\n\t\tAddressTypeAdmin='$this->AddressTypeAdmin' WHERE ID='$this->ID'\" );\n }\n }", "function update_data($data_update_item) {\n\t}", "function a_edit() {\n\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t$u=new Gestionnaire($id);\n\t\textract($u->data);\t\n\t\trequire $this->gabarit;\n\t}", "public function edit()\n {\n $dayId = $this->uri->segment(3);\n \n if ($_POST) {\n \n $this->load->model(\"Eggproductiondata\", 'production');\n \n if ($_POST['pieces'] && $_POST['egg_types']) {\n \n for ($i = 0; $i < sizeof($_POST['pieces']); $i++) {\n \n $data = array('piece'=>$_POST['pieces'][$i]);\n echo $this->production->update($data, array('egg_production_day_id'=>$dayId, 'egg_type_id'=>$_POST['egg_types'][$i]));\n }\n \n echo 1;\n } else {\n echo 0;\n }\n } else {\n \n echo 0;\n }\n \n die;\n }", "function edit(){\n $kode_produk = $_POST['kode_produk'];\n $nama_produk = $_POST['nama_produk'];\n $harga = $_POST['harga'];\n $jumlah = $_POST['jumlah'];\n $connection = new mysqli('localhost','root','','Uji');\n $connection->query(\"UPDATE Produk SET \n\t\tnama_produk='$nama_produk', jumlah=$jumlah, \n\t\tharga=$harga WHERE kode_produk='$kode_produk'\");\n}", "public function edita()\n\t {\t\n\t\t$car=$_REQUEST['car'];\n\t\t$per=$_REQUEST['per'];\n\t\t$logi=$_REQUEST['logi'];\n\t\t$pas=$_REQUEST['pas'];\n\t\t$obs=$_REQUEST['obs'];\n\t\t$est=$_REQUEST['est'];\n\t\t\t//$usu=$_REQUEST['usu'];\n\t\t$user_data=array();\n\t\t$user_data['carnet']=$car;\n\t\t$user_data['login']=$logi;\n\t\t$user_data['password']=$pas;\n\t\t$user_data['estado']=$est;\n\t\t$user_data['observacion']=$obs;\n\t\t$user_data['perfil']=$per;\n\t\t\n\t\t//print_r($user_data);\n\t\t$usuario=new Usuarios;\n\t\t$usuario->edit($user_data);\n\t\t$data1=$usuario->lista();\n\t\t$this->principal();\n\t }", "function show_update()\n{\nif (isset($_POST[\"datum\"]))\n{\n$heute = $_POST[\"datum\"];\n}\nelse\n{\n$heute=date(\"Y-m-d\");\n}\n\n$sql_select_heute = \"SELECT * FROM sendeplan WHERE datum='\". $heute . \"' ORDER BY bis ASC\";\n$db = mysql_connect(\"localhost\", \"portal\", \"psacln\") or die(\"Verbindungsfehler\");\n$query_heute = mysql_db_query(\"portal\", $sql_select_heute);\nif (mysql_affected_rows()==\"0\")\n{ echo 'Es wurde kein Sendeplan f&uuml;r diesen Tag gefunden. Zum bearbeiten eines anderen Tages bitte das Datum eingeben nach ISO Norm = YYYY-MM-TT<br />\n<form method=\"post\" action=\"index.php?x=edit\"><button type=\"submit\">Bearbeiten</button>\n<input type=\"text\" name=\"datum\" value=\"'.$heute.'\" />\n<input type=\"hidden\" name=\"userinput\" value=\"' .$_POST[\"userinput\"].'\" />\n<input type=\"hidden\" name=\"passinput\" value=\"' .$_POST[\"passinput\"].'\" /></form>\n'; }\n\n// Generiere Mod Drop-Down\n $sql1=\"SELECT id,nick FROM user WHERE portal_level<10 AND portal_level>4 ORDER BY 'nick'\";\n $db = mysql_connect(\"localhost\", \"portal\", \"psacln\") or die(\"Verbindungsfehler\");\n $result1=mysql_db_query(\"portal\",$sql1);\n \n $drop=\"\";\n while($zeile1=mysql_fetch_array($result1))\n {\n\t $drop.='<option value=\"'.$zeile1[\"id\"].'\">'.$zeile1[\"nick\"].'</option>';\n } \n \n \n $sql1=\"SELECT id,nick FROM user WHERE portal_level>10 ORDER BY 'nick'\";\n $result1=mysql_db_query(\"portal\",$sql1);\n \n // Generiere Admin Drop-Down\n $drop.='<option value=\"0\">----Admins----</option>';\n \n while($zeile1=mysql_fetch_array($result1))\n {\n\t $drop.='<option value=\"'.$zeile1[\"id\"].'\">'.$zeile1[\"nick\"].'</option>';\n } \n// Drop Ende\n\n\n while($zeile = mysql_fetch_array($query_heute))\n {\n\t \n\t \n\t $sql2=\"SELECT nick FROM user WHERE id='\".$zeile[\"userid\"].\"'\";\n\t $result2=mysql_db_query(\"portal\",$sql2);\n\t $zeile2=mysql_fetch_array($result2); \n\t \n echo '\n <table border=\"1\"><tr><td><form method=\"post\" action=\"index.php?x=edit\">\n <input type=\"hidden\" name=\"userinput\" value=\"' .$_POST[\"userinput\"].'\" />\n <input type=\"hidden\" name=\"passinput\" value=\"' .$_POST[\"passinput\"].'\" />\n <input type=\"hidden\" name=\"del\" value=\"'.$zeile[\"id\"].'\" /><button type=\"submit\">Löschen</button>\n </form>\n </td>\n <td><form method=\"post\" action=\"index.php?x=edit\">';\n //kalenderwoche($heute);\n //echo \": \";\n wochentag($heute);\n echo'</td>\n <td><input type=\"text\" name=\"datum\" value=\"'.$heute.'\" size=\"8\" maxlengh=\"8\" /></td>\n <td><input type=\"text\" name=\"von\" value=\"'.$zeile[\"von\"].'\" size=\"4\" maxlengh=\"4\" /></td>\n <td><input type=\"text\" name=\"bis\" value=\"'.$zeile[\"bis\"].'\" size=\"4\" maxlengh=\"4\" /></td>\n <td><input type=\"text\" name=\"titel\" value=\"'.$zeile[\"titel\"].'\" size=\"20\" maxlengh=\"20\" /></td>\n <td><select name=\"stream\">';\n if ($zeile[\"stream\"]==1)\n { echo '<option value=\"1\">Stream 1</option><option value=\"2\">Stream 2</option><option value=\"3\">Stream 3</option>'; }\n\n elseif ($zeile[\"stream\"]==2)\n { echo '<option value=\"2\">Stream 2</option><option value=\"3\">Stream 3</option><option value=\"1\">Stream 1</option>'; }\n \n else\n { echo '<option value=\"3\">Stream 3</option><option value=\"1\">Stream 1</option><option value=\"2\">Stream 2</option>'; }\n\n \n echo '</select><td><select name=\"userid\"><option value=\"'.$zeile[\"userid\"].'\">---'.$zeile2[\"nick\"].'</option>'.$drop.'</select></td>\n <input type=\"hidden\" value=\"' .$_POST[\"userinput\"].'\" name=\"userinput\" size=\"4\" maxlengh=\"4\" />\n <input type=\"hidden\" value=\"' .$_POST[\"passinput\"].'\" name=\"passinput\" size=\"4\" maxlengh=\"4\" />\n <input type=\"hidden\" value=\"'.$heute.'\" name=\"datum\" />\n <input type=\"hidden\" value=\"'.$zeile[\"id\"].'\" name=\"id\" />\n <input type=\"hidden\" value=\"edit\" name=\"do\" />\n <td><button type=\"submit\">Speichern</button></td></form>\n </tr></table><hr />';\n\n\t }\n}", "function update_record () {\n\t\t\n\t\t// validate input\n $valid = true;\n if (empty($this->name)) {\n $this->nameError = 'Please enter Name';\n $valid = false;\n }\n\n if (empty($this->email)) {\n $this->emailError = 'Please enter Email Address';\n $valid = false;\n } \n\n\n if (empty($this->mobile)) {\n $this->mobileError = 'Please enter Mobile Number';\n $valid = false;\n }\n\n // update data\n if ($valid) {\n $pdo = Database::connect();\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $sql = \"UPDATE customers SET name = ?, email = ?, mobile = ? WHERE id=\".$_GET['id'];\n $q = $pdo->prepare($sql);\n $q->execute(array($this->name,$this->email,$this->mobile));\n Database::disconnect();\n header(\"Location: customer.php\");\n }\n else {\n $this->update();\n }\n\t\n\t}", "public function edit(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$user = $this->_map_posted_data();\n\t\t\t\t$user->set_user_id($_POST['id']);\n\t\t\t\t$this->userrepository->update($user);\n\t\t\t\theader(\"Location: index.php/admin/index/edit\");\n\t\t\t}else{\n\t\t\t\t$view_page = \"adminusersview/edit\";\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$user = $this->userrepository->get_by_id($id);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\theader(\"Location: index.php/admin/index\");\n\t\t\t\t}\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t}\n\t\t}", "protected function _update()\n\t{\n\t}", "public function editar()\n {\n }", "public function edit()\n { }", "abstract function performUpdate(Form $arg0);", "function update()\n\t{\n\t\tif($_POST['old_keyname']!=$_POST['keyname'])\n\t\t\t$this->getModel('mprojectlist')->rmProj($_POST['old_keyname']);\n\t\t$this->getModel('mprojectlist')->addProj($_POST['showname'],$_POST['keyname'],$_POST['path'],$_POST['url']);\n\t\t$this->getModel('mprojectlist')->saveList();\n\t\t$this->getModel('mprojectlist')->loadList();\n\t\theader('location:/install/listall');\n\t\treturn ;\n\t}", "function editrow()\r\n {\r\n $c=$this->connector();\r\n $r='';\r\n $r.=$this->logout();\r\n $db=$_GET['db'];\r\n $tbl=$_GET['table'];\r\n $val=$_GET['val'];\r\n $col=$_GET['col'];\r\n $r.=\"<div id='isi'>\r\n <center><a href='?act=showtable&db=$db'>Show Tables </a></center><br />\";\r\n $r.=\"<form method='post' action='?act=showcon&db=$db&table=$tbl&col=$col&val=$val'>\";\r\n $r.=\"<table width=100% align='center' cellspacing=0 class='xpltab'>\";\r\n \r\n $cols=array();\r\n $iml=mysql_query(\"SHOW COLUMNS FROM $db.$tbl\");\r\n $query=mysql_query(\"SELECT * FROM $db.$tbl WHERE $col='$val'\");\r\n \r\n while($colom=mysql_fetch_assoc($iml))$cols[]=$colom['Field'];\r\n $data=mysql_fetch_assoc($query);\r\n for($i=0;$i<count($cols);$i++)\r\n {\r\n $pt=$cols[$i];\r\n $r.=\"<tr><td style='border:none'>\".$pt.\"</td><td style='border:none'>\".' : <input id=\"sqlbox\" type=\"text\" name=\"'.$cols[$i].'\" value=\"'.$data[$pt].'\"></td></tr>';\r\n\r\n }\r\n $r.=\"</table><input type='hidden' name='action' value='updaterow'><input id='but' type='submit' value='update'></form></div>\";\r\n return $r;\r\n $this->free();\r\n }", "public function edit()\n { \n }", "function UpdateToDB()\n\t{\n\t\tif(isset($_GET['job_id']))\n\t\t{\n\t\t\t//Initializing variables with the user inputs\n\t\t\t$Id = $_GET['job_id'];\n\t\t\t$IndustryType = $_GET['job_industry_type'];\n\t\t\t\n\t\t\tif(!empty($Id))\n\t\t\t{\t\t\t\t\n\t\t\t\t//Query which is going to execute to for database manipulation\n\t\t\t\t$query =\"UPDATE job_details SET industry_type='$IndustryType' WHERE id='$Id'\";\n\t\t\t\t$query_run = mysql_query($query);\n\t\t\t}\n\t\t}\t\n\t}", "public function index_onUpdateForm()\n\t{\n\t\t$record_id = post('record_id');\n\t\tparent::update($record_id);\n\t\t$this->controller->vars['record_id'] = $record_id;\n\t\treturn $this->makePartial('update');\n\t}", "public function updateAction() {\n $model = new Application_Model_Compromisso();\n //passo para a model os dados a serem upados\n $model->update($this->_getAllParams());\n //redireciono para a view\n $this->_redirect('compromisso/index');\n }", "function _edit_update() {\n\t\t$sfgs = $_POST;\n//\t\tunset($sfgs['sfgs_header']['kode_sfg']);\n\t\tunset($sfgs['button']);\n\t\t// end of assign variables and delete not used variables\n\n\t\t$count = count($sfgs['sfgs_detail']['id_sfgs_h_detail']) - 1;\n\n\t\t// check, at least one product quantity entered\n\t\t$quantity_exist = FALSE;\n\n\t\tfor($i = 1; $i <= $count; $i++) {\n\t\t\tif(empty($sfgs['sfgs_detail']['quantity'][$i])) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$quantity_exist = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif($quantity_exist == FALSE)\n\t\t\tredirect('sfgs/edit_error/Anda belum memasukkan data detail. Mohon ulangi');\n\n \tif(isset($_POST['button']['save'])) {\n\n\t\t\t$this->db->trans_start();\n\n \t\t\t$this->session->set_userdata('sfgs_detail', $sfgs['sfgs_detail']);\n $id_sfgs_header = $sfgs['sfgs_header']['id_sfgs_header'];\n\n \t\t\t$data = array (\n \t\t\t\t'id_sfgs_header' =>\t$id_sfgs_header,\n 'quantity_sfg' => $sfgs['sfgs_header']['quantity_sfg'],\n \t\t\t\t'uom_sfg' => $sfgs['sfgs_header']['uom_sfg'],\n \t\t\t);\n\n $input_detail_success = FALSE;\n\n if(($this->m_sfgs->sfgs_header_update($data))&&\n ($this->m_sfgs->sfgs_details_delete($id_sfgs_header))) {\n \t\tfor($i = 1; $i <= $count; $i++) {\n\t\t\t\t\tif((!empty($sfgs['sfgs_detail']['quantity'][$i]))&&(!empty($sfgs['sfgs_detail']['material_no'][$i]))) {\n\n\t\t\t\t\t\t$sfgs_detail['id_sfgs_header'] = $id_sfgs_header;\n\t\t\t\t\t\t$sfgs_detail['quantity'] = $sfgs['sfgs_detail']['quantity'][$i];\n\t\t\t\t\t\t$sfgs_detail['id_sfgs_h_detail'] = $sfgs['sfgs_detail']['id_sfgs_h_detail'][$i];\n\n\t\t\t\t\t\t$sfgs_detail['material_no'] = $sfgs['sfgs_detail']['material_no'][$i];\n\t\t\t\t\t\t$sfgs_detail['material_desc'] = $sfgs['sfgs_detail']['material_desc'][$i];\n\t\t\t\t\t\t$sfgs_detail['uom'] = $sfgs['sfgs_detail']['uom'][$i];\n\n\t\t\t\t\t\tif($this->m_sfgs->sfgs_detail_insert($sfgs_detail))\n $input_detail_success = TRUE;\n\t\t\t\t\t}\n\n \t \t}\n }\n\n \t\t\t$this->db->trans_complete();\n\n if(isset($_POST['button']['save'])) {\n if ($input_detail_success == TRUE) {\n\t\t\t $this->l_general->success_page('Data Master Semi Finished Goods (SFG) BOM berhasil diubah', site_url('sfgs/browse'));\n } else {\n\t\t\t $this->jagmodule['error_code'] = '004'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Master Semi Finished Goods (SFG) BOM tidak berhasil diubah', site_url($this->session->userdata['PAGE']['next']));\n }\n } else if(isset($_POST['button']['approve']))\n if($approve_data_success == TRUE) {\n\t\t\t $this->l_general->success_page('Data Master Semi Finished Goods (SFG) BOM berhasil diapprove', site_url('sfgs/browse'));\n } else {\n\t\t\t $this->jagmodule['error_code'] = '005'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Master Semi Finished Goods (SFG) BOM tidak berhasil diapprove.<br>\n Pesan Kesalahan dari sistem SAP : '.$approved_data['sap_messages'], site_url($this->session->userdata['PAGE']['next']));\n }\n\n\t\t}\n\n\t}", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "function EditDataPegawai()\n\t{\n\t\tinclude '../../koneksi/koneksi.php';\n\n\t\t//inisialisasi\n\t\t$id_pegawai = $_POST['id_pegawai'];\n\t\t$nama = $_POST['nama'];\n\t\t$jabatan = $_POST['jabatan'];\n\t\t$username = $_POST['username'];\n\t\t$password = $_POST['password'];\n\t\t$password = md5($password);\n\n\t\t//update ke tabel pegawai\n\t\t$sql = \"UPDATE pegawai SET id_pegawai = ?, nama = ?, jabatan = ? WHERE id = ?\";\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->bind_param('iss', $id_pegawai, $nama, $jabatan);\n\t\tif($stmt->execute()){\n\t\t\techo \"Data berhasil diperbaharui\";\n\t\t}else{\n\t\t\tdie('Error : ('. $db->errno .')'. $db->error);\n\t\t}\n\t\t$stmt->close();\n\t}", "public function editdata_3(){\n\t\t$id_soal_tpa = $this->input->post('id_soal_tpa');\n\t\t$soal = $this->input->post('soal');\n\t\t$opsi_a = $this->input->post('opsi_a');\n\t\t$opsi_b = $this->input->post('opsi_b');\n\t\t$opsi_c = $this->input->post('opsi_c');\n\t\t$opsi_d = $this->input->post('opsi_d');\n\t\t$opsi_e = $this->input->post('opsi_e');\n\t\t$jawaban = $this->input->post('jawaban');\n\n\t\t$data = array(\n\t\t\t'soal' => $soal,\n\t\t\t'opsi_a' => $opsi_a,\n\t\t\t'opsi_b' => $opsi_b,\n\t\t\t'opsi_c' => $opsi_c,\n\t\t\t'opsi_d' => $opsi_d,\n\t\t\t'opsi_e' => $opsi_e,\n\t\t\t'jawaban' => $jawaban\n\t\t);\n\n\t\t$where = array(\n\t\t\t'id_soal_tpa' => $id_soal_tpa\n\t\t);\n\n\t\t$this->Mdl_soal->update_data($where,$data,'tb_soal_tpa');\n\t\t$this->session->set_flashdata('msg_update','Data Berhasil Diedit');\n\t\tredirect('Soal/Soal_tpa/Soal_tpa_3');\n\t}", "public function edita()\n\t {\t\n\t\t$id=$_REQUEST['id'];\n\t\t$car=$_REQUEST['car'];\n\t\t$nom=$_REQUEST['nom'];\n\t\t$cod=$_REQUEST['cod'];\n\t\t$niv=$_REQUEST['niv'];\n\t\t$obs=$_REQUEST['obs'];\n\t\t$est=$_REQUEST['est'];\n\t\t\t//$usu=$_REQUEST['usu'];\n\t\t$cur_data=array();\n\t\t$cur_data['id_curso']=$id;\n\t\t$cur_data['id_carrera']=$car;\n\t\t$cur_data['nombre']=$nom;\n\t\t$cur_data['codigo']=$cod;\n\t\t$cur_data['nivel']=$niv;\n\t\t$cur_data['observacion']=$obs;\n\t\t$cur_data['estado']=$est;\n\t\t\n\t\tprint_r($cur_data);\n\t\t$curso=new cursos;\n\t\t$curso->edit($cur_data);\n\t\t$data1=$curso->lista();\n\t\t$this->principal();\n\t }", "public function editModel($id,$data){\r\n\t\t$this->db->where('id',$id);\r\n\t\treturn $this->db->update('uqc',$data);\r\n\t}", "function edit(){\n\t\t$arr = $this->uri->uri_to_assoc(3);\n\t\t$data['arr'] = $arr['id'];\n\t\t\n\t\t/* membuat value */\n\t\t$this->user->setID($arr['id']);\n\n\t\t/* fungsi ambil data */\n\t\t$result = $this->user->ambil_data();\n\n\t\t/* data dropdown */\n\t\t$data['role'] = role_dropdown();\n\t\t$data['result'] = $result;\n\n\t\t/* load view */\n\t\t$this->template->write_view('edit', $data);\n\t}", "private function updateModal(){\n $pId = $_REQUEST['info'];\n\n $this->assign('partnerId', $pId);\n $this->assign('partner', $this->getPartnerById($pId));\n $this->display('partners/edit.tpl');\n }" ]
[ "0.72682345", "0.72679824", "0.7206149", "0.72013015", "0.7164414", "0.71429735", "0.70624596", "0.70470595", "0.7032516", "0.69918853", "0.6963347", "0.6961319", "0.6931565", "0.69216913", "0.68896455", "0.68853915", "0.68544734", "0.68432236", "0.6827983", "0.68006665", "0.68002564", "0.6797135", "0.6797135", "0.6784989", "0.6783796", "0.6778807", "0.6777251", "0.6775403", "0.677332", "0.67720145", "0.6736453", "0.67318976", "0.67299545", "0.6726694", "0.6720574", "0.67135483", "0.671142", "0.671142", "0.67079824", "0.67079824", "0.67079824", "0.6706069", "0.6702518", "0.6680955", "0.6675024", "0.6666064", "0.66632545", "0.66612196", "0.6647796", "0.6647796", "0.6647796", "0.6636921", "0.6636273", "0.6629497", "0.66286886", "0.6624493", "0.6617497", "0.66105086", "0.6608203", "0.6589073", "0.65866584", "0.6584801", "0.65844506", "0.65801233", "0.65770125", "0.65742075", "0.65734476", "0.6569437", "0.656787", "0.6562292", "0.6560443", "0.6559309", "0.65589386", "0.65589345", "0.6558499", "0.6558288", "0.65563715", "0.65541804", "0.65516835", "0.6549387", "0.6549035", "0.65477866", "0.65458447", "0.654575", "0.654575", "0.654575", "0.654575", "0.654575", "0.654575", "0.654575", "0.654575", "0.654575", "0.654575", "0.654575", "0.654575", "0.65457255", "0.6545291", "0.6544243", "0.65401137", "0.6532995", "0.6529961" ]
0.0
-1
/edit program Function for delete form
public function deleteProgram(Request $request) { $id = $request->workoutid; $getWorkout = Program::find($id); if($getWorkout->delete()){ return redirect()->back()->with('danger','Program Deleted successfully'); } else{ return redirect()->back()->with('danger','Sorry! Program is not deleted'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function student_form_delete() {\n $id = arg(1);\n $num_deleted = db_delete('student')\n ->condition('st_id', $id)\n ->execute();\n if ($num_deleted) {\n drupal_set_message(t('entry has been deleted.'));\n drupal_goto(\"formlist\");\n }\n else {\n drupal_set_message(t('error in query'));\n }\n}", "function delete_form()\n\t{\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя изменить ID группы, попытайтесь снова\");\n\t\t}\n\n\t\tif ($this->ipsclass->input['id'] < 5)\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Вы не можете перемещать группы, которые используются в данный момент, но переименовать и отредактировать функции можно\");\n\t\t}\n\n\t\t$this->ipsclass->admin->page_title = \"Удаление пользовательской группы\";\n\n\t\t$this->ipsclass->admin->page_detail = \"Пожалуйста, убедитесь в том, что хотите удалить данную группу.\";\n\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'COUNT(id) as users', 'from' => 'members', 'where' => \"mgroup=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$black_adder = $this->ipsclass->DB->fetch_row();\n\n\t\tif ($black_adder['users'] < 1)\n\t\t{\n\t\t\t$black_adder['users'] = 0;\n\t\t}\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'COUNT(id) as users', 'from' => 'members', 'where' => \"mgroup_others LIKE '%\".intval($this->ipsclass->input['id']).\"%'\" ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$extra_group = $this->ipsclass->DB->fetch_row();\n\n\t\tif ($extra_group['users'] < 1)\n\t\t{\n\t\t\t$extra_group['users'] = 0;\n\t\t}\n\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'g_title', 'from' => 'groups', 'where' => \"g_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$group = $this->ipsclass->DB->fetch_row();\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'g_id, g_title', 'from' => 'groups', 'where' => \"g_id <> \".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t$mem_groups = array();\n\n\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Leave out root admin group\n\t\t\t//-----------------------------------------\n\n\t\t\tif ( $this->ipsclass->vars['admin_group'] == $r['g_id'] )\n\t\t\t{\n\t\t\t\tif ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$mem_groups[] = array( $r['g_id'], $r['g_title'] );\n\t\t}\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , 'dodelete' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'group' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'id' , $this->ipsclass->input['id'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'name' , $group['g_title'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 5 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\n\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Подтверждение перемещения: \".$group['g_title'] );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Количество пользователей в этой группе</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t \"<b>\".$black_adder['users'].\"</b>\",\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Количество пользователей с этой группой, как <u>вторичная</u> группа</b><br /><i>Эта вторичная группа будет удалена у этих пользователей.</i>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t \"<b>\".$extra_group['users'].\"</b>\",\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Переместить пользователей из этой группы в...</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_dropdown(\"to_id\", $mem_groups )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form(\"Удалить эту группу\");\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->admin->output();\n\t}", "abstract function performDelete(Form $arg0);", "function contentDelete(){\n if (isset($_GET['delete'])){\n echo \"<h2>BORRAR PALABRA</h2>\n <form method='POST' action='intranet.php'>\n <fieldset>\n <div>\n <label for='pespanol'>Palabla Español:</label>\n <input type='text' name='pespanol' id='pespanol' placeholder='Introduce palabra' required /> \n </div>\n <div>\n <input type='submit' name='delete' value='Eliminar Palabla'/>\n </div>\n </fieldset>\n </form>\";\n }\n}", "function deleteInfo() {\n?>\n <form method=\"post\" id=\"delete_form\">\n <!-- for deletes to work, this must be here and the values must be in this order -->\n <input type=\"hidden\" id=\"primary_key\" name=\"primary_key\" value=\"<?php echo $this->primary_key ?>\">\n <input type=\"hidden\" id=\"primary_key_value\" name=\"primary_key_value\" value=\"<?php echo $this->primary_key_value ?>\">\n <input type=\"hidden\" id=\"delete_from_table\" name=\"delete_from_table\" value=\"<?php echo $this->table_title ?>\">\n <input type=\"hidden\" id=\"return_address\" name=\"return_address\" value=\"/treatment/tables/<?php echo $this->table_display ?>\">\n </form>\n<?php\n }", "function delete(){\n if(isset($_GET[\"id\"]))\n $id=$_GET[\"id\"];\n\n //execute the delete command on the model\n $c=comment_model::delete($id);\n //return a simple view of confirming the deletion\n require_once(\"view/delete.php\");\n }", "public function deleted(Edit $edit)\n {\n //\n }", "public function delete()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'detailfasilitaskesehatan', 'delete')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tif (!empty($_POST)) {\n\t\t\t$query = $this->podb->deleteFrom('detailfasilitaskesehatan')->where('id', $this->postring->valid($_POST['id'], 'sql'));\n\t\t\t$query->execute();\n\t\t\t$this->poflash->success('Detailfasilitaskesehatan has been successfully deleted', 'admin.php?mod=detailfasilitaskesehatan');\n\t\t}\n\t}", "public function save_trash_delete_form() {\n\t\t// Handled in the process_bulk_actions() function in includes/class-forms-list.php\n\t}", "function button_delete_com($idCom,$idPost)\r\n{\r\n\tif(isset($_SESSION['id']))\r\n\t{\r\n\t\tif(isadmin($_SESSION['id']))\r\n\t\t{\r\n\t\t\techo \"<form name='delete_com' action='controller/actions.php' method='post'>\";\r\n\t\t\t\techo \"<input name='id_com' type='hidden' value='\".$idCom.\"'/>\";\r\n\t\t\t\techo \"<input class='button_com'name='action' value='Supprimer com' type='submit'/>\";\r\n\t\t\t\techo \"<input type='hidden' name='url' value='?page=article&POST_ID=\".$idPost.\"'/>\";\r\n\t\t\techo \"</form>\";\r\n\t\t}\r\n\t}\r\n}", "public function delete(){\n $id = $_POST['id'];\n Cita::destroy($id);\n }", "function DeleteEntry() {\n\t\t//to choose an option to delete the selected user. \n\n //Select all contacts in the addressbook\n $data['display_block'] = $this->AddressBook->selectContacts();\n\n //Render the DeleteEntry View. All the options for the \n\t\t//the Select box on DeleteEntry view are in the field $data['display_block']\n $this->load->view('DeleteEntry', $data);\t\n\t}", "public function DeleteAction()\r\n\t{\r\n\t\t// If form has been submitted\r\n\t\tif(isset($_GET['id']))\r\n\t\t{\r\n\t\t\t// Save data to table\r\n\t\t\t$this->View->status = $this->Author->delete($_GET['id']);\r\n\t\t}\r\n\t}", "function delete()\n{\n $data = [$_GET['id']];\n $succes = changeDB('DELETE FROM projecten WHERE id = ?', $data);\n if ($succes) {\n return page_show(\"project verwijderen gelukt\");\n }\n\n return page_show(\"project verwijderen gefaald\");\n\n\n}", "function trash() { \n\t\t$adsdetail = JRequest::get('POST');\n\t\t$model = $this->getModel('showads');\n\t\t$model->statusChange($adsdetail);\n\t}", "function deleteRecord()\t{\n\t\tif ($this->conf['delete'])\t{\t// If deleting is enabled\n\t\n\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $this->recUid);\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ( $this->aCAuth($origArr)&& $this->conf['requireLogin'])||!$this->conf['requireLogin'])\t{\t// Must be logged in OR be authenticated by the aC code in order to delete\n\t\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\tif (is_array($origArr))\t{\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t// Display the form, if access granted.\n\t\t\t\t\t\tif (!$GLOBALS['TCA'][$this->theTable]['ctrl']['delete'])\t{\t// If the record is fully deleted... then remove the image (or any file) attached.\n\t\t\t\t\t\t\t$this->deleteFilesFromRecord($this->recUid);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->cObj->DBgetDelete($this->theTable, $this->recUid, TRUE);\n\t\t\t\t\t\t$this->currentArr = $origArr;\n\t\t\t\t\t\t$this->saved = 1;\n\t\t\t\t\t\t$this->userProcess_alt($conf['edit.']['userFunc_afterDelete'],$conf['edit.']['userFunc_afterDelete.'],array('rec'=>$this->currentArr, 'origRec'=>$origArr));\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->error = '###TEMPLATE_NO_PERMISSIONS###';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\t\t$this->error = '###TEMPLATE_NO_PERMISSIONS###';\n\t\t }\n\t\t}\n\t}", "function botaoExcluir($indiceCadastro){\n echo \"\n <form method='post'>\n <button type='submit' class='btn btn-outline-danger btn-sm' name='botaoExcluir' value='$indiceCadastro'><i class='material-icons'>delete</i></button>\n </form>\";//o botão vai receber o valor do indice correspondente a sua linha na tabela de cadastros\n }", "public function actionDelete() {}", "public function actionDelete() {}", "public function action_personDelete() {\r\n if ($this->validateEdit()) {\r\n\r\n try {\r\n // 2. usunięcie rekordu\r\n App::getDB()->delete(\"person\", [\r\n \"id\" => $this->form->id\r\n ]);\r\n Utils::addInfoMessage('Pomyślnie usunięto rekord');\r\n } catch (\\PDOException $e) {\r\n Utils::addErrorMessage('Wystąpił błąd podczas usuwania rekordu');\r\n if (App::getConf()->debug)\r\n Utils::addErrorMessage($e->getMessage());\r\n }\r\n }\r\n\r\n // 3. Przekierowanie na stronę listy osób\r\n App::getRouter()->forwardTo('personList');\r\n }", "function delete_($id){\r\nglobal $mod_id;\r\nglobal $db;\r\nglobal $_POST;\r\nglobal $tbl_name_main;\r\nglobal $tbl_name_detail;\r\n\r\n$sql =\"DELETE \";\r\n$sql .=\"FROM \".$tbl_name_main.\" \";\r\n$sql .=\"WHERE id_form_rfk_02_jp_main = '$id'\";\r\n\r\n$sqlresult = $db->Execute($sql);\r\n}", "function delete() {\n$id = intval( $_GET[\"id\"] );\n//delete the database record\n$q1 = \"delete from qlns_administrator where ctn_id = '$id'\";\n@mysql_query($q1) or die(mysql_error());\necho \"<script> alert ('Xóa thành viên thành công ! ') </script>\";\necho \"<div align='center'> <font color=blue size=3><img src='images/undo.gif' border='0'><a href='admin.php?dialoose=select'> Trở về </a>\";\n}", "public function deleteAction()\n {\n $request = $this->getRequest();\n if($request->isPost()){\n $id = $this->params()->fromPost('id');\n $combo = $this->modelCombo->findOneBy(array('id'=>$id));\n $combo->setIsdelete(1);\n $this->modelCombo->edit($combo);\n //$this->model->delete(array('id'=>$id));\n echo 1;\n }\n die;\n\n }", "function deleteContinentForm(){\n\n\t//Database connection\n\tglobal $mysqli;\n\t\n\t//Selected continent variables\n\t$continent_name=$_GET[\"continent_name\"];\n\t$continent_id=$_GET[\"continent_id\"];\n\t\n\t//Selected continent profile\n\t$sql_continent=\"SELECT * FROM continents WHERE continent_id=\".d($mysqli, $continent_id).\";\";\n\t$res_continent=mysqli_query($mysqli, $sql_continent);\n\n\t//Selected continent attributes\n\t$sql_attributes=\"SELECT * FROM attributes WHERE continent_id=\".d($mysqli, $continent_id).\";\";\n\t$res_attributes=mysqli_query($mysqli, $sql_attributes);\n\n\t//Selected continent items\n\t$sql_items=\"SELECT * FROM items WHERE continent_id=\".d($mysqli, $continent_id).\";\";\n\t$res_items=mysqli_query($mysqli, $sql_items);\n\n\t//Header for the list of items about to be deleted\n\techo \"<div class=\\\"heading\\\">\n\t\t<h2>You are about to delete all items associated with \".h($continent_name).\"</h2>\n\t\t<h3>The following items will be deleted:</h3><br>\";\n\n\t//Listed continent and its profile\n\tif($res_continent){\n\n\t\twhile($list=$res_continent->fetch_assoc()){\n\n\t\t\techo \"<p>Folder: \".h($continent_name).\"</p><br>\n\t\t\t\t<li>\".h($list[\"map_path\"]).\"</li><br>\n\t\t\t\t<li>\".h($list[\"description_path\"]).\"</li><br>\";\n \n\n\t\t}\n\n\t}\n\n\t//Listed associated attributes\n\tif($res_attributes){\n\n\t\twhile($list=$res_attributes->fetch_assoc()){\n\n\t\t\techo \"<p>Folder: \".h($list[\"attribute_name\"]).\"</p><br>\n\t\t\t\t<li>\".h($list[\"image_path\"]).\"</li><br>\n\t\t\t\t<li>\".h($list[\"description_path\"]).\"</li><br>\";\n \n\n\t\t}\n\n\t}\n\n\t//Listed associated items\n\tif($res_items){\n\n\t\twhile($list=$res_items->fetch_assoc()){\n\n\t\t\techo \"<p>\".h($list[\"title\"]).\"</p><br>\n\t\t\t\t<li>\".h($list[\"image_path\"]).\"</li><br>\n\t\t\t\t<li>\".h($list[\"description_path\"]).\"</li><br>\";\n \n\n\t\t}\n\n\t}\n\n\t//Form for the confirmation question and username, password requirement\n\techo \"</div><div class=\\\"main\\\">\n\t\t<form action=\\\"cms_deleteContinentSubmit.php?continent_id=\".u($continent_id).\"\\\" method=\\\"post\\\">\n\tAre you sure you want to delete this?<br>\t\n\tUsername: <input name=\\\"username\\\" type=\\\"text\\\" value=\\\"\\\"></input><br>\n\tPassword: <input name=\\\"password\\\" type=\\\"password\\\" value=\\\"\\\"></input><br>\n\t<input name=\\\"delete\\\" type=\\\"submit\\\" value=\\\"Delete\\\"></input>\n\t<input name=\\\"cancel\\\" type=\\\"submit\\\" value=\\\"Cancel\\\"></input>\n\t</form>\";\n\t\n\t$res_continent->close();\n\t$res_attributes->close();\n\t$res_items->close();\n\t$mysqli->close();\n}", "function delete()\n\t{\n\t\t$model = $this->getModel();\n\t\t$viewType\t= JFactory::getDocument()->getType();\n\t\t$view = $this->getView($this->view_item, $viewType);\n\t\t$view->setLayout('confirmdelete');\n\t\tif (!JError::isError($model)) {\n\t\t\t$view->setModel($model, true);\n\t\t}\n\t\t//used to load in the confirm form fields\n\t\t$view->setModel($this->getModel('list'));\n\t\t$view->display();\n\t}", "function cmdDeleteGeneradorClick($sender, $params)\n {\n global $sContrato;\n $Estimacion=$this->txtEstimacion->Text;\n $this->txtQueOpcion->Text==\"\";\n $sql = \"select sContrato, iNumeroEstimacion from estimaciones\n where\n sContrato='$sContrato'\n and iNumeroEstimacion='$Estimacion'\";\n $result=mysql_query($sql);\n if (!$row=mysql_fetch_array($result))\n {\n $sql = \"delete\n from estimacionperiodo\n where\n sContrato='$sContrato'\n and iNumeroEstimacion='$Estimacion'\";\n mysql_query($sql);\n }\n if(mysql_error())\n {\n ?>\n <script>\n alert(\" <?php echo \" Error al Eliminar los Datos\".mysql_error() ?>\");\n </script>\n <?php\n }\n }", "public function deleteAddress(){\n $key = $_REQUEST['id'];\n //$key = 2;\n $condition['id'] = $key;\n $form = M(\"addressinfo\");\n $data = $form->where($condition)->delete();\n //$this->display();\n }", "function del($id)\n{\n $this->load->module('site_security');\n $this->site_security->_make_sure_is_admin();\n if(!is_numeric($id)){redirect('index');}\n\n $data = $this->fetch_data_from_db($id);\n\n $submit = $this->input->post('submit', TRUE);\n if ($submit=='No, cancelar.'){\n redirect('blog/index');\n }\n\n if ($submit=='Si, borrar.'){\n $this->del_image($id, TRUE);\n $this->_delete($id);\n \n $value = \"<div class='alert alert-danger'>\n <strong>Hecho!</strong> El articulo fue <strong>eliminado</strong> satisfactoriamente.\n </div>\";\n \n $this->session->set_flashdata('delete', $value);\n \tredirect('blog/index');\n } \n\n $data['form_location'] = current_url();\n $data['view_module'] = 'blog';\n $data['view_file'] = \"delete\";\n $this->load->module('templates');\n $this->templates->admin($data);\n\n}", "public function del(){\n\t\t$this->OnlyAdmin();\n\t\tif($this->input->post()){\n\t\t$this->TicketModel->delet($this->input->post());\n\t\tredirect('index.php/ticket/lists');}\n\t}", "function Delete() {\n include('database_connection.php');\n \n if(isset($_POST[\"id\"]))\n {\n $query = \"\n DELETE FROM Task \n WHERE id = '\".$_POST[\"id\"].\"'\n \";\n $statement = $connect->prepare($query);\n $statement->execute();\n}\n\n }", "function display_del_form() {\n global $cfg, $lang;\n \n if ($cfg['xml_lang'] == 'ja') {\n $h2_title = 'ログ削除';\n $h3_title = '全てのアクセスログを削除します。';\n $h3_msg = 'マジックワードを入力し、削除ボタンを押して下さい。';\n $h4_title = '※警告 : 使用上の注意';\n $h4_msg = 'このボタンは、テーブル内のデータを全て空にします。(空になるのはデータのみで、'.\n 'テーブルは削除されません。)<br />'.\n 'データベースを初期状態(空)に戻したい場合のみ、自己責任でご使用下さい。';\n } else {\n $h2_title = 'DELETE LOGS';\n $h3_title = 'DELETE ALL LOGS with magic words';\n $h3_msg = 'Enter the magic words and click the button.';\n $h4_title = 'WARNING : PLEASE USE THIS BUTTON WITH CARE.';\n $H4_msg = 'This button empties your log table. '.\n 'Yes, This button is very dangerous.<br />'.\n 'Please push this at your own risk.';\n }\n \n $delete_form =<<<EOD\n<h2>{$h2_title}</h2>\n<h3>{$h3_title}</h3>\n<p>{$h3_msg}</p>\n<div class=\"important\">\n<h4>{$h4_title}</h4>\n<p>{$h4_msg}</p>\n</div>\n<form method=\"post\" action=\"{$_SERVER['PHP_SELF']}\">\n<p>\n{$lang['magic_words']} : \n<input tabindex=\"6\" accesskey=\"m\" type=\"text\" name=\"del\" value=\"\" />\n</p>\n<p>\n<input tabindex=\"6\" accesskey=\"d\" type=\"submit\" value=\"{$lang['del_all_logs']}\" />\n</p>\n</form>\nEOD;\n return $delete_form;\n}", "public function post_delete(){\n\t\t\t\n\t\t$data \t= \tFiledb::_rawurldecode(json_decode(stripcslashes(Input::get('data')), true));\n\n\t\tif($data[\"delete\"] == 'delete'){\n\t\t\t\n\t\t\t$status = Users::delete($data[\"id\"]);\n\n\t\t\treturn ($status) ? Utilites::success_message(__('forms.deleted_word')) : Utilites::fail_message(__('forms_errors.undefined'));\n\t\t}\n\t}", "function deleteDataInfo()\n {\n $formPost=array();\n $formPost[deleted]=1;\n \n foreach($this->piVars['selectionList'] as $idVal)\n {\n $GLOBALS['TYPO3_DB']->exec_UPDATEquery($this->tableName,'uid='.$idVal,$formPost);\n }\n return $this->showListings();\n }", "public function deleteAction() {\n \n }", "public function deleteMethod(){\n $fc=AppController::getInstance();\n $args=$fc->getArgsNum();\n if(!isset($args[0]))header('Location:/error');\n if(!$good=$this->_db->getGoodBySlug($args[0]))exit(header('Location:/error'));\n $fn=$good->foto;\n if($_SERVER['REQUEST_METHOD']=='POST'){\n if(isset($_POST['yes'])){\n // получено подтверждение на удаление товара\n if(NULL===$err=$this->_db->deleteGoodOfUserShop($good->id,$this->_user->id))if(NULL===$err=ImgProc::deleteFotos($fn))exit(header('Location:/goods'));\n die($err);\n }\n exit(header('Location:/goods'));\n }\n $fc->setContent($fc->render('goods/delete.twig.html',array('this'=>$this,'good'=>$good)));\n }", "public function delete()\n\t{\n\t\t$selection = $this->input->post('selection');\n\t\t$ignore = implode('|', array_diff($this->ignore_list, $selection));\n\t\t$this->member->ignore_list = $ignore;\n\t\t$this->member->save();\n\n\t\tee()->functions->redirect(ee('CP/URL')->make($this->index_url, $this->query_string));\n\t}", "function delete_adstrue_vendor_province($form,&$form_state,$value) {\n $form = array();\n $form['header'] = array(\n '#type' => 'item',\n '#markup' => '<h4>Vui lòng xác nhận để xóa tỉnh thành</h4>',\n );\n $form['province_id'] = array(\n '#type' => 'hidden',\n '#value' => $value,\n );\n return confirm_form($form,'Vui lòng xác nhận để xóa tỉnh thành','province',t(''),t('Xác nhận'),t('Hủy bỏ'));\n}", "public function actionDelete(){\n\t\t$form = $_POST;\n\t\t$db = $this->context->getService('database');\n\t\t$db->exec('DELETE FROM core_pages WHERE id = ?', $form['id']);\n\t\t$this->redirect('pages:');\n\t}", "public function action_delete()\n {\n\t $this->template = View::forge('template-admin');\n\n $post = Input::post();\n $entry = Model_Event::find_by_pk($post[\"id\"]);\n\t\tif ($entry){\n\t\t\tif(!$entry->delete()){\n\t\t\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t\t\t$this->template->title = \"イベント一覧\";\n\t\t\t\t$this->template->content = View::forge('event/index', $data);\n\t\t\t}\n\t\t}\n\t\t$data[\"events\"] = Model_Event::find_all();\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n }", "function delete() {\n\t\t\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\tConfigure::write('debug', 0);\n\t\t\n\t\t$id = $this->Session->read('Member.memberid');\n\t\t\n\t\t// id 4 means trash\n\t\t\n\t\t$activeid = 4;\n\t\t\t$this->Member->updateAll(array(\n\t\t\t\t'Member.active' => \"'\" . $activeid . \"'\"\n\t\t\t), array(\n\t\t\t\t'Member.id' => $id\n\t\t\t));\n\t\t\n\t\techo \"deleted\";\n\t\t\t\n\t\n\t/*\tif ($id) {\n\t\t\t\n\t\t\t$delete = $this->Member->delete($id);\n\t\t\t\n\t\t \tif ($delete) {\n\t\t\t\t$meta = $this->userMeta->deleteAll(array(\n\t\t\t\t\t'userMeta.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$course = $this->TutCourse->deleteAll(array(\n\t\t\t\t\t'TutCourse.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$event = $this->TutEvent->deleteAll(array(\n\t\t\t\t\t'TutEvent.tutor_id' => $id\n\t\t\t\t));\n\t\t\t\t$image = $this->UserImage->deleteAll(array(\n\t\t\t\t\t'UserImage.user_id' => $id\n\t\t\t\t));\n\t\t\t\t\n\t\t\t}\n\t\t\tif ($meta) {\n\t\t\t\techo \"deleted\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} */\n\t\t\n\t\t\n\t\n\t\n\t}", "function action_delete($params) {\n $form_error =false;\n $category= model_category::load_by_id($params[0]);\n $id =$params[0];\n if(isset($_POST['form']['action'])) {\n //Check if the current category contains products.\n if($category::get_products_by_id($id)) {\n //If the category contains products,an error message appears.\n $form_error =TRUE;\n }\n else {\n if( model_category::deleteC($id)){\n header('Location: ' . APP_URL . 'category/list');\n die;\n }\n }\n }\n @include_once APP_PATH . 'view/category_delete.tpl.php';\n }", "function delete()\n {\n }", "public function save_trash_delete_form() {\n global $wpdb;\n\n if (!isset($_REQUEST['action']) || !isset($_GET['page']))\n return;\n\n if ('swpm-form-builder' !== $_GET['page'])\n return;\n\n if ('delete_form' !== $_REQUEST['action'])\n return;\n\n $id = absint($_REQUEST['form']);\n\n check_admin_referer('delete-form-' . $id);\n\n // Delete form and all fields\n $wpdb->query($wpdb->prepare(\"DELETE FROM $this->form_table_name WHERE form_id = %d\", $id));\n $wpdb->query($wpdb->prepare(\"DELETE FROM $this->field_table_name WHERE form_id = %d\", $id));\n\n // Redirect to keep the URL clean (use AJAX in the future?)\n wp_redirect(add_query_arg('action', 'deleted', 'admin.php?page=swpm-form-builder'));\n exit();\n }", "function delete() {\n if (isset($_GET['id'])) {\n $coche=new coches_model();\n\n $id = $_GET['id'];\n\n $error = $coche->delete($id);\n\n if (!$error) {\n header( \"Location: index.php?controller=coches&action=listado\");\n }\n else {\n echo $error;\n }\n }\n }", "function Doctor_Delete(){\n\t\t\n\t\t//when get id from url\n\t\tif(isset($_GET['List']) AND $_GET['List'] != ''){\n\t\t\t\n\t\t\t//move get id into variable\n\t\t\t$get_id = $_GET['List'];\n\t\t\t\n\t\t\t//delete doctor from table\n\t\t\t$this->Delete('users',$get_id,'Add-doctor?List&m');\n\t\t} // ifsset close\n\t}", "function execute()\n\t{\n\t\t$this->obj_form = New form_input;\n\t\t$this->obj_form->formname = \"transaction_delete\";\n\t\t$this->obj_form->language = $_SESSION[\"user\"][\"lang\"];\n\n\t\t$this->obj_form->action = \"accounts/gl/delete-process.php\";\n\t\t$this->obj_form->method = \"post\";\n\t\t\n\n\t\t// general\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"code_gl\";\n\t\t$structure[\"type\"]\t\t= \"text\";\n\t\t$this->obj_form->add_input($structure);\n\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"description\";\n\t\t$structure[\"type\"]\t\t= \"text\";\n\t\t$this->obj_form->add_input($structure);\n\n\n\t\t// hidden\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"id_transaction\";\n\t\t$structure[\"type\"]\t\t= \"hidden\";\n\t\t$structure[\"defaultvalue\"]\t= $this->id;\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\t\t\n\t\t// confirm delete\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"delete_confirm\";\n\t\t$structure[\"type\"]\t\t= \"checkbox\";\n\t\t$structure[\"options\"][\"label\"]\t= \"Yes, I wish to delete this transaction and realise that once deleted the data can not be recovered.\";\n\t\t$this->obj_form->add_input($structure);\n\n\n\n\t\t/*\n\t\t\tCheck that the transaction can be deleted\n\t\t*/\n\n\t\t// define submit field\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"]\t\t= \"submit\";\n\t\t$structure[\"type\"]\t\t= \"submit\";\n\t\t$structure[\"defaultvalue\"]\t= \"delete\";\n\t\t\t\t\n\t\t$this->obj_form->add_input($structure);\n\n\n\t\t\n\t\t// define subforms\n\t\t$this->obj_form->subforms[\"transaction_delete\"]\t= array(\"code_gl\", \"description\");\n\t\t$this->obj_form->subforms[\"hidden\"]\t\t= array(\"id_transaction\");\n\t\t\n\t\tif ($this->locked)\n\t\t{\n\t\t\t$this->obj_form->subforms[\"submit\"]\t= array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->obj_form->subforms[\"submit\"]\t= array(\"delete_confirm\", \"submit\");\n\t\t}\n\n\t\t\n\t\t// fetch the form data\n\t\t$this->obj_form->sql_query = \"SELECT code_gl, description FROM `account_gl` WHERE id='\". $this->id .\"' LIMIT 1\";\n\t\t$this->obj_form->load_data();\n\n\t}", "function procMenuAdminDeleteButton()\n\t{\n\t\t$menu_srl = Context::get('menu_srl');\n\t\t$menu_item_srl = Context::get('menu_item_srl');\n\t\t$target = Context::get('target');\n\t\t$filename = Context::get('filename');\n\t\tFileHandler::removeFile($filename);\n\n\t\t$this->add('target', $target);\n\t}", "function displayDeleteScreen()\t{\n\t\t$pluginId=$conf['pluginId'];\n\t\t$content=\"feal : displayDeleteScreen unset content\";\n\t\tif ($this->conf['delete'])\t{\t// If deleting is enabled\n\t\t\t$origArr = $GLOBALS['TSFE']->sys_page->getRawRecord($this->theTable, $this->recUid);\n\t\t\tif (($GLOBALS['TSFE']->loginUser && $this->conf['requireLogin']) || ($this->aCAuth($origArr) && $this->conf['requireLogin']) || !$this->conf['requireLogin'])\t{\t// Must be logged in OR be authenticated by the aC code in order to delete\n\t\t\t\t\t// If the recUid selects a record.... (no check here)\n\t\t\t\t\t\n\t\t\t\tif (is_array($origArr))\t{\n\n\t\t\t\t\tif ($this->aCAuth($origArr) || $this->metafeeditlib->DBmayFEUserEdit($this->theTable,$origArr, $GLOBALS['TSFE']->fe_user->user,$this->conf['allowedGroups'],$this->conf['fe_userEditSelf'],$this->conf))\t{\t// Display the form, if access granted.\n\t\t\t\t\t\t$this->markerArray['###HIDDENFIELDS###'].= '<input type=\"hidden\" name=\"rU['.$pluginId.']\" value=\"'.$this->recUid.'\" />';\n\t\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_DELETE_PREVIEW###', $origArr);\n\t\t\t\t\t} else {\t// Else display error, that you could not edit that particular record...\n\t\t\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_NO_PERMISSIONS###');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$content='Object already deleted';\n\t\t\t\t}\n\t\t\t} else {\t// Finally this is if there is no login user. This must tell that you must login. Perhaps link to a page with create-user or login information.\n\t\t\t\t$content = $this->metafeeditlib->getPlainTemplate($this->conf,$this->markerArray,'###TEMPLATE_AUTH###');\n\t\t\t}\n\t\t} else {\n\t\t\t$content='Delete-option is not set in TypoScript';\n\t\t}\n\t\t$content=$content?$content:'No template for delete screen';\n\t\treturn $content;\n\t}", "private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}", "function kala_revision_batch_delete_form() {\n // Initialize Vars.\n $form = array();\n\n // Date text field.\n $form['date'] = array(\n '#type' => 'textfield',\n '#title' => t('Delete nodes revisions before this time.'),\n '#description' => t('Enter as a -1 day, 1-year, etc. Defaults to -90 days.'),\n '#default_value' => t('-90 days'),\n '#required' => TRUE,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Delete These Revisions!'),\n '#submit' => array('kala_revision_batch_delete_form_submit'),\n );\n\n return $form;\n}", "public function delete()\n {\n $textvalues = $this->gettextvalues();\n $this->deleteValues($textvalues);\n \n $componentvalues = $this->getcomponentvalues();\n $this->deleteValues($componentvalues);\n \n $filevalues = $this->getfilevalues();\n $this->deleteValues($filevalues);\n \n $contributorvalues = $this->getcontributorvalues();\n $this->deleteValues($contributorvalues);\n \n parent::delete();\n }", "function print_delete_form($stu) {\n $url = 'index.php';\n $message = get_string('student_deleteconfirm', 'block_curr_admin', cm_fullname($stu->user));\n $optionsyes = array('s' => 'stu', 'section' => 'curr', 'id' => $stu->classid,\n 'action' => 'confirm', 'association_id' => $stu->id, 'confirm' => md5($stu->id));\n $optionsno = array('s' => 'stu', 'section' => 'curr', 'id' => $stu->classid);\n\n echo cm_delete_form($url, $message, $optionsyes, $optionsno);\n }", "public function employee_form_delete()\n {\n $this->common_model->checkAdminUserPermission(9);\n if ($this->session->userdata('admin_id'))\n {\n $id = $_GET['id'];\n $this->db->where('id', $id);\n // $this->db->where_not_in('ID', $ids);\n $this->db->delete('tbl_yourself');\n\n redirect(base_url() . \"employee_form\");\n }\n else\n {\n redirect(base_url() . \"admin\");\n }\n }", "function default_delete(){\n\tglobal $assign_list, $_CONFIG, $_SITE_ROOT, $mod;\n\tglobal $core, $clsModule, $clsButtonNav;\n\t$classTable = \"User\";\n\t$pkeyTable = \"id\";\n\t//################### CAN NOT MODIFY BELOW CODE ###################\n\t$clsTable = new $classTable();\n\t$pval = isset($_REQUEST[$pkeyTable])? $_REQUEST[$pkeyTable] : \"\";\n\tif ($pval!=\"\"){\n\t\t$clsTable->deleteOne($pval);\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod\");\n\t}\n\t$checkList = isset($_POST[\"checkList\"])? $_POST[\"checkList\"] : \"\";\n\tif (is_array($checkList)){\n\t\tforeach ($checkList as $key => $val){\n\t\t\t$clsTable->deleteOne($val);\n\t\t}\n\t\theader(\"location: ?$_SITE_ROOT&mod=$mod\");\n\t}\n\tunset($clsTable);\n}", "function delete()\n {\n if ($this->GET('sure')) {\n $function = basename($this->table->tablename()) . \"_onRowDelete\";\n if (function_exists($function)) {\n $function($this->table->data($this->GET('id')), &$this->table);\n }\n\n $this->table->delete($this->GET('id'));\n $this->table->write();\n $this->browse();\n return;\n }\n $this->displayHead();\n echo 'Do you really want to<br>delete row \\'' . $this->GET('id') . '\\'?<p>';\n echo '<a class=\"danger\" href=\"' . $this->SELF . '?method=delete&table=' . $this->table->tablename() . '&id=' . $this->GET('id') . '&sure=1\">Yes</a> | ';\n echo '<a href=\"' . $this->SELF . '?method=browse&table=' . $this->table->tablename() . '\">No</a>';\n }", "public function suppr()\n {\n $voyage_id = null;\n\n if (!empty($_GET['id']) && ctype_digit($_GET['id'])) {\n $voyage_id = $_GET['id'];\n }\n\n if (!$voyage_id) {\n die('please enter a proper number in the url for this to delete.');\n }\n\n\n $voyage_to_delete = $this->model->find($voyage_id, $this->modelName);\n $velo_id = $voyage_to_delete->velo_id;\n\n if (!$voyage_to_delete) {\n die(\"Does Not Exist\");\n }\n\n $this->model->delete($voyage_id);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "function onDelete($param)\n {\n $key=$param['key'];\n \n // define duas acoes\n $action1 = new TAction(array($this, 'Delete'));\n \n // define os parametros de cada acao\n $action1->setParameter('key', $key);\n \n //encaminha a chave estrangeira\n $action1->setParameter('fk', filter_input(INPUT_GET, 'fk'));\n\n // exibe um dialogo ao usuario\n new TQuestion('Deseja realmente excluir o registro ?', $action1, $action2);\n }", "public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "public function delete()\n\t{\n\t\t$id = $this->input->post('primary_id');\n\t\tif($this->mdl_plant->delete($id)) {\n\t\t\techo true;\n\t\t} else {\n\t\t\techo false;\n\t\t}\n\t}", "function deleteAction()\r\n\t{\r\n\t\t$data['message'] = \"\";\r\n\t\t$MaNguoiDung = $_GET['MaNguoiDung']; \r\n\r\n\t\t//echo $MaNguoiDung;\r\n\t\tif (isset($MaNguoiDung)) {\r\n\r\n\t\t\t$this->model->load(\"Nguoidung\");\r\n\t\t\t$nguoidung = new Nguoidung_Model();\r\n\t\t\t$nguoidung->delete($MaNguoiDung);\r\n\t\t\t$data['message'] = \"xóa người dùng thành công\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data['message'] = \"không tồn tại mã người dùng\";\r\n\t\t}\r\n\r\n\t\t$this->indexAction($data);\r\n\t\t\r\n\t}", "public function adminDelComm()\n {\n $commID = $_POST['commID'];\n $del = \"DELETE FROM comment_section WHERE comm_id = ?\";\n $do = $this->connect()->prepare($del);\n $do->execute([$commID]);\n }", "public function deleting()\n {\n # code...\n }", "function execute()\n\t{\n\t\t$this->obj_form = New form_input;\n\t\t$this->obj_form->formname = \"chart_delete\";\n\t\t$this->obj_form->language = $_SESSION[\"user\"][\"lang\"];\n\n\t\t$this->obj_form->action = \"accounts/charts/delete-process.php\";\n\t\t$this->obj_form->method = \"post\";\n\t\t\n\n\t\t// general\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"code_chart\";\n\t\t$structure[\"type\"]\t\t= \"text\";\n\t\t$this->obj_form->add_input($structure);\n\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"description\";\n\t\t$structure[\"type\"]\t\t= \"text\";\n\t\t$this->obj_form->add_input($structure);\n\n\n\t\t// hidden\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"id_chart\";\n\t\t$structure[\"type\"]\t\t= \"hidden\";\n\t\t$structure[\"defaultvalue\"]\t= $this->id;\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\t\t\n\t\t// confirm delete\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"delete_confirm\";\n\t\t$structure[\"type\"]\t\t= \"checkbox\";\n\t\t$structure[\"options\"][\"label\"]\t= \"Yes, I wish to delete this account and realise that once deleted the data can not be recovered.\";\n\t\t$this->obj_form->add_input($structure);\n\n\n\n\t\t// define submit field\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] = \"submit\";\n\t\t$structure[\"type\"]\t\t= \"submit\";\n\t\t$structure[\"defaultvalue\"]\t= \"delete\";\n\t\t$this->obj_form->add_input($structure);\n\n\n\t\t\n\t\t// define subforms\n\t\t$this->obj_form->subforms[\"chart_delete\"]\t= array(\"code_chart\", \"description\");\n\t\t$this->obj_form->subforms[\"hidden\"]\t\t= array(\"id_chart\");\n\n\t\tif ($this->locked)\n\t\t{\n\t\t\t$this->obj_form->subforms[\"submit\"]\t= array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->obj_form->subforms[\"submit\"]\t\t= array(\"delete_confirm\", \"submit\");\n\t\t}\n\n\t\t\n\t\t// fetch the form data\n\t\t$this->obj_form->sql_query = \"SELECT code_chart, description FROM `account_charts` WHERE id='\". $this->id .\"' LIMIT 1\";\n\t\t$this->obj_form->load_data();\n\t}", "public function del()\n\t\t{\n\t\t\tif(isset($_POST['id']))\n\t\t\t{\n\t\t\t\t$idEmployee = $_POST['id'];\n\n\t\t\t\tif($this->emp->delEmployee($idEmployee))\n\t\t\t\t{\n\t\t\t\t\theader('location:index.php');\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function delete()\r\n {\r\n\r\n }", "static public function ctrDeletePart(){\n\n\t\tif(isset($_GET[\"idPart\"])){\n\n\t\t\t$table =\"parts\";\n\t\t\t$data = $_GET[\"idPart\"];\n\n\t\t\tif($_GET[\"image\"] != \"\" && $_GET[\"image\"] != \"views/img/parts/default/anonymous.png\"){\n\n\t\t\t\tunlink($_GET[\"image\"]);\n\t\t\t\trmdir('views/img/parts/'.$_GET[\"code\"]);\n\n\t\t\t}\n\n\t\t\t$answer = PartsModel::mdlDeletePart($table, $data);\n\n\t\t\tif($answer == \"ok\"){\n\n\t\t\t\techo'<script>\n\n\t\t\t\tswal({\n\t\t\t\t\t type: \"success\",\n\t\t\t\t\t title: \"The Part has been successfully deleted\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Close\"\n\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\twindow.location = \"parts\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t</script>';\n\n\t\t\t}\t\t\n\t\t\n\t\t}\n\n\t}", "function deleterec($recid)\r\n{\r\n\t$res = sql_select();\r\n \t$count = sql_getrecordcount();\r\n \tmysqli_data_seek($res, $recid);\r\n \t$row = mysqli_fetch_assoc($res);\r\n \tshowrecnav(\"del\", $recid, $count);\r\n?>\r\n\t<br>\r\n\t<form action=\"products/processProduct.php?status=true&action=delete\" method=\"post\">\r\n\t\t<input type=\"hidden\" name=\"sql\" value=\"delete\">\r\n\t\t<input type=\"hidden\" name=\"cat_id\" value=\"<?php echo $row[\"prod_code\"] ?>\">\r\n\t\t<?php showrow($row, $recid) ?>\r\n\t\t<p><input type=\"submit\" name=\"action\" value=\"Confirm\"></p>\r\n\t</form>\r\n<?php\r\n mysqli_free_result($res);\r\n}", "function deleterec($recid)\r\n{\r\n\t$res = sql_select();\r\n \t$count = sql_getrecordcount();\r\n \tmysqli_data_seek($res, $recid);\r\n \t$row = mysqli_fetch_assoc($res);\r\n \tshowrecnav(\"del\", $recid, $count);\r\n?>\r\n\t<br>\r\n\t<form action=\"company/processCompany.php?status=true&action=delete\" method=\"post\">\r\n\t\t<input type=\"hidden\" name=\"sql\" value=\"delete\">\r\n\t\t<input type=\"hidden\" name=\"customer_id\" value=\"<?php echo $row[\"customer_id\"] ?>\">\r\n\t\t<?php showrow($row, $recid) ?>\r\n\t\t<p><input type=\"submit\" name=\"action\" value=\"Confirm\"></p>\r\n\t</form>\r\n<?php\r\n mysqli_free_result($res);\r\n}", "function execute()\n\t{\n\t\t$this->obj_form = New form_input;\n\t\t$this->obj_form->formname = \"user_delete\";\n\t\t$this->obj_form->language = $_SESSION[\"user\"][\"lang\"];\n\n\t\t$this->obj_form->action = \"user/user-delete-process.php\";\n\t\t$this->obj_form->method = \"post\";\n\t\t\n\n\t\t// general\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"username\";\n\t\t$structure[\"type\"]\t\t= \"text\";\n\t\t$this->obj_form->add_input($structure);\n\n\n\t\t// hidden\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"id_user\";\n\t\t$structure[\"type\"]\t\t= \"hidden\";\n\t\t$structure[\"defaultvalue\"]\t= $this->id;\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\t\t\n\t\t// confirm delete\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"delete_confirm\";\n\t\t$structure[\"type\"]\t\t= \"checkbox\";\n\t\t$structure[\"options\"][\"label\"]\t= \"Yes, I wish to delete this user and realise that once deleted the data can not be recovered.\";\n\t\t$this->obj_form->add_input($structure);\n\n\n\n\t\t// define submit field\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"]\t\t= \"submit\";\n\t\t$structure[\"type\"]\t\t= \"submit\";\n\t\t$structure[\"defaultvalue\"]\t= \"delete\";\n\t\t$this->obj_form->add_input($structure);\n\n\n\t\t\n\t\t// define subforms\n\t\t$this->obj_form->subforms[\"user_delete\"]\t= array(\"username\");\n\t\t$this->obj_form->subforms[\"hidden\"]\t\t= array(\"id_user\");\n\t\t$this->obj_form->subforms[\"submit\"]\t\t= array(\"delete_confirm\", \"submit\");\n\n\t\t\n\t\t// fetch the form data\n\t\t$this->obj_form->sql_query = \"SELECT username FROM `users` WHERE id='\". $this->id .\"' LIMIT 1\";\n\t\t$this->obj_form->load_data();\n\n\n\t}", "function delete(){\n global $wpdb;\n global $DOPBSP;\n \n $id = $_POST['id'];\n \n $select_option = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n $wpdb->delete($DOPBSP->tables->forms_fields_options, array('id' => $id));\n \n echo $select_option->field_id;\n \n die();\n }", "public function deleteAction()\n {\n \n }", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "public function Do_delete_Example1(){\n\n\t}", "function dev_delete($cmd_list) {\r\n\tglobal $gResult;\r\n\t$msg;\r\n\t$devName = search_cmdOpt($cmd_list, 'n');\r\n\tif ($devName == \"\") {\r\n\t\t$msg = \"couldn't delete a developer without the name\";\r\n\t} else {\r\n\t\t$dev_controller = new Developer_Controller(new Developer);\r\n\t\t$msg = $dev_controller->delete($devName);\r\n\t}\r\n\t$gResult = $gResult.$msg;\r\n\treturn cCmdStatus_OK; \r\n}", "function Eliminar(){\n\t \n\t $this->Model->Eliminar($_GET['id']);\n\t\t\n\t }", "function delete_record () { //deletes a record\n\t\t\n\t\t//deletes record\n\t\t$pdo = Database::connect();\n\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t$sql = \"DELETE FROM customers WHERE id = ?\";\n\t\t$q = $pdo->prepare($sql);\n\t\t$q->execute(array($_GET['id']));\n\t\tDatabase::disconnect();\n\t\theader(\"Location: customer.php\");\n\t\t\t\n\t}", "public function delete()\n {\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n if (!isset($_GET['id'])) {\n call('pages', 'error');\n return;\n }\n // we use the given id to get the correct product\n show_view('views/admin/bodyparts/delete.php', ['bodyPart' => BodyPart::find($_GET['id'])]);\n } else { //case when we are writing the bodypart to the database\n $id = filter_input(INPUT_POST, 'id', FILTER_SANITIZE_SPECIAL_CHARS);\n BodyPart::remove($id);\n redirect('body_parts', 'readAll');\n }\n }", "public function remove(){\n if(!empty($_POST['id'])){\n $val = new ValidaModel();\n $val->Idvalida=$_POST['id'];\n $val->del();\n }\n header('location: '.FOLDER_PATH.'/Valida');\n }", "public function index_delete(){\n\t\t\n\t\t}", "public function getDeleteform($id){\n $id = Crypt::decrypt($id);\n $itemtypelete=RItemType::find($id);\n if($itemtypelete->delete()){\n Session::flash('sms_success', trans('sta.save_data_success'));\n return Redirect::to('itemtype');\n }\n }", "function delete() \n {\n \n }", "function do_delete(){\n\t\t// remove from fieldset:\n\t\t$fieldset = jcf_fieldsets_get( $this->fieldset_id );\n\t\tif( isset($fieldset['fields'][$this->id]) )\n\t\t\tunset($fieldset['fields'][$this->id]);\n\t\tjcf_fieldsets_update( $this->fieldset_id, $fieldset );\n\t\t\n\t\t// remove from fields array\n\t\tjcf_field_settings_update($this->id, NULL);\n\t}", "public function delete()\n {\n $post['id'] = $this->request->getParameter('id'); // récupérer le paramètre de l'ID\n $this->post->deletePost($post['id']);\n $this->redirect(\"admin\", \"chapters\"); // une fois le post supprimé, je redirige vers la vue chapters\n }", "function delete_row($table_name, $redirect_filename, $id_column_name, $row_id)\n{\n ?>\n <td>\n <form class=\"form-horizontal\" action=\"<?= $_SERVER['SCRIPT_NAME'] ?>?p=delete\" method=\"post\">\n <input type=\"hidden\" name=\"table\" value=\"<?= $table_name ?>\">\n <input type=\"hidden\" name=\"return\" value=\"<?= $redirect_filename ?>\">\n <input type=\"hidden\" name=\"id_column\" value=\"<?= $id_column_name ?>\">\n <input type=\"hidden\" name=\"id\" value=\"<?= $row_id ?>\">\n <button type=\"submit\" class=\"btn btn-danger btn-xs\"><span class=\"glyphicon glyphicon-trash\"></span> Delete\n </button>\n </form>\n </td>\n <?php\n}", "function DeleteToDB()\n\t{\n\t\tif(isset($_GET['job_id']))\n\t\t{\n\t\t\t//Initializing variables with the user inputs\n\t\t\t$Id = $_GET['job_id'];\n\t\t\t\n\t\t\tif(!empty($Id))\n\t\t\t{\t\t\t\t\n\t\t\t\t//Query which is going to execute to for database manipulation\n\t\t\t\t$query =\"DELETE FROM job_details WHERE id='$Id'\";\n\t\t\t\t$query_run = mysql_query($query);\n\t\t\t}\n\t\t}\t\n\t}", "function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}", "function delete()\r\n\t{\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\t\tglobal $mainframe;\r\n\t\t$model\t= &$this->getModel( 'table' );\r\n\t\t$ids = JRequest::getVar('ids', array(), 'request', 'array');\r\n\t\t$model->deleteRows( $ids );\r\n\t\tif ( JRequest::getVar('format') == 'raw') {\r\n\t\t\tJRequest::setVar( 'view', 'table' );\r\n\t\t\t$this->display();\r\n\t\t} else {\r\n\t\t\t//@TODO: test this\r\n\t\t\t$ref = JRequest::getVar( 'fabrik_referrer', \"index.php\", 'post' );\r\n\t\t\t$mainframe->redirect( $ref, count($ids) . \" \" . JText::_( 'RECORDS DELETED' ) );\r\n\t\t}\r\n\t}", "final public function delete() {\n global $config; \n # Borrar el elemento de la base de datos\n $this->db->query(\"DELETE FROM guarderia_2 WHERE id_guarderia = $this->id\");\n # Redireccionar a la página principal del controlador\n $this->functions->redir($config['site']['url'] . 'sedes/&success=true');\n }", "public static function delete(){\n\t\tif(isset($_POST['formId']) && isset($_POST['personnalInformationName'])){\n\t\t\t$data = array(\n\t\t\t\t\"formId\" => $_POST['formId'],\n\t\t\t\t\"personnalInformationName\" => $_POST['personnalInformationName']\n\t\t\t);\n\t\t\techo json_encode(ModelAssocFormPI::delete($data));\n\t\t}else{\n\t\t\techo json_encode(false);\n\t\t}\n\t}", "public function deleteOrder(){\r\n $cookies = new CookieModel();\r\n $cookie_id = $cookies -> read();\r\n $Form = M('userinfo');\r\n $condition_in['stuid'] = $cookie_id;\r\n $data = $Form->where($condition_in)->find();\r\n if (! $data['manager']) $this->redirect('/');\r\n\r\n $key = $_REQUEST['id'];\r\n //$key = 2;\r\n $condition['id'] = $key;\r\n $form = M(\"orderinfo\");\r\n $data = $form->where($condition)->delete();\r\n $this->redirect('/index.php/Admin/index');\r\n //$this->display();\r\n }", "function delete(){\n\t\t\t\t$servername = \"localhost\";\n\t\t\t\t$username = \"root\";\n\t\t\t\t$password = \"\";\n\t\t\t\t$dbname = \"CS230\";\n\t\t\t\t//Variables for holding entity data\n\t\t\t\t$i = $_POST['i'];\n\t\t\t\t$conn = mysqli_connect($servername, $username, $password, $dbname);\n\t\t\t\tif($conn){\n\t\t\t\t//echo \"Connection OK\";\n\t\t\t\t}else{\n\t\t\t\t\tdie(\"The Connection has failed: \" .mysqli_connect_error());\n\t\t\t\t}\n\t\t\t\t$sql = \"DELETE FROM eBook_MetaData WHERE id='$i'\";\n\t\t\t\t$data = mysqli_query($conn,$sql);\n\t\t\t\t\t//If data is not transfered to the database\n\t\t\t\t\tif(!$data){\n\t\t\t\t\techo \"error\";\n\t\t\t\t\t//If it is transfered\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo \"Data deleted\";\n\t\t\t\t\t}\n\t\t\t\t$conn = null;\n\t\t\t\t}", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function deleteAction() : object\n {\n if ($_SESSION['permission'] === \"admin\") {\n $form = new DeleteForm($this->di);\n $form->check();\n\n $this->page->add(\"user/crud/delete\", [\n \"form\" => $form->getHTML(),\n ]);\n\n return $this->page->render([\n \"title\" => \"Delete an item\",\n ]);\n }\n $this->di->get(\"response\")->redirect(\"user/login\");\n }", "public function undeleteAction(){\n\t}", "public function eliminar() {\n\t\t\n\t\t\n\t\t$juradodni = $_GET[\"dniJurado\"];\n\t\t\n\t\t$this -> JuradoMapper -> delete($juradodni);\n\n\t\t\n\t\t$this -> view -> redirect(\"jurado\", \"listar\");\n\t\t//falta cambiar\n\t}", "function deleteEntry() \n { \n\t parent::deleteEntry();\n\n\t $values = $this->getArrayOfValues();\n// \t echo \"<pre>\".print_r($values,true).\"</pre>\";\n\t \n\t if (isset($values['reg_id']))\n\t {\n\t \n\t\t // update balance owing column in cim_reg_registration table\n\t\t $singleReg = new RowManager_RegistrationManager($values['reg_id']);\n// \t\t $singleReg_list = $singleReg->getListIterator();\n// \t\t $singleReg_array = $singleReg_list->getDataList();\n// \t\t \n// \t\t reset($singleReg_array);\n// \t\t $record = current($singleReg_array);\n// \t\t $oldBalance = $record['registration_balance'];\n\t\t \n\t\t\t $balanceGetter = new FinancialTools();\n\t\t\t $balance = array();\n// \t\t\t $balance['registration_balance'] = $oldBalance - $record['cctransaction_amount'];\n\t\t\t $balance['registration_balance'] = $balanceGetter->simpleCalcBalanceOwing($values['reg_id']);\t\n\t\t\t $singleReg->loadFromArray( $balance );\n\t\t\t $singleReg->updateDBTable();\t\t\t\n\t\t }\t \t \n \n }", "function DeleteRangeForm($strDatabase, $strTable, $strPK)\n{\n\t//gus mueller, nov 26 2006\n\t$strClassFirst=\"bgclassfirst\";\n\t$strLineClass=\"bgclassline\";\n\t$strOtherBgClass=\"bgclassother\";\n\t$out= \"\";\n\t$preout= \"\";\n\t$preout.= adminbreadcrumb(false, $strDatabase, \"tf.php?\" . qpre . \"db=\" . $strDatabase, \"db tools\", $strPHP . \"?\" . qpre . \"db=\" . $strDatabase, \"Delete range of IDs from this table and dependent rows in other tables\", \"\") ;\n\t//$out.= AdminNav(true);\n\t\n\t$preout.= \"<form method=\\\"post\\\" name=\\\"BForm\\\" action=\\\"tf_delete_range.php\\\">\\n\";\n \t// TextInput(qpre .\"table\", $strTable, \"30\",\"\", \"\", \"\")\n\t$out.=htmlrow(\"bgclassline\", \"table name:\",\n\t\tTableDropdown($strDatabase,$strTable, qpre .\"table\" )\n\t);\n\t$out.=htmlrow(\"bgclassfirst\", \"start:\",\n\t TextInput(qpre .\"low\", \"\", \"30\",\"\", \"\", \"\")\n\t \n\t);\n\t$out.=htmlrow(\"bgclassfirst\", \"end:\",\n\t TextInput(qpre .\"high\", \"\", \"30\",\"\", \"\", \"\")\n\t \n\t);\n\t\n\t$out.=\"<tr>\\n\";\n\t$out.=\"<td align=\\\"right\\\" colspan=\\\"2\\\">\\n\";\n\t//$out.=CheckboxInput(qpre . \"directediting\", 1, $bwlDirectediting, \"\", \"\", \"\") . \"allow direct editing of results \";\n\t//$out.=\"&nbsp;&nbsp;&nbsp;&nbsp;\";\n \t//$out.=CheckboxInput(qpre . \"truncate\", 1, $trunc, \"\", \"\", \"\") . \"truncate fields\";\n\t$out.=\"<input type=\\\"Submit\\\" class=\\\"btn\\\" onmouseover=\\\"this.className='btn btnhov'\\\" onmouseout=\\\"this.className='btn'\\\" value=\\\"Delete Range\\\">\";\n\t$out.=\"</td>\\n\";\n\t$out.=\"</tr>\\n\";\n\t$out=$preout . TableEncapsulate($out, false);\n\t$out.=\"</form>\";\n\treturn $out;\n}", "public function delete()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'component', 'delete')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tif (!empty($_POST)) {\n\t\t\t$component = $this->podb->from('component')->where('id_component', $this->postring->valid($_POST['id'], 'sql'))->limit(1)->fetch();\n\t\t\t$componentType = $component['type'];\n\t\t\tif ($componentType == 'component') {\n\t\t\t\t$folderinstall = 'component';\n\t\t\t} else {\n\t\t\t\t$folderinstall = 'widget';\n\t\t\t}\n\t\t\tif (file_exists('../'.DIR_CON.'/'.$folderinstall.'/'.$component['component'].'/uninstall.php')) {\n\t\t\t\theader('location:admin.php?mod=component&act=uninstall&folder='.$component['component']);\n\t\t\t} else {\n\t\t\t\t$delete_dir = new PoDirectory();\n\t\t\t\tif ($component['active'] == 'Y') {\n\t\t\t\t\t$delete_folder = $delete_dir->deleteDir('../'.DIR_CON.'/'.$folderinstall.'/'.$component['component']);\n\t\t\t\t} else {\n\t\t\t\t\t$delete_folder = $delete_dir->deleteDir('../'.DIR_CON.'/'.$folderinstall.'/_'.$component['component']);\n\t\t\t\t}\n\t\t\t\tif ($delete_folder) {\n\t\t\t\t\t$query = $this->podb->deleteFrom('component')->where('id_component', $this->postring->valid($_POST['id'], 'sql'));\n\t\t\t\t\t$query->execute();\n\t\t\t\t\t$this->poflash->success($GLOBALS['_']['component_message_2'], 'admin.php?mod=component');\n\t\t\t\t} else {\n\t\t\t\t\t$this->poflash->error($GLOBALS['_']['component_message_4'], 'admin.php?mod=component');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function deleteAttributeForm(){\n\n\t//Database connection\n\tglobal $mysqli;\n\t\n\t//Selected continent and attribute\n\t$continent_id=$_GET[\"continent_id\"];\n\t$continent_name=$_GET[\"continent_name\"];\n\t$attribute_id=$_GET[\"attribute_id\"];\n\t$attribute_name=$_GET[\"attribute_name\"];\n\n\t//Selected attribute and items from the database\n\t$sql_attributes=\"SELECT * FROM attributes WHERE continent_id=\".d($mysqli, $continent_id).\" AND attribute_id=\".d($mysqli, $attribute_id).\"; \";\n\t$res_attributes=mysqli_query($mysqli, $sql_attributes);\n\t$sql_items=\"SELECT * FROM items WHERE continent_id=\".d($mysqli, $continent_id).\" AND attribute_id=\".d($mysqli, $attribute_id).\";\";\n\t$res_items=mysqli_query($mysqli, $sql_items);\n\n\t//Delete page header\n\techo \"<div class=\\\"heading\\\">\n\t\t<h2>You are about to delete all items associated with \".h($continent_name).\" \".h($attribute_name).\"</h2>\n\t\t<h3>The following items will be deleted:</h3><br>\";\n\n\n\t//List of associated files to be deleted\n\tif($res_attributes){\n\n\t\twhile($list=$res_attributes->fetch_assoc()){\n\n\t\t\techo \"<p>Folder: \".h($list[\"attribute_name\"]).\"</p><br>\n\t\t\t\t<li>\".h($list[\"image_path\"]).\"</li><br>\n\t\t\t\t<li>\".h($list[\"description_path\"]).\"</li><br>\";\n \n\n\t\t}\n\n\t}\n\n\tif($res_items){\n\n\t\twhile($list=$res_items->fetch_assoc()){\n\n\t\t\techo \"<p>\".h($list[\"title\"]).\"</p><br>\n\t\t\t\t<li>\".h($list[\"image_path\"]).\"</li><br>\n\t\t\t\t<li>\".h($list[\"description_path\"]).\"</li><br>\";\n \n\n\t\t}\n\n\t}\n\n\t//Form for confirmation and password, username input\n\techo \"</div><div class=\\\"main\\\">\n\t\t<form action=\\\"cms_deleteAttributeSubmit.php?continent_id=\".u($continent_id).\"&attribute_id=\".u($attribute_id).\"\\\" method=\\\"post\\\">\n\tAre you sure you want to delete this?<br>\t\n\tUsername: <input name=\\\"username\\\" type=\\\"text\\\" value=\\\"\\\"></input><br>\n\tPassword: <input name=\\\"password\\\" type=\\\"password\\\" value=\\\"\\\"></input><br>\n\t<input name=\\\"delete\\\" type=\\\"submit\\\" value=\\\"Delete\\\"></input>\n\t<input name=\\\"cancel\\\" type=\\\"submit\\\" value=\\\"Cancel\\\"></input>\n\t</form>\";\n\n\t$res_attributes->close();\n\t$res_items->close(); \n\t$mysqli->close();\n\n}", "function execute()\n\t{\n\t\t$this->obj_form = New form_input;\n\t\t$this->obj_form->formname = \"timebilled_delete\";\n\t\t$this->obj_form->language = $_SESSION[\"user\"][\"lang\"];\n\n\t\t$this->obj_form->action = \"projects/timebilled-delete-process.php\";\n\t\t$this->obj_form->method = \"post\";\n\t\n\t\n\t\t// general\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"name_group\";\n\t\t$structure[\"type\"]\t\t= \"text\";\n\t\t$this->obj_form->add_input($structure);\n\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"name_customer\";\n\t\t$structure[\"type\"]\t\t= \"text\";\n\t\t$this->obj_form->add_input($structure);\n\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"description\";\n\t\t$structure[\"type\"]\t\t= \"text\";\n\t\t$this->obj_form->add_input($structure);\n\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"code_invoice\";\n\t\t$structure[\"type\"]\t\t= \"text\";\n\t\t$this->obj_form->add_input($structure);\n\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"delete_confirm\";\n\t\t$structure[\"type\"]\t\t= \"checkbox\";\n\t\t$structure[\"options\"][\"label\"]\t= \"Yes, I wish to delete this time group and realise that once deleted the data can not be recovered.\";\n\t\t$this->obj_form->add_input($structure);\n\n\t\n\n\n\t\t// hidden values\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"]\t\t= \"projectid\";\n\t\t$structure[\"type\"]\t\t= \"hidden\";\n\t\t$structure[\"defaultvalue\"]\t= $this->id;\n\t\t$this->obj_form->add_input($structure);\n\t\t\n\t\t$structure = null;\n\t\t$structure[\"fieldname\"]\t\t= \"groupid\";\n\t\t$structure[\"type\"]\t\t= \"hidden\";\n\t\t$structure[\"defaultvalue\"]\t= $this->groupid;\n\t\t$this->obj_form->add_input($structure);\n\t\n\t\t\n\t\t// submit button\n\t\t$structure = NULL;\n\t\t$structure[\"fieldname\"] \t= \"submit\";\n\t\t$structure[\"type\"]\t\t= \"submit\";\n\t\t$structure[\"defaultvalue\"]\t= \"delete\";\n\t\t$this->obj_form->add_input($structure);\n\n\t\t\n\n\t\t// fetch the form data if editing\n\t\t$this->obj_form->sql_query = \"SELECT name_group, description, account_ar.code_invoice, CONCAT_WS(' -- ', customers.code_customer, customers.name_customer) as name_customer FROM time_groups LEFT JOIN customers ON customers.id = time_groups.customerid LEFT JOIN account_ar ON account_ar.id = time_groups.invoiceid WHERE time_groups.id='\". $this->groupid .\"' LIMIT 1\";\n\t\t$this->obj_form->load_data();\n\n\n\t\t// display the subforms\n\t\t$this->obj_form->subforms[\"timebilled_details\"]\t= array(\"name_group\", \"name_customer\", \"code_invoice\", \"description\");\n\t\t$this->obj_form->subforms[\"hidden\"]\t\t= array(\"projectid\", \"groupid\");\n\t\t\n\t\tif ($this->locked)\n\t\t{\n\t\t\t$this->obj_form->subforms[\"submit\"]\t= array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->obj_form->subforms[\"submit\"]\t= array(\"delete_confirm\", \"submit\");\n\t\t}\n\t}", "function admin_delete($id){\n\t\t$this->loadModel('Pri');\n\t\t$this->Pri->delete($id);\n\t\t$this->Session->setFlash('Le contenu a bien été supprimé'); \n\t\t$this->redirect('admin/prix/index'); \n\t}" ]
[ "0.7396423", "0.7295664", "0.7004687", "0.7004598", "0.69948024", "0.6977662", "0.69732225", "0.6943188", "0.6940848", "0.6896358", "0.6840411", "0.6798465", "0.67909914", "0.6738867", "0.67353976", "0.67347413", "0.6725119", "0.6712503", "0.6712503", "0.6705137", "0.668117", "0.6642865", "0.6630426", "0.6623532", "0.6621953", "0.6617619", "0.66156906", "0.6602206", "0.66008365", "0.65992856", "0.6593253", "0.6584817", "0.65837234", "0.6581082", "0.65715075", "0.6568955", "0.65685445", "0.6566743", "0.6550605", "0.65436655", "0.65414435", "0.65413237", "0.65344024", "0.65305096", "0.65241313", "0.6513115", "0.65113825", "0.6507593", "0.64974123", "0.64934015", "0.649127", "0.6480985", "0.6478884", "0.6477072", "0.64757484", "0.6474034", "0.6473809", "0.6465568", "0.6460606", "0.64605826", "0.6460483", "0.6458012", "0.6452855", "0.64511734", "0.64479023", "0.64437616", "0.64432144", "0.6442675", "0.6442356", "0.6440753", "0.6435491", "0.6430194", "0.6425904", "0.6424549", "0.6421098", "0.64180034", "0.6415867", "0.6415177", "0.64146996", "0.6412819", "0.64102453", "0.6409543", "0.6402665", "0.63899213", "0.6389002", "0.63880205", "0.6387431", "0.63792914", "0.6378528", "0.63774496", "0.63769907", "0.6376569", "0.6374255", "0.6370691", "0.6370139", "0.6364478", "0.6364149", "0.6360166", "0.63561094", "0.6351028", "0.6349301" ]
0.0
-1
/edit video Function for view form
public function editVideo($id) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $workout = Video::find($id); $categories = VideoCategory::all(); //dd($categories); return view('admin.editvideo')->with('workout',$workout)->with('videoCategories',$categories); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Video $video)\n {\n //\n }", "public function edit(Video $video)\n {\n //\n }", "public function editAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid()) {\n return;\n }\n\n //GET LISTING ID\n $listing_id = $this->_getParam('listing_id', 0);\n\n $listingtype_id = $this->_listingType->listingtype_id;\n\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n\n //GET VIDEO OBJECT\n $sitereview_video = Engine_Api::_()->getItem('sitereview_video', $this->_getParam('video_id'));\n\n //GET TAB ID\n $this->view->tab_selected_id = $this->_getParam('content_id');\n\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n $this->view->can_edit = $canEdit = $sitereview->authorization()->isAllowed($viewer, \"edit_listtype_$sitereview->listingtype_id\");\n\n //SUPERADMIN, VIDEO OWNER AND LISTING OWNER CAN EDIT VIDEO\n if ($viewer_id != $sitereview_video->owner_id && $canEdit != 1) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n //GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitereview_main');\n\n //FORM GENERATION\n $this->view->form = $form = new Sitereview_Form_Editvideo();\n\n //PREPARE TAGS\n $sitereviewTags = $sitereview_video->tags()->getTagMaps();\n $tagString = '';\n foreach ($sitereviewTags as $tagmap) {\n if ($tagString !== '') {\n $tagString .= ', ';\n }\n $tagString .= $tagmap->getTag()->getTitle();\n }\n $this->view->tagNamePrepared = $tagString;\n $form->tags->setValue($tagString);\n\n //IF NOT POST OR FORM NOT VALID THAN RETURN\n if (!$this->getRequest()->isPost()) {\n $form->populate($sitereview_video->toArray());\n return;\n }\n\n //IF NOT POST OR FORM NOT VALID THAN RETURN\n if (!$form->isValid($this->getRequest()->getPost())) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid data');\n return;\n }\n\n //GET FORM VALUES\n $values = $form->getValues();\n\n //PROCESS\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n $sitereview_video->setFromArray($values);\n\n // Add tags\n $tags = preg_split('/[,]+/', $values['tags']);\n $sitereview_video->tags()->setTagMaps($viewer, $tags);\n $sitereview_video->save();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview_video->getSlug(), 'video_id' => $sitereview_video->getIdentity(), 'user_id' => $sitereview_video->owner_id, 'content_id' => $this->view->tab_selected_id), \"sitereview_video_view_listtype_$listingtype_id\", true);\n }", "public function getEdit($video)\n\t{\n // Title\n $title = Lang::get('admin/videos/title.video_update');\n\n // Show the page\n return View::make('admin/videos/create_edit', compact('video', 'title'));\n\t}", "public function editVideo(Request $request)\n {\n\n $editVideo = UploadVideo::where(\"id\", $request->id)->first();\n $editVideo->content_title = ucfirst($request->title);\n if ($request->active) {\n $editVideo->active_status = 1;\n } else {\n $editVideo->active_status = 0;\n }\n\n $editVideo->save();\n }", "public function edit($id)\n\t{\n\t\t$video = Resource::find($id);\n\t\t//id=1表示是视频的大类\n\t\t$categories = Category::find(1);\n\t\treturn view('admin.video.edit')->with(compact('video','categories'));\n\t}", "public function edit($id)\n {\n $video = Video::find($id);\n $pk = CoursePackage::all();\n return view('admin.video.edit')->with('v' , $video)->with('pk' , $pk);\n }", "public function edit($id)\n {\n $video=Video::where('id',$id)->first();\n return view('videos.edit-video',compact('video'));\n }", "public function editAction(Tx_Youtubeapi_Domain_Model_Video $video) {\n\t\t$this->view->assign('video', $video);\n\t}", "function edit()\n {\n $id = $this->uri->rsegment('3');\n $video = $this->video_model->get_info($id);\n if(!$video)\n {\n $this->session->set_flashdata('message', 'Không tồn tại video này');\n redirect(admin_url('video'));\n }\n $this->data['video'] = $video;\n \n $this->load->library('form_validation');\n $this->load->helper('form');\n \n //neu ma co du lieu post len thi kiem tra\n if($this->input->post())\n {\n $this->form_validation->set_rules('name', 'Tên video', 'required');\n $this->form_validation->set_rules('link', 'Link video', 'required');\n \n if($this->form_validation->run())\n {\n \n //lay ten file anh minh hoa duoc update len\n $this->load->library('upload_library');\n $upload_path = './upload/video';\n $upload_data = $this->upload_library->upload($upload_path, 'image'); \n $images = '';\n if(isset($upload_data['file_name']))\n {\n $images = $upload_data['file_name'];\n }\n \n //luu du lieu can them\n $data = array(\n 'name' => $this->input->post('name'),\n 'images' => $images,\n 'link' => $this->input->post('link'),\n ); \n if($images != '')\n {\n $data['images'] = $images;\n }\n \n //them moi vao csdl\n if($this->video_model->update($video->id, $data))\n {\n $this->session->set_flashdata('message', 'Cập nhật thành công');\n }else{\n $this->session->set_flashdata('message', 'Không cập nhật được');\n }\n redirect(admin_url('video'));\n }\n }\n \n \n //load view\n $this->data['temp'] = 'admin/video/edit';\n $this->load->view('admin/main', $this->data);\n }", "public function edit(ProductVideo $productVideo)\n {\n //\n }", "public function edit($id)\n {\n $video = Video::findOrFail($id);\n return view('admin.video.edit', compact('video'));\n }", "public function postEdit($video)\n\t{\n\n // Declare the rules for the form validation\n $rules = array(\n 'user' => 'required|min:5',\n 'link' => 'required|min:10',\n 'description' => 'required|min:10'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Update the video video data\n $video->user = Input::get('user');\n $video->link = Input::get('link');\n $video->description = Input::get('description');\n // Was the video video updated?\n if($video->save())\n {\n // Redirect to the new video video page\n return Redirect::to('admin/videos/' . $video->id . '/edit')->with('success', Lang::get('admin/videos/messages.update.success'));\n }\n\n // Redirect to the videos video management page\n return Redirect::to('admin/videos/' . $video->id . '/edit')->with('error', Lang::get('admin/videos/messages.update.error'));\n }\n\n // Form validation failed\n return Redirect::to('admin/videos/' . $video->id . '/edit')->withInput()->withErrors($validator);\n\t}", "public function edit(Video $video)\n {\n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = UserMoodle::where('id', $user_id)->first();\n $users = UserMoodle::all();\n $competitors = Competitor::where('video_id', $video->id)->get();\n $competitor_types = CompetitorType::where('status', 1)->get();\n $video_types = VideoType::where('status', 1)->get();\n\n return view('admin.videos.edit', compact('video', 'usuario', 'users', 'video_types', 'competitor_types', 'competitors'));\n }", "public function edit($id)\n {\n $video = Video::find($id);\n $category = Category::all()->pluck('name','id');\n \n return view('admin.video.edit', compact('video','category'));\n }", "public function edit($id)\n {\n $sl = Video::find($id);\n return view('admin.video.edit', compact('sl'));\n }", "public function edit($id)\n {\n //\n $users = DB::table('video_uploaded')->where('id',$id)->get();\n return view('reg/video')->with('videoDetails',$users);\n }", "public function edit($id)\n\t{\n return View::make('videos.edit');\n\t}", "public function edit($id)\n {\n $title = 'Video Management';\n\n $video = Video::where('id_video', $id)->first();\n\n $category = Categories::all();\n\n return view('video::edit')->withVideo($video)->withCategory($category)->withTitle($title);\n }", "public function addEdit(){\n\t\tif (isset($this->session->userdata['logged_in'])){\n\t\t\t$video_id = $this->uri->segment(4);// get id form url\n\t\t\tif($video_id==''){\n\t\t\t\t$data['title'] = \"Add Video\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$data['title'] = \"Edit Video\";\n\t\t\t}\n\t\t\t$data['content'] = 'admin/addeditvideo';\n\t\t\t$data['getVideo'] = $this->VideoModel->getVideoById($video_id); //retrive all category By Id\n\t\t\t//print_r($data['getVideo']); die;\n\t\t\t$this->load->view('admin/layout/adminmaster',$data);\n\t\t}else{\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "public function edit($id)\n {\n $video = Video::findOrFail($id);\n return view('admin.videos.edit', compact('video'));\n }", "public function editAction() {\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n //GET SITEREVIEW SUBJECT\n $this->view->sitereview = $sitereview = Engine_Api::_()->core()->getSubject();\n\n $this->view->listingtype_id = $listingtype_id = $this->_listingType->listingtype_id;\n\n $this->view->slideShowEnanle = $this->slideShowEnable($listingtype_id);\n\n $this->view->listing_singular_uc = ucfirst($this->_listingType->title_singular);\n $this->view->listing_singular_lc = strtolower($this->_listingType->title_singular);\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, $viewer, \"edit_listtype_$listingtype_id\")->isValid()) {\n return;\n }\n\n $this->view->content_id = Engine_Api::_()->sitereview()->getTabId($listingtype_id, 'sitereview.video-sitereview');\n\n //SELECTED TAB\n $this->view->TabActive = \"video\";\n\n if (!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_videoedit_edit_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n }\n\n //GET VIDEOS\n $this->view->type_video = $type_video = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereview.show.video');\n\n if ($type_video && isset($sitereview->main_video['corevideo_id'])) {\n $this->view->main_video_id = $sitereview->main_video['corevideo_id'];\n } elseif (isset($sitereview->main_video['reviewvideo_id'])) {\n $this->view->main_video_id = $sitereview->main_video['reviewvideo_id'];\n }\n\n $this->view->videos = $videos = array();\n $this->view->integratedWithVideo = false;\n $sitevideoEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitevideo');\n if ($sitevideoEnabled && (Engine_Api::_()->getDbtable('modules', 'sitevideo')->getIntegratedModules(array('enabled' => 1, 'item_type' => \"sitereview_listing_$sitereview->listingtype_id\", 'item_module' => 'sitereview')))) {\n $params = array();\n $params['parent_type'] = $sitereview->getType() . '_' . $sitereview->listingtype_id;\n $params['parent_id'] = $sitereview->listing_id;\n $this->view->videos = $videos = Engine_Api::_()->getDbTable('videos', 'sitevideo')->getVideoPaginator($params);\n $this->view->integratedWithVideo = true;\n } else {\n if (Engine_Api::_()->sitereview()->enableVideoPlugin() && !empty($type_video)) {\n $this->view->videos = $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 1);\n } elseif (empty($type_video)) {\n $this->view->videos = $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 0);\n }\n }\n\n $allowed_upload_video = Engine_Api::_()->sitereview()->allowVideo($sitereview, $viewer, count($videos), $uploadVideo = 1);\n $this->view->upload_video = 1;\n if (Engine_Api::_()->sitereview()->hasPackageEnable()) {\n $this->view->upload_video = $allowed_upload_video;\n } else {\n if (empty($allowed_upload_video)) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n }\n\n $this->view->count = count($videos);\n\n //MAKE FORM\n $this->view->form = $form = new Sitereview_Form_Video_Editvideo();\n\n foreach ($videos as $video) {\n\n $subform = new Sitereview_Form_Video_Edit(array('elementsBelongTo' => $video->getGuid()));\n\n if ($video->status != 1) {\n if ($video->status == 0 || $video->status == 2):\n $msg = $this->view->translate(\"Your video is currently being processed - you will be notified when it is ready to be viewed.\");\n elseif ($video->status == 3):\n $msg = $this->view->translate(\"Video conversion failed. Please try again.\");\n elseif ($video->status == 4):\n $msg = $this->view->translate(\"Video conversion failed. Video format is not supported by FFMPEG. Please try again.\");\n elseif ($video->status == 5):\n $msg = $this->view->translate(\"Video conversion failed. Audio files are not supported. Please try again.\");\n elseif ($video->status == 7):\n $msg = $this->view->translate(\"Video conversion failed. You may be over the site upload limit. Try a smaller file, or delete some files to free up space.\");\n endif;\n\n $subform->addElement('dummy', 'mssg' . $video->video_id, array(\n 'description' => $msg,\n 'decorators' => array(\n 'ViewHelper',\n array('HtmlTag', array('tag' => 'div', 'class' => 'tip')),\n array('Description', array('tag' => 'span', 'placement' => 'APPEND')),\n array('Description', array('placement' => 'APPEND')),\n ),\n ));\n $t = 'mssg' . $video->video_id;\n $subform->$t->getDecorator(\"Description\")->setOption(\"placement\", \"append\");\n }\n $subform->populate($video->toArray());\n $form->addSubForm($subform, $video->getGuid());\n }\n\n //CHECK METHOD\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //GET FORM VALUES\n $values = $form->getValues();\n\n if (isset($_POST['corevideo_cover']) && !empty($_POST['corevideo_cover'])) {\n if (isset($sitereview->main_video) && !empty($sitereview->main_video)) {\n $sitereview->main_video = array_merge((array) $sitereview->main_video, array('corevideo_id' => $_POST['corevideo_cover']));\n } else {\n $sitereview->main_video = array('corevideo_id' => $_POST['corevideo_cover']);\n }\n } elseif (isset($_POST['reviewvideo_cover']) && $_POST['reviewvideo_cover']) {\n if (isset($sitereview->main_video) && !empty($sitereview->main_video)) {\n $sitereview->main_video = array_merge((array) $sitereview->main_video, array('reviewvideo_id' => $_POST['reviewvideo_cover']));\n } else {\n $sitereview->main_video = array('reviewvideo_id' => $_POST['reviewvideo_cover']);\n }\n }\n\n $sitereview->save();\n\n //VIDEO SUBFORM PROCESS IN EDITING\n foreach ($videos as $video) {\n $subform = $form->getSubForm($video->getGuid());\n\n $values = $subform->getValues();\n $values = $values[$video->getGuid()];\n if (isset($values['delete']) && $values['delete'] == '1') {\n Engine_Api::_()->getDbtable('videos', 'sitereview')->delete(array('video_id = ?' => $video->video_id, 'listing_id = ?' => $sitereview->listing_id));\n Engine_Api::_()->getDbtable('actions', 'activity')->delete(array('type = ?' => 'video_sitereview_listtype_' . $listingtype_id, 'object_id = ?' => $sitereview->listing_id));\n } else {\n $video->setFromArray($values);\n $video->save();\n }\n }\n\n return $this->_helper->redirector->gotoRoute(array('action' => 'edit', 'listing_id' => $sitereview->listing_id), \"sitereview_videospecific_listtype_$listingtype_id\", true);\n }", "public function edit($id)\n {\n $video = Video::find($id);\n\n return view('Admin.Videos.edit')\n ->with('video',$video);\n }", "public function edit($id)\n {\n $video = Video::findOrFail($id);\n return view('admin.videos.edit', compact('video'));\n }", "public function edit($id)\n {\n $edit = true;\n $video = Video::findOrFail($id);\n $time = $video->publish_at;\n// $isPm = $time->hour >= 12? true: false;\n\n $video->showTime = $time->day . '/' . $time->month . '/' . $time->year . ' ' . $time->hour . ':' . $time->minute;\n return view('admin.videos.show', compact(['edit', 'video']));\n }", "public function edit($video_type)\n {\n //\n $tipoVideo = VideoType::findOrFail($video_type);\n \n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = usermoodle::where('id', $user_id)->first();\n\n return view('admin.videotype.edit', compact('tipoVideo', 'usuario'));\n }", "public function edit($id)\n {\n $video = Video::find($id);\n // dd($video->categories[0]->name);\n $categories = Category::where('status',1)->orderBy('name')->get();\n $tags = Tag::where('status',1)->get();\n return view('adminCMS.videos.editVideo',compact('video','categories','tags'));\n }", "public function edit(Video $video)\n {\n //\n $categories = DB::table('categories')->Select('categoryID', 'categoryName')->paginate();\n\n $getFilesData = DB::table('files')->select('fileID', 'fileName', 'file', 'created_at')->where('videoID', '=', $video->videoID)->paginate();\n\n return view('video.editVideo', compact('video', 'categories', 'getFilesData'));\n }", "public function edit_video($video){\n\tif(Auth::check()){\n\t\tif(Auth::user()->type==\"Artist\"){\n\t\t\t$deliver_videos = DB::table('requested_videos')->select('*')\n\t\t\t->where('requested_videos.uploadedby','=',Auth::user()->profile_id)\n\t\t\t->where('requested_videos.id','=',$video)\n\t\t\t->paginate(15);\n\t\t\t$artist = Profile::find(Auth::user()->profile_id);\n\t\t\t$video_data['video'] = $deliver_videos;\n\t\t\t$video_data['artist'] = $artist;\n //return view('frontend.my_video',$video_data);\n\t\t\treturn view('frontend.artistDashboard.edit_video',$video_data); \n\t\t}else{\n\t\t\treturn redirect('/login');\n\t\t}\n\t}else{\n\t\treturn redirect('/login'); \n\t} \n\n}", "public function edit(Video $video)\n {\n $bussines=Bussine::lists('slug','id');\n return view('backend.videos.edit')->with('video',$video)->with('bussines',$bussines);\n }", "public function edit($id)\n\t{\n\t\tBreadcrumbs::addCrumb('Manage Teams and Videos', 'teacher');\n\t\tBreadcrumbs::addCrumb('Edit Video', $id);\n\t\tView::share('title', 'Edit Video');\n\t\t$video = Video::with('students')->find($id);\n\n\t\t// Get the most recent competition year with video divisisons\n\t $comp_year = CompYear::orderBy('year', 'desc')\n\t ->with([ 'vid_divisions' => function($q) {\n\t\t\t\t\t\t\t\t\t\treturn $q->orderby('display_order');\n\t\t\t\t\t\t\t\t\t}])\n\t\t\t\t\t\t\t->first();\n\n $division_list = [ 0 => \"- Select Division -\" ] + $comp_year->vid_divisions->lists('name', 'id');\n\n\t\t// Student Setup\n\t\t$ethnicity_list = [ 0 => \"- Select Ethnicity -\" ] + Ethnicity::all()->lists('name','id');\n\t\tif(!Session::has('students')) {\n\t\t\t// On first load we populate the form from the DB\n\t\t\t$students = $video->students;\n\t\t} else {\n\t\t\t// On subsequent loads or errors, use the sessions variable\n\t\t\t$students = [];\n\t\t}\n\t\t$index = -1;\n\n\n\t\tif (is_null($video))\n\t\t{\n\t\t\treturn Redirect::route('teacher.index');\n\t\t}\n\n\t\t$divisions = Division::longname_array();\n\n\t\treturn View::make('teacher.videos.edit', compact('video','students', 'division_list', 'ethnicity_list', 'index'))\n\t\t\t\t ->with('divisions', $divisions);\n\t}", "public function edit($id)\n {\n $video = $this->video->find($id);\n $categories = Category::all();\n\n return view('pages.editvideo')->with('video', $video)->with('categories', $categories);\n }", "public function edit($id)\n {\n $video = $this->video->findOrFail($id);\n\n $data = ['video' => $video, 'title' => $this->title, 'subtitle' => 'Editar notícias'];\n\n return view('admin.videos.form')->with($data);\n }", "public function edit($id)\n {\n $video = Video::findOrFail($id);\n\n return view('admin.videos.edit', compact('video'));\n }", "public function getEditlist()\n {\n // Title\n $title = Lang::get('admin/videos/title.video_edit');\n\n // Grab all the videos\n $videos = $this->video;\n\n // Show the page\n return View::make('admin/videos/editlist', compact('videos', 'title'));\n }", "public function edit($id)\n {\n $user = Auth::user();\n $video = Videos::findOrFail($id);\n\n return view('pages.painel.editar.videos.index', compact('user', 'video'));\n }", "public function edit()\r\n {\r\n if (!isset($_SESSION['auth']) || empty($this->params['id'])) {\r\n header('Location: ' . BASE_URI);\r\n exit;\r\n }\r\n // get genre and publisher list\r\n $genreModel = new GenreModel();\r\n $genreList = $genreModel->read();\r\n $publisherModel = new PublisherModel();\r\n $publisherList = $publisherModel->read();\r\n\r\n // CASE user submit change\r\n if (isset($this->params['title'])) {\r\n $this->model->id = $this->params['id'];\r\n unset($this->model->params['id']);\r\n\r\n $this->model->params = $this->filterArrayEmpty($this->model->params);\r\n /**\r\n * Verif here\r\n */\r\n $this->model->save();\r\n header('Location: ' . BASE_URI . DIRECTORY_SEPARATOR . 'movie?id=' . $this->params['id']);\r\n exit;\r\n }\r\n\r\n // CASE edit movie page\r\n $this->model->id['col'] = 'id_movie';\r\n $this->model->id['val'] = $_GET['id'];\r\n // get genre and publisher real name\r\n $data = $this->model->read();\r\n\r\n $this->render('edit', [\r\n 'movie' => !empty($data) ? $data[0] : 'No data',\r\n 'genreList' => $genreList,\r\n 'publisherList' => $publisherList\r\n ]);\r\n }", "public function edit($id)\n {\n\n $post = Video::findOrFail($id);\n\n return view('admin.videos.edit')->with([\n 'title' => 'Փոփոխել միջոցառումը',\n 'post' => $post,\n ]);\n }", "public function executeEditVideo(sfWebRequest $request)\n {\n // Shut off Chrome's poorly designed XSS filtering that clobbers perfectly legitimate iframe embed submissions\n // http://code.google.com/p/chromium/issues/detail?id=98787\n $this->getResponse()->setHttpHeader('X-XSS-Protection', '0');\n $this->forward404Unless(aMediaTools::userHasUploadPrivilege());\n $item = null;\n $this->slug = false;\n $this->popularTags = PluginTagTable::getPopulars(null, array('sort_by_popularity' => true), false, 10);\n if (sfConfig::get('app_a_all_tags', true))\n {\n $this->allTags = PluginTagTable::getAllTagNameWithCount();\n }\n else\n {\n $this->allTags = array();\n }\n if ($request->hasParameter('slug'))\n {\n $item = $this->getItem();\n $this->slug = $item->getSlug();\n }\n if ($item)\n {\n $this->forward404Unless($item->userHasPrivilege('edit'));\n }\n $this->item = $item;\n $embed = false;\n $parameters = $request->getParameter('a_media_item');\n \n if ($parameters)\n {\n $files = $request->getFiles('a_media_item');\n \n $this->form = new aMediaVideoForm($item);\n \n if (isset($parameters['embed']))\n {\n // We need to do some prevalidation of the embed code so we can prestuff the\n // file, title, tags and description widgets\n $result = $this->form->classifyEmbed($parameters['embed']);\n if (isset($result['thumbnail']))\n {\n $thumbnail = $result['thumbnail'];\n if ((!isset($parameters['title'])) && (!isset($parameters['tags'])) && (!isset($parameters['description'])) && (!isset($parameters['credit'])))\n {\n $parameters['title'] = $result['serviceInfo']['title'];\n // We want tags to be lower case, and slashes break routes in most server configs. \n $parameters['tags'] = str_replace('/', '-', aString::strtolower($result['serviceInfo']['tags']));\n $parameters['description'] = aHtml::textToHtml($result['serviceInfo']['description']);\n $parameters['credit'] = $result['serviceInfo']['credit'];\n }\n }\n }\n\n // On the first pass with a youtube video we just make the service's thumbnail the\n // default thumbnail. We don't force them to use it. This allows more code reuse\n // (Moving this after the bind is necessary to keep it from being overwritten) \n if (isset($thumbnail))\n {\n $this->convertServiceThumbnailToFileUpload($thumbnail, $parameters);\n }\n \n $this->form->bind($parameters, $files);\n \n do\n {\n // first_pass forces the user to interact with the form\n // at least once. Used when we're coming from a\n // YouTube search and we already technically have a\n // valid form but want the user to think about whether\n // the title is adequate and perhaps add a description,\n // tags, etc.\n if (($this->hasRequestParameter('first_pass')) ||\n (!$this->form->isValid()))\n {\n break;\n }\n $thumbnail = $this->form->getValue('file');\n // The base implementation for saving files gets confused when \n // $file is not set, a situation that our code tolerates as useful \n // because if you're updating a record containing an image you \n // often don't need to submit a new one.\n unset($this->form['file']);\n $object = $this->form->getObject();\n if ($thumbnail)\n {\n $object->preSaveFile($thumbnail->getTempName());\n }\n $this->form->save();\n \n if ($thumbnail)\n {\n $object->saveFile($thumbnail->getTempName());\n }\n \n if (aMediaTools::isSelecting())\n {\n return $this->redirect('aMedia/multipleAdd?id=' . $object->id);\n }\n\n return $this->redirect(\"aMedia/resumeWithPage\");\n } while (false);\n }\n return $this->renderTemplate();\n }", "public function edit()\n {\n //return view('movie::edit');\n }", "public function video(){\n\t\t$data=array();\n\t\t$this->load->view('administrador/admin_video',$data);\n\t}", "public function edit(Videocomment $Videocomment)\n {\n //\n }", "public function edit()\n\t{\n\t\tJRequest::setVar( 'view', 'player' );\n\t\tJRequest::setVar( 'layout', 'form' );\n\t\tJRequest::setVar('hidemainmenu', 1);\n\t \t \n\t\tparent::display();\n\t}", "public function edit($id)\n {\n //\n $channels = Channel::pluck('title','id');\n $video = Video::with(['slider'])\n ->where('id',$id)\n ->first();\n // dd($video);\n $val = [];\n $val[] = $video->related_videos_1;\n $val[] = $video->related_videos_2;\n $val[] = $video->related_videos_3;\n $valj = json_encode($val);\n // dd($video);\n $videos = Video::where('channel_id', $video->channel_id)->where('id','<>',$video->id)->pluck('title','id');\n if($video->type==1){\n return view('Push::videos.edit', compact(['channels','video', 'videos','valj']));\n }elseif($video->type==2){\n return view('Push::videos.editpdf', compact(['channels','video', 'videos','valj']));\n }else{\n return view('Push::videos.editslider', compact(['channels','video', 'videos','valj']));\n } \n }", "public function edit(Request $request, $video_id)\n {\n $categories = VideoRecordsCategory::getAllList();\n $videoRecord = VideoRecords::where('id', $video_id)->get();\n foreach ($videoRecord as $videoRecord);\n $photos = VideoRecordImages::where('video_record_id', $video_id)->get();\n return $this->view('video_records.create_edit', compact('categories'))\n ->with('photoable', $videoRecord)\n ->with('folder_date', $videoRecord->created_at->format('dmY'))\n ->with('photos', $photos)\n ->with('item', $videoRecord);\n }", "function type_url_form_video()\n {\n }", "public function edit(Video $video)\n { \n\n $categories = Category::pluck('name', 'id');\n\n return view('admin.videos.edit', compact('video', 'categories'));\n }", "function tpl_edit($video)\n{\n\tglobal $smarty, $config, $lang;\n\n\t// create a form ready quoted version for each value\n\tforeach (array_keys($video) as $key)\n {\n\t\t$video['q_'.$key] = formvar($video[$key]);\n\t}\n\n\t// use custom function for language\n\t$video['f_language'] = custom_language_input('language', $video['language']);\n\n\t// create mediatype selectbox\n $smarty->assign('mediatypes', out_mediatypes());\n if (!isset($video['mediatype'])) $video['mediatype'] = $config['mediadefault'];\n\n\t// prepare the custom fields\n\tcustomfields($video, 'in');\n\n if ($config['multiuser'])\n {\n $smarty->assign('owners', out_owners(array('0' => ''), (check_permission(PERM_ADMIN)) ? false : PERM_WRITE, true));\n }\n\n\t// item genres\n\t$item_genres = getItemGenres($video['id']);\n\t// new-style\n $smarty->assign('genres', out_genres2($item_genres));\n#dlog(out_genres2($item_genres));\n#dlog($item_genres);\n // classic\n $smarty->assign('genreselect', out_genres($item_genres));\n\n\t// assign data\n\t$smarty->assign('video', $video);\n\n\t// get drilldown url for visit link\n\tif ($video['imdbID'])\n {\n require_once './engines/engines.php';\n $engine = engineGetEngine($video['imdbID']);\t\n $smarty->assign('link', engineGetContentUrl($video['imdbID'], $engine));\n $smarty->assign('engine', $engine);\n\t}\n\n/*\n // populate autocomplete boxes\n $smarty->assign('audio_codecs', array_column(runSQL('SELECT DISTINCT audio_codec FROM '.TBL_DATA.' WHERE audio_codec IS NOT NULL'), 'audio_codec'));\n $smarty->assign('video_codecs', array_column(runSQL('SELECT DISTINCT video_codec FROM '.TBL_DATA.' WHERE video_codec IS NOT NULL'), 'video_codec'));\n*/ \n\t$smarty->assign('lookup', array('0' => $lang['radio_look_ignore'],\n\t\t\t\t\t\t\t '1' => $lang['radio_look_lookup'],\n\t\t\t\t\t\t\t '2' => $lang['radio_look_overwrite']));\n\n // needed for ajax image lookup\n $smarty->assign('engines', $config['engines']);\n}", "public function update($id)\n {\n // DB::table('video_uploaded')\n // ->where ('id')\n // ->update(['video_type'=>$request['video_type'],'video_url'=>$request['video_url'], 'price'=>$request['price'], 'video'=>$request['video']\n // ]); \n // return view('reg/video_list');\n }", "public function update(Request $r, $id)\n {\n $video = Video::find($id);\n\n $video->name = $r->name;\n $video->package_id = $r->paket;\n $video->step = $r->tahap;\n $video->link = $r->link;\n $video->save();\n\n Session::flash('Sukses' , 'Video Berhasil Diubah');\n return $this->index();\n\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 update(Request $request, $id)\n {\n //dd($request);\n $video = Video::find($id);\n\n if($video){\n $video->vimeo_id = $request['vimeo_id'];\n $video->vimeo_id_pt = $request['vimeo_id_pt'];\n $video->vimeo_id_en = $request['vimeo_id_en'];\n $video->title_pt = $request['title_pt'];\n $video->title_en = $request['title_en'];\n $video->subtitle_pt = $request['subtitle_pt'];\n $video->subtitle_en = $request['subtitle_en'];\n $video->main_preview_html_pt = $request['main_preview_html_pt'];\n $video->main_preview_html_en = $request['main_preview_html_en'];\n $video->title_box_pt = $request['title_box_pt'];\n $video->title_box_en = $request['title_box_en'];\n $video->poster_pt = $request['poster_pt'];\n $video->poster_en = $request['poster_en'];\n $video->thumb_pt = $request['thumb_pt'];\n $video->thumb_en = $request['thumb_en'];\n $video->category_pt = $request['category_pt'];\n $video->category_en = $request['category_en'];\n $video->specs_pt = $request['specs_pt'];\n $video->specs_en = $request['specs_en'];\n $video->caption_pt = $request['caption_pt'];\n $video->caption_en = $request['caption_en'];\n $video->edition_id = $request['edition_id'];\n $video->video_program_id = $request['video_program_id'];\n $video->order = $request['order'];\n \n $video->save();\n\n return redirect()->route('video.index', ['id' => $request['edition_id']])\n ->with('success', 'Vídeo alterado com sucesso!');\n }\n }", "public function edit($venue_id,$id){\n try{\n $data[\"venue_id\"] = $venue_id;\n $data[\"venue_media_details\"] = VenueMedia::where([\"id\"=>$id])->first();\n return view('admin.venue..media.edit_venue_media',$data);\n }catch(\\Exception $e){\n return redirect()->route('admin.dashboard')->with('error','Something went wrong.');\n }\n }", "public function uploadAction() {\n if (isset($_GET['ul']) || isset($_FILES['Filedata']))\n return $this->_forwardCustom('upload-video', null, null, array('format' => 'json'));\n\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n $this->view->form = $form = new Sitereview_Form_Reviewvideo();\n\n if (!$this->getRequest()->isPost()) {\n if (null !== ($video_id = $this->_getParam('video_id'))) {\n $form->populate(array(\n 'video' => $video_id\n ));\n }\n return;\n }\n\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n $video = $form->saveValues();\n }", "public function edit($id)\n {\n return view('programs.edit',['video'=>Programs::find($id)]);\n }", "public function movieEditActionGet()\n {\n $title = \"Edit a movie\";\n\n $this->app->db->connect();\n\n $movieId = $this->app->session->get(\"movieId\");\n\n $sql = \"SELECT * FROM movie WHERE id = ?;\";\n $movie = $this->app->db->executeFetch($sql, [$movieId]);\n\n $this->app->page->add(\"movie/movie-edit\", [\n \"movie\" => $movie,\n ]);\n\n if ($this->app->request->getGet(\"showAll\")) {\n $sql = \"SELECT * FROM movie;\";\n $res = $this->app->db->executeFetchAll($sql);\n\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n if ($this->app->request->getGet(\"showMovie\")) {\n $sql = \"SELECT * FROM movie WHERE id = ?;\";\n $res = $this->app->db->executeFetchAll($sql, [$movieId]);\n\n $this->app->page->add(\"movie/show-all\", [\n \"res\" => $res,\n ]);\n }\n\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }", "public function edit($id)\n {\n if (!intval($id)) {\n return $this->error('非法参数');\n }\n $videoTag = VideoTag::find($id);\n\n if (is_null($videoTag)) {\n return $this->error('获取数据失败');\n }\n\n return view('admin.nba.video_tag.edit',compact('videoTag'));\n }", "function video() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id'];\n if ($id > 0) {\n $query = \"select * from videos where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $query = \"update videos set views = views + 1 where id =$id;\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }", "public function actionVideo()\n {\n $title = '微站设置/视频设置';\n //title of webpage,you can find title in /web/pub/top.php eg:wechat demo\n $keywords = 'wechat demo';\n //title of webpage,you can find title in /web/pub/top.php eg:''\n $description = '';\n return $this -> render('video',[\n 'title' => $title,//title of webpage,you can find title in the head of /web/pub/top.php\n 'keywords' => $keywords,//keywords of webpage,you can find keywords in the head of /web/pub/top.php\n 'description' => $description//description of webpage,you can find description in the head of /web/pub/top.php\n ]);\n }", "public function edit(Video $video)\n {\n $data = $video->createOrUpdate();\n\n return view( 'videos.video.edit' )\n ->withVideo( $video->edit() )\n ->withSeries( $data['series'] )\n ->withCategories( $data['categories'] );\n }", "public function edit($id)\n {\n $this->authorize('update', [$this->player_repository, $id]);\n $player = $this->player_workflow->edit($id);\n return view('player_edit', compact('player')); //ayto DEN tha to exw sto restful_crud code generation\n }", "public function edit($id)\n {\n $gallery = VideoGallery::findOrFail($id);\n return view('admin.videoGallery.edit', compact('gallery'));\n }", "public function update(Request $request, Video $video)\n {\n //\n }", "public function update(Request $request, Video $video)\n {\n //\n }", "public function updateVideo(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'title' => 'required',\n 'category' => 'required',\n 'video' => 'mimes:mp4'\n ));\n\n $id = $request->id;\n $video = Video::find($id);\n $video->title = $request->title;\n $video->video_category_id = $request->category;\n\n if ($request->hasFile('video')) {\n $file = $request->file('video');\n $filename = time().'.'.$file->getClientOriginalName();\n /*$location = public_path('file/'.$filename);\n Storage::put($filename,file_get_contents($file));*/\n\n $location = public_path('file/'.$filename);\n Storage::disk('file')->put($filename, file_get_contents($file));\n //Storage::disk('public')->put($filename, file_get_contents($file));\n $video->video = $filename;\n\n }\n $video->save();\n Session::flash('success','Video Updated succcessfully.');\n return redirect()->back()->with('workout',$video);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function processForm()\r\n\t{\r\n\t\t$originalViewId = $this->viewId;\r\n\t\tparent::processForm();\r\n\t\t\r\n\t\t$this->mc->database->query(\"UPDATE \" . $this->mc->config['database_pref'] . \"views SET view_action = view_name WHERE view_id = ?\", array(array($this->viewId, \"i\")));\r\n\t\t\r\n\t\t//if(isset($_REQUEST['view_videoselection']) && $_REQUEST['view_videoselection'] != -1)\r\n\t\t\t// TODO: currently just statically inserted\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'The Superbowl XLVI 2012.mp4', 'Superbowl XLVI Trailer', '4:16', 'superbowl_logo.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Ahmad Bradshaw Touchdown.mp4', 'Ahmad Bradshaw Touchdown', '0:24', 'superbowl_shot.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Jerome Simpson Touchdown Flip.mp4', 'Jerome Simpson Touchdown Flip', '0:26', 'nfl_logo_rasen.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Tom Brady Final Throw.mp4', 'Tom Brady Final Throw', '1:33', 'nfl_logl_original.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Best SuperBowl Moments.mp4', 'Best SuperBowl Moments', '3:19', 'superbowl_moments.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\r\n\t\t// update concept type id for this view\r\n\t\t$conceptQuery = $this->mc->database->query(\"SELECT concept_id FROM \" . $this->mc->config['database_pref'] . \"concepts WHERE concept_key = 'mediacenter'\");\r\n\t\t$this->mc->database->query(\"UPDATE \" . $this->mc->config['database_pref'] . \"views SET view_c_type = ? WHERE view_id = ?\", array(array($conceptQuery->rows[0]->concept_id, \"i\"), array($this->viewId, \"i\")));\r\n\t\t\r\n\t\t$this->cleanUpDirectory();\r\n\t\t$this->createXmlFile();\r\n\t\t\r\n\t\t// re-create main xml file and refresh filelist\r\n\t\t$this->mc->filecreator->createGeneralFiles();\r\n\t\t$configSet = true;\r\n\t\tinclude_once('modules/filemanager.module.php');\r\n\t\t$fileManagerObj = new apdModuleFilemanager($this->mc);\r\n\t\t$fileManagerObj->refreshFilelist();\r\n\t\t\r\n\t\theader(\"Location: index.php?m=mediacenter&view_id=\" . $this->viewId);\r\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'title' => 'required',\n \n 'body' => 'required',\n ]);\n \n \n $video = Video::find($id);\n\n $video->update($request->all());\n\n return redirect('/admin/video');\n }", "public function edit(Movie $movie)\n {\n //\n }", "public function edit(Movie $movie)\n {\n //\n }", "public function edit(Movie $movie)\n {\n //\n }", "public function edit(Movie $movie)\n {\n //\n }", "public function edit(Movie $movie)\n {\n //\n }", "public function edit($id)\n {\n $video_gallery = VideoGallery::find($id);\n\n return view('admin.video_gallery.edit', compact('video_gallery'));\n }", "public function edit($id)\n {\n $select_form_tipo_media = TipoMedia::all()->pluck('nom_tipo_media', 'id');\n\n $select_form_categoria_media = CategoriaMedia::all()->pluck('nom_categoria_media', 'id'); \n\n $multimedia = Multimedia::find($id);\n return view('multimedia.edit',compact('multimedia','select_form_tipo_media','select_form_categoria_media'));\n }", "public function edit($id)\n {\n $series = Series::find($id);\n \n if($series != null)\n {\n $content = $series;\n }\n else\n {\n abort(404);\n }\n\n $trailer = Video::where('id', '=', $series['trailer'])->first(['name', 'storage']);\n \n return view('series.edit', [\n 'content' => $content,\n 'trailer' => $trailer,\n 'id' => $id,\n ]);\n }", "public function add_video(){\n\t\t$this->load->view('admin/video_gallery/add_video');\n\t}", "public function edit(ManageUserRequest $request, $id)\n {\n $brand = $this->homepageVideo->find($id);\n return view('backend.access.homepageVideo.editHomepageVideo', compact('brand'));\n }", "public function addEditData(){\n\t\tif (isset($this->session->userdata['logged_in'])){\n\t\t\t$config = array(\n\t\t\t\tarray(\n\t 'field' => 'title',\n\t 'label' => 'Title',\n\t 'rules' => 'required|trim|min_length[2]|max_length[12]'\n\t ),\n\t array(\n\t 'field' => 'link',\n\t 'label' => 'Link',\n\t 'rules' => 'required|trim'\n\t )\n\t ); \n\t\t\t\n\t\t\t$this->form_validation->set_rules($config);\n\t\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\t\t//$this->addedit();\n\t\t\t\t$this->session->set_flashdata('errors', validation_errors());\n\t\t\t\t$id= $this->input->post('id');\n\t\t\t\tif($id==''){\n\t\t\t\t\tredirect('admin/video/add-edit-video');\n\t\t\t\t}else{\n\t\t\t\t\tredirect('admin/video/add-edit-video/'.$id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$id= $this->input->post('id');\n\t\t\t\tif($id==''){\n\t\t\t\t\t$data = array(\n\t\t\t\t\t'title' => $this->input->post('title'),\n\t\t\t\t\t'link' => $this->input->post('link'),\n\t\t\t\t\t);\n\t\t\t\t\t$result = $this->VideoModel->insertVideo($data);\n\t\t\t\t\tif($result == TRUE){\n\t\t\t\t\t\t$this->session->set_flashdata('message', 'Successfully Added.');\n\t\t\t\t\t\tredirect('admin/video');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->session->set_flashdata('err_message', 'This Video already exist');\n\t\t\t\t\t\tredirect('admin/video');\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$data = array(\n\t\t\t\t\t'title' => $this->input->post('title'),\n\t\t\t\t\t'link' => $this->input->post('link'),\n\t\t\t\t\t'id' => $this->input->post('id'),\n\t\t\t\t\t);\n\t\t\t\t\t$result = $this->VideoModel->updateVideo($data);\n\t\t\t\t\tif($result == TRUE){\n\t\t\t\t\t\t$this->session->set_flashdata('message', 'Successfully Updated.');\n\t\t\t\t\t\tredirect('admin/video/add-edit-video/'.$id);\n\t\t\t\t\t\t//echo 'ok'; die;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->session->set_flashdata('message', 'Not Updated.');\n\t\t\t\t\t\tredirect('admin/video/add-edit-video/'.$id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}else{\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "public function edit($id)\n {\n $media = new Media;\n $data['media'] = $media->find($id);\n $data['category'] = Category::all();\n return view('media.edit',$data);\n }", "public function editVideo($data, $video)\n {\n return $this->performRequest('PUT',\"/videos/{$video}\",\n $data);\n }", "public function edit(movie $movie)\n {\n //\n }", "public function edit(movie $movie)\n {\n //\n }", "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 }", "private function updateVideo()\n {\n try\n {\n $request = $_POST;\n\n global $cbvid;\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video Id not provided\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n //check if title provided\n if( !isset($request['title']) || $request['title']==\"\")\n throw_error_msg(\"title not provided\");\n else\n $title = mysql_clean($request['title']);\n\n //check if description provided\n if( !isset($request['description']) || $request['description']==\"\")\n throw_error_msg(\"description not provided.\");\n else\n $description = mysql_clean($request['description']);\n\n //check if tags provided\n if(!isset($request['tags']) || $request['tags']==\"\")\n throw_error_msg(\"tags not provided.\");\n else\n $tags = mysql_clean($request['tags']);\n\n //check if tags provided\n if(!isset($request['category']) || $request['category']==\"\")\n {\n throw_error_msg(\"category not provided.\");\n }\n else\n {\n $request['category'] = explode(',',$request['category']); \n $_POST['category'] = $request['category'];\n }\n \n if (isset($request['video_users-user']) || isset($request['video_users-group'])) \n {\n $video_user_ = mysql_clean($request['video_users-user']);\n $video_group_ = mysql_clean($request['video_users-group']);\n\n $request['video_users'] = get_video_users($video_user_,$video_group_,false);\n }\n \n $result = $cbvid->update_video($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $vdetails = $cbvid->get_video_details($request['videoid']);\n $formatted_video = format_videos(array($vdetails));\n\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $formatted_video[0]);\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function edit($id)\n {\n //\n $player = Player::find($id);\n \n return view('player.edit', compact('player','id')); \n }", "public function editVideoCategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = VideoCategory::find($id);\n return view('admin.editvideocategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function edit($id)\n {\n $tvShow = TvShow::find($id);\n $streamingServices = StreamingService::all();\n return view(\"tvshows.edit\", [\n \"tvShow\" => $tvShow,\n \"streamingServices\" => $streamingServices\n ]);\n }", "public function edit($id, $edition_id)\n {\n return view('video.edit', [\n 'video' => Video::find($id),\n 'edition_id' => $edition_id\n ]);\n }", "public function addVideo(){\n if (isset($_POST[\"add_video\"])) {\n $movie = $this->model('Movie');\n $system = $this->model('System');\n\n $video_name = $_POST[\"video_title\"];\n $video_url = $_POST[\"video_url\"];\n $video_category = $_POST[\"selected_category\"];\n $video_description = $_POST[\"video_description\"];\n $video_sef_url = $system->seflink($video_name);\n\n $movie->addVideo($video_name,$video_url,$video_category,$video_description,$video_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/videos');\n }", "public function movieEditActionPost()\n {\n $this->app->db->connect();\n\n $movieId = $this->app->request->getPost(\"movieId\");\n $movieTitle = $this->app->request->getPost(\"movieTitle\");\n $movieYear = $this->app->request->getPost(\"movieYear\");\n $movieImage = $this->app->request->getPost(\"movieImage\");\n\n if ($this->app->request->getPost(\"doSave\")) {\n $sql = \"UPDATE movie SET title = ?, year = ?, image = ? WHERE id = ?;\";\n $this->app->db->execute($sql, [$movieTitle, $movieYear, $movieImage, $movieId]);\n $this->app->session->destroy();\n return $this->app->response->redirect(\"movie/movie-select?showAll=true\");\n }\n if ($this->app->request->getPost(\"reset\")) {\n return $this->app->response->redirect(\"movie/movie-edit\");\n }\n }", "public function edit($id)\n {\n $media = Media::find($id);\n return view('admin.media.edit' , compact('media' , 'id'));\n }", "public function edit(Video $video)\n {\n return view('videos.edit', compact('video'));\n }", "public function edit($id)\n\n {\n\n $cat = Youtubelink::find($id);\n return view('youtube.edit')->withCat($cat);\n\n }", "function attachment_video_url_edit( $form_fields, $post ) {\n $field_value = get_post_meta( $post->ID, '_attachment_video_url', true );\n $form_fields['video_url'] = array(\n 'value' => $field_value ? $field_value : '',\n 'label' => __( 'Video URL' ),\n );\n return $form_fields;\n}", "public function update(Request $request, $id)\n {\n $video=Programs::find($id);\n if($request->input('url')){\n $video->url=$request->input('url');\n }\n $video->name_en=$request->input('name_en');\n $video->name_ru=$request->input('name_ru');\n $video->name_am=$request->input('name_am');\n $video->description_en=$request->input('description_en');\n $video->description_ru=$request->input('description_ru');\n $video->description_am=$request->input('description_am');\n $video->save();\n return redirect('/programs');\n \n }", "public function edit(Media $media)\n {\n //\n }", "public function edit(Media $media)\n {\n //\n }", "public function show(UploadVideo $uploadVideo)\n {\n //\n }", "public function embedAction() {\n\n //GET SUBJECT (EITHER VIDEO TYPE OR SITEREVIEW_VIDEO TYPE)\n $this->view->video = $video = Engine_Api::_()->core()->getSubject();\n\n //CHECK THAT EMBEDDING IS ALLOWED OR NOT\n if (!Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereview_video.embeds', 1)) {\n $this->view->error = 1;\n return;\n } else if (isset($video->allow_embed) && !$video->allow_embed) {\n $this->view->error = 2;\n return;\n }\n\n //GET EMBED CODE\n $this->view->embedCode = $video->getEmbedCode();\n }", "public function edit(Playlist $playlist)\n {\n //\n }" ]
[ "0.82094455", "0.82094455", "0.7998506", "0.7776602", "0.77720237", "0.76061344", "0.76054996", "0.7556612", "0.7543911", "0.7481285", "0.7459408", "0.7444025", "0.74257445", "0.74120045", "0.74111384", "0.73897797", "0.7382478", "0.7370786", "0.7340393", "0.7335668", "0.73309034", "0.72987694", "0.7291713", "0.7282478", "0.7282196", "0.7275207", "0.7269445", "0.72574896", "0.72436595", "0.72202975", "0.72125757", "0.7174351", "0.71280193", "0.71212506", "0.711297", "0.71064526", "0.7105452", "0.7103966", "0.70675975", "0.70315444", "0.7008201", "0.69784987", "0.6962105", "0.6933469", "0.6893307", "0.68474656", "0.68113285", "0.6777064", "0.6708911", "0.66775393", "0.6675616", "0.6675217", "0.66638666", "0.66574574", "0.6642577", "0.66292423", "0.6619025", "0.6609696", "0.66032326", "0.657612", "0.65470874", "0.6536997", "0.6531678", "0.6531678", "0.6506811", "0.6501962", "0.6496365", "0.64874244", "0.64874244", "0.64874244", "0.64874244", "0.64874244", "0.647401", "0.64664817", "0.64613575", "0.6445558", "0.6435688", "0.64198834", "0.64150774", "0.6412604", "0.6392409", "0.6392409", "0.6386203", "0.6381592", "0.63780445", "0.63689506", "0.6362768", "0.63626456", "0.63562006", "0.6351861", "0.63467175", "0.6341035", "0.63400185", "0.6333673", "0.633239", "0.632434", "0.632434", "0.6316676", "0.6314601", "0.6311257" ]
0.7173445
32
/edit video Function for Update data
public function updateVideo(Request $request) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $this->validate($request,array( 'title' => 'required', 'category' => 'required', 'video' => 'mimes:mp4' )); $id = $request->id; $video = Video::find($id); $video->title = $request->title; $video->video_category_id = $request->category; if ($request->hasFile('video')) { $file = $request->file('video'); $filename = time().'.'.$file->getClientOriginalName(); /*$location = public_path('file/'.$filename); Storage::put($filename,file_get_contents($file));*/ $location = public_path('file/'.$filename); Storage::disk('file')->put($filename, file_get_contents($file)); //Storage::disk('public')->put($filename, file_get_contents($file)); $video->video = $filename; } $video->save(); Session::flash('success','Video Updated succcessfully.'); return redirect()->back()->with('workout',$video); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Video $video)\n {\n //\n }", "public function edit(Video $video)\n {\n //\n }", "public function editVideo(Request $request)\n {\n\n $editVideo = UploadVideo::where(\"id\", $request->id)->first();\n $editVideo->content_title = ucfirst($request->title);\n if ($request->active) {\n $editVideo->active_status = 1;\n } else {\n $editVideo->active_status = 0;\n }\n\n $editVideo->save();\n }", "private function updateVideo()\n {\n try\n {\n $request = $_POST;\n\n global $cbvid;\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video Id not provided\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n //check if title provided\n if( !isset($request['title']) || $request['title']==\"\")\n throw_error_msg(\"title not provided\");\n else\n $title = mysql_clean($request['title']);\n\n //check if description provided\n if( !isset($request['description']) || $request['description']==\"\")\n throw_error_msg(\"description not provided.\");\n else\n $description = mysql_clean($request['description']);\n\n //check if tags provided\n if(!isset($request['tags']) || $request['tags']==\"\")\n throw_error_msg(\"tags not provided.\");\n else\n $tags = mysql_clean($request['tags']);\n\n //check if tags provided\n if(!isset($request['category']) || $request['category']==\"\")\n {\n throw_error_msg(\"category not provided.\");\n }\n else\n {\n $request['category'] = explode(',',$request['category']); \n $_POST['category'] = $request['category'];\n }\n \n if (isset($request['video_users-user']) || isset($request['video_users-group'])) \n {\n $video_user_ = mysql_clean($request['video_users-user']);\n $video_group_ = mysql_clean($request['video_users-group']);\n\n $request['video_users'] = get_video_users($video_user_,$video_group_,false);\n }\n \n $result = $cbvid->update_video($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $vdetails = $cbvid->get_video_details($request['videoid']);\n $formatted_video = format_videos(array($vdetails));\n\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $formatted_video[0]);\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function update($id)\n {\n // DB::table('video_uploaded')\n // ->where ('id')\n // ->update(['video_type'=>$request['video_type'],'video_url'=>$request['video_url'], 'price'=>$request['price'], 'video'=>$request['video']\n // ]); \n // return view('reg/video_list');\n }", "function edit()\n {\n $id = $this->uri->rsegment('3');\n $video = $this->video_model->get_info($id);\n if(!$video)\n {\n $this->session->set_flashdata('message', 'Không tồn tại video này');\n redirect(admin_url('video'));\n }\n $this->data['video'] = $video;\n \n $this->load->library('form_validation');\n $this->load->helper('form');\n \n //neu ma co du lieu post len thi kiem tra\n if($this->input->post())\n {\n $this->form_validation->set_rules('name', 'Tên video', 'required');\n $this->form_validation->set_rules('link', 'Link video', 'required');\n \n if($this->form_validation->run())\n {\n \n //lay ten file anh minh hoa duoc update len\n $this->load->library('upload_library');\n $upload_path = './upload/video';\n $upload_data = $this->upload_library->upload($upload_path, 'image'); \n $images = '';\n if(isset($upload_data['file_name']))\n {\n $images = $upload_data['file_name'];\n }\n \n //luu du lieu can them\n $data = array(\n 'name' => $this->input->post('name'),\n 'images' => $images,\n 'link' => $this->input->post('link'),\n ); \n if($images != '')\n {\n $data['images'] = $images;\n }\n \n //them moi vao csdl\n if($this->video_model->update($video->id, $data))\n {\n $this->session->set_flashdata('message', 'Cập nhật thành công');\n }else{\n $this->session->set_flashdata('message', 'Không cập nhật được');\n }\n redirect(admin_url('video'));\n }\n }\n \n \n //load view\n $this->data['temp'] = 'admin/video/edit';\n $this->load->view('admin/main', $this->data);\n }", "public function postEdit($video)\n\t{\n\n // Declare the rules for the form validation\n $rules = array(\n 'user' => 'required|min:5',\n 'link' => 'required|min:10',\n 'description' => 'required|min:10'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Update the video video data\n $video->user = Input::get('user');\n $video->link = Input::get('link');\n $video->description = Input::get('description');\n // Was the video video updated?\n if($video->save())\n {\n // Redirect to the new video video page\n return Redirect::to('admin/videos/' . $video->id . '/edit')->with('success', Lang::get('admin/videos/messages.update.success'));\n }\n\n // Redirect to the videos video management page\n return Redirect::to('admin/videos/' . $video->id . '/edit')->with('error', Lang::get('admin/videos/messages.update.error'));\n }\n\n // Form validation failed\n return Redirect::to('admin/videos/' . $video->id . '/edit')->withInput()->withErrors($validator);\n\t}", "public function editVideo($data, $video)\n {\n return $this->performRequest('PUT',\"/videos/{$video}\",\n $data);\n }", "public function edit(ProductVideo $productVideo)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //dd($request);\n $video = Video::find($id);\n\n if($video){\n $video->vimeo_id = $request['vimeo_id'];\n $video->vimeo_id_pt = $request['vimeo_id_pt'];\n $video->vimeo_id_en = $request['vimeo_id_en'];\n $video->title_pt = $request['title_pt'];\n $video->title_en = $request['title_en'];\n $video->subtitle_pt = $request['subtitle_pt'];\n $video->subtitle_en = $request['subtitle_en'];\n $video->main_preview_html_pt = $request['main_preview_html_pt'];\n $video->main_preview_html_en = $request['main_preview_html_en'];\n $video->title_box_pt = $request['title_box_pt'];\n $video->title_box_en = $request['title_box_en'];\n $video->poster_pt = $request['poster_pt'];\n $video->poster_en = $request['poster_en'];\n $video->thumb_pt = $request['thumb_pt'];\n $video->thumb_en = $request['thumb_en'];\n $video->category_pt = $request['category_pt'];\n $video->category_en = $request['category_en'];\n $video->specs_pt = $request['specs_pt'];\n $video->specs_en = $request['specs_en'];\n $video->caption_pt = $request['caption_pt'];\n $video->caption_en = $request['caption_en'];\n $video->edition_id = $request['edition_id'];\n $video->video_program_id = $request['video_program_id'];\n $video->order = $request['order'];\n \n $video->save();\n\n return redirect()->route('video.index', ['id' => $request['edition_id']])\n ->with('success', 'Vídeo alterado com sucesso!');\n }\n }", "public function update(Request $request, Video $video)\n {\n //\n }", "public function update(Request $request, Video $video)\n {\n //\n }", "public function update(Request $r, $id)\n {\n $video = Video::find($id);\n\n $video->name = $r->name;\n $video->package_id = $r->paket;\n $video->step = $r->tahap;\n $video->link = $r->link;\n $video->save();\n\n Session::flash('Sukses' , 'Video Berhasil Diubah');\n return $this->index();\n\n }", "function video() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id'];\n if ($id > 0) {\n $query = \"select * from videos where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $query = \"update videos set views = views + 1 where id =$id;\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }", "public function editAction(Tx_Youtubeapi_Domain_Model_Video $video) {\n\t\t$this->view->assign('video', $video);\n\t}", "public function edit_video($video){\n\tif(Auth::check()){\n\t\tif(Auth::user()->type==\"Artist\"){\n\t\t\t$deliver_videos = DB::table('requested_videos')->select('*')\n\t\t\t->where('requested_videos.uploadedby','=',Auth::user()->profile_id)\n\t\t\t->where('requested_videos.id','=',$video)\n\t\t\t->paginate(15);\n\t\t\t$artist = Profile::find(Auth::user()->profile_id);\n\t\t\t$video_data['video'] = $deliver_videos;\n\t\t\t$video_data['artist'] = $artist;\n //return view('frontend.my_video',$video_data);\n\t\t\treturn view('frontend.artistDashboard.edit_video',$video_data); \n\t\t}else{\n\t\t\treturn redirect('/login');\n\t\t}\n\t}else{\n\t\treturn redirect('/login'); \n\t} \n\n}", "public function editAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid()) {\n return;\n }\n\n //GET LISTING ID\n $listing_id = $this->_getParam('listing_id', 0);\n\n $listingtype_id = $this->_listingType->listingtype_id;\n\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n\n //GET VIDEO OBJECT\n $sitereview_video = Engine_Api::_()->getItem('sitereview_video', $this->_getParam('video_id'));\n\n //GET TAB ID\n $this->view->tab_selected_id = $this->_getParam('content_id');\n\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n $this->view->can_edit = $canEdit = $sitereview->authorization()->isAllowed($viewer, \"edit_listtype_$sitereview->listingtype_id\");\n\n //SUPERADMIN, VIDEO OWNER AND LISTING OWNER CAN EDIT VIDEO\n if ($viewer_id != $sitereview_video->owner_id && $canEdit != 1) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n //GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitereview_main');\n\n //FORM GENERATION\n $this->view->form = $form = new Sitereview_Form_Editvideo();\n\n //PREPARE TAGS\n $sitereviewTags = $sitereview_video->tags()->getTagMaps();\n $tagString = '';\n foreach ($sitereviewTags as $tagmap) {\n if ($tagString !== '') {\n $tagString .= ', ';\n }\n $tagString .= $tagmap->getTag()->getTitle();\n }\n $this->view->tagNamePrepared = $tagString;\n $form->tags->setValue($tagString);\n\n //IF NOT POST OR FORM NOT VALID THAN RETURN\n if (!$this->getRequest()->isPost()) {\n $form->populate($sitereview_video->toArray());\n return;\n }\n\n //IF NOT POST OR FORM NOT VALID THAN RETURN\n if (!$form->isValid($this->getRequest()->getPost())) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid data');\n return;\n }\n\n //GET FORM VALUES\n $values = $form->getValues();\n\n //PROCESS\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n $sitereview_video->setFromArray($values);\n\n // Add tags\n $tags = preg_split('/[,]+/', $values['tags']);\n $sitereview_video->tags()->setTagMaps($viewer, $tags);\n $sitereview_video->save();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview_video->getSlug(), 'video_id' => $sitereview_video->getIdentity(), 'user_id' => $sitereview_video->owner_id, 'content_id' => $this->view->tab_selected_id), \"sitereview_video_view_listtype_$listingtype_id\", true);\n }", "public function edit(Videocomment $Videocomment)\n {\n //\n }", "public function edit($id)\n {\n //\n $channels = Channel::pluck('title','id');\n $video = Video::with(['slider'])\n ->where('id',$id)\n ->first();\n // dd($video);\n $val = [];\n $val[] = $video->related_videos_1;\n $val[] = $video->related_videos_2;\n $val[] = $video->related_videos_3;\n $valj = json_encode($val);\n // dd($video);\n $videos = Video::where('channel_id', $video->channel_id)->where('id','<>',$video->id)->pluck('title','id');\n if($video->type==1){\n return view('Push::videos.edit', compact(['channels','video', 'videos','valj']));\n }elseif($video->type==2){\n return view('Push::videos.editpdf', compact(['channels','video', 'videos','valj']));\n }else{\n return view('Push::videos.editslider', compact(['channels','video', 'videos','valj']));\n } \n }", "public function update(Request $request, Video $video)\n { \n\n $request->validate([\n 'name' => \"required|unique:videos,name,$video->id\"\n ]);\n\n $url_video = $request->url_video;\n\n $url_video_array = explode(\"/\", $url_video);\n \n if(Str::contains($url_video, 'youtube')) {\n $url_video_id = $url_video_array[4];\n $url_thumbail = 'https://img.youtube.com/vi/'.$url_video_id.'/0.jpg';\n } \n\n if(Str::contains($url_video, 'vimeo')) {\n $url_video_id = $url_video_array[4];\n $hash = unserialize(file_get_contents(\"https://vimeo.com/api/v2/video/\".$url_video_id.\".php\"));\n $url_thumbail_preview = $hash[0]['thumbnail_large'];\n $url_thumbail = substr_replace( $url_thumbail_preview, \"480x360\", -3);\n } \n\n $video->update([\n 'name' => $request->name, \n 'date_public' => $request->date_public, \n 'status' => $request->status,\n 'category_id' => $request->category_id,\n 'url_video' => $url_video,\n 'url_thumbail' => $url_thumbail\n ]);\n\n return redirect()->route('admin.videos.edit', $video)->with('info', 'El video se actualizó con éxito');\n }", "public function updateVideoDetails($videoID){\n\t\t try{\n\t\t\t $conn=DBConnection::getConnection();\n\t\t\t $updateQuery=\"UPDATE video SET video_name=:video_name,video_image=:video_image,url=:url,release_id=:release_id WHERE video_id='\".$videoID.\"'\";\n\t\t\t $cmd=$conn->prepare($updateQuery);\n\t\t\t $cmd->bindValue(':video_name',$this->getVideoName(),PDO::PARAM_STR);\n\t\t\t $cmd->bindValue(':video_image',$this->getVideoImage(),PDO::PARAM_STR);\n\t\t\t $cmd->bindValue(':url',$this->getUrl(),PDO::PARAM_STR);\n\t\t\t $cmd->bindValue(':release_id',$this->getReleaseId(),PDO::PARAM_INT);\t\n\t\t\t return $cmd->execute();\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }", "public function update(Request $request, UploadVideo $uploadVideo)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n $validator = Validator::make(\n $request->all(), \n [\n 'title' => 'required', ],\n [\n 'title.required' => 'メールアドレスが間違っています。',\n ]\n );\n if(strtotime($request->start_date) > strtotime($request->end_date)) {\n $validator->after(function ($validator) {\n $validator->errors()->add('end_date.format', '終了日が開始日より大きい');\n });\n }\n if ($validator->fails()) {\n return back()\n ->withErrors($validator)\n ->withInput();\n }\n\n $data = $request->all();\n // dd($data);\n unset($data['_token']);\n unset($data['thumbnail']);\n unset($data['thumbnail_detail']);\n unset($data['banner']);\n unset($data['video']);\n unset($data['slider']);\n unset($data['_method']);\n if(@$data['related'][0]) {\n $data['related_videos_1'] = @$data['related'][0];\n }else{\n $data['related_videos_1'] = 0;\n }\n if(@$data['related'][1]) {\n $data['related_videos_2'] = @$data['related'][1];\n }else{\n $data['related_videos_2'] = 0;\n }\n if(@$data['related'][2]) {\n $data['related_videos_3'] = @$data['related'][2];\n }else{\n $data['related_videos_3'] = 0;\n }\n unset($data['related']);\n $rs = Video::find($id)->update($data);\n if($rs) {\n $vd = Video::find($id);\n if($request->thumbnail){\n $thumbnail_u = $vd->thumbnail;\n $thumbnail_u = str_replace('/storage/app/', '', $thumbnail_u);\n $path = '/storage/app/'.@$request->file('thumbnail')->store('TVpro/images');\n $vd->thumbnail = $path;\n $vd->save();\n Storage::delete($thumbnail_u);\n }\n if($request->thumbnail_detail){\n $thumbnail_detail_u = $vd->thumbnail_detail;\n $thumbnail_detail_u = str_replace('/storage/app/', '', $thumbnail_detail_u);\n $path = '/storage/app/'.@$request->file('thumbnail_detail')->store('TVpro/images');\n $vd->thumbnail_detail = $path;\n $vd->save();\n Storage::delete($thumbnail_detail_u);\n }\n\n if($request->banner){\n $banner_u = $vd->banner;\n $banner_u = str_replace('/storage/app/', '', $banner_u);\n $path = '/storage/app/'.@$request->file('banner')->store('TVpro/images');\n $vd->banner = $path;\n $vd->save();\n Storage::delete($banner_u);\n }\n \n if($request->video_edit){\n if($vd->video != \"\"){\n $rmf = 1;\n }else{\n $rmf = 0;\n }\n $video_u = '/var/www/html'.$vd->video;\n $video_u = str_replace('/playlist.m3u8', '', $video_u);\n\n $folder = md5(date('Y-m-d H:i:s:u'));\n $store_p = 'TVpro/videos/'.$folder.'/';\n\n $path_up = '/storage/app/'.@$request->file('video_edit')->store($store_p);\n $path = '/storage/app/TVpro/videos/'.$folder.'/playlist.m3u8';\n $video = str_replace('/storage/app/TVpro/videos/'.$folder.'/', '' , $path_up);\n $video = str_replace('/', '' , $video);\n $video = str_replace($folder, '' , $video);\n // \n $cd = '/var/www/html/storage/app/'.$store_p;\n chmod($cd, 0777);\n $command = 'cd '.$cd.' ; /usr/local/bin/bin/ffmpeg -y -i '.$video.' -r 25 -g 25 -c:a libfdk_aac -b:a 128k -c:v libx264 -preset veryfast -b:v 1600k -maxrate 1600k -bufsize 800k -s 640x360 -c:a libfdk_aac -vbsf h264_mp4toannexb -flags -global_header -f ssegment -segment_list playlist.m3u8 -segment_list_flags +live-cache -segment_time 5 output-%04d.ts; sudo chmod -R 777 '.$cd;\n if($rmf==1){\n $command = $command.'; rm -rf '.$video_u;\n }\n // $command = 'cd '.$cd.' ; /usr/local/bin/bin/ffmpeg -y -i '.$video.' -r 25 -g 25 -c:a libfdk_aac -b:a 128k -c:v libx264 -preset veryfast -b:v 1600k -maxrate 1600k -bufsize 800k -s 640x360 -c:a libfdk_aac -vbsf h264_mp4toannexb -flags -global_header -f ssegment -segment_list playlist.m3u8 -segment_list_flags +live-cache -segment_time 5 output-%04d.ts; sudo chmod -R 777 '.$cd.'; rm -rf '.$video_u;\n exec($command.\" 2>&1\", $output);\n\n $vd = Video::find($id)->update(['video'=> $path]);\n // $vd->video = $path;\n // $vd->save();\n\n }\n if($request->pdf){\n $pdf_u = $vd->pdf;\n $pdf_u = str_replace('/storage/app/', '', $pdf_u);\n $path = '/storage/app/'.@$request->file('pdf_edit')->store('TVpro/pdf');\n $vd->pdf = $path;\n $vd->save();\n Storage::delete($pdf_u);\n }\n\n if($request->slider){\n $slid = Slider::where('video_id', $id)->get();\n if(count($slid)) {\n foreach ($slid as $key => $value) {\n $slider_u = $value->slider;\n $slider_u = str_replace('/storage/app/', '', $slider_u);\n Storage::delete($slider_u);\n }\n }\n Slider::where('video_id', $id)->delete();\n foreach (@$request->slider as $key => $image) {\n $image = '/storage/app/'.$image->store('TVpro/images');\n Slider::insert([\n 'video_id'=>$id,\n 'image'=>$image\n ]);\n }\n }\n\n return redirect(route('push.videos.index'));\n }else{\n return back();\n }\n }", "public function edit($id)\n {\n $video = Video::find($id);\n $pk = CoursePackage::all();\n return view('admin.video.edit')->with('v' , $video)->with('pk' , $pk);\n }", "public function edit(Video $video)\n {\n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = UserMoodle::where('id', $user_id)->first();\n $users = UserMoodle::all();\n $competitors = Competitor::where('video_id', $video->id)->get();\n $competitor_types = CompetitorType::where('status', 1)->get();\n $video_types = VideoType::where('status', 1)->get();\n\n return view('admin.videos.edit', compact('video', 'usuario', 'users', 'video_types', 'competitor_types', 'competitors'));\n }", "public function actionUpdate($id)\n\t{\n\t\n\t\t$this->actionVideo($id);\n\n\t}", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'headline'=>'required',\n 'video'=>'mimes:mp4,mov,ogg',\n 'description'=>'required',\n ]);\n\n $abt_com=AboutCompany::find($id);\n $video_prev=$abt_com->video;\n\n $headline=$request->input('headline');\n $description=$request->input('description');\n\n if($request->hasFile('video')){\n\n unlink($video_prev);\n $video = $request->file('video');\n $destinationPath = 'video/home/aboutCompany/';\n $originalFile = $video->getClientOriginalName();\n $uniqueName = time().$originalFile;\n $video->move($destinationPath, $uniqueName);\n $originalPath = $destinationPath.$uniqueName;\n\n $data=array(\n 'headline'=>$headline,\n 'description'=>$description,\n 'video'=>$originalPath,\n );\n AboutCompany::where('id',$id)->update($data);\n session()->flash('update', 'Successfully updated');\n return redirect('/about_company');\n }\n\n else{\n $data=array(\n 'headline'=>$headline,\n 'description'=>$description\n \n );\n\n AboutCompany::where('id',$id)->update($data);\n session()->flash('update', 'Successfully updated');\n return redirect('/about_company');\n \n }\n\n\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'title' => 'required',\n \n 'body' => 'required',\n ]);\n \n \n $video = Video::find($id);\n\n $video->update($request->all());\n\n return redirect('/admin/video');\n }", "public function edit($id)\n {\n //\n $users = DB::table('video_uploaded')->where('id',$id)->get();\n return view('reg/video')->with('videoDetails',$users);\n }", "public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n \n $post = Yii::$app->request->post();\n if ($post) {\n// $file = UploadedFile::getInstance($model, 'file');\n// $path = Yii::$app->basePath. \"/../frontend/web/\";\n// $filePath = Yii::$app->basePath. \"/../frontend/web/videos/\";\n \n// if ($file) {\n// $filename = \"videos/\" . time() . rand(1,1000) . '.' . $file->getExtension();\n// $path = $path . $filename;\n \n// if(!file_exists($filePath)){\n// mkdir($filePath);\n// }\n// $file->saveAs($path);\n \n $url = $path = Yii::$app->params['uploadsUrl'].$post['Video']['video'];\n $header_array = get_headers($url, true);\n $size = $header_array['Content-Length']; \n \n $post['Video']['video'] = $post['Video']['video'];\n $post['Video']['filesize'] = $size;\n $post['Video']['ext'] = explode('.', basename($post['Video']['video']))[1];\n $post['Video']['is_complete'] = '1';\n $post['Video']['product_id'] = empty($post['Video']['product_id']) ? '' : join(',', $post['Video']['product_id']);\n// }\n \n if ($model->load($post) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function getEdit($video)\n\t{\n // Title\n $title = Lang::get('admin/videos/title.video_update');\n\n // Show the page\n return View::make('admin/videos/create_edit', compact('video', 'title'));\n\t}", "public function addEdit(){\n\t\tif (isset($this->session->userdata['logged_in'])){\n\t\t\t$video_id = $this->uri->segment(4);// get id form url\n\t\t\tif($video_id==''){\n\t\t\t\t$data['title'] = \"Add Video\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$data['title'] = \"Edit Video\";\n\t\t\t}\n\t\t\t$data['content'] = 'admin/addeditvideo';\n\t\t\t$data['getVideo'] = $this->VideoModel->getVideoById($video_id); //retrive all category By Id\n\t\t\t//print_r($data['getVideo']); die;\n\t\t\t$this->load->view('admin/layout/adminmaster',$data);\n\t\t}else{\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "public function update(Request $request)\n {\n $id = $request->id;\n $thumbnail = 'http://img.youtube.com/vi/' . $request->thumbnail . '/mqdefault.jpg';\n\n $datas = [\n 'video_title' => $request->title,\n 'user_id' => Auth::user()->id,\n 'id_category' => $request->category,\n 'video_url' => $request->urlnew,\n 'content' => $request->area,\n 'key' => $request->thumbnail,\n 'thumbnail' => $thumbnail,\n ];\n \n $updatevideo = Video::where('id_video',$id)->update($datas);\n\n return redirect()->route('video.index')->withErrors(['success' => 'Success update Video']);\n }", "public function update(VideoRequest $request, $id)\n {\n $request->validated();\n parse_str( parse_url( $request->url, PHP_URL_QUERY ), $array_param_video );\n if (empty($array_param_video)) {\n\n return redirect()->back()->with('error', 'URL digitada não é válida!');\n\n }else{\n $video = Videos::findOrFail($id);\n $video->titulo = $request->titulo;\n $video->descricao = $request->descricao;\n $video->url = $array_param_video['v'];\n $video->save();\n return redirect()->back()->with('message', 'Cadastro efetuado com sucesso!');\n }\n }", "public function edit($id)\n {\n $video = Video::find($id);\n // dd($video->categories[0]->name);\n $categories = Category::where('status',1)->orderBy('name')->get();\n $tags = Tag::where('status',1)->get();\n return view('adminCMS.videos.editVideo',compact('video','categories','tags'));\n }", "public function update(Request $request, $video_id)\n {\n $rules = [\n 'name' => 'required|string',\n 'especialidad' => 'required|string',\n 'tema' => 'required|string',\n 'video_types_id' => 'required|string',\n 'resumen' => 'required|string',\n 'contenido' => 'required|string',\n 'fecha' => 'required',\n 'lugar' => 'required|string',\n 'duracion' => 'required|string',\n 'url' => 'required|string',\n 'tipo_licencia' => 'required|string',\n 'keys' => 'nullable|string',\n 'competitor' => 'required|array',\n ];\n\n $messages = [\n 'name.required' => 'El nombre del vídeo es requerido',\n 'especialidad.required' => 'La especialidad del vídeo es requerida',\n 'tema.required' => 'El tema del vídeo es requerido',\n 'video_types_id.required' => 'El tipo de vídeo es requerido',\n 'resumen.required' => 'El resumen de vídeo es requerido',\n 'contenido.required' => 'El contenido de vídeo es requerido',\n 'fecha.required' => 'La fecha de ejecución del vídeo es requerida',\n 'lugar.required' => 'El lugar de vídeo es requerido',\n 'duracion.required' => 'La duración de vídeo es requerida',\n 'url.required' => 'La url de vídeo es requerida',\n 'tipo_licencia.required' => 'El tipo de licencia es requerido',\n 'competitor.required' => 'Los participantes son requeridos',\n ];\n\n $this->validate($request, $rules, $messages);\n\n $competitors = $request->input('competitor');\n\n $request->merge([\n 'url' => str_replace(\"watch?v=\", \"embed/\", $request->input('url'))\n ]);\n\n $video = Video::where('id', $video_id)->firstOrFail();\n $video->update($request->except(['competitor']));\n\n Competitor::where('video_id', $video_id)->delete();\n foreach ($competitors as $key => $item) {\n $competitor = [\n 'user_id' => $item['user_id'],\n 'video_id' => $video_id,\n 'competitor_type_id' => $key\n ];\n Competitor::create($competitor);\n }\n\n return redirect('videos');\n }", "public function update_video($arr_data,$arr_where){\n\n\t\t$str_select=\"video_file,video_img\";\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->where($arr_where);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$video=$query->row_array();\n\n\t\tif(isset($arr_data['video_file']) && is_array($video) && (element('video_file',$video,'') != $arr_data['video_file']) && (element('video_file',$video,'') != ''))\n\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.element('video_file',$video,''));\n\n\t\tif(isset($arr_data['video_img']) && is_array($video) && (element('video_img',$video,'') != $arr_data['video_img']) && (element('video_img',$video,'') != '')){\n\n\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.element('video_img',$video,''));\n\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.\"_thumbs/\".element('video_img',$video,''));\n\t\t}\n\n\t\t$this->db->where($arr_where);\n\t\treturn $this->db->update($this->_table,$arr_data);\n\n\t}", "public function update(Request $request, $id)\n {\n $video=Programs::find($id);\n if($request->input('url')){\n $video->url=$request->input('url');\n }\n $video->name_en=$request->input('name_en');\n $video->name_ru=$request->input('name_ru');\n $video->name_am=$request->input('name_am');\n $video->description_en=$request->input('description_en');\n $video->description_ru=$request->input('description_ru');\n $video->description_am=$request->input('description_am');\n $video->save();\n return redirect('/programs');\n \n }", "public function edit($id)\n {\n $video=Video::where('id',$id)->first();\n return view('videos.edit-video',compact('video'));\n }", "public function edit($id)\n\t{\n\t\t$video = Resource::find($id);\n\t\t//id=1表示是视频的大类\n\t\t$categories = Category::find(1);\n\t\treturn view('admin.video.edit')->with(compact('video','categories'));\n\t}", "public function update(Request $request, $id)\n {\n $video = Video::find($id); \n\n // $validator = Validator::make($request->all(), $video->rules);\n // if ($validator->fails())\n // {\n // return $this->message('error', 'Please fill all required fields.');\n // }\n $video->unit_id = $request->unit_id;\n $video->video_title = $request->video_title;\n $video->save();\n\n return $this->message('success', 'Video has been updated.');;\n \n }", "public function updateMovie($data) {\n\n\t\t$this->dbAdapter->dbOpen();\n\t\t// var_dump($data);\n\t\t$this->dbAdapter->updateMovie($data);\n\t\t$this->dbAdapter->dbClose();\n\t\t$this->error = $this->dbAdapter->lastError();\n\t\t\n\t}", "public function update(Request $request, ProductVideo $productVideo)\n {\n //\n }", "public function executeEditVideo(sfWebRequest $request)\n {\n // Shut off Chrome's poorly designed XSS filtering that clobbers perfectly legitimate iframe embed submissions\n // http://code.google.com/p/chromium/issues/detail?id=98787\n $this->getResponse()->setHttpHeader('X-XSS-Protection', '0');\n $this->forward404Unless(aMediaTools::userHasUploadPrivilege());\n $item = null;\n $this->slug = false;\n $this->popularTags = PluginTagTable::getPopulars(null, array('sort_by_popularity' => true), false, 10);\n if (sfConfig::get('app_a_all_tags', true))\n {\n $this->allTags = PluginTagTable::getAllTagNameWithCount();\n }\n else\n {\n $this->allTags = array();\n }\n if ($request->hasParameter('slug'))\n {\n $item = $this->getItem();\n $this->slug = $item->getSlug();\n }\n if ($item)\n {\n $this->forward404Unless($item->userHasPrivilege('edit'));\n }\n $this->item = $item;\n $embed = false;\n $parameters = $request->getParameter('a_media_item');\n \n if ($parameters)\n {\n $files = $request->getFiles('a_media_item');\n \n $this->form = new aMediaVideoForm($item);\n \n if (isset($parameters['embed']))\n {\n // We need to do some prevalidation of the embed code so we can prestuff the\n // file, title, tags and description widgets\n $result = $this->form->classifyEmbed($parameters['embed']);\n if (isset($result['thumbnail']))\n {\n $thumbnail = $result['thumbnail'];\n if ((!isset($parameters['title'])) && (!isset($parameters['tags'])) && (!isset($parameters['description'])) && (!isset($parameters['credit'])))\n {\n $parameters['title'] = $result['serviceInfo']['title'];\n // We want tags to be lower case, and slashes break routes in most server configs. \n $parameters['tags'] = str_replace('/', '-', aString::strtolower($result['serviceInfo']['tags']));\n $parameters['description'] = aHtml::textToHtml($result['serviceInfo']['description']);\n $parameters['credit'] = $result['serviceInfo']['credit'];\n }\n }\n }\n\n // On the first pass with a youtube video we just make the service's thumbnail the\n // default thumbnail. We don't force them to use it. This allows more code reuse\n // (Moving this after the bind is necessary to keep it from being overwritten) \n if (isset($thumbnail))\n {\n $this->convertServiceThumbnailToFileUpload($thumbnail, $parameters);\n }\n \n $this->form->bind($parameters, $files);\n \n do\n {\n // first_pass forces the user to interact with the form\n // at least once. Used when we're coming from a\n // YouTube search and we already technically have a\n // valid form but want the user to think about whether\n // the title is adequate and perhaps add a description,\n // tags, etc.\n if (($this->hasRequestParameter('first_pass')) ||\n (!$this->form->isValid()))\n {\n break;\n }\n $thumbnail = $this->form->getValue('file');\n // The base implementation for saving files gets confused when \n // $file is not set, a situation that our code tolerates as useful \n // because if you're updating a record containing an image you \n // often don't need to submit a new one.\n unset($this->form['file']);\n $object = $this->form->getObject();\n if ($thumbnail)\n {\n $object->preSaveFile($thumbnail->getTempName());\n }\n $this->form->save();\n \n if ($thumbnail)\n {\n $object->saveFile($thumbnail->getTempName());\n }\n \n if (aMediaTools::isSelecting())\n {\n return $this->redirect('aMedia/multipleAdd?id=' . $object->id);\n }\n\n return $this->redirect(\"aMedia/resumeWithPage\");\n } while (false);\n }\n return $this->renderTemplate();\n }", "public function edit($id)\n {\n $edit = true;\n $video = Video::findOrFail($id);\n $time = $video->publish_at;\n// $isPm = $time->hour >= 12? true: false;\n\n $video->showTime = $time->day . '/' . $time->month . '/' . $time->year . ' ' . $time->hour . ':' . $time->minute;\n return view('admin.videos.show', compact(['edit', 'video']));\n }", "public function update($video,Request $request)\n\t{\n\t\t$data = $request->all();\n\n\t\t// add slug.\n\t\tif(! isset($data['slug'])) {\n\t\t\t$data['slug'] = str_slug($data['title']);\n\t\t}\n\n\t\t// If status is equal to one then set the published_date to current date.\n\t\tif((int)$data['status'] == 1) {\n\t\t\t$data['published_at'] = Carbon::now();\n\t\t} else {\n\t\t\t$data['published_at'] = null;\n\t\t}\n\n\n\n\t\t$video = $this->getById($video);\n\n\t\treturn $video->update($data);\n\t}", "public function edit($id)\n {\n $video = Video::find($id);\n $category = Category::all()->pluck('name','id');\n \n return view('admin.video.edit', compact('video','category'));\n }", "function tpl_edit($video)\n{\n\tglobal $smarty, $config, $lang;\n\n\t// create a form ready quoted version for each value\n\tforeach (array_keys($video) as $key)\n {\n\t\t$video['q_'.$key] = formvar($video[$key]);\n\t}\n\n\t// use custom function for language\n\t$video['f_language'] = custom_language_input('language', $video['language']);\n\n\t// create mediatype selectbox\n $smarty->assign('mediatypes', out_mediatypes());\n if (!isset($video['mediatype'])) $video['mediatype'] = $config['mediadefault'];\n\n\t// prepare the custom fields\n\tcustomfields($video, 'in');\n\n if ($config['multiuser'])\n {\n $smarty->assign('owners', out_owners(array('0' => ''), (check_permission(PERM_ADMIN)) ? false : PERM_WRITE, true));\n }\n\n\t// item genres\n\t$item_genres = getItemGenres($video['id']);\n\t// new-style\n $smarty->assign('genres', out_genres2($item_genres));\n#dlog(out_genres2($item_genres));\n#dlog($item_genres);\n // classic\n $smarty->assign('genreselect', out_genres($item_genres));\n\n\t// assign data\n\t$smarty->assign('video', $video);\n\n\t// get drilldown url for visit link\n\tif ($video['imdbID'])\n {\n require_once './engines/engines.php';\n $engine = engineGetEngine($video['imdbID']);\t\n $smarty->assign('link', engineGetContentUrl($video['imdbID'], $engine));\n $smarty->assign('engine', $engine);\n\t}\n\n/*\n // populate autocomplete boxes\n $smarty->assign('audio_codecs', array_column(runSQL('SELECT DISTINCT audio_codec FROM '.TBL_DATA.' WHERE audio_codec IS NOT NULL'), 'audio_codec'));\n $smarty->assign('video_codecs', array_column(runSQL('SELECT DISTINCT video_codec FROM '.TBL_DATA.' WHERE video_codec IS NOT NULL'), 'video_codec'));\n*/ \n\t$smarty->assign('lookup', array('0' => $lang['radio_look_ignore'],\n\t\t\t\t\t\t\t '1' => $lang['radio_look_lookup'],\n\t\t\t\t\t\t\t '2' => $lang['radio_look_overwrite']));\n\n // needed for ajax image lookup\n $smarty->assign('engines', $config['engines']);\n}", "public function edit(Video $video)\n {\n //\n $categories = DB::table('categories')->Select('categoryID', 'categoryName')->paginate();\n\n $getFilesData = DB::table('files')->select('fileID', 'fileName', 'file', 'created_at')->where('videoID', '=', $video->videoID)->paginate();\n\n return view('video.editVideo', compact('video', 'categories', 'getFilesData'));\n }", "public function update(Request $request, $id)\n {\n $data = $this->getSaveData($request);\n if ($data['preview'] == 1) {\n return $this->preview($data);\n } else {\n $video = Video::findOrFail($id);\n\n $video->update($data);\n\n $user = Auth::user();\n if ($user) {\n Log::info($user->name . ' update video ' . $id);\n }\n return redirect('admin/videos');\n }\n }", "public function update(Request $request, $id)\n {\n $video = Video::where('id',$id)->first();\n\n $request->validate([\n 'title' => 'required',\n ]);\n\n if($request->has('image')){\n $randomPath = Str::random(16);\n $newPath = $randomPath . '.' . $request->image->getClientOriginalExtension();\n\n Storage::delete($video->image_path);\n\n $image = Image::make($request->image)->resize(320,180);\n\n $path = Storage::put($newPath, $image->stream());\n\n $video->image_path = $newPath;\n }\n\n $video->title = $request->title;\n\n $video->update([\n 'title' => $video->title,\n ]);\n\n $video->save();\n\n return redirect('/videos')->with('success','The data has updated successfully');\n }", "public function updateVideo(Request $request, $id)\n {\n try {\n $video = VideoContent::where('ID', '=' ,(int) $id)->first();\n if (!$video) {\n return APIResponse('201', 'No videos found.');\n }\n\n $validateData = Validator::make($request->all(),[\n 'title' => 'required',\n 'asset_type' => 'required',\n 'slug' => 'required',\n 'short_description' => 'required|max:520',\n 'description' => 'required',\n 'content_type' => 'required'\n ]);\n\n if ($validateData->fails()) {\n $messages = $validateData->errors()->all();\n return APIResponse('201', 'Validation errors.', $messages);\n }\n\n $photoURL = '';\n if ($request->hasFile('thumbnail_image')) {\n $file = $request->file('thumbnail_image');\n $folderpath = 'bcci/videos/';\n $result = uploadFileToS3($file, $folderpath, '');\n $photoURL = $result['ObjectURL'] ?? '';\n }\n\n $videoUrl = '';\n if ($request->hasFile('video_url')) {\n $file = $request->file('video_url');\n $folderpath = 'Input/';\n $result = uploadFileToS3($file, $folderpath, 'video');\n $videoUrl = $result['ObjectURL'] ?? '';\n }\n\n $dataArr = [\n 'title' => $request->get('title'),\n 'short_description' => $request->get('short_description'), \n 'description' => $request->get('description'),\n 'match_id' => $request->get('match_id'), \n 'video_duration' => $request->get('video_duration'), \n 'content_type' => $request->get('content_type'), \n 'video_scope' => $request->get('video_scope'),\n 'video_url' => $videoUrl,\n 'match_formats' => $request->get('match_formats'),\n 'keywords' => $request->get('keywords'),\n 'published_by' => $request->get('published_by'),\n 'publish_date' => $request->get('publish_date'), \n 'meta_languages' => $request->get('meta_languages'), \n 'langauge' => $request->get('langauge'),\n 'asset_type' => $request->get('asset_type'),\n 'expiry_date' => $request->get('expiry_date'),\n 'total_viewcount' => $request->get('total_viewcount'),\n 'titleslug' => $request->get('titleslug'), \n 'varients' => $request->get('varients'), \n 'views_count' => $request->get('views_count'), \n 'comments' => $request->get('comments'),\n 'platform' => $request->get('platform'),\n 'thumbnail_image' => $photoURL,\n 'current_status'=> $request->get('current_status'),\n 'lastModified'=> $request->get('lastModified'),\n 'video_status'=> $request->get('video_status'),\n 'location'=> $request->get('location'),\n 'titleUrlSegment'=> $request->get('titleUrlSegment'),\n 'subtitle'=> $request->get('subtitle'),\n 'titleTranslations'=> $request->get('titleTranslations'),\n 'coordinates'=> $request->get('coordinates'),\n 'lastModified'=> $request->get('lastModified'),\n 'publishTo'=> $request->get('publishTo'),\n 'mediaId'=> $request->get('mediaId'),\n 'references'=> $request->get('references'),\n 'closedCaptioned'=> $request->get('closedCaptioned'),\n 'status'=> true\n ];\n\n $updated = VideoContent::where('ID', (int) $id)->update($dataArr);\n\n if ($updated) {\n $response = APIResponse('200', 'Video has been updated successfully.');\n }\n else {\n $response = APIResponse('201', 'Something went wrong, please try again.');\n }\n\n } catch (\\Throwable $e) {\n $response = APIResponse('201', $e->getMessage());\n }\n return $response;\n }", "public function editVideo($id)\n {\n\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = Video::find($id);\n $categories = VideoCategory::all();\n //dd($categories);\n return view('admin.editvideo')->with('workout',$workout)->with('videoCategories',$categories);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function update_processed_video($file_array,$status='Successful',$ingore_file_status=false,$failed_status='')\r\n{\r\n global $db;\r\n $file = $file_array['cqueue_name'];\r\n $array = explode('-',$file);\r\n\r\n if(!empty($array[0]))\r\n $file_name = $array[0];\r\n $file_name = $file;\r\n\r\n $file_path = VIDEOS_DIR.'/'.$file_array['cqueue_name'].'.flv';\r\n $file_size = @filesize($file_path);\r\n\r\n if(file_exists($file_path) && $file_size>0 && !$ingore_file_status)\r\n {\r\n $stats = get_file_details($file_name);\r\n\r\n //$duration = $stats['output_duration'];\r\n //if(!$duration)\r\n // $duration = $stats['duration'];\r\n\r\n $duration = parse_duration(LOGS_DIR.'/'.$file_array['cqueue_name'].'.log');\r\n\r\n $db->update(tbl(\"video\"),array(\"status\",\"duration\",\"failed_reason\"),\r\n array($status,$duration,$failed_status),\" file_name='\".$file_name.\"'\");\r\n }else\r\n {\r\n //$duration = $stats['output_duration'];\r\n //if(!$duration)\r\n // $duration = $stats['duration'];\r\n $result = db_select(\"SELECT * FROM \".tbl(\"video\").\" WHERE file_name = '$file_name'\");\r\n if($result)\r\n {\r\n foreach($result as $result1)\r\n {\r\n $str = '/'.$result1['file_directory'].'/';\r\n $duration = parse_duration(LOGS_DIR.$str.$file_array['cqueue_name'].'.log');\r\n }\r\n }\r\n \r\n\r\n $db->update(tbl(\"video\"),array(\"status\",\"duration\",\"failed_reason\"),\r\n array($status,$duration,$failed_status),\" file_name='\".$file_name.\"'\");\r\n\r\n \r\n }\r\n}", "public function edit(Video $video)\n {\n $bussines=Bussine::lists('slug','id');\n return view('backend.videos.edit')->with('video',$video)->with('bussines',$bussines);\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,\n [\n 'video_title'=>'required',\n 'Video_link'=>'required',\n ]); \n Video::where('id', '=', $id)->update([\n 'Video_title' => $request->video_title??'',\n 'Video_link' => $request->video_link??''\n ]);\n return redirect()->back()->with('success', 'Updated Successfully');\n }", "public function addEditData(){\n\t\tif (isset($this->session->userdata['logged_in'])){\n\t\t\t$config = array(\n\t\t\t\tarray(\n\t 'field' => 'title',\n\t 'label' => 'Title',\n\t 'rules' => 'required|trim|min_length[2]|max_length[12]'\n\t ),\n\t array(\n\t 'field' => 'link',\n\t 'label' => 'Link',\n\t 'rules' => 'required|trim'\n\t )\n\t ); \n\t\t\t\n\t\t\t$this->form_validation->set_rules($config);\n\t\t\tif ($this->form_validation->run() == FALSE) {\n\t\t\t\t//$this->addedit();\n\t\t\t\t$this->session->set_flashdata('errors', validation_errors());\n\t\t\t\t$id= $this->input->post('id');\n\t\t\t\tif($id==''){\n\t\t\t\t\tredirect('admin/video/add-edit-video');\n\t\t\t\t}else{\n\t\t\t\t\tredirect('admin/video/add-edit-video/'.$id);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$id= $this->input->post('id');\n\t\t\t\tif($id==''){\n\t\t\t\t\t$data = array(\n\t\t\t\t\t'title' => $this->input->post('title'),\n\t\t\t\t\t'link' => $this->input->post('link'),\n\t\t\t\t\t);\n\t\t\t\t\t$result = $this->VideoModel->insertVideo($data);\n\t\t\t\t\tif($result == TRUE){\n\t\t\t\t\t\t$this->session->set_flashdata('message', 'Successfully Added.');\n\t\t\t\t\t\tredirect('admin/video');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->session->set_flashdata('err_message', 'This Video already exist');\n\t\t\t\t\t\tredirect('admin/video');\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$data = array(\n\t\t\t\t\t'title' => $this->input->post('title'),\n\t\t\t\t\t'link' => $this->input->post('link'),\n\t\t\t\t\t'id' => $this->input->post('id'),\n\t\t\t\t\t);\n\t\t\t\t\t$result = $this->VideoModel->updateVideo($data);\n\t\t\t\t\tif($result == TRUE){\n\t\t\t\t\t\t$this->session->set_flashdata('message', 'Successfully Updated.');\n\t\t\t\t\t\tredirect('admin/video/add-edit-video/'.$id);\n\t\t\t\t\t\t//echo 'ok'; die;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$this->session->set_flashdata('message', 'Not Updated.');\n\t\t\t\t\t\tredirect('admin/video/add-edit-video/'.$id);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}else{\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "public function update(Request $request, $id)\n {\n request()->validate([\n 'nom_multimedia' => 'required',\n 'desc_multimedia' => 'required',\n ]);\n\n\n\n\n switch ($request->get('tipo_media_id')) {\n case 1: \n if(request()->multimedia_img){\n\n $image = $request->file('multimedia_img');\n $nombre_archivo = str_replace(\" \",\"_\",$request->get('nom_multimedia')).substr(str_replace(\"0.\",\"\",microtime()),0,4).'.'.$image->getClientOriginalExtension();\n \n \n $destinationPath = public_path('/archivos_media/images');\n $img = Image::make($image->getRealPath());\n\n if($img->width() > $img->height()){\n\n $img->resize(1024, null, function ($constraint) {\n $constraint->aspectRatio();\n })->save($destinationPath.'/'.$nombre_archivo);\n\n }else{\n\n $img->resize(null,700, function ($constraint) {\n $constraint->aspectRatio();\n })->save($destinationPath.'/'.$nombre_archivo);\n\n }\n\n\n $destinationPath = public_path('/archivos_media/thumbnail');\n $img = Image::make($image->getRealPath());\n $img->resize(250, 250, function ($constraint) {\n $constraint->aspectRatio();\n })->save($destinationPath.'/'.$nombre_archivo);\n\n }else{\n\n\n $nombre_archivo = request()->multimedia;\n\n\n\n }\n \n break;\n \n\n case 3: \n if(request()->multimedia_video){\n\n request()->multimedia =request()->multimedia_video; \n $time = time(); \n $nombre_archivo = $time.'.'.request()->multimedia->getClientOriginalExtension();\n request()->multimedia->move(public_path('archivos_media/videos'), $nombre_archivo); \n $ruta = public_path('archivos_media/videos/'); \n \n $frame = exec('ffmpeg -i '.$ruta.$nombre_archivo.' '. $ruta.$time.'.jpg');//capturo el frame del video\n\n \n }else{\n\n\n $nombre_archivo = request()->multimedia;\n\n\n\n } \n break;\n case 2:\n if(request()->multimedia_youtube){\n//dd(request()->multimedia_youtube);\n request()->multimedia=request()->multimedia_youtube;\n $patron = '%^ (?:https?://)? (?:www\\.)? (?: youtu\\.be/ | youtube\\.com (?: /embed/ | /v/ | /watch\\?v= ) ) ([\\w-]{10,12}) $%x';\n $array = preg_match($patron, request()->multimedia, $parte);\n if (false !== $array) {\n\n $nombre_archivo = $parte[1];\n\n $imagen = file_get_contents(\"http://img.youtube.com/vi/\".$nombre_archivo.\"/default.jpg\");\n file_put_contents(\"archivos_media/thumbnail/\".$nombre_archivo.\".jpg\", $imagen);\n\n\n }\n\n }else{\n\n $nombre_archivo = request()->multimedia;\n\n }\n\n\n break; \n default:\n # code...\n break;\n }\n//dd($request->get('nom_multimedia'));\n MultiMedia::where('id',$id)->update([\n 'nom_multimedia' => $request->get('nom_multimedia'), \n 'desc_multimedia' => $request->get('desc_multimedia'),\n 'tipo_media_id' => $request->get('tipo_media_id'),\n 'categoria_media_id' => $request->get('categoria_media_id'),\n 'multimedia' => $nombre_archivo, \n ]);\n\n\n return redirect()->route('multimedia.index')\n ->with('success','categoria_media updated successfully');\n }", "public function edit()\r\n {\r\n if (!isset($_SESSION['auth']) || empty($this->params['id'])) {\r\n header('Location: ' . BASE_URI);\r\n exit;\r\n }\r\n // get genre and publisher list\r\n $genreModel = new GenreModel();\r\n $genreList = $genreModel->read();\r\n $publisherModel = new PublisherModel();\r\n $publisherList = $publisherModel->read();\r\n\r\n // CASE user submit change\r\n if (isset($this->params['title'])) {\r\n $this->model->id = $this->params['id'];\r\n unset($this->model->params['id']);\r\n\r\n $this->model->params = $this->filterArrayEmpty($this->model->params);\r\n /**\r\n * Verif here\r\n */\r\n $this->model->save();\r\n header('Location: ' . BASE_URI . DIRECTORY_SEPARATOR . 'movie?id=' . $this->params['id']);\r\n exit;\r\n }\r\n\r\n // CASE edit movie page\r\n $this->model->id['col'] = 'id_movie';\r\n $this->model->id['val'] = $_GET['id'];\r\n // get genre and publisher real name\r\n $data = $this->model->read();\r\n\r\n $this->render('edit', [\r\n 'movie' => !empty($data) ? $data[0] : 'No data',\r\n 'genreList' => $genreList,\r\n 'publisherList' => $publisherList\r\n ]);\r\n }", "public function update(Request $request, $id)\n {\n $video = Video::find($id);\n $this->validate($request, [\n 'url' => 'required|string|max:255',\n 'title' => 'required|string|max:255|unique:videos,title,' . $video->id,\n 'description' => 'required|string',\n 'cat_id' =>'required'\n ]);\n //update Video Record\n $this->UpdateRecords($video,$request);\n Alert::success('عظيم','تم تعديل هذا الفيديو بنجاح');\n return redirect('/dashboard/videos');\n }", "public function edit($video_type)\n {\n //\n $tipoVideo = VideoType::findOrFail($video_type);\n \n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = usermoodle::where('id', $user_id)->first();\n\n return view('admin.videotype.edit', compact('tipoVideo', 'usuario'));\n }", "public function edit($id)\n {\n $title = 'Video Management';\n\n $video = Video::where('id_video', $id)->first();\n\n $category = Categories::all();\n\n return view('video::edit')->withVideo($video)->withCategory($category)->withTitle($title);\n }", "public function update($id, VideoRequest $request)\n {\n $video = Video::findOrFail($id);\n if($request->file('video') && $request->file('video')->isValid()){\n @unlink(base_path().'/public/upload/videos/'.$video->video);\n $vidName = 'video'.time().'.'.$request->file('video')->getClientOriginalExtension();\n $video->video = $vidName;\n $request->file('video')->move(base_path().'/public/upload/videos',$vidName);\n }\n $video->title = $request->get('title');\n $video->description = $request->get('description');\n $video->save();\n Session::flash('flash_message','Video Updated!');\n return redirect('admin/videos');\n \n }", "protected function update()\n {\n if ($this->getDataChanged() || !$this->getCustomSetting(\"duration\")) {\n try {\n $this->setCustomSetting(\"duration\", $this->getDurationFromBackend());\n } catch (\\Exception $e) {\n Logger::err(\"Unable to get duration of video: \" . $this->getId());\n }\n }\n\n $this->clearThumbnails();\n parent::update();\n }", "public function edit($id)\n {\n $video = Video::findOrFail($id);\n return view('admin.video.edit', compact('video'));\n }", "public function update()\n {\n\n $id = null;\n $velo_id = null;\n $description = null;\n $image = null;\n\n if (!empty($_POST['id']) && ctype_digit($_POST['id'])) {\n $id = $_POST['id'];\n }\n if (!empty($_POST['velo_id']) && ctype_digit($_POST['velo_id'])) {\n $velo_id = $_POST['velo_id'];\n }\n if (!empty($_POST['image']) && $_POST['image'] != \"\") {\n $image = htmlspecialchars($_POST['image']);\n }\n\n if (!empty($_POST['description'])) {\n $description = htmlspecialchars($_POST['description']);\n }\n if (!$id || !$image || !$description) {\n die(\"formulaire mal rempli $id, $image, $description\");\n }\n\n $voyage_to_edit = $this->model->find($id, $this->modelName);\n\n if (!$voyage_to_edit) {\n die(\"Does Not Exist\");\n }\n\n $this->model->edit($id, $description, $image);\n\n \\Http::redirect(\"index.php?controller=velo&task=show&id=$velo_id\");\n }", "public function video(){\n\t\t$data=array();\n\t\t$this->load->view('administrador/admin_video',$data);\n\t}", "public function proses_edit_video(){\n \n $this->load->library('upload');// library dapat di load di fungsi , di autoload atau di construc nya tinggal pilih salah satunya\n $date \t\t\t= date('Y-m-d H:i:s');\n $nmfile = \"file_\".time(); //nama file saya beri nama langsung dan diikuti fungsi time\n $path = './assets/uploads/'; //path folder\n $path2 = './assets/hasil_resize/';\n $config['upload_path'] = $path; //variabel path untuk config upload\n $config['allowed_types'] = 'gif|jpg|png|jpeg|bmp'; //type yang dapat diakses bisa anda sesuaikan\n $config['max_size'] = '2048'; //maksimum besar file 2M\n $config['file_name'] = $nmfile; //nama yang terupload nantinya\n \n $this->upload->initialize($config);\n \n $idgbr = $this->input->post('kode'); /* variabel id gambar */\n $filelama = $this->input->post('filelama'); /* variabel file gambar lama */\n \n if($_FILES['filefoto']['name'])\n {\n if ($this->upload->do_upload('filefoto'))\n {\n $gbr = $this->upload->data();\n $data = array(\n 'image' =>$gbr['file_name'],\n 'judul' =>$this->input->post('judul'),\n 'link_video' =>$this->input->post('link_video'),\n 'status' =>$this->input->post('status'),\n 'kategori' =>$this->input->post('kategori'),\n 'datetime'=>$date\n \n );\n \n @unlink($path.$filelama);//menghapus gambar lama, variabel dibawa dari form\n @unlink($path2.$filelama);//menghapus gambar lama, variabel dibawa dari form\n \n $where =array('id_video'=>$idgbr); //array where query sebagai identitas pada saat query dijalankan\n $this->Video_model->get_update($data,$where); //akses model untuk menyimpan ke database\n //$this->helper_log(\"edit\", \"Mengedit data video\");\n \n $this->session->set_flashdata('pesan', '<div role=\"alert\" class=\"alert alert-success alert-dismissible\">\n <button type=\"button\" data-dismiss=\"alert\" aria-label=\"Close\" class=\"close\"><span aria-hidden=\"true\" class=\"mdi mdi-close\"></span></button><span class=\"icon mdi mdi-check\"></span><strong>Bagus!</strong> Anda Berhasil Mengedit Data Video </div>'); //pesan yang muncul jika berhasil diupload pada session flashdata\n redirect('Superadmin/read_video'); //jika berhasil maka akan ditampilkan view vupload\n \n }else{ /* jika upload gambar gagal maka akan menjalankan skrip ini */\n $er_upload=$this->upload->display_errors(); /* untuk melihat error uploadnya apa */\n //pesan yang muncul jika terdapat error dimasukkan pada session flashdata\n $this->session->set_flashdata('pesan','<div role=\"alert\" class=\"alert alert-danger alert-dismissible\">\n <button type=\"button\" data-dismiss=\"alert\" aria-label=\"Close\" class=\"close\"><span aria-hidden=\"true\" class=\"mdi mdi-close\"></span></button><span class=\"icon mdi mdi-check\"></span><strong>Oops!</strong> Anda Gagal Mengedit Data Video </div>');\n redirect('Superadmin/read_video'); //jika gagal maka akan ditampilkan form upload\n }\n }else{ /* jika file foto tidak ada maka query yg dijalankan adalah skrip ini */\n \n $data = array(\n 'judul' =>$this->input->post('judul'),\n 'link_video' =>$this->input->post('link_video'),\n 'status' =>$this->input->post('status'),\n 'kategori' =>$this->input->post('kategori'),\n 'datetime'=>$date\n );\n \n $where =array('id_video'=>$idgbr); //array where query sebagai identitas pada saat query dijalankan\n $this->Video_model->get_update($data,$where); //akses model untuk menyimpan ke database\n // $this->helper_log(\"edit\", \"Mengedit data video\");\n \n $this->session->set_flashdata('pesan', '<div role=\"alert\" class=\"alert alert-success alert-dismissible\">\n <button type=\"button\" data-dismiss=\"alert\" aria-label=\"Close\" class=\"close\"><span aria-hidden=\"true\" class=\"mdi mdi-close\"></span></button><span class=\"icon mdi mdi-check\"></span><strong>Bagus!</strong> Anda Berhasil Mengedit Data Video | Gambar tidak ada !!</div>');\n redirect('Superadmin/read_video'); /* jika berhasil maka akan kembali ke home upload */\n }\n }", "public function update(Request $request, $id)\n {\n $video = $this->video->find($id);\n $video->title = $request->title;\n $video->description = $request->description;\n $video->url = $request->url;\n $video->category_id = $request->category;\n $video->save();\n\n return redirect()->back()->with('status', 'Like a real boss, you did it!');\n }", "public function update(Request $request, Videocomment $Videocomment)\n {\n //\n }", "public function updateOffreVideo($offreVid, $data)\n {\n\n $offreVid->setNom($data['nom']);\n $offreVid->setDescription($data['description']);\n $offreVid->setPrix($data['prix']);\n\n\n $offreVid->setDuree($data['duree']);\n $offreVid->setDevise($data['devise']);\n $offreVid->setNbreVideos($data['nbreVideos']);\n $offreVid->setImage($data['image']);\n $offreVid->setEtat($data['etat']);\n $offreVid->setRemise($data['remise']);\n\n $offreVid = self::$documentManager->merge($offreVid);\n self::$documentManager->flush();\n return $offreVid;\n }", "public function edit($id)\n {\n $video = Video::find($id);\n\n return view('Admin.Videos.edit')\n ->with('video',$video);\n }", "public function editAction() {\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n //GET SITEREVIEW SUBJECT\n $this->view->sitereview = $sitereview = Engine_Api::_()->core()->getSubject();\n\n $this->view->listingtype_id = $listingtype_id = $this->_listingType->listingtype_id;\n\n $this->view->slideShowEnanle = $this->slideShowEnable($listingtype_id);\n\n $this->view->listing_singular_uc = ucfirst($this->_listingType->title_singular);\n $this->view->listing_singular_lc = strtolower($this->_listingType->title_singular);\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, $viewer, \"edit_listtype_$listingtype_id\")->isValid()) {\n return;\n }\n\n $this->view->content_id = Engine_Api::_()->sitereview()->getTabId($listingtype_id, 'sitereview.video-sitereview');\n\n //SELECTED TAB\n $this->view->TabActive = \"video\";\n\n if (!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_videoedit_edit_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n }\n\n //GET VIDEOS\n $this->view->type_video = $type_video = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereview.show.video');\n\n if ($type_video && isset($sitereview->main_video['corevideo_id'])) {\n $this->view->main_video_id = $sitereview->main_video['corevideo_id'];\n } elseif (isset($sitereview->main_video['reviewvideo_id'])) {\n $this->view->main_video_id = $sitereview->main_video['reviewvideo_id'];\n }\n\n $this->view->videos = $videos = array();\n $this->view->integratedWithVideo = false;\n $sitevideoEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitevideo');\n if ($sitevideoEnabled && (Engine_Api::_()->getDbtable('modules', 'sitevideo')->getIntegratedModules(array('enabled' => 1, 'item_type' => \"sitereview_listing_$sitereview->listingtype_id\", 'item_module' => 'sitereview')))) {\n $params = array();\n $params['parent_type'] = $sitereview->getType() . '_' . $sitereview->listingtype_id;\n $params['parent_id'] = $sitereview->listing_id;\n $this->view->videos = $videos = Engine_Api::_()->getDbTable('videos', 'sitevideo')->getVideoPaginator($params);\n $this->view->integratedWithVideo = true;\n } else {\n if (Engine_Api::_()->sitereview()->enableVideoPlugin() && !empty($type_video)) {\n $this->view->videos = $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 1);\n } elseif (empty($type_video)) {\n $this->view->videos = $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 0);\n }\n }\n\n $allowed_upload_video = Engine_Api::_()->sitereview()->allowVideo($sitereview, $viewer, count($videos), $uploadVideo = 1);\n $this->view->upload_video = 1;\n if (Engine_Api::_()->sitereview()->hasPackageEnable()) {\n $this->view->upload_video = $allowed_upload_video;\n } else {\n if (empty($allowed_upload_video)) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n }\n\n $this->view->count = count($videos);\n\n //MAKE FORM\n $this->view->form = $form = new Sitereview_Form_Video_Editvideo();\n\n foreach ($videos as $video) {\n\n $subform = new Sitereview_Form_Video_Edit(array('elementsBelongTo' => $video->getGuid()));\n\n if ($video->status != 1) {\n if ($video->status == 0 || $video->status == 2):\n $msg = $this->view->translate(\"Your video is currently being processed - you will be notified when it is ready to be viewed.\");\n elseif ($video->status == 3):\n $msg = $this->view->translate(\"Video conversion failed. Please try again.\");\n elseif ($video->status == 4):\n $msg = $this->view->translate(\"Video conversion failed. Video format is not supported by FFMPEG. Please try again.\");\n elseif ($video->status == 5):\n $msg = $this->view->translate(\"Video conversion failed. Audio files are not supported. Please try again.\");\n elseif ($video->status == 7):\n $msg = $this->view->translate(\"Video conversion failed. You may be over the site upload limit. Try a smaller file, or delete some files to free up space.\");\n endif;\n\n $subform->addElement('dummy', 'mssg' . $video->video_id, array(\n 'description' => $msg,\n 'decorators' => array(\n 'ViewHelper',\n array('HtmlTag', array('tag' => 'div', 'class' => 'tip')),\n array('Description', array('tag' => 'span', 'placement' => 'APPEND')),\n array('Description', array('placement' => 'APPEND')),\n ),\n ));\n $t = 'mssg' . $video->video_id;\n $subform->$t->getDecorator(\"Description\")->setOption(\"placement\", \"append\");\n }\n $subform->populate($video->toArray());\n $form->addSubForm($subform, $video->getGuid());\n }\n\n //CHECK METHOD\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //GET FORM VALUES\n $values = $form->getValues();\n\n if (isset($_POST['corevideo_cover']) && !empty($_POST['corevideo_cover'])) {\n if (isset($sitereview->main_video) && !empty($sitereview->main_video)) {\n $sitereview->main_video = array_merge((array) $sitereview->main_video, array('corevideo_id' => $_POST['corevideo_cover']));\n } else {\n $sitereview->main_video = array('corevideo_id' => $_POST['corevideo_cover']);\n }\n } elseif (isset($_POST['reviewvideo_cover']) && $_POST['reviewvideo_cover']) {\n if (isset($sitereview->main_video) && !empty($sitereview->main_video)) {\n $sitereview->main_video = array_merge((array) $sitereview->main_video, array('reviewvideo_id' => $_POST['reviewvideo_cover']));\n } else {\n $sitereview->main_video = array('reviewvideo_id' => $_POST['reviewvideo_cover']);\n }\n }\n\n $sitereview->save();\n\n //VIDEO SUBFORM PROCESS IN EDITING\n foreach ($videos as $video) {\n $subform = $form->getSubForm($video->getGuid());\n\n $values = $subform->getValues();\n $values = $values[$video->getGuid()];\n if (isset($values['delete']) && $values['delete'] == '1') {\n Engine_Api::_()->getDbtable('videos', 'sitereview')->delete(array('video_id = ?' => $video->video_id, 'listing_id = ?' => $sitereview->listing_id));\n Engine_Api::_()->getDbtable('actions', 'activity')->delete(array('type = ?' => 'video_sitereview_listtype_' . $listingtype_id, 'object_id = ?' => $sitereview->listing_id));\n } else {\n $video->setFromArray($values);\n $video->save();\n }\n }\n\n return $this->_helper->redirector->gotoRoute(array('action' => 'edit', 'listing_id' => $sitereview->listing_id), \"sitereview_videospecific_listtype_$listingtype_id\", true);\n }", "public function edit($id)\n {\n $sl = Video::find($id);\n return view('admin.video.edit', compact('sl'));\n }", "public function save_video( $post_id ) {\n if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {\n /*\n If autosaving, do nothing\n */\n return;\n }\n if( !isset( $_POST['videoid'] ) || !isset ( $_POST['provider']) || !wp_verify_nonce( $_REQUEST['video_meta_box'], 'video_meta_save' ) ) {\n /*\n If the video ID and provider isn't selected, or the wp_kses is faked, get out\n */\n return;\n }\n if( !current_user_can( 'edit_post' ) ) {\n /*\n If you can't edit a post, get the hell out\n */\n return;\n }\n\n /*\n Update video ID\n */\n $videoid = wp_kses( $_POST['videoid'], '');\n update_post_meta( $post_id, 'videoid', $videoid, '' );\n\n /*\n Update video provider\n */\n $provider = wp_kses ($_POST['provider'], '');\n update_post_meta( $post_id, 'provider', $provider, '');\n\n /*\n Season and Episode database insertion\n */\n $season = wp_kses($_POST['season'], '');\n update_post_meta($post_id, 'season', $season, '');\n\n $episode = wp_kses($_POST['episode'], '');\n update_post_meta($post_id, 'episode', $episode, '');\n /*\n Define Video type name to be inserted into database\n */\n $video_category = wp_kses($_POST['video_category'], '');\n $term = get_term_by('name', $video_category, 'video_category');\n\n if( !empty($term) && !is_wp_error( $term ) ) {\n wp_set_object_terms( $post_id, $term->term_id, 'video_category', false);\n }\n\n /*\n If there is no Featured Image, grab it from youtube\n */\n if( !has_post_thumbnail($post_id)) {\n if($provider == 'youtube') {\n $this->Generate_Featured_Image( $this->fetch_youtube_thumbnail($videoid), $post_id );\n }\n if($provider == 'vimeo') {\n $this->Generate_Featured_Image( $this->fetch_vimeo_thumbnail($videoid), $post_id );\n }\n }\n }", "public function actionUpdate($id)\n {\n\n $query = AplikasiItday::find()\n ->andWhere(['id' => $id])\n ->one();\n\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n $file = $model->getPosterName();\n $dir = $model->folder;\n\n $img = UploadedFile::getInstance($model, 'poster');\n\n if (!empty($query->poster)) {\n $model->poster = $query->poster;\n }\n \n if(is_object($img))\n { \n $file = $query->folder.'/'.$query->poster;\n if(!empty($query->poster)){\n chown($file,0777);\n unlink($file);\n }\n $model->poster = Yii::$app->formatter->asTimestamp(date('Y-d-m h:i:s'));//Formats a date, time or datetime in a float number as UNIX timestamp (seconds since 01-01-1970).\n \n $model->poster .='.'.$img->extension;\n\n $path = $dir.\"/\".$model->poster; //represent file paths or URLs // @app: Your application root directory\n $img->saveAs($path, false);\n }\n\n $video = UploadedFile::getInstance($model, 'video');\n if (!empty($query->video)) {\n $model->video = $query->video;\n }\n if(is_object($video))\n {\n $file = $query->folder.'/'.$query->video;\n if(!empty($query->video)){\n chmod($file,0777);\n unlink($file);\n }\n\n $model->video .= Yii::$app->formatter->asTimestamp(date('Y-d-m h:i:s'));\n $model->video .='.'.$video->extension;\n\n $path = $dir.\"/\".$model->video;\n $video->saveAs($path, false);\n } \n\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }", "public function update(Request $request, $id)\n {\n $video = Video::findOrFail($id);\n\n $data = request()->validate([\n 'title' => 'required|string',\n 'body' => 'required|string',\n 'url' => 'required|url',\n 'status' => 'required|string',\n\n ]);\n try {\n $video->update($data);\n return redirect()->route('videos.index')->with('status', 'Video post updated successfully');\n } catch (\\Exception $e) {\n return redirect()->route('videos.edit')->with('error', $e->getMessage());\n }\n\n }", "public function edit($id)\n {\n $video = Video::findOrFail($id);\n return view('admin.videos.edit', compact('video'));\n }", "public function update(UpdateCoursesRequest $request, $id)\n {\n if (!Gate::allows('course_edit')) {\n return abort(401);\n }\n $course = Course::findOrFail($id);\n\n $slug = str_slug($request->title);\n\n $slug_exits = Course::where('slug', '=', $slug)->where('id', '!=', $course->id)->first();\n if ($slug_exits) {\n return back()->withFlashDanger(__('alerts.backend.general.slug_exist'));\n }\n $request = $this->saveFiles($request);\n //Saving videos\n if ($request->media_type != \"\" || $request->media_type != null) {\n // if ($course->mediavideo) {\n // $course->mediavideo->delete();\n // }\n $model_type = Course::class;\n $model_id = $course->id;\n $size = 0;\n $media = '';\n $url = 'default';\n $video_id = '';\n $name = $course->title . ' - video';\n $media = $course->mediavideo;\n if ($media == \"\") {\n $media = new Media();\n }\n if ($request->media_type != 'upload') {\n if (($request->media_type == 'youtube') || ($request->media_type == 'vimeo')) {\n $video = $request->video;\n $url = $video;\n $video_id = array_last(explode('/', $request->video));\n $size = 0;\n\n } else if ($request->media_type == 'embed') {\n $url = $request->video;\n }\n $media->model_type = $model_type;\n $media->model_id = $model_id;\n $media->name = $name;\n $media->url = $url;\n $media->type = $request->media_type;\n $media->file_name = $video_id;\n $media->user_id = auth()->user()->id;\n $media->size = 0;\n $media->save();\n }\n\n if ($request->media_type == 'upload') {\n if ($request->video_file) {\n $oldMedia = Media::where('model_id', $id)->where('model_type', $model_type)->first();\n if ($oldMedia) {\n if ($oldMedia->type == 'upload') {\n $oldMedia->model_type = '';\n $oldMedia->model_id = null;\n $oldMedia->name = 'Unselected - video';\n $oldMedia->save();\n } else {\n $oldMedia->delete();\n }\n }\n $media = Media::where('id', $request->video_file)->first();\n $media->model_type = $model_type;\n $media->model_id = $model_id;\n $media->name = $name;\n $media->save();\n } else {\n redirect()->back()->withFlashDanger('Please select a video from the list');\n }\n\n }\n }\n\n\n \n foreach ($request->eduStatge as $i => $statge) {\n foreach($request->semesters as $j => $semester) {\n $ids[] = EduStageSemester::where('edu_stage_id',$request->eduStatge [$i])->where('semester_id',$request->semesters [$j])->pluck('id');\n }\n\n }\n $statgeSemestersIDS = Arr::collapse($ids);\n\n $oldCourses = CourseEduStatgeSem::where('course_id',$course->id)->delete();\n\n\n foreach($statgeSemestersIDS as $i=>$semID){\n\n $courseSemester = new CourseEduStatgeSem();\n $courseSemester->course_id = $course->id;\n $courseSemester->edu_statge_sem_id = $statgeSemestersIDS[$i];\n $courseSemester->save();\n }\n \n\n\n if ($request->offlineData) {\n $seats = 0;\n foreach (json_decode($request->offlineData, true) as $key => $item) {\n foreach ($item as $SingleDatekey => $value) {\n if (substr($SingleDatekey, 0, 4) == 'seat') {\n $seats += $value;\n }\n }\n }\n $course->seats = $seats ? $seats : $course->seats;\n }\n $course->update($request->except(['offlineData', 'duration', 'learned', 'learned_ar', 'opt_courses', 'mand_courses', 'seats']));\n if ($request->offlineData) {\n $course->date = $request->offlineData ? json_encode($request->offlineData) : Null;\n }\n if ($request->opt_courses && count($request->opt_courses) > 0) {\n $course->optional_courses = $request->opt_courses ? json_encode($request->opt_courses) : json_encode([]);\n }\n if ($request->mand_courses && count($request->mand_courses) > 0) {\n $course->mandatory_courses = $request->mand_courses ? json_encode($request->mand_courses) : json_encode([]);\n }\n if ($request->learn_ar && count($request->learn_ar) > 0) {\n $course->learned_ar = $request->learn_ar ? json_encode($request->learn_ar) : json_encode([]);\n }\n if ($request->learn && count($request->learn) > 0) {\n $course->learned = $request->learn ? json_encode($request->learn) : json_encode([]);\n }\n if (($request->slug == \"\") || $request->slug == null) {\n $course->slug = str_slug($request->title);\n }\n if ((int)$request->price == 0) {\n $course->price = NULL;\n $course->free = 1;\n }\n $course->save();\n $teachers = (auth()->user()->isAdmin() || auth()->user()->hasRole('academy')) ? array_filter((array)$request->input('teachers')) : [auth()->user()->id];\n $course->teachers()->sync($teachers);\n\n return redirect()->route('admin.courses.index')->withFlashSuccess(trans('alerts.backend.general.updated'));\n }", "public function update(Request $request, $id)\n {\n $post = Post::find($id);\n\n $post->text= $request->text;\n $post->user_id = Auth::user()->id;\n if($request->hasFile('image'))\n {\n $image = $request->file('image');\n $filename = time() . '.' . $image->getClientOriginalExtension();\n $location = public_path('media/' . $filename);\n $uploaded = Storage::disk('local')->put($location, file_get_contents($image->getRealPath()));\n\n\n $post->image = $filename;\n };\n\n if($request->hasFile('video'))\n {\n $video = $request->file('video');\n $filename = time() . '.' . $video->getClientOriginalExtension();\n $location = public_path('media/' . $filename);\n $uploaded = Storage::disk('local')->put($location, file_get_contents($image->getRealPath()));\n\n\n $post->video = $filename;\n };\n\n $post->save();\n echo \"saved\";\n }", "public function edit($id)\n {\n $video = Video::findOrFail($id);\n return view('admin.videos.edit', compact('video'));\n }", "public function edit(Request $request, $video_id)\n {\n $categories = VideoRecordsCategory::getAllList();\n $videoRecord = VideoRecords::where('id', $video_id)->get();\n foreach ($videoRecord as $videoRecord);\n $photos = VideoRecordImages::where('video_record_id', $video_id)->get();\n return $this->view('video_records.create_edit', compact('categories'))\n ->with('photoable', $videoRecord)\n ->with('folder_date', $videoRecord->created_at->format('dmY'))\n ->with('photos', $photos)\n ->with('item', $videoRecord);\n }", "public function update(StoreHomepageVideoRequest $request, $id)\n {\n if ($this->homepageVideo->update(['data' => $request->only('id', 'url')])) {\n return redirect()->route('admin.access.homepagevideo.index')->withFlashSuccess('Video updated successfully!');\n\n } else {\n return redirect()->route('admin.access.homepagevideo.edit',['id' => $request->input('id')])->withFlashDanger('Video Not found with this URL');\n\n }\n\n }", "public function edit($id)\n\t{\n return View::make('videos.edit');\n\t}", "public function update(Request $request, Video $video)\n {\n //\n $request->validate([\n 'input_videoName',\n 'input_category',\n 'input_videoDescription',\n 'input_videoFile',\n 'input_videoThumbnail',\n ]);\n\n $input = $request->all();\n\n $video = Video::find($video['videoID']);\n\n $video->videoName = $input['input_videoName'];\n $video->videoDescription = $input['input_videoDescription'];\n $video->categoryID = $input['input_category'];\n\n if ($thumbNail_file = $request->file('input_videoThumbnail')) {\n $destinationPath = 'image/';\n if ($video->image != \"defaultCategory.png\") {\n File::delete($destinationPath . $video->image);\n }\n $thumbNail = date('YmdHis') . \".\" . $thumbNail_file->getClientOriginalExtension();\n $thumbNail_file->move($destinationPath, $thumbNail);\n $video->image = \"$thumbNail\";\n }\n\n if ($file = $request->file('input_videoFile')) {\n $destinationPath = 'videos/';\n File::delete($destinationPath . $video->videoFile);\n $videoFile = date('YmdHis') . \".\" . $file->getClientOriginalExtension();\n $file->move($destinationPath, $videoFile);\n $video->videoFile = \"$videoFile\";\n }\n\n $video->save();\n\n if ($request->hasFile('input_files')) {\n $files = $request->file('input_files');\n foreach ($files as $file) {\n $name = time() . rand(1, 100) . \".\" . $file->getClientOriginalExtension();\n $file->move(public_path('files'), $name);\n\n Files::create([\n 'fileName' => pathinfo($file->getClientOriginalName())['filename'],\n 'file' => $name,\n 'videoID' => $video->videoID\n ]);\n }\n }\n }", "public function movieEditActionPost()\n {\n $this->app->db->connect();\n\n $movieId = $this->app->request->getPost(\"movieId\");\n $movieTitle = $this->app->request->getPost(\"movieTitle\");\n $movieYear = $this->app->request->getPost(\"movieYear\");\n $movieImage = $this->app->request->getPost(\"movieImage\");\n\n if ($this->app->request->getPost(\"doSave\")) {\n $sql = \"UPDATE movie SET title = ?, year = ?, image = ? WHERE id = ?;\";\n $this->app->db->execute($sql, [$movieTitle, $movieYear, $movieImage, $movieId]);\n $this->app->session->destroy();\n return $this->app->response->redirect(\"movie/movie-select?showAll=true\");\n }\n if ($this->app->request->getPost(\"reset\")) {\n return $this->app->response->redirect(\"movie/movie-edit\");\n }\n }", "public function update(Request $request, $id)\n {\n if ($id==\"header\") {\n $validatedData = $request->validate([\n 'file' => 'image|max:1000',\n ]);\n\n $option=Option::where('key','header')->first();\n $info=json_decode($option->value ?? '');\n if (empty($option)) {\n $option=new Option;\n $option->key=\"header\";\n }\n if(!empty($request->ytb_video)){\n $ytb_url=$this->parse_yotube_url($request->ytb_video);\n }\n else{\n $ytb_url=null;\n }\n ///\n if(isset($request->title_ar) || isset($request->title_en)){\n $title = json_encode([\n 'ar' => $request->title_ar,\n 'en' => $request->title_en,\n ]);\n }\n if(isset($request->highlight_title_ar) || isset($request->highlight_title_en)){\n $highlight_title = json_encode([\n 'ar' => $request->highlight_title_ar,\n 'en' => $request->highlight_title_en,\n ]);\n }\n if(isset($request->description_ar) || isset($request->description_en)){\n $description = json_encode([\n 'ar' => $request->description_ar,\n 'en' => $request->description_en,\n ]);\n }\n ///\n\n $data['title']=$title;\n $data['highlight_title']=$highlight_title;\n $data['ytb_video']=$ytb_url;\n $data['description']=$description;\n if ($request->file) {\n if (!empty($info->preview)) {\n if (file_exists($info->preview)) {\n unlink($info->preview);\n }\n }\n $fileName = time().'.'.$request->file->extension();\n $request->file->move('uploads/1/'.date('Y/m/'), $fileName);\n $fileName='uploads/1/'.date('Y/m/').$fileName;\n\n }\n else{\n $fileName =$info->preview ?? null;\n }\n\n $data['preview']=$fileName;\n $option->value=json_encode($data);\n $option->save();\n\n// return response()->json(['Update Success']);\n return response()->json([trans('success')]);\n }\n\n if ($id==\"counter_area\") {\n\n\n $option=Option::where('key','counter_area')->first();\n if (empty($option)) {\n $option=new Option;\n $option->key='counter_area';\n }\n\n $data['happy_customer']=$request->happy_customer;\n $data['total_reviews']=$request->total_reviews;\n $data['total_domain']=$request->total_domain;\n $data['community_member']=$request->community_member;\n\n $option->value=json_encode($data);\n $option->save();\n\n// return response()->json(['Update Success']);\n return response()->json([trans('success')]);\n }\n\n\n\n\n if ($id==\"ecom_features\") {\n $validatedData = $request->validate([\n 'top_image' => 'image|max:1000',\n 'center_image' => 'image|max:1000',\n 'bottom_image' => 'image|max:1000',\n ]);\n $option=Option::where('key',$id)->first();\n $info=json_decode($option->value ?? '');\n if (empty($option)) {\n $option=new Option;\n $option->key=$id;\n }\n\n if ($request->top_image) {\n if (!empty($info->top_image)) {\n if (file_exists($info->top_image)) {\n unlink($info->top_image);\n }\n }\n $fileName = time().'.'.$request->top_image->extension();\n $request->top_image->move('uploads/1/'.date('Y/m/'), $fileName);\n $top_image='uploads/1/'.date('Y/m/').$fileName;\n\n }\n else{\n $top_image =$info->top_image ?? null;\n }\n\n if ($request->center_image) {\n if (!empty($info->center_image)) {\n if (file_exists($info->center_image)) {\n unlink($info->center_image);\n }\n }\n $fileName = time().'.'.$request->center_image->extension();\n $request->center_image->move('uploads/1/'.date('Y/m/'), $fileName);\n $center_image='uploads/1/'.date('Y/m/').$fileName;\n\n }\n else{\n $center_image =$info->center_image ?? null;\n }\n\n if ($request->bottom_image) {\n if (!empty($info->bottom_image)) {\n if (file_exists($info->bottom_image)) {\n unlink($info->bottom_image);\n }\n }\n $fileName = time().'.'.$request->bottom_image->extension();\n $request->bottom_image->move('uploads/1/'.date('Y/m/'), $fileName);\n $bottom_image='uploads/1/'.date('Y/m/').$fileName;\n\n }\n else{\n $bottom_image =$info->bottom_image ?? null;\n }\n if(isset($request->area_title_ar) || isset($request->area_title_en)){\n $area_title = json_encode([\n 'ar' => $request->area_title_ar,\n 'en' => $request->area_title_en,\n ]);\n }\n if(isset($request->description_ar) || isset($request->description_en)){\n $description = json_encode([\n 'ar' => $request->description_ar,\n 'en' => $request->description_en,\n ]);\n }\n if(isset($request->btn_text_ar) || isset($request->btn_text_en)){\n $btn_text = json_encode([\n 'ar' => $request->btn_text_ar,\n 'en' => $request->btn_text_en,\n ]);\n }\n\n $data['top_image']=$top_image;\n $data['center_image']=$center_image;\n $data['bottom_image']=$bottom_image;\n $data['area_title']=$area_title;\n $data['description']=$description;\n $data['btn_link']=$request->btn_link;\n $data['btn_text']=$btn_text;\n $option->value=json_encode($data);\n $option->save();\n\n// return response()->json('Option Updated Successfully...!!');\n return response()->json([trans('success')]);\n\n\n }\n if ($id==\"about_1\") {\n $validatedData = $request->validate([\n 'file' => 'image|max:1000',\n ]);\n\n $option=Option::where('key',$id)->first();\n $info=json_decode($option->value ?? '');\n if (empty($option)) {\n $option=new Option;\n $option->key=$id;\n }\n if(isset($request->title_ar) || isset($request->title_en)){\n $title = json_encode([\n 'ar' => $request->title_ar,\n 'en' => $request->title_en,\n ]);\n }\n if(isset($request->description_ar) || isset($request->description_en)){\n $description = json_encode([\n 'ar' => $request->description_ar,\n 'en' => $request->description_en,\n ]);\n }\n if(isset($request->btn_text_ar) || isset($request->btn_text_en)){\n $btn_text = json_encode([\n 'ar' => $request->btn_text_ar,\n 'en' => $request->btn_text_en,\n ]);\n }\n $about_1['title']=$title ?? '';\n $about_1['description']=$description ?? '';\n $about_1['btn_link']=$request->btn_link ?? '';\n $about_1['btn_text']=$btn_text ?? '';\n $fileName =$request->icon_name ?? null;\n\n $about_1['preview']=$fileName;\n $option->value=json_encode($about_1);\n $option->save();\n\n// return response()->json('Section Updated');\n return response()->json([trans('success')]);\n }\n\n if ($id==\"about_2\") {\n\n $validatedData = $request->validate([\n 'file' => 'image|max:1000',\n ]);\n\n $option=Option::where('key',$id)->first();\n $info=json_decode($option->value ?? '');\n if (empty($option)) {\n $option=new Option;\n $option->key=$id;\n }\n if(isset($request->title_ar) || isset($request->title_en)){\n $title = json_encode([\n 'ar' => $request->title_ar,\n 'en' => $request->title_en,\n ]);\n }\n if(isset($request->description_ar) || isset($request->description_en)){\n $description = json_encode([\n 'ar' => $request->description_ar,\n 'en' => $request->description_en,\n ]);\n }\n if(isset($request->btn_text_ar) || isset($request->btn_text_en)){\n $btn_text = json_encode([\n 'ar' => $request->btn_text_ar,\n 'en' => $request->btn_text_en,\n ]);\n }\n $about_2['title']=$title ?? '';\n $about_2['description']=$description ?? '';\n $about_2['btn_link']=$request->btn_link ?? '';\n $about_2['btn_text']=$btn_text ?? '';\n $fileName =$request->icon_name ?? null;\n\n $about_2['preview']=$fileName;\n $option->value=json_encode($about_2);\n $option->save();\n\n// return response()->json('Section Updated');\n return response()->json([trans('success')]);\n }\n\n if ($id==\"about_3\") {\n $validatedData = $request->validate([\n 'file' => 'image|max:1000',\n ]);\n\n $option=Option::where('key',$id)->first();\n $info=json_decode($option->value ?? '');\n if (empty($option)) {\n $option=new Option;\n $option->key=$id;\n }\n if(isset($request->title_ar) || isset($request->title_en)){\n $title = json_encode([\n 'ar' => $request->title_ar,\n 'en' => $request->title_en,\n ]);\n }\n if(isset($request->description_ar) || isset($request->description_en)){\n $description = json_encode([\n 'ar' => $request->description_ar,\n 'en' => $request->description_en,\n ]);\n }\n if(isset($request->btn_text_ar) || isset($request->btn_text_en)){\n $btn_text = json_encode([\n 'ar' => $request->btn_text_ar,\n 'en' => $request->btn_text_en,\n ]);\n }\n $data['title']=$title ?? '';\n $data['description']=$description ?? '';\n $data['btn_link']=$request->btn_link ?? '';\n $data['btn_text']=$btn_text ?? '';\n $fileName =$request->icon_name ?? null;\n\n $data['preview']=$fileName;\n $option->value=json_encode($data);\n $option->save();\n\n// return response()->json('Section Updated');\n return response()->json([trans('success')]);\n }\n\n\n\n if ($id==\"contact\") {\n $validatedData = $request->validate([\n 'file' => 'image|max:1000',\n ]);\n $fileName = 'contact.png';\n $request->file->move('uploads/', $fileName);\n// return response()->json(['Image Changed']);\n return response()->json([trans('success')]);\n\n }\n }", "public function update($id, VideoRequest $request)\n {\n $video = Video::findOrFail($id);\n $data = $request->all();\n if ($request->file('image') && $request->file('image')->isValid()) {\n $data['image'] = $this->saveImage($request);\n }\n $video->update($data);\n \n flash('Edit video success!', 'success');\n return redirect('admin/videos');\n }", "public function updateAction(Tx_Youtubeapi_Domain_Model_Video $video) {\n\t\t$this->videoRepository->update($video);\n\t\t$this->flashMessageContainer->add('Your Video was updated.');\n\t\t$this->redirect('index');\n\t}", "public function process() {\n // Add oembed streams to video file types.\n $video = file_type_load('video');\n $video->mimetypes[] = 'video/oembed';\n $video->streams[] = 'oembed';\n file_type_save($video);\n\n // Oembed specific display settings for videos.\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '560',\n 'height' => '340',\n 'wmode' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '180',\n 'height' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__preview__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__teaser__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n }", "public function update(Request $request, $id)\n {\n $Video = Video::findOrFail($id);\n $Video->name = $request->name;\n $Video-> link = $request->link;\n $Video->stand_id = $request->stand_id;\n\n $Video->save();\n\n return $Video;\n }", "function media_upload_video()\n {\n }", "public function edit($id)\n\t{\n\t\tBreadcrumbs::addCrumb('Manage Teams and Videos', 'teacher');\n\t\tBreadcrumbs::addCrumb('Edit Video', $id);\n\t\tView::share('title', 'Edit Video');\n\t\t$video = Video::with('students')->find($id);\n\n\t\t// Get the most recent competition year with video divisisons\n\t $comp_year = CompYear::orderBy('year', 'desc')\n\t ->with([ 'vid_divisions' => function($q) {\n\t\t\t\t\t\t\t\t\t\treturn $q->orderby('display_order');\n\t\t\t\t\t\t\t\t\t}])\n\t\t\t\t\t\t\t->first();\n\n $division_list = [ 0 => \"- Select Division -\" ] + $comp_year->vid_divisions->lists('name', 'id');\n\n\t\t// Student Setup\n\t\t$ethnicity_list = [ 0 => \"- Select Ethnicity -\" ] + Ethnicity::all()->lists('name','id');\n\t\tif(!Session::has('students')) {\n\t\t\t// On first load we populate the form from the DB\n\t\t\t$students = $video->students;\n\t\t} else {\n\t\t\t// On subsequent loads or errors, use the sessions variable\n\t\t\t$students = [];\n\t\t}\n\t\t$index = -1;\n\n\n\t\tif (is_null($video))\n\t\t{\n\t\t\treturn Redirect::route('teacher.index');\n\t\t}\n\n\t\t$divisions = Division::longname_array();\n\n\t\treturn View::make('teacher.videos.edit', compact('video','students', 'division_list', 'ethnicity_list', 'index'))\n\t\t\t\t ->with('divisions', $divisions);\n\t}", "public function history_edit_post() { \n \n // Check if data was submitted\n if ($this->CI->input->post()) {\n \n // Add form validation\n $this->CI->form_validation->set_rules('post_id', 'Post ID', 'trim|numeric|required');\n $this->CI->form_validation->set_rules('post', 'Post', 'trim|required');\n $this->CI->form_validation->set_rules('url', 'Url', 'trim');\n $this->CI->form_validation->set_rules('medias', 'Medias', 'trim');\n $this->CI->form_validation->set_rules('post_title', 'Post Title', 'trim');\n $this->CI->form_validation->set_rules('date', 'Date', 'trim');\n $this->CI->form_validation->set_rules('current_date', 'Current Date', 'trim');\n \n // Get data\n $post_id = $this->CI->input->post('post_id');\n $post = str_replace('-', '/', $this->CI->input->post('post'));\n $post = $this->CI->security->xss_clean(base64_decode($post));\n $url = $this->CI->input->post('url');\n $medias = $this->CI->input->post('medias');\n $post_title = $this->CI->input->post('post_title');\n $date = $this->CI->input->post('date');\n $current_date = $this->CI->input->post('current_date');\n $img = array();\n $video = array();\n\n // Verify if medias is not empty\n if ( $medias ) {\n \n foreach ( $medias as $media ) {\n \n if ( $media['type'] === 'image' ) {\n \n $img[] = $media['id'];\n \n } else {\n \n $video[] = $media['id']; \n \n }\n \n }\n \n }\n \n // Serialize media\n $img = serialize($img);\n $video = serialize($video);\n \n if ( $this->CI->form_validation->run() === false ) {\n \n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('your_post_too_short_or_post_id_missing')\n );\n\n echo json_encode($data);\n exit();\n \n } else {\n\n // Get post data by user id and post id\n $get_post = $this->CI->posts_model->get_post($this->CI->user_id, $post_id);\n\n // Publish time\n $publish_time = 0;\n\n // Verify if user is the post's owner\n if ( $get_post ) {\n\n // Verify if the post is scheduled\n if ( $get_post['status'] > 1 ) {\n\n $date = (is_numeric(strtotime($date))) ? strtotime($date) : time();\n \n $current_date = (is_numeric(strtotime($current_date))) ? strtotime($current_date) : time();\n \n // If date is null or has invalid format will be converted to current time or null with strtotime\n if ( $date > $current_date ) {\n \n $d = $date - $current_date;\n \n $date = time() + $d;\n \n } else {\n \n $date = time();\n \n }\n\n $publish_time = $date;\n\n }\n\n // Try to update the post\n if ( $this->CI->posts_model->update_post($post_id, $this->CI->user_id, $post, $url, $img, $video, $post_title, $publish_time) ) {\n\n $data = array(\n 'success' => TRUE,\n 'message' => $this->CI->lang->line('posts_post_was_updated'),\n 'post_id' => $post_id\n );\n \n echo json_encode($data);\n\n } else {\n\n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('posts_post_not_updated')\n );\n \n echo json_encode($data);\n\n }\n\n } else {\n\n $data = array(\n 'success' => FALSE,\n 'message' => $this->CI->lang->line('posts_the_post_is_not_yours')\n );\n\n echo json_encode($data);\n\n }\n \n }\n \n }\n \n }", "function updateFilm($id,$title,$poster,$actors,$plot,$files,$device,$idCategory){\n global $pdo;\n $request = $pdo->prepare('UPDATE `movie` SET \n `mov_title` = :title,\n `mov_poster` = :poster,\n `mov_actors`= :actors,\n `mov_plot`=:plot,\n `mov_file_path`=:files,\n `mov_device`=:device,\n `category_cat_id`=:idcategory\n WHERE `movie`.`mov_id` = :id;');\n $request->execute([\n ':title'=> $title, \n ':poster'=>$poster, \n ':actors'=>$actors, \n ':plot'=>$plot, \n ':files'=>$files, \n ':device'=>$device, \n ':idcategory'=>$idCategory,\n ':id'=>$id\n ]);\n}", "public function updateVideoEntry($slug, $entry_id, $videoFileFullPath, $basedir, $videoFile, $thumbnail, $item)\n {\n $cmd = 'cd '.$basedir.' && ffprobe -v quiet -print_format json -show_format -show_streams \"'.$videoFile.'\"';\n $process = Process::fromShellCommandline(\n $cmd\n );\n $process->run();\n $process->wait();\n\n $mytime = Carbon::now();\n $now = Carbon::createFromFormat('Y-m-d H:i:u', Carbon::now())->toDateTimeString();\n $nextWeek = Carbon::createFromFormat('Y-m-d H:i:u', $mytime)->addWeeks(1)->toDateTimeString();\n\n $exploaded_content = explode(\":\", $process->getOutput());\n $content = self::praseArrForEntry($exploaded_content);\n\n $attributes['name'] = $slug;\n $attributes['slug'] = $this->v4('stream_');\n $attributes['entry_id'] = $entry_id;\n $attributes['apy_key'] = Auth::user()->api_key;\n $attributes['vcodec_name'] = $content[0]['vcodec_name'];\n $attributes['vcodec_long_name'] = $content[0]['vcodec_long_name'];\n $attributes['width'] = $content[0]['width'];\n $attributes['height'] = $content[0]['height'];\n $attributes['ratio'] = $content[0]['ratio'];\n $attributes['duraction'] = $content[0]['duraction'];\n $attributes['bit_rate'] = $content[0]['bit_rate'];\n $attributes['acodec_name'] = $content[0]['acodec_name'];\n $attributes['acodec_long_name'] = $content[0]['acodec_long_name'];\n $attributes['sample_rate'] = $content[0]['sample_rate'];\n $attributes['channels'] = $content[0]['channels'];\n $attributes['format_name'] = $content[0]['format_name'];\n $attributes['format_long_name'] = $content[0]['format_long_name'];\n $attributes['file_name'] = $videoFile;\n $attributes['file_path'] = $basedir;\n $attributes['prefix'] = 'video_';\n $attributes['status'] = 1;\n $attributes['active_from'] = $now;\n $attributes['active_to'] = $nextWeek;\n $attributes['created_by'] = Auth::user()->id;\n $attributes['updated_by'] = Auth::user()->id;\n\n $item->update($attributes);\n VideoRecordImages::create([\n 'filename' => $thumbnail.'.png',\n 'video_record_id' => $item->id,\n 'video_record_type' => get_class($item),\n 'name' => strlen($thumbnail) < 2 ? 'Снимка име' : $thumbnail,\n ]);\n\n $destinationPath = '/home/adm1n/HLS/rec/'.Auth::user()->api_key;\n $img_dest_folder = '/home/adm1n/nginx/livestream/laravel-admin-live/public/uploads/videos/'.Auth::user()->api_key;\n\n $cmd_mv_video_image = 'cd '.$destinationPath.' && mv '.$thumbnail.'.png '.$img_dest_folder.$thumbnail.'.png';\n $process_move = Process::fromShellCommandline(\n $cmd_mv_video_image\n );\n $process_move->run();\n $process_move->wait();\n\n return $item;\n }", "public function EditMovie($movie, $movieNameToEdit) {\n if($movie->GetCoverImage() == 'dont-update') {\n $query = $this->con->prepare(\"UPDATE Movie SET PK_movieName=?, FK_type=?, runTime=?, description=? WHERE PK_movieName=?\");\n $query->bind_param(\"ssiss\", $movie->GetMovieName(), $movie->GetType(), $movie->GetRunTime(), $movie->GetDescription(), $movieNameToEdit);\n } else {\n $query = $this->con->prepare(\"UPDATE Movie SET PK_movieName=?, FK_type=?, runTime=?, description=?, coverImage=? WHERE PK_movieName=?\");\n $query->bind_param(\"ssisss\", $movie->GetMovieName(), $movie->GetType(), $movie->GetRunTime(), $movie->GetDescription(), $movie->GetCoverImage(), $movieNameToEdit); \n }\n $query->execute();\n $query->close(); \n }", "public function mediadb_edit_media()\n {\n $form = $this->_getMediaForm();\n $worker = new \\Yana\\Forms\\Worker($this->_connectToDatabase('mediadb'), $form);\n return $worker->update();\n }", "public function edit($id)\n {\n $user = Auth::user();\n $video = Videos::findOrFail($id);\n\n return view('pages.painel.editar.videos.index', compact('user', 'video'));\n }", "public function edit($id)\n {\n $video = $this->video->find($id);\n $categories = Category::all();\n\n return view('pages.editvideo')->with('video', $video)->with('categories', $categories);\n }" ]
[ "0.75878435", "0.75878435", "0.75445503", "0.7264923", "0.7123643", "0.70566493", "0.69860923", "0.69637764", "0.6932711", "0.68725497", "0.6852951", "0.6852951", "0.6799745", "0.6792167", "0.6781767", "0.67788374", "0.6732424", "0.67019075", "0.66847676", "0.6680973", "0.666269", "0.6641271", "0.66309464", "0.6619691", "0.6603919", "0.6603852", "0.6599692", "0.6590845", "0.65698165", "0.6541381", "0.65360457", "0.6526796", "0.652254", "0.651979", "0.6512021", "0.6510654", "0.65102035", "0.64785093", "0.6468715", "0.64592206", "0.644528", "0.64434296", "0.6441885", "0.6438362", "0.6434898", "0.63791466", "0.6374727", "0.6368478", "0.63665783", "0.6365931", "0.63614064", "0.634716", "0.6342165", "0.63336045", "0.6315906", "0.6313071", "0.6300027", "0.62725794", "0.62571394", "0.6255193", "0.62531346", "0.6249231", "0.62381715", "0.6219727", "0.6217715", "0.6214842", "0.6191627", "0.6190473", "0.6184549", "0.6175158", "0.61428267", "0.6135279", "0.61274946", "0.61257946", "0.612378", "0.611949", "0.61035746", "0.6090439", "0.60851055", "0.60616", "0.6050202", "0.6039917", "0.6038782", "0.6030712", "0.60281056", "0.60202205", "0.6019157", "0.60161346", "0.60137016", "0.6008104", "0.6001471", "0.5993314", "0.59862584", "0.59821594", "0.59799415", "0.5958211", "0.59399635", "0.59365463", "0.59305847", "0.5928223" ]
0.68594325
10
/edit video Function for delete
public function deleteVideo(Request $request) { $id = $request->workoutid; $getWorkout = Video::find($id); if($getWorkout->delete()){ return redirect()->back()->with('danger','Video Deleted successfully'); } else{ return redirect()->back()->with('danger','Sorry! Video is not deleted'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function del()\n {\n $id = $this->uri->rsegment(3);\n $this->_del($id);\n \n $this->session->set_flashdata('message', 'Xóa thành công');\n redirect(admin_url('video'));\n }", "private function deleteVideo()\n {\n try \n {\n global $cbvid;\n \n $request = $_REQUEST;\n #pex($request,true);\n if(!isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video id not provided\");\n\n if( isset($request['videoid']) && !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n $cbvid->delete_video( (int)$request['videoid'] );\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"video deleted successfully\", \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n } \n }", "public function edit(Video $video)\n {\n //\n }", "public function edit(Video $video)\n {\n //\n }", "public function delete($video_id);", "public function deleteAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET VIEWER INFO\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n $listingtype_id = $this->_listingType->listingtype_id;\n $this->view->listingType = $this->_listingType;\n\n //GET TAB ID\n $this->view->tab_selected_id = $tab_selected_id = $this->_getParam('content_id');\n $this->view->format_form = $this->_getParam('format', null);\n\n //GET VIDEO OBJECT\n $this->view->sitereview_video = $sitereview_video = Engine_Api::_()->getItem('sitereview_video', $this->getRequest()->getParam('video_id'));\n\n //GET VIDEO TITLE\n $this->view->title = $sitereview_video->title;\n\n //GET LISTING ID\n $listing_id = $sitereview_video->listing_id;\n\n //GET NAVIGATION \n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitereview_main');\n\n //GET SITEREVIEW SUBJECT\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n $can_edit = $sitereview->authorization()->isAllowed($viewer, 'edit_listtype_' . $sitereview->listingtype_id);\n\n if (!$sitereview_video) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_(\"Video doesn't exists or not authorized to delete\");\n return;\n }\n\n //VIDEO OWNER AND LISTING OWNER CAN DELETE VIDEO\n if ($viewer_id != $sitereview_video->owner_id && $can_edit != 1) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n if (!$this->getRequest()->isPost()) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid request method');\n return;\n }\n\n $db = $sitereview_video->getTable()->getAdapter();\n $db->beginTransaction();\n\n try {\n\n Engine_Api::_()->getDbtable('videoratings', 'sitereview')->delete(array('videorating_id =?' => $this->getRequest()->getParam('video_id')));\n\n $sitereview_video->delete();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n\n\n\n\n $this->view->status = true;\n if ($this->view->format_form == 'smoothbox') {\n $this->_forwardCustom('success', 'utility', 'core', array(\n 'smoothboxClose' => true,\n 'parentRefresh' => '500',\n 'parentRefreshTime' => '500',\n 'format' => 'smoothbox',\n 'messages' => Zend_Registry::get('Zend_Translate')->_('You have successfully deleted this video.')\n ));\n } else {\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n if ($can_edit) {\n return $this->_gotoRouteCustom(array('action' => 'edit', 'listing_id' => $sitereview->listing_id), \"sitereview_videospecific_listtype_$listingtype_id\", true);\n } else {\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview->getSlug(), 'tab' => $tab_selected_id), \"sitereview_entry_view_listtype_$listingtype_id\", true);\n }\n } else {\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview->getSlug(), 'tab' => $tab_selected_id), \"sitereview_entry_view_listtype_$listingtype_id\", true);\n }\n }\n }", "public function editVideo(Request $request)\n {\n\n $editVideo = UploadVideo::where(\"id\", $request->id)->first();\n $editVideo->content_title = ucfirst($request->title);\n if ($request->active) {\n $editVideo->active_status = 1;\n } else {\n $editVideo->active_status = 0;\n }\n\n $editVideo->save();\n }", "protected function _delete()\r\n\t{\r\n\t\tEngine_Api::_() -> getDbTable('favorites', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from favorite table\r\n\t\tEngine_Api::_() -> getDbTable('favorites', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from rating table\r\n\t\tEngine_Api::_() -> getDbTable('ratings', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from watchlater table\r\n\t\tEngine_Api::_() -> getDbTable('watchlaters', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// update video count in signature table\r\n\t\t$signatureTbl = Engine_Api::_() -> getDbTable('signatures', 'ynvideo');\r\n\t\t$signature = $signatureTbl -> fetchRow($signatureTbl -> select() -> where('user_id = ?', $this -> owner_id));\r\n\t\tif ($signature)\r\n\t\t{\r\n\t\t\t$signature -> video_count = new Zend_Db_Expr('video_count - 1');\r\n\t\t}\r\n\t\t$signature -> save();\r\n\r\n\t\t// remove video from playlists\r\n\t\t$playlistAssocTbl = Engine_Api::_() -> getDbTable('playlistassoc', 'ynvideo');\r\n\t\t$playlistAssocs = $playlistAssocTbl -> fetchAll($playlistAssocTbl -> select() -> where('video_id = ?', $this -> getIdentity()));\r\n\t\tforeach ($playlistAssocs as $playlistAssoc)\r\n\t\t{\r\n\t\t\t$playlistAssoc -> delete();\r\n\t\t}\r\n\r\n\t\tparent::_delete();\r\n\t}", "function deleteVideo()\n{\n global $connection;\n if (isset($_POST['btn_delete'])) {\n $idVideo = $_POST['btn_delete'];\n $data = videoCurrentFileTitle($idVideo, $connection);\n $videoTitle = $data['videoTitle'];\n $podcast_location = '../../../upload_podcast/';\n $video_location = '../../../upload_video/';\n $trailerTitle = $data['trailerTitle'];\n $trailer_location = '../../../trail_video/';\n $thumbnailTitle = $data['thumbnailTitle'];\n $thumbnail_location = '../../../thumbnail_video/';\n $superCategorie = $data['superCategorie'];\n \n if ($superCategorie == 1 || $superCategorie == 3) {\n $videoPath = $video_location.$videoTitle;\n } else {\n $videoPath = $podcast_location.$videoTitle;\n }\n \n $trailerPath = $trailer_location.$trailerTitle;\n $thumbnailPath = $thumbnail_location.$thumbnailTitle;\n \n \n global $deleteVideoResponse;\n $deleteVideoResponse = \"\";\n if (empty($idVideo)) {\n $deleteVideoResponse = '<script language=\"javascript\">swal(\"Errore!\", \"È necessario selezionare un video!\", \"error\").then(function() {\n location.reload();\n })</script>';\n } else {\n $query = \"DELETE FROM videos\n WHERE id_video = '$idVideo'\";\n $result = mysqli_query($connection, $query);\n if ($result) {\n unlink($videoPath);\n unlink($trailerPath);\n unlink($thumbnailPath);\n $deleteVideoResponse = '<script language=\"javascript\">swal(\"Successo!\", \"Il video è stato eliminato!\", \"success\".then(function() {\n location.reload();\n }))</script>';\n } else {\n $deleteVideoResponse = '<script language=\"javascript\">swal(\"Errore!\", \"Il video non è stato eliminato!\", \"error\").then(function() {\n location.reload();\n })</script>';\n }\n }\n }\n}", "public function delete_media() {\n $id = $this->input->post('media_id');\n $valors = array();\n $resultat = $this->media_model->delete_media($id);\n if ($resultat > 0) {\n $filename = 'videos/' . $id . '.mp4';\n $filenameImg = 'img/' . $id . '.jpg';\n if (file_exists($filename)) {\n unlink($filename);\n }\n if (file_exists($filenameImg)) {\n unlink($filenameImg);\n }\n $resultat = \"Se ha borrado un registro con éxito\";\n } else {\n $resultat = \"No se ha borrado ningún registro\";\n }\n\n $this->load->view(\"admin.php\", array(\"data\" => $valors, \"error\" => $resultat));\n }", "function edit()\n {\n $id = $this->uri->rsegment('3');\n $video = $this->video_model->get_info($id);\n if(!$video)\n {\n $this->session->set_flashdata('message', 'Không tồn tại video này');\n redirect(admin_url('video'));\n }\n $this->data['video'] = $video;\n \n $this->load->library('form_validation');\n $this->load->helper('form');\n \n //neu ma co du lieu post len thi kiem tra\n if($this->input->post())\n {\n $this->form_validation->set_rules('name', 'Tên video', 'required');\n $this->form_validation->set_rules('link', 'Link video', 'required');\n \n if($this->form_validation->run())\n {\n \n //lay ten file anh minh hoa duoc update len\n $this->load->library('upload_library');\n $upload_path = './upload/video';\n $upload_data = $this->upload_library->upload($upload_path, 'image'); \n $images = '';\n if(isset($upload_data['file_name']))\n {\n $images = $upload_data['file_name'];\n }\n \n //luu du lieu can them\n $data = array(\n 'name' => $this->input->post('name'),\n 'images' => $images,\n 'link' => $this->input->post('link'),\n ); \n if($images != '')\n {\n $data['images'] = $images;\n }\n \n //them moi vao csdl\n if($this->video_model->update($video->id, $data))\n {\n $this->session->set_flashdata('message', 'Cập nhật thành công');\n }else{\n $this->session->set_flashdata('message', 'Không cập nhật được');\n }\n redirect(admin_url('video'));\n }\n }\n \n \n //load view\n $this->data['temp'] = 'admin/video/edit';\n $this->load->view('admin/main', $this->data);\n }", "function cs_pb_video($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$video_element_size = '25';\n\t\t$video_url = '';\n\t\t$video_width = '';\n\t\t$video_height = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$video_element_size = $cs_node->video_element_size;\n\t\t\t$video_url = $cs_node->video_url;\n\t\t\t$video_width = $cs_node->video_width;\n\t\t\t$video_height = $cs_node->video_height;\n\t\t\t\t$counter = $post->ID.$count_node;\n}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $video_element_size?>\" item=\"video\" data=\"<?php echo element_size_data_array_index($video_element_size)?>\" >\n \t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"video_element_size[]\" class=\"item\" value=\"<?php echo $video_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> &nbsp; \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp; \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n \t<div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Video Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n <div class=\"opt-conts\">\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Video URL</label></li>\n <li class=\"to-field\">\n \t<input type=\"text\" name=\"video_url[]\" class=\"txtfield\" value=\"<?php echo $video_url?>\" />\n <p>Enter Video URL (Youtube, Vimeo or any other supported by wordpress)</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Width</label></li>\n <li class=\"to-field\"><input type=\"text\" name=\"video_width[]\" class=\"txtfield\" value=\"<?php echo $video_width?>\" /></li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Height</label></li>\n <li class=\"to-field\"><input type=\"text\" name=\"video_height[]\" class=\"txtfield\" value=\"<?php echo $video_height?>\" /></li>\n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"video\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "public function destroy($id)\n {\n $video = Video::find($id)->delete();\n \n Session::flash('delete_video','The video has been deleted!!!');\n \n return redirect('/admin/video');\n }", "public function edit(ProductVideo $productVideo)\n {\n //\n }", "public function delete_video($arr_where){\n\n\t\t$str_select=\"video_file,video_img\";\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->where($arr_where);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$video=$query->row_array();\n\n\t\t$this->db->where($arr_where);\n\t\tif($this->db->delete($this->_table)){\n\n\t\t\tif(is_array($video) && (element('video_file',$video,'') != ''))\n\t\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.element('video_file',$video,''));\n\n\t\t\tif(is_array($video) && (element('video_img',$video,'') != '')){\n\n\t\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.element('video_img',$video,''));\n\t\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.\"_thumbs/\".element('video_img',$video,''));\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n\t}", "public function deleteVideo(Request $request)\n {\n \\Log::info($request->id);\n $video = UploadVideo::findorfail($request->id);\n $video->delete();\n return response()->json(['status' => true, 'message' => \"Admin deleted successfully.\"]);\n }", "public function postEdit($video)\n\t{\n\n // Declare the rules for the form validation\n $rules = array(\n 'user' => 'required|min:5',\n 'link' => 'required|min:10',\n 'description' => 'required|min:10'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Update the video video data\n $video->user = Input::get('user');\n $video->link = Input::get('link');\n $video->description = Input::get('description');\n // Was the video video updated?\n if($video->save())\n {\n // Redirect to the new video video page\n return Redirect::to('admin/videos/' . $video->id . '/edit')->with('success', Lang::get('admin/videos/messages.update.success'));\n }\n\n // Redirect to the videos video management page\n return Redirect::to('admin/videos/' . $video->id . '/edit')->with('error', Lang::get('admin/videos/messages.update.error'));\n }\n\n // Form validation failed\n return Redirect::to('admin/videos/' . $video->id . '/edit')->withInput()->withErrors($validator);\n\t}", "function remove_video_files($vdetails)\r\n{\r\n global $cbvid;\r\n return $cbvid->remove_files($vdetails);\r\n}", "public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "public function destroy($id)\n {\n $video = Video::find($id);\n if (!$video){ Alert::warning('عذراً','ﻻ يوجد فيديو بنفس المواصفات'); return redirect('/dashboard/videos');}\n Video::find($id)->delete();\n Alert::success('عظيم','تم حذف فيديو بنجاح');\n return redirect('/dashboard/videos');\n }", "public function destroy(Request $request, $id)\n {\n try{\n\n $video = Video::find($id);\n\n @unlink($this->getAssetPath($video->thumbnail,'uploads'));\n @unlink($this->getAssetPath($video->video,'uploads'));\n $video->categories()->detach();\n $video->tags()->detach();\n $video->delete();\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was deleted successfully !!\");\n return redirect()->back();\n } catch(\\Exception $e) {\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not deleted the video\");\n Log::warning(\"Can not deleted Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n }", "public function postDelete($video)\n {\n // Declare the rules for the form validation\n $rules = array(\n 'id' => 'required|integer'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n $id = $video->id;\n $video->delete();\n\n // Was the video video deleted?\n $video = Video::find($id);\n if(empty($video))\n {\n // Redirect to the video videos management page\n return Redirect::to('admin/videos')->with('success', Lang::get('admin/videos/messages.delete.success'));\n }\n }\n // There was a problem deleting the video video\n return Redirect::to('admin/videos')->with('error', Lang::get('admin/videos/messages.delete.error'));\n }", "function delete_video_acepcion_lse($id_imagen) {\n\t\n\t\t$imagen=$this->datos_imagen($id_imagen);\n\t\t\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t\n\t\t$qDelete = \"DELETE FROM imagenes WHERE id_imagen='$id_imagen'\";\t\n\t\t$result = mysql_query($qDelete); \n\t\t\n\t\t$qDelete1 = \"DELETE FROM palabra_imagen WHERE id_imagen='$id_imagen'\";\t\n\t\t$result1 = mysql_query($qDelete1);\n\t\t\n\t\tunlink('../../repositorio/LSE_acepciones/'.$imagen['imagen']);\n\t\t\n\t\tif (file_exists('../../importar/videos/acepciones/'.$imagen['id_palabra'].'.flv')) { \n\t\t\tunlink('../../importar/videos/acepciones/'.$imagen['id_palabra'].'.flv');\n\t\t}\n\t\tmysql_close($connection);\n\t\treturn mysql_error();\t\t\n\t}", "public function destroy($id)\n {\n $video = Video::findOrFail($id);\n try {\n $video->delete();\n return redirect()->route('videos.index')->with('status', 'Video post deleted successfully');\n } catch (\\Exception $e) {\n \\Log::error($e->getMessage());\n }\n }", "public function edit($id)\n {\n $video = Video::find($id);\n // dd($video->categories[0]->name);\n $categories = Category::where('status',1)->orderBy('name')->get();\n $tags = Tag::where('status',1)->get();\n return view('adminCMS.videos.editVideo',compact('video','categories','tags'));\n }", "public function edit(Videocomment $Videocomment)\n {\n //\n }", "public function proses_edit_video(){\n \n $this->load->library('upload');// library dapat di load di fungsi , di autoload atau di construc nya tinggal pilih salah satunya\n $date \t\t\t= date('Y-m-d H:i:s');\n $nmfile = \"file_\".time(); //nama file saya beri nama langsung dan diikuti fungsi time\n $path = './assets/uploads/'; //path folder\n $path2 = './assets/hasil_resize/';\n $config['upload_path'] = $path; //variabel path untuk config upload\n $config['allowed_types'] = 'gif|jpg|png|jpeg|bmp'; //type yang dapat diakses bisa anda sesuaikan\n $config['max_size'] = '2048'; //maksimum besar file 2M\n $config['file_name'] = $nmfile; //nama yang terupload nantinya\n \n $this->upload->initialize($config);\n \n $idgbr = $this->input->post('kode'); /* variabel id gambar */\n $filelama = $this->input->post('filelama'); /* variabel file gambar lama */\n \n if($_FILES['filefoto']['name'])\n {\n if ($this->upload->do_upload('filefoto'))\n {\n $gbr = $this->upload->data();\n $data = array(\n 'image' =>$gbr['file_name'],\n 'judul' =>$this->input->post('judul'),\n 'link_video' =>$this->input->post('link_video'),\n 'status' =>$this->input->post('status'),\n 'kategori' =>$this->input->post('kategori'),\n 'datetime'=>$date\n \n );\n \n @unlink($path.$filelama);//menghapus gambar lama, variabel dibawa dari form\n @unlink($path2.$filelama);//menghapus gambar lama, variabel dibawa dari form\n \n $where =array('id_video'=>$idgbr); //array where query sebagai identitas pada saat query dijalankan\n $this->Video_model->get_update($data,$where); //akses model untuk menyimpan ke database\n //$this->helper_log(\"edit\", \"Mengedit data video\");\n \n $this->session->set_flashdata('pesan', '<div role=\"alert\" class=\"alert alert-success alert-dismissible\">\n <button type=\"button\" data-dismiss=\"alert\" aria-label=\"Close\" class=\"close\"><span aria-hidden=\"true\" class=\"mdi mdi-close\"></span></button><span class=\"icon mdi mdi-check\"></span><strong>Bagus!</strong> Anda Berhasil Mengedit Data Video </div>'); //pesan yang muncul jika berhasil diupload pada session flashdata\n redirect('Superadmin/read_video'); //jika berhasil maka akan ditampilkan view vupload\n \n }else{ /* jika upload gambar gagal maka akan menjalankan skrip ini */\n $er_upload=$this->upload->display_errors(); /* untuk melihat error uploadnya apa */\n //pesan yang muncul jika terdapat error dimasukkan pada session flashdata\n $this->session->set_flashdata('pesan','<div role=\"alert\" class=\"alert alert-danger alert-dismissible\">\n <button type=\"button\" data-dismiss=\"alert\" aria-label=\"Close\" class=\"close\"><span aria-hidden=\"true\" class=\"mdi mdi-close\"></span></button><span class=\"icon mdi mdi-check\"></span><strong>Oops!</strong> Anda Gagal Mengedit Data Video </div>');\n redirect('Superadmin/read_video'); //jika gagal maka akan ditampilkan form upload\n }\n }else{ /* jika file foto tidak ada maka query yg dijalankan adalah skrip ini */\n \n $data = array(\n 'judul' =>$this->input->post('judul'),\n 'link_video' =>$this->input->post('link_video'),\n 'status' =>$this->input->post('status'),\n 'kategori' =>$this->input->post('kategori'),\n 'datetime'=>$date\n );\n \n $where =array('id_video'=>$idgbr); //array where query sebagai identitas pada saat query dijalankan\n $this->Video_model->get_update($data,$where); //akses model untuk menyimpan ke database\n // $this->helper_log(\"edit\", \"Mengedit data video\");\n \n $this->session->set_flashdata('pesan', '<div role=\"alert\" class=\"alert alert-success alert-dismissible\">\n <button type=\"button\" data-dismiss=\"alert\" aria-label=\"Close\" class=\"close\"><span aria-hidden=\"true\" class=\"mdi mdi-close\"></span></button><span class=\"icon mdi mdi-check\"></span><strong>Bagus!</strong> Anda Berhasil Mengedit Data Video | Gambar tidak ada !!</div>');\n redirect('Superadmin/read_video'); /* jika berhasil maka akan kembali ke home upload */\n }\n }", "public function addEdit(){\n\t\tif (isset($this->session->userdata['logged_in'])){\n\t\t\t$video_id = $this->uri->segment(4);// get id form url\n\t\t\tif($video_id==''){\n\t\t\t\t$data['title'] = \"Add Video\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$data['title'] = \"Edit Video\";\n\t\t\t}\n\t\t\t$data['content'] = 'admin/addeditvideo';\n\t\t\t$data['getVideo'] = $this->VideoModel->getVideoById($video_id); //retrive all category By Id\n\t\t\t//print_r($data['getVideo']); die;\n\t\t\t$this->load->view('admin/layout/adminmaster',$data);\n\t\t}else{\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "public function destroy($id)\n {\n \n Video::find($id)->delete();\n return redirect()->route('mivideo.index')\n ->with('info','El video se ha elminado exito'); \n }", "public function destroy($id)\n {\n $gallery = Video::find($id);\nunlink(public_path().\"/uploads/video/\".$gallery->file);\n\n\n\n $gallery->delete();\n return redirect()->route('video.index');\n }", "public function getEdit($video)\n\t{\n // Title\n $title = Lang::get('admin/videos/title.video_update');\n\n // Show the page\n return View::make('admin/videos/create_edit', compact('video', 'title'));\n\t}", "public function destroy()\n {\n // DB::table('video_uploaded')->delete();\n }", "public function editAction(Tx_Youtubeapi_Domain_Model_Video $video) {\n\t\t$this->view->assign('video', $video);\n\t}", "public function removeAction() {\r\n if (empty($_POST['photo_id']))\r\n die('error');\r\n //GET PHOTO ID AND ITEM\r\n $photo_id = (int) $this->_getParam('photo_id');\r\n $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n $db = Engine_Api::_()->getDbTable('chanelphotos', 'sesvideo')->getAdapter();\r\n $db->beginTransaction();\r\n try {\r\n $photo->delete();\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n }", "public function edit($id)\n {\n $video = Video::find($id);\n $category = Category::all()->pluck('name','id');\n \n return view('admin.video.edit', compact('video','category'));\n }", "public function destroy($id, Request $request)\n {\n //\n LikeVideo::where('video_id', $id)->delete();\n $slid = Slider::where('video_id', $id)->get();\n if(count($slid)) {\n foreach ($slid as $key => $value) {\n $slider_u = $value->image;\n $slider_u = str_replace('/storage/app/', '', $slider_u);\n Storage::delete($slider_u);\n }\n }\n \n Slider::where('video_id', $id)->delete();\n $video = Video::find($id);\n if($video->thumbnail) {\n $thumbnail_u = $video->thumbnail;\n $thumbnail_u = str_replace('/storage/app/', '', $thumbnail_u);\n Storage::delete($thumbnail_u);\n }\n if($video->thumbnail_detail) {\n $thumbnail_detail_u = $video->thumbnail_detail;\n $thumbnail_detail_u = str_replace('/storage/app/', '', $thumbnail_detail_u);\n Storage::delete($thumbnail_detail_u);\n }\n if($video->video) {\n // $video_u = $video->video;\n // $video_u = str_replace('/storage/app/', '', $video_u);\n $video_u = '/var/www/html'.$video->video;\n $video_u = str_replace('/playlist.m3u8', '', $video_u);\n $command = 'rm -rf '.$video_u;\n exec($command.\" 2>&1\", $output);\n\n // Storage::delete($video_u);\n }\n Video::destroy($id);\n ViewVideo::where('video_id',$id)->delete();\n return redirect(route('push.videos.index').'?channel_id='.@$request->channel_id);\n }", "public function edit(Video $video)\n {\n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = UserMoodle::where('id', $user_id)->first();\n $users = UserMoodle::all();\n $competitors = Competitor::where('video_id', $video->id)->get();\n $competitor_types = CompetitorType::where('status', 1)->get();\n $video_types = VideoType::where('status', 1)->get();\n\n return view('admin.videos.edit', compact('video', 'usuario', 'users', 'video_types', 'competitor_types', 'competitors'));\n }", "public function edit($id)\n {\n $video = Video::find($id);\n $pk = CoursePackage::all();\n return view('admin.video.edit')->with('v' , $video)->with('pk' , $pk);\n }", "private function removeVideoFromGroup()\n {\n try\n {\n $request = $_REQUEST;\n\n if(!isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg('provide group id');\n else if(!is_numeric($request['group_id'])) \n throw_error_msg('invalid group id'); \n else\n $gid = (int)$request['group_id'];\n\n if(!isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg('provide video id');\n else if(!is_numeric($request['videoid'])) \n throw_error_msg('invalid video id'); \n else\n $vid = (int)$request['videoid'];\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n global $cbgroup; \n $id = $cbgroup->remove_group_video($vid,$gid,true);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg())\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'video removed from group', \"data\" => array());\n $this->response($this->json($data));\n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function excluirVideoPorId($idVideo){\r\n \r\n $sql = mysql_query(\"DELETE FROM video_galeria WHERE id_video='$idVideo'\") or die(mysql_error());\r\n \r\n if($sql == true){\r\n\t\r\n\treturn true; \r\n\t\r\n }else{\r\n\t\r\n\treturn false; \r\n }\r\n\t\r\n}", "public function edit($id)\n\t{\n\t\t$video = Resource::find($id);\n\t\t//id=1表示是视频的大类\n\t\t$categories = Category::find(1);\n\t\treturn view('admin.video.edit')->with(compact('video','categories'));\n\t}", "public function edit($id)\n {\n $video=Video::where('id',$id)->first();\n return view('videos.edit-video',compact('video'));\n }", "public function editAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid()) {\n return;\n }\n\n //GET LISTING ID\n $listing_id = $this->_getParam('listing_id', 0);\n\n $listingtype_id = $this->_listingType->listingtype_id;\n\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n\n //GET VIDEO OBJECT\n $sitereview_video = Engine_Api::_()->getItem('sitereview_video', $this->_getParam('video_id'));\n\n //GET TAB ID\n $this->view->tab_selected_id = $this->_getParam('content_id');\n\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n $this->view->can_edit = $canEdit = $sitereview->authorization()->isAllowed($viewer, \"edit_listtype_$sitereview->listingtype_id\");\n\n //SUPERADMIN, VIDEO OWNER AND LISTING OWNER CAN EDIT VIDEO\n if ($viewer_id != $sitereview_video->owner_id && $canEdit != 1) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n //GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitereview_main');\n\n //FORM GENERATION\n $this->view->form = $form = new Sitereview_Form_Editvideo();\n\n //PREPARE TAGS\n $sitereviewTags = $sitereview_video->tags()->getTagMaps();\n $tagString = '';\n foreach ($sitereviewTags as $tagmap) {\n if ($tagString !== '') {\n $tagString .= ', ';\n }\n $tagString .= $tagmap->getTag()->getTitle();\n }\n $this->view->tagNamePrepared = $tagString;\n $form->tags->setValue($tagString);\n\n //IF NOT POST OR FORM NOT VALID THAN RETURN\n if (!$this->getRequest()->isPost()) {\n $form->populate($sitereview_video->toArray());\n return;\n }\n\n //IF NOT POST OR FORM NOT VALID THAN RETURN\n if (!$form->isValid($this->getRequest()->getPost())) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid data');\n return;\n }\n\n //GET FORM VALUES\n $values = $form->getValues();\n\n //PROCESS\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n $sitereview_video->setFromArray($values);\n\n // Add tags\n $tags = preg_split('/[,]+/', $values['tags']);\n $sitereview_video->tags()->setTagMaps($viewer, $tags);\n $sitereview_video->save();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview_video->getSlug(), 'video_id' => $sitereview_video->getIdentity(), 'user_id' => $sitereview_video->owner_id, 'content_id' => $this->view->tab_selected_id), \"sitereview_video_view_listtype_$listingtype_id\", true);\n }", "public function updateVideo(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'title' => 'required',\n 'category' => 'required',\n 'video' => 'mimes:mp4'\n ));\n\n $id = $request->id;\n $video = Video::find($id);\n $video->title = $request->title;\n $video->video_category_id = $request->category;\n\n if ($request->hasFile('video')) {\n $file = $request->file('video');\n $filename = time().'.'.$file->getClientOriginalName();\n /*$location = public_path('file/'.$filename);\n Storage::put($filename,file_get_contents($file));*/\n\n $location = public_path('file/'.$filename);\n Storage::disk('file')->put($filename, file_get_contents($file));\n //Storage::disk('public')->put($filename, file_get_contents($file));\n $video->video = $filename;\n\n }\n $video->save();\n Session::flash('success','Video Updated succcessfully.');\n return redirect()->back()->with('workout',$video);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function video() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id'];\n if ($id > 0) {\n $query = \"select * from videos where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $query = \"update videos set views = views + 1 where id =$id;\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }", "function media_upload_video()\n {\n }", "public function editVideo($id)\n {\n\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = Video::find($id);\n $categories = VideoCategory::all();\n //dd($categories);\n return view('admin.editvideo')->with('workout',$workout)->with('videoCategories',$categories);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function destroy($id)\n {\n $file = new Video;\n $file = $file->findorfail($id);\n $file->delete();\n return redirect()->route('lecture-live');\n }", "public function getDelete($video)\n {\n // Title\n $title = Lang::get('admin/videos/title.video_delete');\n\n // Show the page\n return View::make('admin/videos/delete', compact('video', 'title'));\n }", "public function update_video($arr_data,$arr_where){\n\n\t\t$str_select=\"video_file,video_img\";\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->where($arr_where);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$video=$query->row_array();\n\n\t\tif(isset($arr_data['video_file']) && is_array($video) && (element('video_file',$video,'') != $arr_data['video_file']) && (element('video_file',$video,'') != ''))\n\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.element('video_file',$video,''));\n\n\t\tif(isset($arr_data['video_img']) && is_array($video) && (element('video_img',$video,'') != $arr_data['video_img']) && (element('video_img',$video,'') != '')){\n\n\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.element('video_img',$video,''));\n\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.\"_thumbs/\".element('video_img',$video,''));\n\t\t}\n\n\t\t$this->db->where($arr_where);\n\t\treturn $this->db->update($this->_table,$arr_data);\n\n\t}", "public function destroy($id)\n {\n $about = VideoService::find($id);\n\n if (!$about)\n {\n\n return back()->with('error','Failed To Delete');\n }\n else{\n File::delete($about->title_image);\n VideoService::find($id)->delete();\n return back()->with('success','Data Deleted');\n }\n }", "public function eliminarVideoController($datos)\n {\n //eliminado los datos\n $respuesta = @GestorVideosModel::eliminarVideoModel($datos, 'videos');\n if ($respuesta == 'ok') {\n //eliminado el video del servidor\n unlink($datos['rutaVideo']);\n\n echo 'ok';\n } else {\n echo 'error';\n }\n }", "public function executeEditVideo(sfWebRequest $request)\n {\n // Shut off Chrome's poorly designed XSS filtering that clobbers perfectly legitimate iframe embed submissions\n // http://code.google.com/p/chromium/issues/detail?id=98787\n $this->getResponse()->setHttpHeader('X-XSS-Protection', '0');\n $this->forward404Unless(aMediaTools::userHasUploadPrivilege());\n $item = null;\n $this->slug = false;\n $this->popularTags = PluginTagTable::getPopulars(null, array('sort_by_popularity' => true), false, 10);\n if (sfConfig::get('app_a_all_tags', true))\n {\n $this->allTags = PluginTagTable::getAllTagNameWithCount();\n }\n else\n {\n $this->allTags = array();\n }\n if ($request->hasParameter('slug'))\n {\n $item = $this->getItem();\n $this->slug = $item->getSlug();\n }\n if ($item)\n {\n $this->forward404Unless($item->userHasPrivilege('edit'));\n }\n $this->item = $item;\n $embed = false;\n $parameters = $request->getParameter('a_media_item');\n \n if ($parameters)\n {\n $files = $request->getFiles('a_media_item');\n \n $this->form = new aMediaVideoForm($item);\n \n if (isset($parameters['embed']))\n {\n // We need to do some prevalidation of the embed code so we can prestuff the\n // file, title, tags and description widgets\n $result = $this->form->classifyEmbed($parameters['embed']);\n if (isset($result['thumbnail']))\n {\n $thumbnail = $result['thumbnail'];\n if ((!isset($parameters['title'])) && (!isset($parameters['tags'])) && (!isset($parameters['description'])) && (!isset($parameters['credit'])))\n {\n $parameters['title'] = $result['serviceInfo']['title'];\n // We want tags to be lower case, and slashes break routes in most server configs. \n $parameters['tags'] = str_replace('/', '-', aString::strtolower($result['serviceInfo']['tags']));\n $parameters['description'] = aHtml::textToHtml($result['serviceInfo']['description']);\n $parameters['credit'] = $result['serviceInfo']['credit'];\n }\n }\n }\n\n // On the first pass with a youtube video we just make the service's thumbnail the\n // default thumbnail. We don't force them to use it. This allows more code reuse\n // (Moving this after the bind is necessary to keep it from being overwritten) \n if (isset($thumbnail))\n {\n $this->convertServiceThumbnailToFileUpload($thumbnail, $parameters);\n }\n \n $this->form->bind($parameters, $files);\n \n do\n {\n // first_pass forces the user to interact with the form\n // at least once. Used when we're coming from a\n // YouTube search and we already technically have a\n // valid form but want the user to think about whether\n // the title is adequate and perhaps add a description,\n // tags, etc.\n if (($this->hasRequestParameter('first_pass')) ||\n (!$this->form->isValid()))\n {\n break;\n }\n $thumbnail = $this->form->getValue('file');\n // The base implementation for saving files gets confused when \n // $file is not set, a situation that our code tolerates as useful \n // because if you're updating a record containing an image you \n // often don't need to submit a new one.\n unset($this->form['file']);\n $object = $this->form->getObject();\n if ($thumbnail)\n {\n $object->preSaveFile($thumbnail->getTempName());\n }\n $this->form->save();\n \n if ($thumbnail)\n {\n $object->saveFile($thumbnail->getTempName());\n }\n \n if (aMediaTools::isSelecting())\n {\n return $this->redirect('aMedia/multipleAdd?id=' . $object->id);\n }\n\n return $this->redirect(\"aMedia/resumeWithPage\");\n } while (false);\n }\n return $this->renderTemplate();\n }", "public function edit(Video $video)\n {\n //\n $categories = DB::table('categories')->Select('categoryID', 'categoryName')->paginate();\n\n $getFilesData = DB::table('files')->select('fileID', 'fileName', 'file', 'created_at')->where('videoID', '=', $video->videoID)->paginate();\n\n return view('video.editVideo', compact('video', 'categories', 'getFilesData'));\n }", "public function edit($id)\n {\n //\n $users = DB::table('video_uploaded')->where('id',$id)->get();\n return view('reg/video')->with('videoDetails',$users);\n }", "public function edit($id)\n {\n $video = Video::findOrFail($id);\n return view('admin.video.edit', compact('video'));\n }", "public function destroy($id)\n {\n $video = Video::findOrFail($id);\n $video->delete();\n flash('Success deleted video!');\n return redirect('admin/videos');\n }", "public function update(Request $request, Video $video)\n { \n\n $request->validate([\n 'name' => \"required|unique:videos,name,$video->id\"\n ]);\n\n $url_video = $request->url_video;\n\n $url_video_array = explode(\"/\", $url_video);\n \n if(Str::contains($url_video, 'youtube')) {\n $url_video_id = $url_video_array[4];\n $url_thumbail = 'https://img.youtube.com/vi/'.$url_video_id.'/0.jpg';\n } \n\n if(Str::contains($url_video, 'vimeo')) {\n $url_video_id = $url_video_array[4];\n $hash = unserialize(file_get_contents(\"https://vimeo.com/api/v2/video/\".$url_video_id.\".php\"));\n $url_thumbail_preview = $hash[0]['thumbnail_large'];\n $url_thumbail = substr_replace( $url_thumbail_preview, \"480x360\", -3);\n } \n\n $video->update([\n 'name' => $request->name, \n 'date_public' => $request->date_public, \n 'status' => $request->status,\n 'category_id' => $request->category_id,\n 'url_video' => $url_video,\n 'url_thumbail' => $url_thumbail\n ]);\n\n return redirect()->route('admin.videos.edit', $video)->with('info', 'El video se actualizó con éxito');\n }", "private function updateVideo()\n {\n try\n {\n $request = $_POST;\n\n global $cbvid;\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video Id not provided\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n //check if title provided\n if( !isset($request['title']) || $request['title']==\"\")\n throw_error_msg(\"title not provided\");\n else\n $title = mysql_clean($request['title']);\n\n //check if description provided\n if( !isset($request['description']) || $request['description']==\"\")\n throw_error_msg(\"description not provided.\");\n else\n $description = mysql_clean($request['description']);\n\n //check if tags provided\n if(!isset($request['tags']) || $request['tags']==\"\")\n throw_error_msg(\"tags not provided.\");\n else\n $tags = mysql_clean($request['tags']);\n\n //check if tags provided\n if(!isset($request['category']) || $request['category']==\"\")\n {\n throw_error_msg(\"category not provided.\");\n }\n else\n {\n $request['category'] = explode(',',$request['category']); \n $_POST['category'] = $request['category'];\n }\n \n if (isset($request['video_users-user']) || isset($request['video_users-group'])) \n {\n $video_user_ = mysql_clean($request['video_users-user']);\n $video_group_ = mysql_clean($request['video_users-group']);\n\n $request['video_users'] = get_video_users($video_user_,$video_group_,false);\n }\n \n $result = $cbvid->update_video($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $vdetails = $cbvid->get_video_details($request['videoid']);\n $formatted_video = format_videos(array($vdetails));\n\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $formatted_video[0]);\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function edit(Video $video)\n {\n $bussines=Bussine::lists('slug','id');\n return view('backend.videos.edit')->with('video',$video)->with('bussines',$bussines);\n }", "function video_unpreferito()\n{\n if (isset($_POST['unpreferito'])) {\n global $connection;\n $user_id = $_SESSION['users_id'];\n $unpreferito = $_POST['unpreferito'];\n\n if ($unpreferito !=\"\" && $unpreferito != null) {\n $query_delete = \"DELETE FROM prefiriti WHERE preferiti_video='$unpreferito' AND preferiti_userid='$user_id'\";\n \n mysqli_query($connection, $query_delete);\n }\n return header('Location: video_details.php?id='.$unpreferito);\n }\n}", "public function editVideo($data, $video)\n {\n return $this->performRequest('PUT',\"/videos/{$video}\",\n $data);\n }", "public function destroy(Request $request,$id)\n {\n if (!intval($video_id=$id)) {\n return $this->error('获取视频id失败');\n }\n if (!intval($video_list_id=$request->video_list_id)) {\n return $this->error('获取集合id失败');\n }\n\n if (!DB::table('nba_list_video')->where(['video_id' => $video_id , 'video_list_id' => $video_list_id])->delete()) {\n return $this->ajaxResponse(500,'移除视频失败');\n }\n\n return $this->ajaxResponse(200,'移除视频成功');\n\n \n\n }", "public function edit($id)\n {\n $video = Video::findOrFail($id);\n return view('admin.videos.edit', compact('video'));\n }", "function delete_video_thumb($file_dir,$file)\r\n{\r\n global $LANG;\r\n if($file_dir!=NULL){\r\n $path = THUMBS_DIR.'/'.$file_dir.'/'.$file;\r\n }\r\n else{\r\n $path = THUMBS_DIR.'/'.$file; \r\n }\r\n \r\n if(file_exists($path))\r\n {\r\n unlink($path);\r\n e(lang('video_thumb_delete_msg'),'m');\r\n }else{\r\n e(lang('video_thumb_delete_err'));\r\n }\r\n}", "public function delete(){\n\t $this->model->clear()->filter(array('preview_master_id' => WaxUrl::get(\"id\")))->delete();\n\t parent::delete();\n\t}", "public function destroy($id)\n {\n Video::findOrFail($id)->delete();\n return redirect()->route('admin.videos.index')\n ->with('success','Ջնջվեց');\n }", "public function edit_video($video){\n\tif(Auth::check()){\n\t\tif(Auth::user()->type==\"Artist\"){\n\t\t\t$deliver_videos = DB::table('requested_videos')->select('*')\n\t\t\t->where('requested_videos.uploadedby','=',Auth::user()->profile_id)\n\t\t\t->where('requested_videos.id','=',$video)\n\t\t\t->paginate(15);\n\t\t\t$artist = Profile::find(Auth::user()->profile_id);\n\t\t\t$video_data['video'] = $deliver_videos;\n\t\t\t$video_data['artist'] = $artist;\n //return view('frontend.my_video',$video_data);\n\t\t\treturn view('frontend.artistDashboard.edit_video',$video_data); \n\t\t}else{\n\t\t\treturn redirect('/login');\n\t\t}\n\t}else{\n\t\treturn redirect('/login'); \n\t} \n\n}", "public function edit($id)\n {\n $video = Video::findOrFail($id);\n return view('admin.videos.edit', compact('video'));\n }", "public function edit($id)\n {\n $title = 'Video Management';\n\n $video = Video::where('id_video', $id)->first();\n\n $category = Categories::all();\n\n return view('video::edit')->withVideo($video)->withCategory($category)->withTitle($title);\n }", "public function delete_from_cache($id,$request,$filename) {\n if (!empty($id))\n $find[\"id\"]=(int)$id;\n if (!empty($request))\n $find[\"request\"]=$request;\n if (!empty($filename))\n $find[\"storage\"]=$filename;\n $video=$this->db->get_row(\"videos\",$find);\n unlink($video[\"storage\"]);\n $this->db->delete_row(\"videos\",array(\"id\"=>$video[\"id\"]));\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' =>'required',\n ]);\n\n $post = Video::find($id);\n$ext = $request->file('file')->extension();\n\n $filename = str_random(10) . '.' .$ext;\n\n\n if($request->file('file') != null){ unlink(public_path().'/uploads/video/' . $post->file);}\n\n\n $path = $request->file('file')->storeAs('/uploads/video/',$filename);\n\n$post->title = $request->get(\"title\");\n $post->file = $filename; \n$post->save(); \n \n\n return redirect()->route('video.index');\n }", "public function destroy($id)\n {\n $video=Video::where('id',$id)->first();\n $convertedVideos=ConvertedVideo::where('video_id',$id)->get();\n\n foreach ($convertedVideos as $convertedVideo) {\n Storage::delete([\n $convertedVideo->mp4_Format_240,\n $convertedVideo->mp4_Format_360,\n $convertedVideo->mp4_Format_480,\n $convertedVideo->mp4_Format_720,\n $convertedVideo->mp4_Format_1080,\n $convertedVideo->webm_Format_240,\n $convertedVideo->webm_Format_360,\n $convertedVideo->webm_Format_480,\n $convertedVideo->webm_Format_720,\n $convertedVideo->webm_Format_1080,\n $video->image_path,\n ]);\n }\n\n $video->delete();\n\n return back()->with('success','The video has been deleted successfully');\n }", "public function update(Request $request, $id)\n {\n //\n $validator = Validator::make(\n $request->all(), \n [\n 'title' => 'required', ],\n [\n 'title.required' => 'メールアドレスが間違っています。',\n ]\n );\n if(strtotime($request->start_date) > strtotime($request->end_date)) {\n $validator->after(function ($validator) {\n $validator->errors()->add('end_date.format', '終了日が開始日より大きい');\n });\n }\n if ($validator->fails()) {\n return back()\n ->withErrors($validator)\n ->withInput();\n }\n\n $data = $request->all();\n // dd($data);\n unset($data['_token']);\n unset($data['thumbnail']);\n unset($data['thumbnail_detail']);\n unset($data['banner']);\n unset($data['video']);\n unset($data['slider']);\n unset($data['_method']);\n if(@$data['related'][0]) {\n $data['related_videos_1'] = @$data['related'][0];\n }else{\n $data['related_videos_1'] = 0;\n }\n if(@$data['related'][1]) {\n $data['related_videos_2'] = @$data['related'][1];\n }else{\n $data['related_videos_2'] = 0;\n }\n if(@$data['related'][2]) {\n $data['related_videos_3'] = @$data['related'][2];\n }else{\n $data['related_videos_3'] = 0;\n }\n unset($data['related']);\n $rs = Video::find($id)->update($data);\n if($rs) {\n $vd = Video::find($id);\n if($request->thumbnail){\n $thumbnail_u = $vd->thumbnail;\n $thumbnail_u = str_replace('/storage/app/', '', $thumbnail_u);\n $path = '/storage/app/'.@$request->file('thumbnail')->store('TVpro/images');\n $vd->thumbnail = $path;\n $vd->save();\n Storage::delete($thumbnail_u);\n }\n if($request->thumbnail_detail){\n $thumbnail_detail_u = $vd->thumbnail_detail;\n $thumbnail_detail_u = str_replace('/storage/app/', '', $thumbnail_detail_u);\n $path = '/storage/app/'.@$request->file('thumbnail_detail')->store('TVpro/images');\n $vd->thumbnail_detail = $path;\n $vd->save();\n Storage::delete($thumbnail_detail_u);\n }\n\n if($request->banner){\n $banner_u = $vd->banner;\n $banner_u = str_replace('/storage/app/', '', $banner_u);\n $path = '/storage/app/'.@$request->file('banner')->store('TVpro/images');\n $vd->banner = $path;\n $vd->save();\n Storage::delete($banner_u);\n }\n \n if($request->video_edit){\n if($vd->video != \"\"){\n $rmf = 1;\n }else{\n $rmf = 0;\n }\n $video_u = '/var/www/html'.$vd->video;\n $video_u = str_replace('/playlist.m3u8', '', $video_u);\n\n $folder = md5(date('Y-m-d H:i:s:u'));\n $store_p = 'TVpro/videos/'.$folder.'/';\n\n $path_up = '/storage/app/'.@$request->file('video_edit')->store($store_p);\n $path = '/storage/app/TVpro/videos/'.$folder.'/playlist.m3u8';\n $video = str_replace('/storage/app/TVpro/videos/'.$folder.'/', '' , $path_up);\n $video = str_replace('/', '' , $video);\n $video = str_replace($folder, '' , $video);\n // \n $cd = '/var/www/html/storage/app/'.$store_p;\n chmod($cd, 0777);\n $command = 'cd '.$cd.' ; /usr/local/bin/bin/ffmpeg -y -i '.$video.' -r 25 -g 25 -c:a libfdk_aac -b:a 128k -c:v libx264 -preset veryfast -b:v 1600k -maxrate 1600k -bufsize 800k -s 640x360 -c:a libfdk_aac -vbsf h264_mp4toannexb -flags -global_header -f ssegment -segment_list playlist.m3u8 -segment_list_flags +live-cache -segment_time 5 output-%04d.ts; sudo chmod -R 777 '.$cd;\n if($rmf==1){\n $command = $command.'; rm -rf '.$video_u;\n }\n // $command = 'cd '.$cd.' ; /usr/local/bin/bin/ffmpeg -y -i '.$video.' -r 25 -g 25 -c:a libfdk_aac -b:a 128k -c:v libx264 -preset veryfast -b:v 1600k -maxrate 1600k -bufsize 800k -s 640x360 -c:a libfdk_aac -vbsf h264_mp4toannexb -flags -global_header -f ssegment -segment_list playlist.m3u8 -segment_list_flags +live-cache -segment_time 5 output-%04d.ts; sudo chmod -R 777 '.$cd.'; rm -rf '.$video_u;\n exec($command.\" 2>&1\", $output);\n\n $vd = Video::find($id)->update(['video'=> $path]);\n // $vd->video = $path;\n // $vd->save();\n\n }\n if($request->pdf){\n $pdf_u = $vd->pdf;\n $pdf_u = str_replace('/storage/app/', '', $pdf_u);\n $path = '/storage/app/'.@$request->file('pdf_edit')->store('TVpro/pdf');\n $vd->pdf = $path;\n $vd->save();\n Storage::delete($pdf_u);\n }\n\n if($request->slider){\n $slid = Slider::where('video_id', $id)->get();\n if(count($slid)) {\n foreach ($slid as $key => $value) {\n $slider_u = $value->slider;\n $slider_u = str_replace('/storage/app/', '', $slider_u);\n Storage::delete($slider_u);\n }\n }\n Slider::where('video_id', $id)->delete();\n foreach (@$request->slider as $key => $image) {\n $image = '/storage/app/'.$image->store('TVpro/images');\n Slider::insert([\n 'video_id'=>$id,\n 'image'=>$image\n ]);\n }\n }\n\n return redirect(route('push.videos.index'));\n }else{\n return back();\n }\n }", "public function update(Request $request, $id)\n {\n //dd($request);\n $video = Video::find($id);\n\n if($video){\n $video->vimeo_id = $request['vimeo_id'];\n $video->vimeo_id_pt = $request['vimeo_id_pt'];\n $video->vimeo_id_en = $request['vimeo_id_en'];\n $video->title_pt = $request['title_pt'];\n $video->title_en = $request['title_en'];\n $video->subtitle_pt = $request['subtitle_pt'];\n $video->subtitle_en = $request['subtitle_en'];\n $video->main_preview_html_pt = $request['main_preview_html_pt'];\n $video->main_preview_html_en = $request['main_preview_html_en'];\n $video->title_box_pt = $request['title_box_pt'];\n $video->title_box_en = $request['title_box_en'];\n $video->poster_pt = $request['poster_pt'];\n $video->poster_en = $request['poster_en'];\n $video->thumb_pt = $request['thumb_pt'];\n $video->thumb_en = $request['thumb_en'];\n $video->category_pt = $request['category_pt'];\n $video->category_en = $request['category_en'];\n $video->specs_pt = $request['specs_pt'];\n $video->specs_en = $request['specs_en'];\n $video->caption_pt = $request['caption_pt'];\n $video->caption_en = $request['caption_en'];\n $video->edition_id = $request['edition_id'];\n $video->video_program_id = $request['video_program_id'];\n $video->order = $request['order'];\n \n $video->save();\n\n return redirect()->route('video.index', ['id' => $request['edition_id']])\n ->with('success', 'Vídeo alterado com sucesso!');\n }\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 edit($video_type)\n {\n //\n $tipoVideo = VideoType::findOrFail($video_type);\n \n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = usermoodle::where('id', $user_id)->first();\n\n return view('admin.videotype.edit', compact('tipoVideo', 'usuario'));\n }", "function remove_video_thumbs($vdetails)\r\n{\r\n global $cbvid;\r\n return $cbvid->remove_thumbs($vdetails);\r\n}", "public function update($id)\n {\n // DB::table('video_uploaded')\n // ->where ('id')\n // ->update(['video_type'=>$request['video_type'],'video_url'=>$request['video_url'], 'price'=>$request['price'], 'video'=>$request['video']\n // ]); \n // return view('reg/video_list');\n }", "function deleteVideoBought($userId, $idVideo, $connection)\n{\n $query = \"DELETE FROM video_buy_idVideos\n WHERE id_user = '$userId'\n AND id_video = '$idVideo'\";\n $result = mysqli_query($connection, $query);\n if ($result) {\n echo '<script language=\"javascript\">alert(\"L\\'abbonamento a questo video è stato cancellato\")</script>';\n }\n}", "public function deletePlaylistVideosAction()\n {\n\t\t$userSession\t= new Container('fo_user');\n\t\t$request\t\t= $this->getRequest();\n\t\tif(!isset($userSession->userSession['_id']) || trim($userSession->userSession['_id']) == '') {\n\t\t\techo \"-1\";\n\t\t\tdie();\n\t\t}\n\t\tif($request->isPost()) {\n\t\t\t$formData\t= $request->getPost();\n\t\t\tif(isset($formData['id']) && trim($formData['id']) != '') {\n\t\t\t\t$result\t= $this->deletePlaylistVideo($formData);\n\t\t\t\techo \"1\";\t//\tSuccess\n\t\t\t} else {\n\t\t\t\techo \"0\";\t//\timproper request\n\t\t\t}\n\t\t} else {\n\t\t\techo \"0\";\t//\timproper request\n\t\t}\n\t\treturn $this->getResponse();\n }", "public function deleteVideo() {\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\n $result['message'] = 'Xóa video thất bại!';\n $result['type'] = 'error';\n // Create FTP\n $this->load->library('ftp');\n $config['hostname'] = IP_CLOUDSERVER;\n $config['username'] = USER_CLOUDSERVER;\n $config['password'] = PASS_CLOUDSERVER;\n $config['port'] = PORT_CLOUDSERVER; \n $config['debug'] = FALSE;\n $this->ftp->connect($config);\n $this->load->model('videos_model');\n\n #Create folder\n $pathImage = 'media/images/content/';\n $path = '/public_html/media/images/content';\n $dir_image = $this->session->userdata('sessionUsername');\n $dir = date('dmY');\n $iVideoId = $this->input->post('iVideoId');\n\n $aVideos = $this->videos_model->get(\"*\",'id = '.$iVideoId);\n if(isset($aVideos[0]) && !empty($aVideos[0])) {\n $oVideo = $aVideos[0];\n $this->videos_model->delete($iVideoId,'id',false);\n $this->ftp->delete_file('/public_html/video/'.$oVideo->name);\n $this->ftp->delete_file('/public_html/video/thumbnail/'.$oVideo->thumbnail);\n $this->ftp->delete_file('/public_html/video/thumbnail/thumbnail_1_'.$oVideo->thumbnail);\n }\n \n $result['message'] = 'Xóa video thành công!';\n $result['type'] = 'success';\n\n echo json_encode($result);\n die();\n }", "public function edit($id)\n {\n $edit = true;\n $video = Video::findOrFail($id);\n $time = $video->publish_at;\n// $isPm = $time->hour >= 12? true: false;\n\n $video->showTime = $time->day . '/' . $time->month . '/' . $time->year . ' ' . $time->hour . ':' . $time->minute;\n return view('admin.videos.show', compact(['edit', 'video']));\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'headline'=>'required',\n 'video'=>'mimes:mp4,mov,ogg',\n 'description'=>'required',\n ]);\n\n $abt_com=AboutCompany::find($id);\n $video_prev=$abt_com->video;\n\n $headline=$request->input('headline');\n $description=$request->input('description');\n\n if($request->hasFile('video')){\n\n unlink($video_prev);\n $video = $request->file('video');\n $destinationPath = 'video/home/aboutCompany/';\n $originalFile = $video->getClientOriginalName();\n $uniqueName = time().$originalFile;\n $video->move($destinationPath, $uniqueName);\n $originalPath = $destinationPath.$uniqueName;\n\n $data=array(\n 'headline'=>$headline,\n 'description'=>$description,\n 'video'=>$originalPath,\n );\n AboutCompany::where('id',$id)->update($data);\n session()->flash('update', 'Successfully updated');\n return redirect('/about_company');\n }\n\n else{\n $data=array(\n 'headline'=>$headline,\n 'description'=>$description\n \n );\n\n AboutCompany::where('id',$id)->update($data);\n session()->flash('update', 'Successfully updated');\n return redirect('/about_company');\n \n }\n\n\n }", "public function deleteAction(Tx_Youtubeapi_Domain_Model_Video $video) {\n\t\t$this->videoRepository->remove($video);\n\t\t$this->flashMessageContainer->add('Your Video was removed.');\n\t\t$this->redirect('index');\n\t}", "public function edit($id)\n {\n $sl = Video::find($id);\n return view('admin.video.edit', compact('sl'));\n }", "public function deleteVideo($id)\n {\n try {\n $udpated=VideoContent::where('ID',(int) $id)->update(['status' => false]);\n\n if ($udpated) {\n $response = APIResponse('200', 'Video has been deleted successfully.');\n } else {\n $response = APIResponse('201', 'Something went wrong, please try again.');\n }\n } catch (\\Throwable $e) {\n $response = APIResponse('201', $e->getMessage());\n }\n return $response;\n }", "private function deactivateVideo()\n {\n try\n {\n $request = $_POST;\n\n global $cbvid;\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n else \n $uid = userid();\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video Id not provided\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n $videoid = $request['videoid'];\n\n $vdetails = $cbvid->get_video_details($videoid);\n\n if(!isset($vdetails['videoid']))\n throw_error_msg(\"video does not exist\");\n\n if($vdetails['userid']!=$uid && !has_access('admin_access',true) )\n throw_error_msg(\"you have not rights to activate this video\");\n\n $cbvid->action('deactivate',$videoid);\n\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => \"video has been deactivated successfully\");\n $this->response($this->json($data));\n }\n else\n {\n throw_error_msg(\"There was some thing wrong to deactivate video\"); \n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function edit($id)\n {\n $user = Auth::user();\n $video = Videos::findOrFail($id);\n\n return view('pages.painel.editar.videos.index', compact('user', 'video'));\n }", "public function video(){\n\t\t$data=array();\n\t\t$this->load->view('administrador/admin_video',$data);\n\t}", "public function addVideo(){\n if (isset($_POST[\"add_video\"])) {\n $movie = $this->model('Movie');\n $system = $this->model('System');\n\n $video_name = $_POST[\"video_title\"];\n $video_url = $_POST[\"video_url\"];\n $video_category = $_POST[\"selected_category\"];\n $video_description = $_POST[\"video_description\"];\n $video_sef_url = $system->seflink($video_name);\n\n $movie->addVideo($video_name,$video_url,$video_category,$video_description,$video_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/videos');\n }", "public function edit($id)\n\t{\n return View::make('videos.edit');\n\t}", "public function destroy($id)\n {\n $video = Video::where('id_video', $id);\n //dd($video);\n\n if(!$video->delete()){\n $data = [\n 'status' => 2,\n 'message' => 'Fail Update Data'\n ];\n }else{\n $data = [\n 'status' => 1,\n 'message' => 'Success Update Data'\n ];\n }\n\n return json_encode($data);\n }", "public function videosphere_edit_delete(Request $request, $videosphere_id) {\n\n if ($videosphere_id == null) {\n abort(404);\n }\n\n try {\n $videosphere = Videosphere::where('id', $videosphere_id)->firstOrFail();\n } catch (ModelNotFoundException $e) {\n abort(404);\n }\n\n try {\n $genericFile = GenericFile::where('id', $videosphere->file_id)->firstOrFail();\n } catch (ModelNotFoundException $e) {\n abort(404);\n }\n\n $uri = $genericFile->uri;\n\n File::delete($uri);\n\n $videosphere->delete();\n $genericFile->delete();\n\n return response()->json(['status' => 'success', 'videosphere_id' => $videosphere_id]);\n }", "public function update(Request $request, Video $video)\n {\n //\n }", "public function update(Request $request, Video $video)\n {\n //\n }", "public function update($id, VideoRequest $request)\n {\n $video = Video::findOrFail($id);\n if($request->file('video') && $request->file('video')->isValid()){\n @unlink(base_path().'/public/upload/videos/'.$video->video);\n $vidName = 'video'.time().'.'.$request->file('video')->getClientOriginalExtension();\n $video->video = $vidName;\n $request->file('video')->move(base_path().'/public/upload/videos',$vidName);\n }\n $video->title = $request->get('title');\n $video->description = $request->get('description');\n $video->save();\n Session::flash('flash_message','Video Updated!');\n return redirect('admin/videos');\n \n }", "public function edit($id)\n {\n //\n $channels = Channel::pluck('title','id');\n $video = Video::with(['slider'])\n ->where('id',$id)\n ->first();\n // dd($video);\n $val = [];\n $val[] = $video->related_videos_1;\n $val[] = $video->related_videos_2;\n $val[] = $video->related_videos_3;\n $valj = json_encode($val);\n // dd($video);\n $videos = Video::where('channel_id', $video->channel_id)->where('id','<>',$video->id)->pluck('title','id');\n if($video->type==1){\n return view('Push::videos.edit', compact(['channels','video', 'videos','valj']));\n }elseif($video->type==2){\n return view('Push::videos.editpdf', compact(['channels','video', 'videos','valj']));\n }else{\n return view('Push::videos.editslider', compact(['channels','video', 'videos','valj']));\n } \n }", "public function edit($id)\n {\n $video = Video::find($id);\n\n return view('Admin.Videos.edit')\n ->with('video',$video);\n }", "function deleteallvideos()\n\t{\n\t\t$obj = new clsdbaccess();\n\t\t$mysqli = $obj->db_connect();\t\t\t\n\t\tif(!($stmt = $mysqli->prepare(\"DELETE FROM videoinventory\"))){\n\t\t\techo \"Prepare failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\t\t\n\t\tif(!$stmt->execute()){\n\t\t\techo \"Execute failed: \" . $mysqli->connect_errno . \" \" . $mysqli->connect_error;\n\t\t}\t\t\t\t\n\t\t$stmt->fetch();\t\t\n\t}" ]
[ "0.7388208", "0.73701775", "0.73647755", "0.73647755", "0.71583915", "0.7045595", "0.69015956", "0.67832226", "0.67685986", "0.6701937", "0.6693719", "0.6625152", "0.6597354", "0.65410125", "0.65278876", "0.65186405", "0.64987296", "0.64841425", "0.64774865", "0.6437365", "0.64226574", "0.6420191", "0.64081925", "0.6392976", "0.63888556", "0.63784176", "0.6374432", "0.63721156", "0.63655883", "0.6357728", "0.6341981", "0.63410777", "0.6327933", "0.63253564", "0.6309532", "0.6309458", "0.62988234", "0.6289605", "0.6287757", "0.628093", "0.62502754", "0.6244589", "0.6243808", "0.6243782", "0.6241916", "0.6237142", "0.62177247", "0.6192901", "0.6184475", "0.6171533", "0.61660784", "0.6162045", "0.61517096", "0.6149609", "0.61405474", "0.6113201", "0.60933304", "0.6081271", "0.6080713", "0.606679", "0.6057295", "0.6051021", "0.6048981", "0.6045068", "0.60275626", "0.60200745", "0.6017739", "0.6014896", "0.6008141", "0.60065025", "0.6000259", "0.59936327", "0.5990861", "0.5986567", "0.5983914", "0.5978832", "0.59744114", "0.5968134", "0.59668696", "0.5964817", "0.59617096", "0.5960831", "0.59591514", "0.5958266", "0.5956075", "0.5938868", "0.59375685", "0.59365", "0.5934622", "0.5918335", "0.5916136", "0.5914362", "0.59109396", "0.59068185", "0.5901784", "0.5901784", "0.5898264", "0.58912057", "0.58770496", "0.5876098" ]
0.64933693
17
/edit nutrition Function for view form
public function editnutration($id) { $dietPlan = false; if((Auth::check()) && (Auth::user()->is_admin == 1)){ $nutration = Nutration::find($id); $categories = NutrationCategory::all(); if(($nutration->nutration_categorys_id) && ($nutration->is_seven == 1)){ $nutration = SevenDayPlan::where('nutration_id',$id)->first(); $dietPlan = true; return view('admin.editsevenddays')->with('nutration',$nutration)->with('NutrationCategory',$categories)->with('dietplan',$dietPlan)->with('id',$id); } /*$isFoodplan = $workout->nutration_categorys_id; if($isFoodplan){ $workout = SevenDayPlan::where('nutration_id',$id)->first(); }*/ return view('admin.editnutration')->with('nutration',$nutration)->with('NutrationCategory',$categories)->with('dietplan',$dietPlan)->with('id',$id); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit($id)\n {\n $entry = Nutrition::find($id);\n return view('modify', ['entry'=>$entry]);\n }", "public function edit(gestionnaire $gestionnaire)\n {\n //\n }", "function get_form_edit(){\n\t\t\tif($this->check_session->user_session() && $this->check_session->get_level()==1){\n\t\t\t\t$kode_unit \t= form_prep($this->input->post('kode_unit'));\n\t\t\t\t$data['result_unit'] = $this->unit_model->get_unit($kode_unit);\n\t\t\t\t$this->load->view('form_edit_unit_',$data);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tshow_404('page');\n\t\t\t}\n\t\t}", "public function editnutritionalelements($id)\n\n {\n\n\t\tif($this->uri->segment(3)==\"\")\n\n\t\t{\n\n\t\t\t$this->session->set_flashdata('err_msg', 'Dont Change the URL physically'); \n\n\t\t\tredirect('admin/recipe/viewnutritionalelements');\t\n\n\t\t}\n\n\t\t\n\n\t\tif ($this->input->server('REQUEST_METHOD') == 'POST')\n\n\t\t{\n\n \n\n\t $data['name']= strip_tags($this->input->post('name'));\n\n\t\t\t$name=strip_tags($this->input->post('slug'));\n\n\t\t\t$data['slug'] = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $name)));\n\n\t\t\t$data['description']= strip_tags($this->input->post('description'));\n\n\t\t\t$data['status']= strip_tags($this->input->post('status'));\n\n \n\n \n\n\t\t\t $this->form_validation->set_rules('name', 'Name', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('description', 'Description', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('slug', 'Slug', 'trim|required');\n\n \n\n if ($this->form_validation->run() == TRUE) {\n\n $data_inserted = $this->Nutritional_elements_model->edit_data($data,$id);\n\n $this->session->set_flashdata('success_msg', 'Nutritional edited Successfully'); \n\n redirect('admin/recipe/viewnutritionalelements');\t\n\n }\n\n\t\t}\n\n\t\t\n\n\t\t\n\n\t\t$site_name=$this->config->item('site_name');\n\n\t $this->template->set('title', 'Edit Nutritional | '.$site_name);\n\n\t\t$data_single = $this->Nutritional_elements_model->get_data_by_id($id);\n\n\t\t$data['nutritional']=$data_single ;\n\n\t\t//print_r($data_single);die();\n\n $this->template->set_layout('layout_main', 'front');\n\n $this->template->build('editnutritionalelements',$data);\n\n }", "public function postEdit(){\n\t\n\t\t$tax = Tax::find(Input::get('id') );\n\n\t\treturn View::make('tax.edit')\n\t\t\t->with('id', $tax->id)\n\t\t\t->with('name', $tax->name)\n\t\t\t->with('rate', $tax->rate);\n\t}", "public function edit( )\r\n {\r\n //\r\n }", "function edit($situation_id)\n { \n // check if the situation exists before trying to edit it\n $data['situation'] = $this->Situation_model->get_situation($situation_id);\n \n if(isset($data['situation']['situation_id']))\n {\n $this->load->library('form_validation');\n\n\t\t\t$this->form_validation->set_rules('quartier_sid','Quartier Sid','required');\n\t\t\n\t\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t\t'quartier_sid' => $this->input->post('quartier_sid'),\n\t\t\t\t\t'intitule' => $this->input->post('intitule'),\n\t\t\t\t\t'avenue_sid' => $this->input->post('avenue_sid'),\n\t\t\t\t\t'cellule_sid' => $this->input->post('cellule_sid'),\n\t\t\t\t\t'date_jour_situation' => $this->input->post('date_jour_situation'),\n\t\t\t\t\t'date_created' => $this->input->post('date_created'),\n\t\t\t\t\t'last_update' => $this->input->post('last_update'),\n\t\t\t\t\t'contenu_situation' => $this->input->post('contenu_situation'),\n );\n\n $this->Situation_model->update_situation($situation_id,$params); \n redirect('situation/index');\n }\n else\n {\n\t\t\t\t$this->load->model('Quartier_model');\n\t\t\t\t$data['all_quartiers'] = $this->Quartier_model->get_all_quartiers();\n\n $data['_view'] = 'situation/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The situation you are trying to edit does not exist.');\n }", "public function edit(Rental $rental)\n {\n //\n }", "public function edit() {\n\t\t\t\n\t\t}", "function a_edit() {\n\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t$u=new Gestionnaire($id);\n\t\textract($u->data);\t\n\t\trequire $this->gabarit;\n\t}", "public function edit(Nurse $nurse)\n {\n //\n }", "public function edit(Territory $territory)\n {\n //\n }", "function edit($ordon_id)\n { \n // check if the ordonance exists before trying to edit it\n $data['ordonance'] = $this->Ordonance_model->get_ordonance($ordon_id);\n \n if(isset($data['ordonance']['ordon_id']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t\t'malade_noms' => $this->input->post('malade_noms'),\n 'malade_age' => $this->input->post('malade_age'),\n \n 'malade_telephone' => $this->input->post('malade_telephone'),\n\t\t\t\t\t'ordonance_numero' => $this->input->post('ordonance_numero'),\n\t\t\t\t\t'ordonance_date' => $this->input->post('ordonance_date'),\n\t\t\t\t\t'nom_medecin' => $this->input->post('nom_medecin'),\n 'spec_medecin' => $this->input->post('spec_medecin'),\n\t\t\t\t\t'ordonance_details' => $this->input->post('ordonance_details'),\n );\n\n $this->Ordonance_model->update_ordonance($ordon_id,$params); \n redirect('ordonance/index');\n }\n else\n {\n\n $data['_view'] = 'ordonance/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The ordonance you are trying to edit does not exist.');\n }", "public function editNutrationCategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = NutrationCategory::find($id);\n return view('admin.editnutrationcategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function edit_testimonials_form(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect('admin');\n\t\t}else {\n\t\t\t$this->data['heading'] = 'Edit Contact';\n\t\t\t$testimonials_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('id' => $testimonials_id);\n\t\t\t$this->data['testimonials_details'] = $this->review_model->get_all_details(TESTIMONIALS,$condition);\n\t\t\tif ($this->data['testimonials_details']->num_rows() == 1){\n\t\t\t\t$this->load->view('admin/testimonials/edit_testimonials',$this->data);\n\t\t\t}else {\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t}\n\t}", "function showApprentice() {\n\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\n\t\t\t\t\t$editForm = new h2o('views/editApprentice.html');\n\t\t\t\t\techo $editForm->render(compact('apprentice'));\n\t\t\t\t}", "public function edit()\n {\n \n \n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit(Gestionnaire $gestionnaire)\n {\n //\n }", "public function edit(Insurance $insurance)\n {\n //\n }", "public function edit()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $data = array(\n 'title' => 'edit',\n 'tacgia' => $tacgia\n );\n\n // Load view\n $this->view->load('tacgias/edit', $data);\n }", "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 editSpecialist($cat_id)\n {\n\n $specialistData = DB::table('specialists')\n ->join('departments', 'specialists.department_id', '=', 'departments.id')\n ->select('specialists.*', 'departments.name as deptName', 'departments.id as catID')\n /*->get();*/\n ->where('specialists.id',$cat_id)\n ->first();\n\n $editSpecialist=view('admin.specialist_edit')\n ->with('specialistData',$specialistData);\n\n return view('admin.master')\n ->with('main_content',$editSpecialist);\n\n return Redirect::to('/specialists');\n }", "public function edit()\n\t{\n\t\t\n\t}", "public function edit(Penduduk $penduduk)\n {\n //\n }", "public function edit(Penduduk $penduduk)\n {\n //\n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n \n }", "public function edit()\n {\n //\n }", "public function edit(IceTax $iceTax)\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n //\n }", "public function edit()\n {\n \n }", "public function edit(Town $town)\n {\n //\n }", "public function edit() {\n }", "public function edit(Talent $talent)\n {\n //\n }", "public function postEdit(){\n return view(\"admin.product.edit\" );\n }", "public function edit_exercise($Et_id)\n {\n \n\n $data_exercise['data_exercise'] = DB::table('Exercise_type')->where('Et_id',$Et_id)->get();\n \n \n return view('/e_exercise',$data_exercise);\n // return view('/efood',$data_type);\n \n }", "public function edit(kartustok $kartustok)\n {\n //\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function edit()\n {\n }", "public function showEdit()\n {\n\n }", "public function edit(Income $income)\n {\n //\n }", "public function editAction() {}", "public function edit(Requisition $requisition)\n {\n //\n }", "public function getEdit(){\n return view(\"admin.product.edit\" );\n }", "public function edit(Frequencia $frequencia)\n {\n //\n }", "public function edit($id)\n {\n $row=CompanyRepresentative::find($id);\n $company=Company::all();\n $data=Representative::all();\n return view('admin.company.representative.update', ['company'=>$company, 'data'=>$data, 'row'=>$row]);\n }", "public function edit()\n { \n }", "public function Edit()\n\t{\n\t\t\n\t}", "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(Corporate $corporate)\n {\n //\n }", "public function edit($id)\n {\n $data=CompanyRepresentative::find($id);\n $rep=representative::all();\n return view('frontend.dashboard.representative.update', ['data'=>$data, 'rep'=>$rep]);\n\n }", "public function edit() {\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($id)\n {\n //\n //find record of given id\n $edit_form = Assignatory::find($id);\n\n if($edit_form->kind == 'R'){\n $records = Assignatory::all()->where('kind', '=', 'R');\n }elseif ($edit_form->kind == 'AA') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'AA');\n }elseif ($edit_form->kind == 'C') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'C');\n }elseif ($edit_form->kind == 'A') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'A');\n }\n \n $dept = Office::all();\n \n\n //show edit form and pass the info to it\n return View('signatory.editsignatory', compact('edit_form','records','dept')); \n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit()\n {\n\n }", "public function edit(Expense $expense)\n {\n //\n }", "public function edit(Expense $expense)\n {\n //\n }", "public function edit(DaomniInfluentialcoupons $daomniInfluentialcoupons)\n {\n //\n }", "public function editingredients($id)\n\n {\n\n\t\tif($this->uri->segment(3)==\"\")\n\n\t\t{\n\n\t\t\t$this->session->set_flashdata('err_msg', 'Dont Change the URL physically'); \n\n\t\t\tredirect('admin/recipe/viewingredients');\t\n\n\t\t}\n\n\t\t\n\n\t\tif ($this->input->server('REQUEST_METHOD') == 'POST')\n\n\t\t{\n\n \n\n\t $data['name']= strip_tags($this->input->post('name'));\n\n\t\t\t$name=strip_tags($this->input->post('slug'));\n\n\t\t\t$data['slug'] = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $name)));\n\n\t\t\t$data['description']= strip_tags($this->input->post('description'));\n\n\t\t\t$data['status']= strip_tags($this->input->post('status'));\n\n \n\n \n\n\t\t\t $this->form_validation->set_rules('name', 'Name', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('description', 'Description', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('slug', 'Slug', 'trim|required');\n\n \n\n if ($this->form_validation->run() == TRUE) {\n\n $data_inserted = $this->Ingredients_model->edit_data($data,$id);\n\n $this->session->set_flashdata('success_msg', 'Ingredient edited Successfully'); \n\n redirect('admin/recipe/viewingredients');\t\n\n }\n\n\t\t}\n\n\t\t\n\n\t\t\n\n\t\t$site_name=$this->config->item('site_name');\n\n\t $this->template->set('title', 'Edit Ingredients | '.$site_name);\n\n\t\t$data_single = $this->Ingredients_model->get_data_by_id($id);\n\n\t\t$data['ingredients']=$data_single ;\n\n\t\t//print_r($data_single);die();\n\n $this->template->set_layout('layout_main', 'front');\n\n $this->template->build('editingredients',$data);\n\n }", "public function edit(Renta $renta)\n {\n //\n }", "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 }", "function edit(){\n\t\t$arr = $this->uri->uri_to_assoc(3);\n\t\t$data['arr'] = $arr['id'];\n\t\t\n\t\t/* membuat value */\n\t\t$this->user->setID($arr['id']);\n\n\t\t/* fungsi ambil data */\n\t\t$result = $this->user->ambil_data();\n\n\t\t/* data dropdown */\n\t\t$data['role'] = role_dropdown();\n\t\t$data['result'] = $result;\n\n\t\t/* load view */\n\t\t$this->template->write_view('edit', $data);\n\t}", "public function getEditForm();", "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 edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n\t\t\t\ttry {\n\t\t\t\t\t$edit = Ingredient::findOrFail($id);\n\t\t\t\t\t$units = Unit::orderBy('name')->get();\n\t\t\t\t\treturn view('ingredient.edit', compact('edit', 'units'));\n\t\t\t\t} catch (\\Exception $th) {\n\t\t\t\t\treturn redirect()->back();\n\t\t\t\t}\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function edit(Prescription $prescription)\n {\n\n }", "public function edit($id,$pendview)\n {\n // get the nerd\n Session::put('citycode', $id);\n $city = City::find($id);\n $countries = Country::lists('countryname', 'id');\n $states = State::lists('statename', 'id');\n\n // show the edit form and pass the nerd\n return view('city.edit')\n ->with('countries', $countries)\n ->with('states', $states)\n ->with('pendview', $pendview)\n ->with('city', $city);\n }", "public function editAction(){\n\t\t$recipe = new Recipe();\n\t\t\n\t\t//updating the meal\n\t\tif ($this->_request->isPost()) {\n\t\n\t\t\t$data = $this->_validateRecipe();\n\t\t\t//if no errors validating fields add recipe\n\t\t\tif ($this->view->errorMsg == null) {\n\t\t\t\t$recipe_id = $this->_request->getPost('recipe_idTF');\n\t\t\t\t\n\t\t\t\t//make sure recipe with this name does not already exist\n\t\t\t\t$where = array(\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('user_id = ?', $this->session->user_id),\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('recipe_id != ?', $recipe_id),\n\t\t\t\t\t$recipe->getAdapter()->quoteInto('title = ?', $data['recipe']['title']),\n\t\t\t\t\t'status is null'\n\t\t\t\t); \n\t\t\t\t$recipe_row = $recipe->fetchRow($where);\n\t\t\t\tif($recipe_row != null){\n\t\t\t\t\t$this->view->errorMsg = 'Meal \"'.$data['recipe']['title'].'\" already exists, please use a different title.';\n\t\t\t\t\t$data['recipe']['recipe_id'] = $recipe_id;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t//update recipe\n\t\t\t\t\t$where = $recipe->getAdapter()->quoteInto('recipe_id = ?', $recipe_id);\n\t\t\t\t\t$recipe->update($data['recipe'], $where);\n\t\n\t\t\t\t\t//delete old recipexquantityxingredients\n\t\t\t\t\t$rxqxi = new RecipexQuantityxIngredient();\n\t\t\t\t\t$where = $rxqxi->getAdapter()->quoteInto('recipe_id = ?', $recipe_id);\n\t\t\t\t\t$rxqxi->delete($where);\n\t\t\t\t\t\n\t\t\t\t\t$this->_saveRecipexQuantityxIngredient($recipe_id, $data);\n\t\t\n\t\t\t\t\t//if successful, redirect to main page\n\t\t\t\t \t$this->_redirect($this->baseUrl.'/meals');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t$this->view->recipe_data = $data;\t\t\n\t\t}\n\t\t//get meal to display in edit form\n\t\telse{\n\t\t\t$filter = new Zend_Filter_StripTags();\n\t\t\t$id = trim($filter->filter($this->_request->getQuery('id')));\n\t\t\tif($id != null){\n\t\t\t\t$where = $recipe->getAdapter()->quoteInto('recipe_id = ?', $id);\n\t\t\t\t$row = $recipe->fetchRow($where);\n\t\t\n\t\t\t\t$data = $this->_getRecipe($row);\n\t\t\t\t$this->view->recipe_data = $data;\n\t\t\n\t\t\t}\n\t\t}\n\t\n\n\t\t//populate amounts and ingredients for autocomplete textfields (COPY&PASTE = YUCK!)\n \t$ingredient_arr = array();\n \t$ingredient = new Ingredient();\n\t\t$ingredient_rs = $ingredient->fetchAll();\n\t\t$i = 0;\n\t\twhile($ingredient_rs->valid()){\n\t\t\t$ingredient = $ingredient_rs->current();\n\t\t\t$ingredient_arr[$i] = $ingredient->name;\n\t\t\t$i++;\n\t\t\t$ingredient_rs->next();\n\t\t}\n \t$this->view->ingredient_data = $ingredient_arr;\n\t\n \t$amount_arr = array();\n \t$quantity = new Quantity();\n\t\t$quantity_rs = $quantity->fetchAll();\n\t\t$i = 0;\n\t\twhile($ingredient_rs->valid()){\n\t\t\t$amount = $quantity_rs->current();\n\t\t\tif($amount->measure != null) $amount_arr[$i] = $this->_convertd2f($amount->amount).' '.$amount->measure;\n\t\t\telse $amount_arr[$i] = $amount->amount;\n\t\t\t$i++;\n\t\t\t$quantity_rs->next();\n\t\t}\n \t$this->view->amount_data = $amount_arr;\n \t\n \t\n \t\n \t// additional view fields required by form\n\t\t$this->view->action = 'edit';\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t$this->render('add');\n }", "public function edit(ChooseUs $chooseUs)\n {\n //\n }", "function editdata($id) {\r\n $data['unitofarea'] = $this->myspidey_unitofarea_model->get_unitofarea($id);\r\n\r\n\r\n $this->load->view('myspidey_unitofarea/edit', $data);\r\n }", "public function edit(Testimonial $testimonial)\n {\n //\n }", "public function edit($id)\n {\n $contest = Contest::find($id);\n $contestShows = Show::all();\n $gratifications = Gratification::selectRaw('CONCAT(grat_name, \"-\", quantity) as grat, id')->lists('grat', 'id');\n return view('contests.edit', array('contest' => $contest, 'contestShows' => $contestShows, 'gratifications' => $gratifications));\n }", "public function edit($id)\n {\n $testimonial=Testimonial::findOrFail($id);\n return view('backend.testimonial.edit')->with('testimonial',$testimonial);\n }", "public function annimalEditAction()\n {\n }", "public function edit(Huisarts $huisarts)\n {\n //\n }", "public function editarmiperfil()\n {\n return view('formularios.formulariousuario');\n }", "public function edit(Truck $truck)\n { $suppliers = Supplier::all();\n return view ('admin.trucks.edit',compact('truck','suppliers'));\n }", "public function edit(Prescription $prescription)\n {\n //\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}" ]
[ "0.7154243", "0.6891006", "0.68758917", "0.679723", "0.6782807", "0.6697209", "0.6695456", "0.6683639", "0.66821104", "0.6679249", "0.667714", "0.66561234", "0.6627897", "0.6614566", "0.6607163", "0.6603681", "0.6599527", "0.6594065", "0.6594065", "0.6593316", "0.65847224", "0.65768164", "0.6575938", "0.6575935", "0.6537204", "0.6530785", "0.6519766", "0.6519766", "0.6498023", "0.6498023", "0.6498023", "0.6497854", "0.6497492", "0.64946836", "0.64946836", "0.64946836", "0.64946836", "0.64946836", "0.64946836", "0.64946836", "0.64946836", "0.64946836", "0.64946836", "0.64946836", "0.64946836", "0.6484015", "0.6481466", "0.64752007", "0.6458454", "0.64400506", "0.64124566", "0.6406109", "0.6405908", "0.6405908", "0.6405908", "0.6401851", "0.64003485", "0.6397233", "0.639636", "0.63939846", "0.6393712", "0.6393342", "0.6392083", "0.6389172", "0.637186", "0.63708955", "0.6370276", "0.63593453", "0.63514686", "0.63480943", "0.6345414", "0.6345414", "0.6345414", "0.6345414", "0.634344", "0.634344", "0.6340406", "0.6340248", "0.6331525", "0.6320836", "0.6296309", "0.6292807", "0.6287273", "0.62872565", "0.6284006", "0.6282892", "0.628121", "0.6280244", "0.62771237", "0.6273162", "0.6272814", "0.62723815", "0.6268887", "0.6267025", "0.6266891", "0.62587804", "0.62558246", "0.62492627", "0.62464863", "0.6241622" ]
0.68616873
3
/edit nutrition Function for update data
public function updatenutration(Request $request) { //dd($request); $id = $request->id; //if diet plan for seven days if($request->foodplanDays == '7'){ $this->validate($request,array( 'title' => 'required', 'nutration_description1' => 'required', 'nutration_description2' => 'required', 'nutration_description3' => 'required', 'nutration_description4' => 'required', 'nutration_description5' => 'required', 'nutration_description6' => 'required', 'nutration_description7' => 'required' )); $nutration = Nutration::find($id); $nutration->title = $request->title; $nutration->nutration_description = $request->nutration_description1; $nutration->is_seven = 1; $nutration->nutration_categorys_id = 2; if ($request->hasFile('proteinimage')) { $file = $request->file('proteinimage'); $filename = time().'.'.$file->getClientOriginalName(); /*$location = public_path('file/'.$filename); Storage::put($filename,file_get_contents($file));*/ $location = public_path('file/'.$filename); Storage::disk('file')->put($filename, file_get_contents($file)); //Storage::disk('public')->put($filename, file_get_contents($file)); $nutration->nutration_image = $filename; } $nutration->save(); $nutrationId = $nutration->id; $sevenDaysData = SevenDayPlan::where('nutration_id',$id)->first(); if(!empty($sevenDaysData)){ $sevenDaysData->nutration_id = $nutrationId; $sevenDaysData->title = $request->title; $sevenDaysData->first = $request->nutration_description1; $sevenDaysData->second = $request->nutration_description2; $sevenDaysData->third = $request->nutration_description3; $sevenDaysData->fourth = $request->nutration_description4; $sevenDaysData->fifth = $request->nutration_description5; $sevenDaysData->sixth = $request->nutration_description6; $sevenDaysData->seventh = $request->nutration_description7; } else{ $sevenDaysData = new SevenDayPlan; $sevenDaysData->nutration_id = $nutrationId; $sevenDaysData->title = $request->title; $sevenDaysData->first = $request->nutration_description1; $sevenDaysData->second = $request->nutration_description2; $sevenDaysData->third = $request->nutration_description3; $sevenDaysData->fourth = $request->nutration_description4; $sevenDaysData->fifth = $request->nutration_description5; $sevenDaysData->sixth = $request->nutration_description6; $sevenDaysData->seventh = $request->nutration_description7; } if ($request->hasFile('proteinimage')) { $file = $request->file('proteinimage'); $filename = time().'.'.$file->getClientOriginalName(); /*$location = public_path('file/'.$filename); Storage::put($filename,file_get_contents($file));*/ $location = public_path('file/'.$filename); Storage::disk('file')->put($filename, file_get_contents($file)); //Storage::disk('public')->put($filename, file_get_contents($file)); $sevenDaysData->image = $filename; } if($sevenDaysData->save()){ return redirect()->back()->with('success','Nutration updated successfully.'); } else{ return redirect()->back()->with('danger','Nutration is not updated.'); } } else{ $this->validate($request,array( 'title' => 'required', 'nuCategory' => 'required', 'nutration_description' => 'required', )); $nutration = Nutration::find($id); $nutration->title = $request->title; $nutration->nutration_description = $request->nutration_description; $nutration->nutration_categorys_id = $request->nuCategory; $nutration->is_seven = 0; if ($request->hasFile('proteinimage')) { $file = $request->file('proteinimage'); $filename = time().'.'.$file->getClientOriginalName(); /*$location = public_path('file/'.$filename); Storage::put($filename,file_get_contents($file));*/ $location = public_path('file/'.$filename); Storage::disk('file')->put($filename, file_get_contents($file)); //Storage::disk('public')->put($filename, file_get_contents($file)); $nutration->nutration_image = $filename; } if($nutration->save()){ return redirect()->back()->with('success','Nutration updated successfully.'); } else{ return redirect()->back()->with('denger-success','Nutration is not updated.'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdateSuperfund()\n {\n }", "public function addNutritionalBenefit(){\n \t$id = $this->formValueForKey(\"nutritionalBenefitSelection\");\n \n \t$foundNutritionalBenefit = BLGenericRecord::recordMatchingKeyAndValue(\"NutritionalBenefit\", \"id\", $id);\n \t$this->currentRecipe()->addNutritionalBenefit($foundNutritionalBenefit);\n }", "abstract public function updateData();", "function Specialities_Update(){\n\t\t\n\t\t//when click on button\n\t\tif(isset($_POST['updatesp'])){\n\t\t\t\n\t\t\t\t// get id move to variable\n\t\t\t$get_id = $_GET['Edit'];\n\t\t\t\n\t\t\t//values for Specialities table\n\t\t\t$values = \"specialitie_name='\".$_POST['sp'].\"'\";\n\t\t\t\n\t\t // update Specialities from table\n\t\t $this->Update('specialities',$values,\"where id='$get_id'\",'Specialities?m');\n\t\t} // ifisset close\n\t}", "public function editnutration($id)\n {\n $dietPlan = false;\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $nutration = Nutration::find($id);\n $categories = NutrationCategory::all();\n if(($nutration->nutration_categorys_id) && ($nutration->is_seven == 1)){\n $nutration = SevenDayPlan::where('nutration_id',$id)->first(); \n $dietPlan = true;\n return view('admin.editsevenddays')->with('nutration',$nutration)->with('NutrationCategory',$categories)->with('dietplan',$dietPlan)->with('id',$id);\n }\n /*$isFoodplan = $workout->nutration_categorys_id;\n if($isFoodplan){\n $workout = SevenDayPlan::where('nutration_id',$id)->first();\n }*/\n return view('admin.editnutration')->with('nutration',$nutration)->with('NutrationCategory',$categories)->with('dietplan',$dietPlan)->with('id',$id);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function editRent($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$rent = $this->modify(mysqli_real_escape_string($conn, $data['rent']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\tif(empty($rent)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[0-9]+$/\", $rent)) {\n\t\t\t\t\tif($this->length($rent, 8, 3)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', 'post_rent', $rent, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function update_data($data_update_item) {\n\t}", "public function taxupdate() {\n $arr['page'] = 'taxdetail';\n\t\t$arr['active'] = 'other';\n\t\t$arr['productTax'] = $this->setting->getTax('product');\n\t\t$arr['shippingTax'] = $this->setting->getTax('shipping');\n\t\t$this->load->view('vwSettingTax',$arr);\n\t}", "public function update(DataRequest $request, $id)\n {\n $entry = Nutrition::find($id);\n $entry->school_name = $request->input('school_name');\n $entry->address = $request->input('address');\n $entry->city = $request->input('city');\n $entry->postal_code = $request->input('postal_code');\n $entry->school_board = $request->input('school_board');\n $entry->school_id = $request->input('school_id');\n $entry->breakfast = $request->input('breakfast');\n $entry->lunch = $request->input('lunch');\n $entry->snack = $request->input('snack');\n $entry->hidden = $request->input('hidden');\n $entry->save();\n session()->flash('message', \"Entry #$id has been successfully modified\");\n return redirect(url(''));\n }", "function update_insurance($data)\n\t{\n\t\tglobal $db, $cid, $ins_id;\n\n\t\t// Now we update this row\n\t\t$sql = \"UPDATE \". GARAGE_INSURANCE_TABLE .\"\n\t\t\tSET business_id = '\".$data['business_id'].\"', premium = '\".$data['premium'].\"', cover_type = '\".$data['cover_type'].\"', comments = '\".$data['comments'].\"' \n\t\t\tWHERE id = '$ins_id' and garage_id = '$cid'\";\n\n\t\tif(!$result = $db->sql_query($sql))\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could Not Update Insurance Premium', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\treturn;\n\t}", "public function update_with($new_data)\n {\n }", "public function updateNutrationCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n 'tips' => 'required',\n ));\n $id = $request->id;\n $nutrationCategory = NutrationCategory::find($id);\n $nutrationCategory->nutration_category_name = $request->name;\n $nutrationCategory->tips = $request->tips;\n $nutrationCategory->save();\n Session::flash('success','Nutration Category Updated succcessfully.');\n return redirect()->back()->with('workout',$nutrationCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function update($p_merchant_name, $p_merchant_email, $p_tax_govt, $p_tax_service)\n {\n $result_update = false;\n \n // format\n $p_merchant_name = sanitizeNoTags($p_merchant_name);\n $p_merchant_email = sanitizeEmail(sanitizeNoTags($p_merchant_email));\n $p_tax_govt = sanitizeFloat($p_tax_govt);\n $p_tax_service = sanitizeFloat($p_tax_service);\n \n // set\n $p_tax_govt = number_format(($p_tax_govt/100), 2);\n $p_tax_service = number_format(($p_tax_service/100), 2);\n\n // set\n $arr_vars = array(\n 'MERCHANT_NAME' => $p_merchant_name,\n 'MERCHANT_EMAIL' => $p_merchant_email,\n 'TAX_GOVT' => $p_tax_govt,\n 'TAX_SERVICE' => $p_tax_service\n );\n \n // connect to database \n parent::connect();\n \n while(list($key,$value) = each($arr_vars))\n {\n if ($value != '')\n {\n // update\n $result = parent::dataUpdate($key, $value); \n }\n \n $key = '';\n $value = '';\n }\n \n // disconnect from database\n parent:: disconnect();\n \n $result_update = '1';\n \n return $result_update; \n }", "function update_tender_basic_details($tndr_id,$mgo_ref,$dos_ref,$vote_id,$item_id,$quantity,$unit,$tndr_open){\n\t\t$query = \"UPDATE tbl_tender_basic_details SET vote_id='$vote_id',item_id='$item_id',quantity='$quantity',unit_type_id='$unit',tndr_open_date='$tndr_open' WHERE tender_id='$tndr_id'\";\n $query_result = $this->mDbm->setData($query);\n return $query_result;\n }", "public function updateMultiple_data()\n {\n \n }", "function index_g_and_o_update(){\n\t\t$this->load->model('Da_evs_set_form_g_and_o','dsfg');\n\t\t$index_level = $this->input->post(\"index_level\"); // index level of G&O form\n\t\t$index_ranges = $this->input->post(\"index_ranges\"); // indeax range of G&O form\n\t\t$pos_id = $this->input->post(\"pos_id\"); //position id\n\t\t$year_id = $this->input->post(\"year_id\"); //year id\n\t\t\n\t\t$this->dsfg->sfg_pay_id = $year_id;\n\t\t$this->dsfg->sfg_index_level = $index_level;\n\t\t$this->dsfg->sfg_index_ranges = $index_ranges;\n\t\t$this->dsfg->sfg_pos_id = $pos_id;\n\t\t$this->dsfg->update();\n\n\t}", "public function update()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_POST['id']);\n $tacgia->anh = $_POST['anh'];\n $tacgia->ten = $_POST['ten'];\n $tacgia->thongtin = $_POST['thongtin'];\n $tacgia->update();\n\n go_back();\n }", "public function editnutritionalelements($id)\n\n {\n\n\t\tif($this->uri->segment(3)==\"\")\n\n\t\t{\n\n\t\t\t$this->session->set_flashdata('err_msg', 'Dont Change the URL physically'); \n\n\t\t\tredirect('admin/recipe/viewnutritionalelements');\t\n\n\t\t}\n\n\t\t\n\n\t\tif ($this->input->server('REQUEST_METHOD') == 'POST')\n\n\t\t{\n\n \n\n\t $data['name']= strip_tags($this->input->post('name'));\n\n\t\t\t$name=strip_tags($this->input->post('slug'));\n\n\t\t\t$data['slug'] = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $name)));\n\n\t\t\t$data['description']= strip_tags($this->input->post('description'));\n\n\t\t\t$data['status']= strip_tags($this->input->post('status'));\n\n \n\n \n\n\t\t\t $this->form_validation->set_rules('name', 'Name', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('description', 'Description', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('slug', 'Slug', 'trim|required');\n\n \n\n if ($this->form_validation->run() == TRUE) {\n\n $data_inserted = $this->Nutritional_elements_model->edit_data($data,$id);\n\n $this->session->set_flashdata('success_msg', 'Nutritional edited Successfully'); \n\n redirect('admin/recipe/viewnutritionalelements');\t\n\n }\n\n\t\t}\n\n\t\t\n\n\t\t\n\n\t\t$site_name=$this->config->item('site_name');\n\n\t $this->template->set('title', 'Edit Nutritional | '.$site_name);\n\n\t\t$data_single = $this->Nutritional_elements_model->get_data_by_id($id);\n\n\t\t$data['nutritional']=$data_single ;\n\n\t\t//print_r($data_single);die();\n\n $this->template->set_layout('layout_main', 'front');\n\n $this->template->build('editnutritionalelements',$data);\n\n }", "function update($units, $total){}", "public function Do_update_Example1(){\n\n\t}", "function editTypeOfRent($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$tOFr = $this->modify(mysqli_real_escape_string($conn, $data['tOFr']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\tif(empty($tOFr)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-z ]+$/i\", $tOFr)) {\n\t\t\t\t\tif($this->length($tOFr, 25, 3)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', 'post_type_of_Rent', $tOFr, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set Origen='$this->Origen',Fechap='$this->Fechap',Horap='$this->Horap',Cod_Referencia='$this->Referencia',Nombre_Referencia='$this->Nombre',Ref_Tela='$this->Reftela',Pinta='$this->Pinta',Color='$this->Color',Proceso='$this->Proceso',Ubicacion='$this->Ubicacion',SKU='$this->Sku',Maquina='$this->Maquina',Longitud_Inicial='$this->Longitudini',Longitud_Final='$this->Longitudfin',Peso='$this->Peso',Grados_PFoAT800K='$this->Plancha',Grados_Plato='$this->Plato',Grados_Pie='$this->Pie',Grados_Aire_S='$this->Airesup',Grados_Aire_I='$this->Aireinf',Caudal_Sup='$this->Caudalsup',Caudal_Inf='$this->Caudalinf',Presion='$this->Presion',Velocidad='$this->Velocidad',Velocidad_Sup='$this->Velocidad_Sup',Velocidad_Inf='$this->Velocidad_Inf',Intensidad='$this->Intensidad',Tiempo_Exp='$this->Tiempo',Resultado='$this->Resultado',Dinamometro='$this->Dinamometro',Observaciones1='$this->Observaciones' where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "function _edit_update() {\n\t\t$tpaket = $_POST;\n\t\tunset($tpaket['tpaket_header']['id_tpaket_header']);\n\t\tunset($tpaket['button']);\n\t\t// end of assign variables and delete not used variables\n\n\t\t$count = count($tpaket['tpaket_detail']['id_tpaket_h_detail']) - 1;\n\n\t\t// check, at least one product quantity entered\n\t\t$quantity_exist = FALSE;\n\n\t\tfor($i = 1; $i <= $count; $i++) {\n\t\t\tif(empty($tpaket['tpaket_detail']['quantity'][$i])) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$quantity_exist = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif($quantity_exist == FALSE)\n\t\t\tredirect('tpaket/edit_error/Anda belum memasukkan data detail. Mohon ulangi');\n\n \tif(isset($_POST['button']['save']) || isset($_POST['button']['approve'])) {\n\n\t\t\t$this->db->trans_start();\n\n \t\t\t$this->session->set_userdata('tpaket_detail', $tpaket['tpaket_detail']);\n\n $id_tpaket_header = $this->uri->segment(3);\n $postingdate = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);\n\n \t\t\t$data = array (\n \t\t\t\t'id_tpaket_header' => $id_tpaket_header,\n \t\t\t\t'posting_date' => $postingdate,\n \t\t\t);\n\t\t\t\t/*$sirah= $id_tpaket_header;\n\t\t\t\t$ti=\"SELECT * FROM t_tpaket_detail_paket WHERE id_tpaket_header='$sirah'\";\n\t\t\t\t$tq=mysql_query($ta);\n\t\t\t\t$count1=mysql_num_rows($tq);*/\n \t\n\t\t\t $this->m_tpaket->tpaket_header_update($data);\n $edit_tpaket_header = $this->m_tpaket->tpaket_header_select($id_tpaket_header);\n\n \t\t\tif ($this->m_tpaket->tpaket_header_update($data)) {\n $input_detail_success = FALSE;\n \t\t\t if($this->m_tpaket->tpaket_details_delete($id_tpaket_header) && $this->m_tpaket->batch_delete($id_tpaket_header) ) {\n \t//\tfor($i = 1; $i <= $count; $i++) {\n \t\t\t\t\tif((!empty($tpaket['tpaket_detail']['quantity'][$i]))&&(!empty($tpaket['tpaket_detail']['material_no'][$i]))) {\n\n \t\t\t\t\t\t/*$tpaket_detail['id_tpaket_header'] = $id_tpaket_header;\n \t\t\t\t\t\t$tpaket_detail['quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n \t\t\t\t\t\t$tpaket_detail['id_tpaket_h_detail'] = $tpaket['tpaket_detail']['id_tpaket_h_detail'][$i];\n\n \t\t\t\t\t\t$tpaket_detail['material_no'] = $tpaket['tpaket_detail']['material_no'][$i];\n \t\t\t\t\t\t$tpaket_detail['material_desc'] = $tpaket['tpaket_detail']['material_desc'][$i];\n \t\t\t\t\t\t$tpaket_detail['uom'] = $tpaket['tpaket_detail']['uom'][$i];*/\n\n $tpaket_to_approve['item'][$i] = $tpaket_detail['id_tpaket_h_detail'];\n $tpaket_to_approve['material_no'][$i] = $tpaket_detail['material_no'];\n $tpaket_to_approve['quantity'][$i] = $tpaket_detail['quantity'];\n $tpaket_to_approve['uom'][$i] = $tpaket_detail['uom'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t//\n\t\t\t\t\t\t$tpaket_detail['id_tpaket_header'] = $id_tpaket_header;\n\t\t\t\t\t\t$batch['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t$tpaket_detail['quantity'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$tpaket_detail['qty'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$batch['Quantity'] = $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t$tpaket_detail['id_tpaket_h_detail'] = 1;\n\t\t\t\t\t\t$batch['BaseLinNum'] = 1;\n \t\t\t\t\t\t$tpaket_detail['material_no'] = $tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$batch['ItemCode'] = $tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$item=$tpaket['tpaket_detail']['material_no'];\n\t\t\t\t\t\t$date=date('ymd');\n\t\t\t\t\t\t$whs=$this->session->userdata['ADMIN']['plant'];\n\t\t\t\t\t\t$q=\"SELECT * FROM m_batch WHERE ItemCode = '$item' AND Whs ='$whs'\";\n\t\t\t\t\t\t$cek=\"SELECT BATCH,MAKTX FROM m_item WHERE MATNR = '$item'\";\n\t\t\t\t\t\t$cek1=mysql_query($cek);\n\t\t\t\t\t\t$ra=mysql_fetch_array($cek1);\n\t\t\t\t\t\t$b=$ra['BATCH'];\n\t\t\t\t\t\t$tq=mysql_query($q);\n\t\t\t\t\t\t$count1=mysql_num_rows($tq) + 1;\n\t\t\t\t\t\tif ($count1 > 9 && $count1 < 100)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dg=\"0\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$dg=\"00\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$num=$item.$date.$dg.$count1;\n\t\t\t\t\t\tif ($count1 < 2)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$batch['BatchNum'] = $num;\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$batch['BaseType'] = 4;\n\t\t\t\t\t\t$tpaket_detail['num'] = $num;\n\t\t\t\t\t\t$batch['Createdate'] = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);\n \t\t\t\t\t\t$tpaket_detail['material_desc'] = $ra['MAKTX'];\n \t\t\t\t\t\t$tpaket_detail['uom'] = $tpaket['tpaket_detail']['uom'][1];\n\t\t\t\t\t\tif ($b=='Y')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t$batch_in=$this->m_tpaket->batch_insert($batch);\n\t\t\t\t\t\t\tif ($count1 < 2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tmysql_query(\"INSERT INTO m_batch () VALUES ('$item','$num','$batch[Quantity]','$whs')\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t/*\t$batch['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t$batch['Quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n\t\t\t\t\t\t$batch['BaseLinNum'] = $tpaket['tpaket_detail']['id_tpaket_h_detail'][$i];\n \t\t\t\t\t\t$batch['ItemCode'] = $tpaket['tpaket_detail']['material_no'][$i];\n\t\t\t\t\t\t$batch['BatchNum'] = $tpaket['tpaket_detail']['num'][$i];\n\t\t\t\t\t\t$batch['BaseType'] = 4;\n\t\t\t\t\t\t$batch['Createdate'] = $this->l_general->str_to_date($tpaket['tpaket_header']['posting_date']);*/\n\n if($id_tpaket_detail = $this->m_tpaket->tpaket_detail_insert($tpaket_detail)) {\n /* if($item_pakets = $this->m_mpaket->mpaket_details_select_by_item_paket($tpaket_detail['material_no'])) {\n if($item_pakets !== FALSE) {\n \t\t$k = 1;\n unset($item_paket);\n \t\tforeach ($item_pakets->result_array() as $object['temp']) {\n \t\t\tforeach($object['temp'] as $key => $value) {\n \t\t\t\t$item_paket[$key][$k] = $value;\n \t\t\t}\n \t\t\t$k++;\n \t\t\tunset($object['temp']);\n \t\t}\n \t }*/\n\t\t\t\t\t\t\t\t\t// echo \"$batch[BaseEntry],$batch[Quantity],$batch[BaseLinNum],$batch[ItemCode],$batch[BatchNum],$b <br>\";\n\t\t\t\t\t//\techo $tpaket_detail['id_tpaket_header'].\",\".$tpaket_detail['quantity'].\",\".$tpaket_detail['material_no'].\",\".$tpaket_detail['num'];\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t// $c_item_paket = count($item_paket['id_mpaket_h_detail']);\n \t\t\tfor($i = 1; $i <= $count; $i++) {\n $tpaket_detail_paket['id_tpaket_h_detail_paket'] = $i;\n\t\t\t\t\t\t\t $batch1['BaseLinNum'] =$i;\n $tpaket_detail_paket['id_tpaket_detail'] = $id_tpaket_detail;\n $tpaket_detail_paket['id_tpaket_header'] = $id_tpaket_header;\n\t\t\t\t\t\t\t $batch1['BaseEntry'] = $id_tpaket_header;\n\t\t\t\t\t\t\t $batch1['BaseType'] = 4;\n\t\t\t\t\t\t\t $batch1['ItemCode'] = $tpaket['tpaket_detail']['material_detail'][$i];\n\t\t\t\t\t\t\t $qq=\"SELECT * FROM m_batch WHERE ItemCode = '$batch1[ItemCode]' AND Whs ='$whs'\";\n\t\t\t\t\t\t\t $cekQQ=mysql_query($qq);\n\t\t\t\t\t\t\t $rQ=mysql_num_rows($cekQQ);\n\t\t\t\t\t\t\t $num_detail=$tpaket['tpaket_detail']['num'][$i];\n\t\t\t\t\t\t\t $date=date('ymd');\n\t\t\t\t\t\t\t $cekq=\"SELECT BATCH,MAKTX FROM m_item WHERE MATNR = '$batch1[ItemCode]'\";\n\t\t\t\t\t\t\t $cekr=mysql_query($cekq);\n\t\t\t\t\t\t\t $rai=mysql_fetch_array($cekr);\n\t\t\t\t\t\t\t $tpaket_detail_paket['material_desc'] = $rai['MAKTX'];\n\t\t\t\t\t\t\t $bet=$ra['MAKTX'];\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t $batch1['Createdate'] =$batch['Createdate'] ;\n $tpaket_detail_paket['material_no_paket'] = $tpaket_detail['material_no'];\n $tpaket_detail_paket['material_no'] = $tpaket['tpaket_detail']['material_detail'][$i];\n\t\t\t\t\t\t\t $tpaket_detail_paket['material_desc'] = $item_paket['material_desc'][$i];\n $tpaket_detail_paket['quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n\t\t\t\t\t\t\t $batch1['Quantity'] = $tpaket['tpaket_detail']['quantity'][$i];\n $tpaket_detail_paket['uom'] = $tpaket['tpaket_detail']['detail_uom'][$i];\n\t\t\t\t\t\t\t $tpaket_detail_paket['num'] = $num_detail;\n\t\t\t\t\t\t\t $tpaket_detail_paket['quantity_total'] = $tpaket['tpaket_detail']['quantity'][$i] * $tpaket['tpaket_detail']['qty'][1];\n\t\t\t\t\t\t\t if ($num_detail != \"\" && $bet == 'Y')\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t $batch1['BatchNum'] = $num_detail;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t else\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t \t\t$count1=$rQ + 1;\n\t\t\t\t\t\t\t\t\t\tif ($count1 > 9 && $count1 < 100)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$dg=\"0\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse \n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$dg=\"00\";\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$num=$batch1['ItemCode'].$date.$dg.$count1;\n\t\t\t\t\t\t\t\t\t\t\t$batch1['BatchNum'] = $num;\n\t\t\t\t\t\t\t\t\t\t\tmysql_query(\"INSERT INTO m_batch () VALUES ('$batch1[ItemCode]','$batch1[BatchNum]','$batch1[Quantity]','$whs')\");\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// echo \"$batch1[BaseEntry],$batch1[Quantity],$batch1[BaseLinNum],$batch1[ItemCode],$batch1[BatchNum],$b <br>\";\n\t\t\t\t\t\t\t if ($batch1['Quantity'] != \"\" && $bet=='Y')\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->m_tpaket->batch_insert($batch1);\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 if($this->m_tpaket->tpaket_detail_paket_insert($tpaket_detail_paket)) {\n $input_detail_success = TRUE;\n \t\t\t\t\t } else {\n $input_detail_success = FALSE; } } }\n \n \t else {\n $input_detail_success = FALSE;\n\t\t\t\t\t\t\t\t //echo \"aaaaaaaaaaaaaaaaa\";\n \t}\n// \t\t\t\t\t\tif($this->m_tpaket->tpaket_detail_insert($tpaket_detail))\n// $input_detail_success = TRUE;\n \t\t\t\t\t}\n\n \t \t//}\n }\n }\n\n\t\t\tif (($input_detail_success == TRUE) && (isset($_POST['button']['approve']))) {\n $internal_order = $this->m_tpaket->tpaket_internal_order_select();\n $tpaket_to_approve['plant'] = $edit_tpaket_header['plant'];\n $tpaket_to_approve['internal_order'] = $internal_order['internal_order'];\n $tpaket_to_approve['storage_location'] = $this->session->userdata['ADMIN']['storage_location'];\n $tpaket_to_approve['posting_date'] = date('Ymd',strtotime($edit_tpaket_header['posting_date']));\n $tpaket_to_approve['id_tpaket_header'] = $id_tpaket_header;\n $tpaket_to_approve['plant'] = $edit_tpaket_header['plant'];\n $tpaket_to_approve['id_tpaket_plant'] = $edit_tpaket_header['id_tpaket_plant'];\n $tpaket_to_approve['id_user_input'] = $this->session->userdata['ADMIN']['admin_id'];\n $tpaket_to_approve['web_trans_id'] = $this->l_general->_get_web_trans_id($edit_tpaket_header['plant'],$edit_tpaket_header['posting_date'],\n $edit_tpaket_header['id_tpaket_plant'],'17');\n\t\t\t/* $approved_data = $this->m_tpaket->sap_tpaket_header_approve($tpaket_to_approve);\n \t\t\tif((!empty($approved_data['material_document'])) && ($approved_data['material_document'] !== '') &&\n (!empty($approved_data['material_document_out'])) && ($approved_data['material_document_out'] !== '')) {\n \t\t\t $tpaket_no = $approved_data['material_document'];\n \t\t\t $tpaket_no_out = $approved_data['material_document_out'];*/\n \t\t\t\t$data = array (\n \t\t\t\t\t'id_tpaket_header'\t=>$id_tpaket_header,\n \t\t\t\t\t'material_doc_no'\t=>\t$tpaket_no,\n \t\t\t\t\t'material_doc_no_out'\t=>\t$tpaket_no_out,\n \t\t\t\t\t'status'\t=>\t'2',\n \t\t\t\t\t'id_user_approved'\t=>\t$this->session->userdata['ADMIN']['admin_id'],\n \t\t\t\t);\n \t\t\t\t$tpaket_header_update_status = $this->m_tpaket->tpaket_header_update($data);\n \t\t\t\t $approve_data_success = TRUE;\n\t\t\t\t/*} else {\n\t\t\t\t $approve_data_success = FALSE;\n\t\t\t\t}*/\n }\n\n \t\t\t$this->db->trans_complete();\n if(isset($_POST['button']['save'])) {\n if ($input_detail_success == TRUE) {\n \t\t\t $this->l_general->success_page('Data Transaksi Paket berhasil diubah', site_url('tpaket/browse'));\n } else {\n \t\t\t $this->jagmodule['error_code'] = '006'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Transaksi Paket tidak berhasil diubah', site_url($this->session->userdata['PAGE']['next']));\n }\n } else if(isset($_POST['button']['approve']))\n if($approve_data_success == TRUE) {\n \t\t\t $this->l_general->success_page('Data Transaksi Paket berhasil diapprove', site_url('tpaket/browse'));\n } else {\n \t\t $this->jagmodule['error_code'] = '007'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Transaksi Paket tidak berhasil diapprove.<br>\n Pesan Kesalahan dari sistem SAP : '.$approved_data['sap_messages'], site_url($this->session->userdata['PAGE']['next']));\n }\n\n\t\t}\n\t}", "function Avi_Update(){\n\t\t\n\t\t\n\t\t//when click on button\n\t\tif(isset($_POST['avibtnupdate'])){\n\t\t\t\n\t\t\t//move id into variable\n\t\t\t$get_id = $_GET['Edit'];\n\t\t\t\n\t\t\t//values for table \n\t\t\t$values = \"monday='\".$_POST['monstart'].\" - \".$_POST['monend'].\"',tuesday='\".$_POST['tustart'].\" - \".$_POST['tuend'].\"',wednesday='\".$_POST['wedstart'].\" - \".$_POST['wedend'].\"',thursday='\".$_POST['thustart'].\" - \".$_POST['thuend'].\"',friday='\".$_POST['fristart'].\" - \".$_POST['friend'].\"',saturday='\".$_POST['satstart'].\" - \".$_POST['satend'].\"',sunday='\".$_POST['sunstart'].\" - \".$_POST['sunend'].\"',user_id='\".$_POST['doctor'].\"',date=NOW()\";\n\t\t\t\n\t\t\t//Update From Avialibalility table\n\t\t\t$this->Update('availability',$values,\" where id='$get_id' \",'Availability?List&m');\n\t\t\t\n\t\t\t\n\t\n\t\t} // ifisset close\n\t\t\n\t}", "private function update($cat){\r\n\t\tif(!$this->acceptUpdates) return;//do not allow health coach to change answers\r\n\t\tif(!isset($this->categories[$cat])) throw new Exception(\"Invalid category\");\r\n\r\n\t\t$sql=\"UPDATE `u_mod_ifocus` SET \";\r\n\t\t$comma=false;\r\n\t\tforeach($this->data[$cat] as $key=>$value){\r\n\t\t\tif($comma) $sql.=\" , \";\r\n\t\t\t$sql.=\"`\".$key.\"`='\".$this->dbOb->escape_string($value).\"'\";\r\n\t\t\t$comma=true;\r\n\t\t}\r\n\t\tif(!$comma) return; //cant update a section we have no data for\r\n\t\tif(!$this->id) return; //can't update a record we haven't loaded\r\n\r\n\t\t$sql .= \", last_completed = '\" . $cat . \"'\";\r\n\r\n\t\tif($cat==\"biometric_data\"){\r\n\t\t\tif(!$this->isCompleted()) $sql.=\", date_completed=NOW() \";\r\n\t\t\t//upon completion reward points for Health Assessment Questions\r\n\t\t\t$im=new IncentivePointsModel();\r\n\t\t\tif($this->data[\"preventative_health\"][\"q12\"]==1){\r\n\t\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"FluShot\");\r\n\t\t\t}\r\n\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"Complete\");\r\n\t\t}\r\n\r\n\t\t$sql .= \" ,date_updated=NOW() WHERE id = '\" . $this->data['id'] . \"'\";\r\n\t\t$this->dbOb->update($sql);\r\n\t}", "function update(){\n\t\t\t\t$servername = \"localhost\";\n\t\t\t\t$username = \"root\";\n\t\t\t\t$password = \"\";\n\t\t\t\t$dbname = \"CS230\";\n\t\t\t\t//Variables for holding entity data\n\t\t\t\t$i = $_POST['i'];\n\t\t\t\t$cr = $_POST['creator'];\n\t\t\t\t$ti = $_POST['title'];\n\t\t\t\t$ty = $_POST['type'];\n\t\t\t\t$id = $_POST['identifier'];\n\t\t\t\t$da = $_POST['date'];\n\t\t\t\t$la = $_POST['language'];\n\t\t\t\t$de = $_POST['description'];\n\t\t\t\t$conn = mysqli_connect($servername, $username, $password, $dbname);\n\t\t\t\t\tif($conn){\n\t\t\t\t\t//echo \"Connection OK\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\tdie(\"The Connection has failed: \" .mysqli_connect_error());\n\t\t\t\t\t}\n\t\t\t\t$sql = \"UPDATE eBook_MetaData SET creator='$cr', title='$ti', type='$ty', identifier='$id', date='$da', language='$la', description='$de' WHERE id='$i'\";\n\t\t\t\t\t$data = mysqli_query($conn, $sql);\n\n\t\t\t\t\tif(!$data){\n\t\t\t\t\t\techo \"error\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo \"data updated\";\n\t\t\t\t\t}\t\n\t\t\t\t\n\t\t\t\t$conn = null;\n\t\t\t\t}", "public function actionUpdate() {}", "public function actionUpdate() {}", "function ciniki_recipes_recipeUpdate(&$ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'recipe_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Recipe'), \n 'name'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Name'), \n 'primary_image_id'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Image'),\n 'num_servings'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Number of Servings'), \n 'webflags'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Web Flags'), \n 'prep_time'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Prep Time'), \n 'roast_time'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Roast Time'), \n 'cook_time'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Cook Time'), \n 'synopsis'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Synopsis'), \n 'description'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Description'), \n 'ingredients'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Ingredients'), \n 'instructions'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Instructions'), \n 'notes'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Notes'), \n 'tag-10'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Meals'),\n 'tag-20'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Ingredients'),\n 'tag-30'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Cuisines'),\n 'tag-40'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Methods'),\n 'tag-50'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Occasions'),\n 'tag-60'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Diets'),\n 'tag-70'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Seasons'),\n 'tag-80'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Collections'),\n 'tag-90'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Products'),\n 'tag-100'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'delimiter'=>'::', 'name'=>'Contributors'),\n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n\n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'recipes', 'private', 'checkAccess');\n $rc = ciniki_recipes_checkAccess($ciniki, $args['tnid'], 'ciniki.recipes.recipeUpdate'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n if( isset($args['name']) ) {\n $args['permalink'] = preg_replace('/ /', '-', preg_replace('/[^a-z0-9 ]/', '', strtolower($args['name'])));\n //\n // Make sure the permalink is unique\n //\n $strsql = \"SELECT id, name, permalink FROM ciniki_recipes \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND permalink = '\" . ciniki_core_dbQuote($ciniki, $args['permalink']) . \"' \"\n . \"AND id <> '\" . ciniki_core_dbQuote($ciniki, $args['recipe_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.recipes', 'recipe');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num_rows'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.recipes.16', 'msg'=>'You already have a recipe with this name, please choose another name'));\n }\n }\n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.recipes');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Update the recipe\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n $rc = ciniki_core_objectUpdate($ciniki, $args['tnid'], 'ciniki.recipes.recipe', \n $args['recipe_id'], $args);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the tags\n //\n $tag_types = array(\n '10'=>'meals',\n '20'=>'mainingredients',\n '30'=>'cuisines',\n '40'=>'methods',\n '50'=>'occasions',\n '60'=>'diets',\n '70'=>'seasons',\n '80'=>'collections',\n '90'=>'products',\n '100'=>'contributors',\n );\n foreach($tag_types as $tag_type => $arg_name) {\n if( isset($args['tag-' . $tag_type]) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'tagsUpdate');\n $rc = ciniki_core_tagsUpdate($ciniki, 'ciniki.recipes', 'tag', $args['tnid'],\n 'ciniki_recipe_tags', 'ciniki_recipe_history',\n 'recipe_id', $args['recipe_id'], $tag_type, $args['tag-' . $tag_type]);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.recipes');\n return $rc;\n }\n }\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.recipes');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'recipes');\n\n return array('stat'=>'ok');\n}", "function update_food_id1($id,$data){\n$this->db->where('SlNo', $SlNo);\n$this->db->update('food_items', $data);\n}", "public function edit(gestionnaire $gestionnaire)\n {\n //\n }", "function update_daftar_yudisium($nim,$data){\r\n $this->db->where('NIM', $nim);\r\n $this->db->update('tb_yudisium', $data);\r\n redirect(site_url('modul5/Yudisium/daftar_yudisium')); \r\n \r\n }", "function update() {\r\n\r\n\t\t$this->connection = new Connection();\r\n\t\t$conn = $this->connection->openConnection();\r\n\r\n\t\t$insert = $conn->prepare(\"UPDATE `panier` SET `quantite`=:quantite WHERE id_internaute=:id_internaute AND id_nourriture=:id_nourriture AND datep=:datep\");\r\n\t\ttry {\r\n\t\t\t$result = $insert->execute(array('quantite' => $this->getQuantite(),'id_internaute' => $this->getId_internaute(),'id_nourriture' => $this->getId_nourriture(),'datep' => $this->getDate()));\r\n\t\t\t\r\n\t\t} catch (PDOExecption $e) {\r\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"</br>\";\r\n\t\t}\r\n\t\t$this->connection->closeConnection();\r\n\t}", "function editAlterRate($design_no, $suit_rate,$dupatta_rate, $ghagra_rate, $blause_rate, $total_rate)\n\t\n\t{\n\t\t/*$stock_id\t\t\t =\tmysql_real_escape_string(trim($stock_id));*/\n\t\t$design_no\t \t\t=\ttrim($design_no);\n\t\t$suit_rate\t\t\t \t\t= mysql_real_escape_string(trim($suit_rate));\n\t\t$dupatta_rate\t\t\t =\tmysql_real_escape_string(trim($dupatta_rate));\n\t\t$ghagra_rate\t\t =\tmysql_real_escape_string(trim($ghagra_rate));\n\t\t$blause_rate\t\t =\tmysql_real_escape_string(trim($blause_rate));\n\t\t$total_rate\t\t\t =\tmysql_real_escape_string(trim($total_rate));\n\t\t\n\t\t//update stock description\n\t\t$edit = \"UPDATE alter_rate\n\t\t\t\tSET\n\t\t\t\tdesign_no\t\t \t= '$design_no',\n\t\t\t\tsuit_rate\t\t\t= '$suit_rate',\n\t\t\t\tdupatta_rate\t\t= '$dupatta_rate',\n\t\t\t\tghagra_rate \t\t= '$ghagra_rate',\n\t\t\t\tblause_rate \t\t= '$blause_rate',\n\t\t\t\ttotal_rate\t\t = '$total_rate',\n\t\t\t\tmodified_on\t\t\t= now()\n\t\t\t\tWHERE\n\t\t\t\trate_id \t\t\t= '$rate_id'\n\t\t\t\t\";\n\t\t$query = mysql_query($edit);\n\t\t//echo $edit.mysql_error();exit;\n\t\t\n\t}", "function update() {\n\t\n\t \t$sql = \"UPDATE evs_database.evs_identification \n\t \t\t\tSET\tidf_identification_detail_en=?, idf_identification_detail_th=?, idf_pos_id=?, idf_ctg_id=? \n\t \t\t\tWHERE idf_id=?\";\n\t\t\n\t\t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id, $this->idf_id));\n\t\t\n\t }", "public function update(){\n\t//\tprint_r($this->country);\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",description=\\\"$this->description\\\",tags=\\\"$this->tags\\\",area_id=\".$this->area_id.\",image=\\\"$this->image\\\",created_at=$this->created_at,is_public=$this->is_public,price=$this->price where id=\".$this->id;\n\t\tExecutor::doit($sql);\n\t}", "function a_edit() {\n\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t$u=new Gestionnaire($id);\n\t\textract($u->data);\t\n\t\trequire $this->gabarit;\n\t}", "public function update(){\r\n $query = DB::connection()->prepare('\r\n UPDATE Wine\r\n SET name=:name, \r\n region=:region, \r\n winetext=:winetext,\r\n type=:type\r\n WHERE id=:id');\r\n $query->execute(array(\r\n 'id' => $this->id,\r\n 'name' => $this->name, \r\n 'region' => $this->region, \r\n 'winetext' => $this->winetext, \r\n 'type' => $this->type));\r\n }", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function update($data) {}", "public function update($data) {}", "function updateNoiDungTip($id,$name_nd1,$name_nd2,$name_nd3,$name_nd4,$noidung1,$noidung3,$noidung5,$noidung7,$tip2,$tip4,$tip6,$tip8){\n $sql = \"update noidungtipnote set name_nd1='$name_nd1',name_nd2='$name_nd2',name_nd3='$name_nd3',name_nd4='$name_nd4',\n noidung1='$noidung1',noidung2='$tip2',noidung3='$noidung3',noidung4='$tip4',noidung5='$noidung5',noidung6='$tip6',noidung7='$noidung7',noidung8='$tip8'\n where id_nd='$id'\";\n execute($sql);\n }", "public function testUpdateFinancialStatementUsingPut()\n {\n }", "function update_itinerary($pid) {\n $i_trip_name = $_POST['trip_name'];\n $i_region_name = $_POST['region_name'];\n $i_price_include = $_POST['price_include'];\n $i_price_exclude = $_POST['price_exclude'];\n $i_equipment = $_POST['equipment'];\n $i_itinerary_detail = $_POST['itinerary_detail'];\n $i_faqs = $_POST['faqs'];\n $i_highlight = $_POST['highlight'];\n $i_video_link = $_POST['video_link'];\n $sql = \"UPDATE itinerary SET trip_id='$i_trip_name',region_id='$i_region_name',price_include='$i_price_include',price_exclude='$i_price_exclude',equipment='$i_equipment',itinerary_detail='$i_itinerary_detail',faqs='$i_faqs',\n\t\t\thighlight='$i_highlight',video_link='$i_video_link' WHERE id='$pid'\";\n $this->mysqli->query($sql);\n if ($this->mysqli->error) {\n echo $this->mysqli->error;\n } else {\n echo \"<script type='text/javascript'>alert('Itinerary updated successfully')</script>\";\n }\n }", "protected function _update()\n\t{\n\t}", "public function update() {\n $this->connection->update(\n \"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), array(\"idchangemoney\" => $this->observer->idchangemoney), $this->user->iduser\n );\n }", "public function updatenationalities ($id , $description \n ){\n $sqlQuery = \" UPDATE nationalities SET id =’ $id ’, description =’\n$description ’\";\n $sqlQuery .= \" WHERE id= $id\";\n $result = $this -> getDbManager () -> executeQuery ( $sqlQuery );\n return $result ;\n }", "public function setNutrition(Nutrition $nutrition)\n\t{\n\t\t$this->nutrition = $nutrition;\n\t\treturn $this;\n\t}", "function master_jual_rawat_update(){\r\n\t\t//POST variable here\r\n\t\t$jrawat_id=trim(@$_POST[\"jrawat_id\"]);\r\n\t\t$jrawat_nobukti=trim(@$_POST[\"jrawat_nobukti\"]);\r\n\t\t$jrawat_nobukti=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$jrawat_nobukti);\r\n\t\t$jrawat_nobukti=str_replace(\"'\", '\"',$jrawat_nobukti);\r\n\t\t$jrawat_grooming=trim(@$_POST[\"jrawat_grooming\"]);\r\n\t\t\r\n\t\t$jrawat_nobukti_medis=trim(@$_POST[\"jrawat_nobukti_medis\"]);\r\n\t\t$jrawat_nobukti_medis=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$jrawat_nobukti_medis);\r\n\t\t$jrawat_nobukti_medis=str_replace(\"'\", '\"',$jrawat_nobukti_medis);\r\n\t\t$jrawat_nobukti_pajak=trim(@$_POST[\"jrawat_nobukti_pajak\"]);\r\n\t\t$jrawat_nobukti_pajak=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$jrawat_nobukti_pajak);\r\n\t\t$jrawat_nobukti_pajak=str_replace(\"'\", '\"',$jrawat_nobukti_pajak);\r\n\t\t$jrawat_total_medis=trim($_POST[\"jrawat_total_medis\"]);\r\n\t\t$jrawat_total_nonmedis=trim($_POST[\"jrawat_total_nonmedis\"]);\r\n\t\t\r\n\t\t$jrawat_cust=trim(@$_POST[\"jrawat_cust\"]);\r\n\t\t$jrawat_tanggal=trim(@$_POST[\"jrawat_tanggal\"]);\r\n\t\t$jrawat_diskon=trim(@$_POST[\"jrawat_diskon\"]);\r\n\t\t$jrawat_cara=trim(@$_POST[\"jrawat_cara\"]);\r\n\t\t$jrawat_cara=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$jrawat_cara);\r\n\t\t$jrawat_cara=str_replace(\"'\", '\"',$jrawat_cara);\r\n\t\t\r\n\t\t$jrawat_cara2=trim(@$_POST[\"jrawat_cara2\"]);\r\n\t\t$jrawat_cara2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$jrawat_cara2);\r\n\t\t$jrawat_cara2=str_replace(\"'\", '\"',$jrawat_cara2);\r\n\t\t\r\n\t\t$jrawat_cara3=trim(@$_POST[\"jrawat_cara3\"]);\r\n\t\t$jrawat_cara3=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$jrawat_cara3);\r\n\t\t$jrawat_cara3=str_replace(\"'\", '\"',$jrawat_cara3);\r\n\t\t\r\n\t\t$jrawat_keterangan=trim(@$_POST[\"jrawat_keterangan\"]);\r\n\t\t$jrawat_keterangan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$jrawat_keterangan);\r\n\t\t$jrawat_keterangan=str_replace(\"'\", '\"',$jrawat_keterangan);\r\n\t\t\r\n\t\t$jrawat_ket_disk=trim(@$_POST[\"jrawat_ket_disk\"]);\r\n\t\t$jrawat_ket_disk=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$jrawat_ket_disk);\r\n\t\t$jrawat_ket_disk=str_replace(\"'\", '\"',$jrawat_ket_disk);\r\n\t\t\r\n\t\t$jrawat_ket_disk_medis=trim(@$_POST[\"jrawat_ket_disk_medis\"]);\r\n\t\t$jrawat_ket_disk_medis=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$jrawat_ket_disk_medis);\r\n\t\t$jrawat_ket_disk_medis=str_replace(\"'\", '\"',$jrawat_ket_disk_medis);\r\n\t\t\r\n\t\t$jrawat_stat_dok=trim(@$_POST[\"jrawat_stat_dok\"]);\r\n\t\t$jrawat_stat_dok=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$jrawat_stat_dok);\r\n\t\t$jrawat_stat_dok=str_replace(\"'\", '\"',$jrawat_stat_dok);\r\n\t\t\r\n\t\t$jrawat_cashback=trim($_POST[\"jrawat_cashback\"]);\r\n\t\t$jrawat_cashback_medis=trim($_POST[\"jrawat_cashback_medis\"]);\r\n\t\t\r\n\t\t//tunai\r\n\t\t$jrawat_tunai_nilai=trim($_POST[\"jrawat_tunai_nilai\"]);\r\n\t\t//tunai-2\r\n\t\t$jrawat_tunai_nilai2=trim($_POST[\"jrawat_tunai_nilai2\"]);\r\n\t\t//tunai-3\r\n\t\t$jrawat_tunai_nilai3=trim($_POST[\"jrawat_tunai_nilai3\"]);\r\n\t\t//voucher\r\n\t\t$jrawat_voucher_no=trim($_POST[\"jrawat_voucher_no\"]);\r\n\t\t$jrawat_voucher_cashback=trim($_POST[\"jrawat_voucher_cashback\"]);\r\n\t\t//voucher-2\r\n\t\t$jrawat_voucher_no2=trim($_POST[\"jrawat_voucher_no2\"]);\r\n\t\t$jrawat_voucher_cashback2=trim($_POST[\"jrawat_voucher_cashback2\"]);\r\n\t\t//voucher-3\r\n\t\t$jrawat_voucher_no3=trim($_POST[\"jrawat_voucher_no3\"]);\r\n\t\t$jrawat_voucher_cashback3=trim($_POST[\"jrawat_voucher_cashback3\"]);\r\n\t\t\r\n\t\t//bayar\r\n\t\t$jrawat_total=trim($_POST[\"jrawat_total\"]);\r\n\t\t$jrawat_bayar=trim($_POST[\"jrawat_bayar\"]);\r\n\t\t$jrawat_subtotal=trim($_POST[\"jrawat_subtotal\"]);\r\n\t\t$jrawat_hutang=trim($_POST[\"jrawat_hutang\"]);\r\n\t\t//card\r\n\t\t$jrawat_card_nama=trim($_POST[\"jrawat_card_nama\"]);\r\n\t\t$jrawat_card_edc=trim($_POST[\"jrawat_card_edc\"]);\r\n\t\t$jrawat_card_no=trim($_POST[\"jrawat_card_no\"]);\r\n\t\t$jrawat_card_nilai=trim($_POST[\"jrawat_card_nilai\"]);\r\n\t\t//card-2\r\n\t\t$jrawat_card_nama2=trim($_POST[\"jrawat_card_nama2\"]);\r\n\t\t$jrawat_card_edc2=trim($_POST[\"jrawat_card_edc2\"]);\r\n\t\t$jrawat_card_no2=trim($_POST[\"jrawat_card_no2\"]);\r\n\t\t$jrawat_card_nilai2=trim($_POST[\"jrawat_card_nilai2\"]);\r\n\t\t//card-3\r\n\t\t$jrawat_card_nama3=trim($_POST[\"jrawat_card_nama3\"]);\r\n\t\t$jrawat_card_edc3=trim($_POST[\"jrawat_card_edc3\"]);\r\n\t\t$jrawat_card_no3=trim($_POST[\"jrawat_card_no3\"]);\r\n\t\t$jrawat_card_nilai3=trim($_POST[\"jrawat_card_nilai3\"]);\r\n\t\t//kwitansi\r\n\t\t$jrawat_kwitansi_no=trim($_POST[\"jrawat_kwitansi_no\"]);\r\n\t\t$jrawat_kwitansi_nama=trim(@$_POST[\"jrawat_kwitansi_nama\"]);\r\n\t\t$jrawat_kwitansi_nama=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$jrawat_kwitansi_nama);\r\n\t\t$jrawat_kwitansi_nama=str_replace(\"'\", '\"',$jrawat_kwitansi_nama);\r\n\t\t$jrawat_kwitansi_nilai=trim($_POST[\"jrawat_kwitansi_nilai\"]);\r\n\t\t$jual_kwitansi_id=trim($_POST[\"jual_kwitansi_id\"]);\r\n\t\t//kwitansi-2\r\n\t\t$jrawat_kwitansi_no2=trim($_POST[\"jrawat_kwitansi_no2\"]);\r\n\t\t$jrawat_kwitansi_nama2=trim(@$_POST[\"jrawat_kwitansi_nama2\"]);\r\n\t\t$jrawat_kwitansi_nama2=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$jrawat_kwitansi_nama2);\r\n\t\t$jrawat_kwitansi_nama2=str_replace(\"'\", '\"',$jrawat_kwitansi_nama2);\r\n\t\t$jrawat_kwitansi_nilai2=trim($_POST[\"jrawat_kwitansi_nilai2\"]);\r\n\t\t$jual_kwitansi_id2=trim($_POST[\"jual_kwitansi_id2\"]);\r\n\t\t//kwitansi-3\r\n\t\t$jrawat_kwitansi_no3=trim($_POST[\"jrawat_kwitansi_no3\"]);\r\n\t\t$jrawat_kwitansi_nama3=trim(@$_POST[\"jrawat_kwitansi_nama3\"]);\r\n\t\t$jrawat_kwitansi_nama3=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$jrawat_kwitansi_nama3);\r\n\t\t$jrawat_kwitansi_nama3=str_replace(\"'\", '\"',$jrawat_kwitansi_nama3);\r\n\t\t$jrawat_kwitansi_nilai3=trim($_POST[\"jrawat_kwitansi_nilai3\"]);\r\n\t\t$jual_kwitansi_id3=trim($_POST[\"jual_kwitansi_id3\"]);\r\n\t\t//cek\r\n\t\t$jrawat_cek_nama=trim($_POST[\"jrawat_cek_nama\"]);\r\n\t\t$jrawat_cek_no=trim($_POST[\"jrawat_cek_no\"]);\r\n\t\t$jrawat_cek_valid=trim($_POST[\"jrawat_cek_valid\"]);\r\n\t\t$jrawat_cek_bank=trim($_POST[\"jrawat_cek_bank\"]);\r\n\t\t$jrawat_cek_nilai=trim($_POST[\"jrawat_cek_nilai\"]);\r\n\t\t//cek-2\r\n\t\t$jrawat_cek_nama2=trim($_POST[\"jrawat_cek_nama2\"]);\r\n\t\t$jrawat_cek_no2=trim($_POST[\"jrawat_cek_no2\"]);\r\n\t\t$jrawat_cek_valid2=trim($_POST[\"jrawat_cek_valid2\"]);\r\n\t\t$jrawat_cek_bank2=trim($_POST[\"jrawat_cek_bank2\"]);\r\n\t\t$jrawat_cek_nilai2=trim($_POST[\"jrawat_cek_nilai2\"]);\r\n\t\t//cek-3\r\n\t\t$jrawat_cek_nama3=trim($_POST[\"jrawat_cek_nama3\"]);\r\n\t\t$jrawat_cek_no3=trim($_POST[\"jrawat_cek_no3\"]);\r\n\t\t$jrawat_cek_valid3=trim($_POST[\"jrawat_cek_valid3\"]);\r\n\t\t$jrawat_cek_bank3=trim($_POST[\"jrawat_cek_bank3\"]);\r\n\t\t$jrawat_cek_nilai3=trim($_POST[\"jrawat_cek_nilai3\"]);\r\n\t\t//transfer\r\n\t\t$jrawat_transfer_bank=trim($_POST[\"jrawat_transfer_bank\"]);\r\n\t\t$jrawat_transfer_nama=trim($_POST[\"jrawat_transfer_nama\"]);\r\n\t\t$jrawat_transfer_nilai=trim($_POST[\"jrawat_transfer_nilai\"]);\r\n\t\t//transfer-2\r\n\t\t$jrawat_transfer_bank2=trim($_POST[\"jrawat_transfer_bank2\"]);\r\n\t\t$jrawat_transfer_nama2=trim($_POST[\"jrawat_transfer_nama2\"]);\r\n\t\t$jrawat_transfer_nilai2=trim($_POST[\"jrawat_transfer_nilai2\"]);\r\n\t\t//transfer-3\r\n\t\t$jrawat_transfer_bank3=trim($_POST[\"jrawat_transfer_bank3\"]);\r\n\t\t$jrawat_transfer_nama3=trim($_POST[\"jrawat_transfer_nama3\"]);\r\n\t\t$jrawat_transfer_nilai3=trim($_POST[\"jrawat_transfer_nilai3\"]);\r\n\t\t\r\n\t\t$cetak_jrawat=trim($_POST[\"cetak_jrawat\"]);\r\n\t\t\r\n\t\t$drawat_count=trim($_POST[\"drawat_count\"]);\r\n\t\t\r\n\t\t$dcount_drawat_id=trim($_POST[\"dcount_drawat_id\"]);\r\n\t\t\r\n\t\t/*\r\n\t\t * Penambahan Detail Penjualan Perawatan\r\n\t\t*/\r\n\t\t$drawat_id = $_POST['drawat_id']; // Get our array back and translate it :\r\n\t\t$array_drawat_id = json_decode(stripslashes($drawat_id));\r\n\t\t\r\n\t\t$drawat_dtrawat = $_POST['drawat_dtrawat']; // Get our array back and translate it :\r\n\t\t$array_drawat_dtrawat = json_decode(stripslashes($drawat_dtrawat));\r\n\t\t\r\n\t\t$drawat_rawat = $_POST['drawat_rawat']; // Get our array back and translate it :\r\n\t\t$array_drawat_rawat = json_decode(stripslashes($drawat_rawat));\r\n\t\t\r\n\t\t$drawat_jumlah = $_POST['drawat_jumlah']; // Get our array back and translate it :\r\n\t\t$array_drawat_jumlah = json_decode(stripslashes($drawat_jumlah));\r\n\t\t\r\n\t\t$drawat_harga = $_POST['drawat_harga']; // Get our array back and translate it :\r\n\t\t$array_drawat_harga = json_decode(stripslashes($drawat_harga));\r\n\t\t\r\n\t\t$drawat_diskon = $_POST['drawat_diskon']; // Get our array back and translate it :\r\n\t\t$array_drawat_diskon = json_decode(stripslashes($drawat_diskon));\r\n\t\t\r\n\t\t$drawat_diskon_jenis = $_POST['drawat_diskon_jenis']; // Get our array back and translate it :\r\n\t\t$array_drawat_diskon_jenis = json_decode(stripslashes($drawat_diskon_jenis));\r\n\t\t\r\n\t\t$drawat_sales = $_POST['drawat_sales']; // Get our array back and translate it :\r\n\t\t$array_drawat_sales = json_decode(stripslashes($drawat_sales));\r\n\t\t\r\n\t\t$drawat_karyawan = $_POST['drawat_karyawan']; // Get our array back and translate it :\r\n\t\t$array_drawat_karyawan = json_decode(stripslashes($drawat_karyawan));\r\n\t\t\r\n\t\t$result = $this->m_master_jual_rawat->master_jual_rawat_update($jrawat_id ,$jrawat_nobukti ,$jrawat_nobukti_medis,$jrawat_nobukti_pajak,$jrawat_total_medis,$jrawat_total_nonmedis,$jrawat_cust ,$jrawat_tanggal\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_stat_dok, $jrawat_diskon ,$jrawat_cara ,$jrawat_cara2\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_cara3 ,$jrawat_keterangan , $jrawat_cashback, $jrawat_cashback_medis, $jrawat_tunai_nilai\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_tunai_nilai2, $jrawat_tunai_nilai3, $jrawat_voucher_no\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_voucher_cashback, $jrawat_voucher_no2, $jrawat_voucher_cashback2\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_voucher_no3, $jrawat_voucher_cashback3, $jrawat_total\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_bayar, $jrawat_subtotal, $jrawat_hutang, $jrawat_kwitansi_no\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_kwitansi_nama, $jrawat_kwitansi_nilai, $jrawat_kwitansi_no2\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_kwitansi_nama2, $jrawat_kwitansi_nilai2, $jrawat_kwitansi_no3\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_kwitansi_nama3, $jrawat_kwitansi_nilai3, $jrawat_card_nama\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_card_edc, $jrawat_card_no, $jrawat_card_nilai, $jrawat_card_nama2\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_card_edc2, $jrawat_card_no2, $jrawat_card_nilai2, $jrawat_card_nama3\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_card_edc3, $jrawat_card_no3, $jrawat_card_nilai3, $jrawat_cek_nama\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_cek_no, $jrawat_cek_valid, $jrawat_cek_bank, $jrawat_cek_nilai\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_cek_nama2, $jrawat_cek_no2, $jrawat_cek_valid2, $jrawat_cek_bank2\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_cek_nilai2, $jrawat_cek_nama3, $jrawat_cek_no3, $jrawat_cek_valid3\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_cek_bank3, $jrawat_cek_nilai3, $jrawat_transfer_bank\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_transfer_nama, $jrawat_transfer_nilai, $jrawat_transfer_bank2\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_transfer_nama2, $jrawat_transfer_nilai2, $jrawat_transfer_bank3\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_transfer_nama3, $jrawat_transfer_nilai3 ,$cetak_jrawat\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$jrawat_ket_disk, $jrawat_ket_disk_medis, $drawat_count, $dcount_drawat_id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$array_drawat_id ,$array_drawat_dtrawat ,$array_drawat_rawat\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$array_drawat_jumlah ,$array_drawat_harga ,$array_drawat_diskon\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ,$array_drawat_diskon_jenis, $array_drawat_sales, $array_drawat_karyawan, $jrawat_grooming, $jual_kwitansi_id, $jual_kwitansi_id2, $jual_kwitansi_id3);\r\n\t\techo $result;\r\n\t}", "public function UpdateFood($sku, $foodDesc, $category, $price){\r\n $conn = new ConnectionManager();\r\n $pdo = $conn->getConnection();\r\n \r\n \r\n // YOUR CODE GOES HERE\r\n\r\n\r\n\r\n return $isOk;\r\n }", "public function editRent($args = []){\r\n\t\ttry {\r\n\t\t\t$conn = $this->connect();\r\n\t\t\t$sql = \"UPDATE rent\" \r\n\t\t\t\t\t.\"SET\" \r\n\t\t\t\t\t.\"rent_name = :rent_name, price = :price, type_id= :type_id, square = :square,\" \r\n\t\t\t\t\t.\"describe_rent = :describe_rent, post_time = :post_time, drop_time = :drop_time,\"\r\n\t\t\t\t\t.\"status = :status, user_id = :user_id, province_id = :province_id, district_id = :district_id,\" \r\n\t\t\t\t\t.\"ward_id = :ward_id, address_detail = :address_detail\" \r\n\t\t\t\t\t.\"WHERE rent_id = :rent_id\";\r\n\t\t\t$stmt = $conn->prepare($sql);\r\n\t\t\t$stmt->bindParam(':rent_name',$args['rent_name']);\r\n\t\t\t$stmt->bindParam(':price',$args['price']);\r\n\t\t\t$stmt->bindParam(':type_id',$args['type_id']);\r\n\t\t\t$stmt->bindParam(':square',$args['square']);\r\n\t\t\t$stmt->bindParam(':describe_rent',$args['describe_rent']);\r\n\t\t\t$stmt->bindParam(':post_time',$args['post_time']);\r\n\t\t\t$stmt->bindParam(':drop_time',$args['drop_time']);\r\n\t\t\t$stmt->bindParam(':status',$args['status']);\r\n\t\t\t$stmt->bindParam(':user_id',$args['user_id']);\r\n\t\t\t$stmt->bindParam(':province_id',$args['province_id']);\r\n\t\t\t$stmt->bindParam(':district_id',$args['district_id']);\r\n\t\t\t$stmt->bindParam(':ward_id',$args['ward_id']);\r\n\t\t\t$stmt->bindParam(':address_detail',$args['address_detail']);\r\n\t\t\t$stmt->bindParam(':rent_id',$args['rent_id']);\t\t\t\r\n\t\t\t$stmt->execute();\r\n\t\t\treturn true;\r\n\t }catch(PDOException $e){\t \t\r\n\t \treturn false;//error 404\r\n\t }\r\n\t}", "private function modifyTurkey()\n {\n echo PHP_EOL;\n \n $turkeyToModify = $this->productDao->getByEan(self::PRODUCT_TURKEY_EAN); \n $turkeyToModify->ean = self::PRODUCT_TURKEY_NEW_EAN;\n $turkeyToModify->name = self::PRODUCT_TURKEY_NEW_NAME;\n \n try\n {\n $isTurkeyModified = $this->productDao->modify($turkeyToModify);\n\n echo self::PRODUCT_TURKEY_NAME . ' modified ' . \n (($isTurkeyModified) ? '' : 'un') . \n 'successfuly!' . PHP_EOL; \n }\n catch (Exception $e)\n {\n echo $e->getMessage();\n }\n\n }", "public function edit($id)\n {\n $entry = Nutrition::find($id);\n return view('modify', ['entry'=>$entry]);\n }", "private function changesku(){\t \r\n\t $this->chartValue(); //adding to output\r\n\t $this->idleStHealthChk(); //adding to output\r\n\t}", "public function editData() {\n $this->daftar_barang = array_values($this->daftar_barang);\n $data_barang = json_encode($this->daftar_barang, JSON_PRETTY_PRINT);\n file_put_contents($this->file, $data_barang);\n $this->ambilData();\n }", "public function update()\r\n {\r\n //\r\n }", "public function update_ratting_data() {\n\t\tglobal $wpdb;\n\t\t$sso = new Top_Ratter_SSO ();\n\t\t// get the ratting data from sso class\n\t\t$journal_records=$sso->esi_api_gather_ratted_isk_amount();\n\t\t\n\t\tif ($journal_records == null) {\n\t\t echo'<p>Problem with API :(</p>';\n\t\t\treturn;\n\t\t}\n\t\tif($journal_records=='no_officer_token'){\n\t\t echo'<p>There is no officer token, inform officers. Pretty please?</p>';\n\t\t return;\n\t\t}\n\n\t\t$bounties_array = $this->filter_ratting_data ( $journal_records);\n\t\t$structures_array = $this->filter_ratting_data ( $journal_records,true);\n\t\t\n\t\t/*\n\t\t * Bounties akka ratting data to be inserted.\n\t\t */\n\t\tif($bounties_array){\n\t\t \n\t\t $this->insert_new_characters_in_database($bounties_array);\n\t\t \n\t\t $bounties_to_insert=null;\n\t\t \n\t\t $sql_max_ref_id=\"SELECT MAX(`ref_id`) AS ref_id FROM `\" . $wpdb->prefix . \"tr_ratting_data`\";\n\t\t $max_ref_id=$wpdb->get_row($sql_max_ref_id,ARRAY_A); \n\t\t \n\t\t if($max_ref_id['ref_id']!==NULL){\n\t\t foreach($bounties_array as $bounty_record){\n\t\t // select only those that is not in the db\n\t\t if($bounty_record['ref_id']>(float)$max_ref_id['ref_id']){\n\t\t //this is new record that is not in the db yet\n\t\t $bounties_to_insert[]=$bounty_record;\n\t\t } \n\t\t }\n\t\t }else{\n // insert all since nothing in db\n\t\t $bounties_to_insert=$bounties_array;\n\t\t }\n\t\t \n\t\t if($bounties_to_insert){\n\t\t $sql=\"INSERT INTO `\" . $wpdb->prefix . \"tr_ratting_data`(`owner_id`, `date_acquired`, `amount`, `system_id`, `npc_kills`, `ref_id`) VALUES\";\n\t\t $count=count($bounties_to_insert);\n\t\t $i=1;\n\t\t foreach($bounties_to_insert as $record){\n\t\t $system_id=0;\n\t\t if($record['extra_info']['system_id']){\n\t\t $system_id=$record['extra_info']['system_id'];\n\t\t }\n\t\t $sql.='(\"'.$record['second_party_id'].'\",\"'.$record['date'].'\",\"'.$record['tax'].'\",\"'.$system_id.'\",\"'.$record['npc_kills'].'\",\"'.$record['ref_id'].'\")';\n\t\t \n\t\t if($i==$count){\n\t\t $sql.='';\n\t\t }else{\n\t\t $sql.=',';\n\t\t }\n\t\t $i++;\n\t\t }\n\t\t $sql.=';';\n\t\t $wpdb->query($sql);\n\t\t } \n\t\t}\n\t\t\n\t\t/*\n\t\t * Structures data insert starts here\n\t\t */\n\t\tif($structures_array){\n\t\t $sql=\"INSERT INTO `\" . $wpdb->prefix . \"tr_structures_income`(`ref_id`, `date_acquired`, `amount`, `ref_type`) VALUES\";\n\t\t $count=count($structures_array);\n\t\t $i=1;\n\t\t foreach($structures_array as $record){\n\t\t \n\t\t $sql.='(\"'.$record['ref_id'].'\",\"'.$record['date'].'\",\"'.$record['amount'].'\",\"'.$record['ref_type'].'\")';\n\t\t \n\t\t if($i==$count){\n\t\t $sql.='';\n\t\t }else{\n\t\t $sql.=',';\n\t\t }\n\t\t $i++;\n\t\t }\n\t\t $sql.=';';\n\t\t $wpdb->query($sql); \n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public function update($dato, $datoNuevo){\n }", "public function db_update() {}", "public function update(){\n\t\t\t$matk = $_POST['matk'];\n\t\t\t$tentk = $_POST['tentk'];\n\t\t\t$pass = $_POST['pass'];\n\t\t\t$fullname = $_POST['fullname'];\n\n\t\t\t$post = array(\n\t\t\t\t'matk' => $matk,\n\t\t\t\t'tentk' => $tentk,\n\t\t\t\t'pass' => $pass,\n\t\t\t\t'fullname' => $fullname,\n\t\t\t);\n\n\t\t\trequire_once('model/model.php');\n\t\t\t$Model = new Model();\n\t\t\t$update = $Model -> updateData($post);\n\n\t\t\trequire_once('view/View.php');\n\t\t\t$View = new View();\n\t\t\t$View ->alertupdate($update);\n\t\t}", "public function update(){\n\t\techo $sql = \"update \".self::$tablename.\" set title=\\\"$this->title\\\",description=\\\"$this->description\\\",skills=\\\"$this->skills\\\",area_id=$this->area_id,jobtype_id=$this->jobtype_id,jobperiod_id=$this->jobperiod_id,duration=$this->duration,is_public=$this->is_public,is_finished=$this->is_finished,created_at=$this->created_at where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update($cbtRekapNilai);", "public function update_equipment($data)\n\t {\n\t }", "public function update() {\r\n\r\n\t}", "public function Update($data) {\n\n }", "public function edit(Territory $territory)\n {\n //\n }", "protected function update() {}", "public function edit(DaomniInfluentialcoupons $daomniInfluentialcoupons)\n {\n //\n }", "public function testUpdateSurvey0()\n {\n }", "public function testUpdateSurvey0()\n {\n }", "public function actualizar_prof_turma()\n {\n $id = $this->input->post('id_prof_turma');\n $prof_turma = array( \n 'anolectivo_id' => $this->input->post('anolectivo'),\n 'turma_id' \t=> $this->input->post('turma_id')\n );\n $this->db->where('id_prof_turma', $id);\n return $this->db->update('prof_turma', $prof_turma); \n }", "function update() {\n\t\t$sql = \"UPDATE cost_detail \n\t\t\t\tSET\tcd_start_time=?, cd_end_time=?, cd_hour=?, cd_minute=?, cd_cost=?, cd_update=?, cd_user_update=? \n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\t\n\t\t$this->ffm->query($sql, array($this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update, $this->cd_fr_id, $this->cd_seq));\t\n\t}", "public function update(): void\n {\n $this->updateQuality();\n $this->updateSellIn();\n $this->expiresAfterSale();\n }", "function editar_pr_factura_inventario(){\n\n\t\t $u = new entrada();\n $u->usuario_id = $GLOBALS['usuarioid'];\n $u->empresas_id = $GLOBALS['empresaid'];\n\t$precio=$_POST['costo_unitario'];\n\t$producto_id=$_POST['cproductos_id'];\n $u->fecha = date(\"Y-m-d H:i:s\");\n $related = $u->from_array($_POST);\n\t $f = new Pr_factura();\n $f->get_by_id($u->pr_facturas_id);\n $u->espacios_fisicos_id = $f->espacios_fisicos_id;\n $u->lote_id = $f->lote_id;\n $u->costo_total = ($u->cantidad * $u->costo_unitario);\n\t$u->existencia = $u->cantidad;\n $u->cproveedores_id = $f->cproveedores_id;\n $u->fecha = date(\"Y-m-d H:i:s\");\n if ($u->id == 0)\n unset($u->id);\n if ($u->save($related)) {\n$this->db->query(\"update cproductos set precio_compra='$precio' where id=$producto_id\");\n echo $u->id;\n } else\n echo 0; \n \n\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",comments=\\\"$this->comments\\\",price=\\\"$this->price\\\",brand=\\\"$this->brand\\\",model=\\\"$this->model\\\",y=\\\"$this->y\\\",link=\\\"$this->link\\\",in_existence=\\\"$this->in_existence\\\",is_public=\\\"$this->is_public\\\",is_featured=\\\"$this->is_featured\\\",category_id=\\\"$this->category_id\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public abstract function update();", "function update_aroundus_POI_details($data)\n {\n $this->db->where('rGeninfoId', $data['rGeninfoId']);\n return $this->db->update('r_app_aroundus_gen_info', $data);\n }", "public function update()\r\n {\r\n \r\n }", "public function update($loyPrg);", "function updateField() {\n DATABASE::INIT_TABLE($this->database, $this->table);\n $fname = $this->urlParam('fname');\n $fvalue = $this->urlParam('fvalue');\n $id = $this->urlParam('id');\n DATABASE::UPDATE($this->table, [$fname], [$fvalue], $id);\n }", "function update_modification($data)\n\t{\n\t\tglobal $db, $cid, $mid;\n\n\t\t$sql = \"UPDATE \". GARAGE_MODS_TABLE .\"\n\t\t\tSET category_id = '\".$data['category_id'].\"', title = '\".$data['title'].\"', price = '\".$data['price'].\"', install_price = '\".$data['install_price'].\"', install_rating = '\".$data['install_rating'].\"', product_rating = '\".$data['product_rating'].\"', comments = '\".$data['comments'].\"', install_comments = '\".$data['install_comments'].\"' , business_id = '\".$data['business_id'].\"', install_business_id = '\".$data['install_business_id'].\"', date_updated = '\".$data['time'].\"'\n\t\t\tWHERE id = '$mid' and garage_id = '$cid'\";\n\n\t\tif(!$result = $db->sql_query($sql))\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could Not Update Modification', '', __LINE__, __FILE__, $sql);\n\t\t}\n\n\t\treturn;\n\t}", "function modify_values($id, $CompID, $price, $sq_ft, $num_floors,\n $num_bdrm, $num_baths, $year_built, $prop_type, $bldg_type,\n $district, $maintenance, $status, $address, $description) {\n \n $con = getSQLConnection();\n mysqli_select_db($con, 's403_project');\n \n $sql = \"UPDATE listing SET CompID='$CompID', price='$price', sq_ft='$sq_ft', num_floors='$num_floors', \"\n . \"num_bdrm='$num_bdrm', num_baths='$num_baths', year_built='$year_built', prop_type='$prop_type',\"\n . \"bldg_type='$bldg_type', district='$district', maintenance='$maintenance', status='$status',\"\n . \"address='$address', description='$description' WHERE ID='$id'\" ;\n $result = mysqli_query($con, $sql);\n if(!$result){\n trigger_error(\"Modification error!\");\n }\n else {\n echo\"Modification successful\\n\";\n }\n mysqli_close($con);\n\n}", "public function update()\n {\n //\n }", "public function update()\n {\n //\n }", "function absenrich_update(){\r\n\t\t//POST variable here\r\n\t\t$gudang_id=trim(@$_POST[\"gudang_id\"]);\r\n\t\t$gudang_nama=trim(@$_POST[\"gudang_nama\"]);\r\n\t\t$gudang_nama=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_nama);\r\n\t\t$gudang_nama=str_replace(\"'\", '\"',$gudang_nama);\r\n\t\t$gudang_lokasi=trim(@$_POST[\"gudang_lokasi\"]);\r\n\t\t$gudang_lokasi=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_lokasi);\r\n\t\t$gudang_lokasi=str_replace(\"'\", '\"',$gudang_lokasi);\r\n\t\t$gudang_keterangan=trim(@$_POST[\"gudang_keterangan\"]);\r\n\t\t$gudang_keterangan=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_keterangan);\r\n\t\t$gudang_keterangan=str_replace(\"'\", '\"',$gudang_keterangan);\r\n\t\t$gudang_aktif=trim(@$_POST[\"gudang_aktif\"]);\r\n\t\t$gudang_aktif=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_aktif);\r\n\t\t$gudang_aktif=str_replace(\"'\", '\"',$gudang_aktif);\r\n\t\t$gudang_creator=trim(@$_POST[\"gudang_creator\"]);\r\n\t\t$gudang_creator=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$gudang_creator);\r\n\t\t$gudang_creator=str_replace(\"'\", '\"',$gudang_creator);\r\n\t\t$gudang_date_create=trim(@$_POST[\"gudang_date_create\"]);\r\n\t\t$absenrich_updater=trim(@$_POST[\"absenrich_updater\"]);\r\n\t\t$absenrich_updater=str_replace(\"/(<\\/?)(p)([^>]*>)\", \"\",$absenrich_updater);\r\n\t\t$absenrich_updater=str_replace(\"'\", '\"',$absenrich_updater);\r\n\t\t$gudang_date_update=trim(@$_POST[\"gudang_date_update\"]);\r\n\t\t$gudang_revised=trim(@$_POST[\"gudang_revised\"]);\r\n\t\t$result = $this->m_absensi_enrichment->absenrich_update($gudang_id ,$gudang_nama ,$gudang_lokasi ,$gudang_keterangan ,$gudang_aktif ,$gudang_creator ,$gudang_date_create ,$absenrich_updater ,$gudang_date_update ,$gudang_revised );\r\n\t\techo $result;\r\n\t}", "function summons_details_update($data,$id)\n\t{\n\t$this->db->where('id', $id);\n\t$this->db->update('summons_details', $data);\n\t}", "public function edit(IceTax $iceTax)\n {\n //\n }", "abstract function update();", "public function update()\n\t{\n\n\t}", "function _edit_update() {\n\t\t$sfgs = $_POST;\n//\t\tunset($sfgs['sfgs_header']['kode_sfg']);\n\t\tunset($sfgs['button']);\n\t\t// end of assign variables and delete not used variables\n\n\t\t$count = count($sfgs['sfgs_detail']['id_sfgs_h_detail']) - 1;\n\n\t\t// check, at least one product quantity entered\n\t\t$quantity_exist = FALSE;\n\n\t\tfor($i = 1; $i <= $count; $i++) {\n\t\t\tif(empty($sfgs['sfgs_detail']['quantity'][$i])) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$quantity_exist = TRUE;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif($quantity_exist == FALSE)\n\t\t\tredirect('sfgs/edit_error/Anda belum memasukkan data detail. Mohon ulangi');\n\n \tif(isset($_POST['button']['save'])) {\n\n\t\t\t$this->db->trans_start();\n\n \t\t\t$this->session->set_userdata('sfgs_detail', $sfgs['sfgs_detail']);\n $id_sfgs_header = $sfgs['sfgs_header']['id_sfgs_header'];\n\n \t\t\t$data = array (\n \t\t\t\t'id_sfgs_header' =>\t$id_sfgs_header,\n 'quantity_sfg' => $sfgs['sfgs_header']['quantity_sfg'],\n \t\t\t\t'uom_sfg' => $sfgs['sfgs_header']['uom_sfg'],\n \t\t\t);\n\n $input_detail_success = FALSE;\n\n if(($this->m_sfgs->sfgs_header_update($data))&&\n ($this->m_sfgs->sfgs_details_delete($id_sfgs_header))) {\n \t\tfor($i = 1; $i <= $count; $i++) {\n\t\t\t\t\tif((!empty($sfgs['sfgs_detail']['quantity'][$i]))&&(!empty($sfgs['sfgs_detail']['material_no'][$i]))) {\n\n\t\t\t\t\t\t$sfgs_detail['id_sfgs_header'] = $id_sfgs_header;\n\t\t\t\t\t\t$sfgs_detail['quantity'] = $sfgs['sfgs_detail']['quantity'][$i];\n\t\t\t\t\t\t$sfgs_detail['id_sfgs_h_detail'] = $sfgs['sfgs_detail']['id_sfgs_h_detail'][$i];\n\n\t\t\t\t\t\t$sfgs_detail['material_no'] = $sfgs['sfgs_detail']['material_no'][$i];\n\t\t\t\t\t\t$sfgs_detail['material_desc'] = $sfgs['sfgs_detail']['material_desc'][$i];\n\t\t\t\t\t\t$sfgs_detail['uom'] = $sfgs['sfgs_detail']['uom'][$i];\n\n\t\t\t\t\t\tif($this->m_sfgs->sfgs_detail_insert($sfgs_detail))\n $input_detail_success = TRUE;\n\t\t\t\t\t}\n\n \t \t}\n }\n\n \t\t\t$this->db->trans_complete();\n\n if(isset($_POST['button']['save'])) {\n if ($input_detail_success == TRUE) {\n\t\t\t $this->l_general->success_page('Data Master Semi Finished Goods (SFG) BOM berhasil diubah', site_url('sfgs/browse'));\n } else {\n\t\t\t $this->jagmodule['error_code'] = '004'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Master Semi Finished Goods (SFG) BOM tidak berhasil diubah', site_url($this->session->userdata['PAGE']['next']));\n }\n } else if(isset($_POST['button']['approve']))\n if($approve_data_success == TRUE) {\n\t\t\t $this->l_general->success_page('Data Master Semi Finished Goods (SFG) BOM berhasil diapprove', site_url('sfgs/browse'));\n } else {\n\t\t\t $this->jagmodule['error_code'] = '005'; \n\t\t$this->l_general->error_page($this->jagmodule, 'Data Master Semi Finished Goods (SFG) BOM tidak berhasil diapprove.<br>\n Pesan Kesalahan dari sistem SAP : '.$approved_data['sap_messages'], site_url($this->session->userdata['PAGE']['next']));\n }\n\n\t\t}\n\n\t}", "public function postUpdate(Request $request){\n \tTax::where('id','>',0)->where('company_id',Auth::user()->company_id)->update(['status' => 2]);\n \t// insert new tax row with status 1 to show that this is the current tax rate.\n //Validate the request\n $this->validate($request, [\n 'rate' => 'required|min:1',\n 'company_id'=>'required'\n ]); \n\n // adjust rate\n $tax_rate = ($request->rate > 1) ? ($request->rate / 100) : $request->rate;\n\n $tax = new Tax();\n $tax->company_id = Auth::user()->company_id;\n $tax->rate = $tax_rate;\n $tax->status = 1;\n if($tax->save()){\n\t\t\tFlash::success('Successfully updated sales tax!');\n\t\t\treturn Redirect::route('taxes_index');\n } \t\n }", "function updateData($data,$id)\n\t{\n\t\tdbIdReport('update','update Benefit',json_encode($data), 100);\n\t\t$this->db->where('ben_id', $id);\n\t\t$this->db->update($this->table, $data);\n\t\t$str = $this->db->last_query();\t\n\t\tlogConfig(\"update Benefit:$str\",'logDB');\n\t\t\n\t}", "public function update_woreda_ri(){\n/*\n //** retrive woreda population\n $woredas_population = DB::table('ketena')->select('woreda_id',DB::raw('SUM(population) as woreda_population'))->groupBy('woreda_id')->get();\n \n //** update woreda population\n foreach ($woredas_population as $key => $woreda_population) {\n DB::table('woreda')\n ->where('id', $woreda_population->woreda_id )\n ->update([ \n 'population' => $woreda_population->woreda_population,\n ]);\n }*/\n\n $woredas = Woreda::all();\n\n //** retrive indicators porsion \n $woreda_indicator_value = Data::select('indicator_id','woreda_id',DB::raw('SUM(value) as woreda_value') )->groupBy('woreda_id', 'indicator_id')->get();\n //** for all woredas request indicators index and update or insert data\n foreach ($woredas as $workey => $woreda) {\n\n foreach ($woreda_indicator_value as $indkey => $data) {\n if($woreda->id == $data->woreda_id){\n\n\n if(\n $data->Indicator->name == \"HH Size\" or $data->Indicator->name == \"Hand Washing\" or $data->Indicator->name == \"Soap and Detergents\" or $data->Indicator->name == \"Sanitation\" or $data->Indicator->name == \"Cooking\" or $data->Indicator->name == \"Solid Fuel\"){\n if($woreda->hh == '' or $woreda->hh == 0){\n $ri = array(\n 'risk_index_infection' => 'unavailable', \n 'risk_index_hospital' => 'unavailable', \n 'risk_index_death' => 'unavailable'\n );\n }\n else$ri = $this->get_ri($data->Indicator->name, (($data->woreda_value/$woreda->hh)*100));\n\n }\n else if($data->Indicator->name == \"Population density\"){\n if($woreda->area == '' or $woreda->area == 0){\n $ri = array(\n 'risk_index_infection' => 'unavailable', \n 'risk_index_hospital' => 'unavailable', \n 'risk_index_death' => 'unavailable'\n );\n }\n else$ri = $this->get_ri($data->Indicator->name, (($data->woreda_value/$woreda->area)*100));\n\n }\n else if($data->Indicator->name == \"Informal Employment\"){\n if($woreda->age == '' or $woreda->age == 0){\n $ri = array(\n 'risk_index_infection' => 'unavailable', \n 'risk_index_hospital' => 'unavailable', \n 'risk_index_death' => 'unavailable'\n );\n }\n else$ri = $this->get_ri($data->Indicator->name, (($data->woreda_value/$woreda->age)*100));\n\n }\n else if($woreda->population == 0){\n $ri = array(\n 'risk_index_infection' => 'unavailable', \n 'risk_index_hospital' => 'unavailable', \n 'risk_index_death' => 'unavailable'\n );\n }\n else $ri = $this->get_ri($data->Indicator->name, (($data->woreda_value/$woreda->population)*100));\n \n\n $id = DB::table('woreda_ri')->select('id')->where('woreda_id', $woreda->id )->where('indicator_id', $data->indicator_id )->get();\n \n if(isset($id[0]->id)){\n \n\n DB::table('woreda_ri')\n ->where('id', $id[0]->id )\n ->update([ \n 'risk_index_infection' => $ri['risk_index_infection'],\n 'risk_index_hospital' => $ri['risk_index_hospital'],\n 'risk_index_death' => $ri['risk_index_death'],\n 'woreda_value' => $data->woreda_value,\n 'updated_by' => Auth::user()->id\n ]);\n }\n else{\n DB::table('woreda_ri')\n \n ->insert([ \n 'woreda_id' => $woreda->id,\n 'indicator_id' => $data->indicator_id, \n 'risk_index_infection' => $ri['risk_index_infection'],\n 'risk_index_hospital' => $ri['risk_index_hospital'],\n 'risk_index_death' => $ri['risk_index_death'],\n 'woreda_value' => $data->woreda_value,\n 'updated_by' => Auth::user()->id\n ]);\n\n }\n }\n \n }\n }\n }", "abstract public function update();", "abstract public function update();", "public function editingredients($id)\n\n {\n\n\t\tif($this->uri->segment(3)==\"\")\n\n\t\t{\n\n\t\t\t$this->session->set_flashdata('err_msg', 'Dont Change the URL physically'); \n\n\t\t\tredirect('admin/recipe/viewingredients');\t\n\n\t\t}\n\n\t\t\n\n\t\tif ($this->input->server('REQUEST_METHOD') == 'POST')\n\n\t\t{\n\n \n\n\t $data['name']= strip_tags($this->input->post('name'));\n\n\t\t\t$name=strip_tags($this->input->post('slug'));\n\n\t\t\t$data['slug'] = strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $name)));\n\n\t\t\t$data['description']= strip_tags($this->input->post('description'));\n\n\t\t\t$data['status']= strip_tags($this->input->post('status'));\n\n \n\n \n\n\t\t\t $this->form_validation->set_rules('name', 'Name', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('description', 'Description', 'trim|required');\n\n\t\t\t $this->form_validation->set_rules('slug', 'Slug', 'trim|required');\n\n \n\n if ($this->form_validation->run() == TRUE) {\n\n $data_inserted = $this->Ingredients_model->edit_data($data,$id);\n\n $this->session->set_flashdata('success_msg', 'Ingredient edited Successfully'); \n\n redirect('admin/recipe/viewingredients');\t\n\n }\n\n\t\t}\n\n\t\t\n\n\t\t\n\n\t\t$site_name=$this->config->item('site_name');\n\n\t $this->template->set('title', 'Edit Ingredients | '.$site_name);\n\n\t\t$data_single = $this->Ingredients_model->get_data_by_id($id);\n\n\t\t$data['ingredients']=$data_single ;\n\n\t\t//print_r($data_single);die();\n\n $this->template->set_layout('layout_main', 'front');\n\n $this->template->build('editingredients',$data);\n\n }", "public function update($data) { \n\n\t\tif ($data['name'] != $this->name) { \n\t\t\t$this->update_name($data['name']); \n\t\t} \n\t\tif ($data['pl_type'] != $this->type) { \n\t\t\t$this->update_type($data['pl_type']); \n\t\t} \n\n\t}", "public\n\n function updateschoolequipmntfacavailmathkit()\n {\n $emis_loggedin = $this->session->userdata('emis_loggedin');\n if ($emis_loggedin)\n {\n $value = $this->input->post('value');\n if ($value == \"1\" || $value == \"2\")\n {\n $data = array(\n \"math_kit\" => $value\n );\n $school_id = $this->session->userdata('emis_school_id');\n if ($this->Udise_assetmodel->updatedata($data, $school_id))\n {\n $result_arr['response_code'] = 1;\n }\n else\n {\n $result_arr['response_code'] = 0;\n $result_arr['error_msg'] = \"Unable to update the database. Kindly re-try\";\n }\n }\n else\n {\n $result_arr['response_code'] = - 1;\n $result_arr['error_msg'] = \"Update Science Kit \" . \" is not in the correct format.Re-check and submit again \";\n }\n\n echo json_encode($result_arr);\n }\n else\n {\n redirect('/', 'refresh');\n }\n }", "public function update(Request $request, IceTax $iceTax)\n {\n //\n }", "function update() {\n\t\n\t \t$sql = \"UPDATE evs_database.evs_group \n\t \t\t\tSET\tgru_id=?, gru_name=?, gru_head_dept=? \n\t \t\t\tWHERE gru_id=?\";\n\t\t\n\t\t$this->db->query($sql, array($this->gru_id_new, $this->gru_name, $this->gru_head_dept, $this->gru_id_old));\n\t\t \n\t }" ]
[ "0.6205825", "0.6188661", "0.615069", "0.60900736", "0.60419804", "0.5922151", "0.5914309", "0.5894883", "0.5840756", "0.58298254", "0.5815297", "0.58077335", "0.5802055", "0.57874167", "0.5781095", "0.5777252", "0.57587916", "0.5733289", "0.57305455", "0.5715105", "0.57093215", "0.5708892", "0.5678127", "0.5667656", "0.56661534", "0.56660473", "0.5663108", "0.5663108", "0.56556576", "0.5655013", "0.5649369", "0.5636342", "0.5634298", "0.56260926", "0.56252694", "0.5624454", "0.5622842", "0.56126094", "0.56113917", "0.56113917", "0.56106174", "0.56106174", "0.56028885", "0.5599894", "0.55987227", "0.5593497", "0.5593479", "0.558926", "0.5586617", "0.55832624", "0.55777407", "0.5576589", "0.55742645", "0.5571136", "0.5569494", "0.5563435", "0.555566", "0.5554265", "0.55487156", "0.5547799", "0.55454993", "0.5544587", "0.55400115", "0.5534026", "0.55314976", "0.55301785", "0.55259687", "0.552514", "0.55189687", "0.55156934", "0.55156934", "0.55146", "0.551364", "0.55127966", "0.55040175", "0.55038935", "0.55030054", "0.5500582", "0.5500191", "0.5499673", "0.5499056", "0.54923064", "0.5492104", "0.54856265", "0.54856265", "0.54818827", "0.5476923", "0.54763496", "0.5472033", "0.5468882", "0.5465303", "0.5464969", "0.5463106", "0.5461519", "0.5457917", "0.5457917", "0.545586", "0.5445375", "0.5442813", "0.5441763", "0.5440825" ]
0.0
-1
/Edit nutririon Function for delete
public function deletenutration(Request $request) { $id = $request->workoutid; $getWorkout = Nutration::find($id); if($getWorkout->delete()){ return redirect()->back()->with('danger','Nutration Deleted successfully'); } else{ return redirect()->back()->with('danger','Sorry! Nutration is not deleted'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete()\n {\n }", "public function deleting()\n {\n # code...\n }", "function delete()\r\n {\r\n\r\n }", "public function Do_delete_Example1(){\n\n\t}", "function delete() \n {\n \n }", "public function actionDelete() {}", "public function actionDelete() {}", "public function delete()\r\n\t{\r\n\t}", "public function index_delete(){\n\t\t\n\t\t}", "protected function delete() {\n\t}", "public function delete()\n\t{\n\t}", "public function delete(){\n \t\ttry{\n \t\t\t$db = DB::get();\n \t\t\t$sql = \"UPDATE t_\" . self::$Table . \" \n \t\t\t\t\tSET \" . self::$Table . \"_supprime='1' \n \t\t\t\t\tWHERE \" . self::$Table . \"_id = '\".$this->Id.\"' \";\n \t\t\n \t\t\t$result = $db->query($sql);\n \t\t}\n \t\tcatch(Exception $e){\n \t\t\tvar_dump($e->getMessage());\n \t\t}\n }", "public function DELETE() {\n #\n }", "function delete() ;", "function delete() ;", "public static function Delete(){\r\n }", "public function deleteAction() {\n \n }", "public function delete(){\r\n\t\t// goi den phuong thuc delete cua tableMask voi id cua man ghi hien hanh\r\n\t\t$mask = $this->mask();\r\n\t\treturn $mask->delete(array($mask->idField=>$this->id));\r\n\t\t// $query = \"DELETE FROM $this->tableName WHERE id='$this->id'\";\r\n\t\t// $conn = self::getConnect()->prepare($query);\r\n\t}", "public static function delete() {\r\n\t\t\r\n\t}", "function delete() {\n\n }", "public function delete()\n {\n \n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "public static function delete() {\n\n\n\t\t}", "public function delete() {\r\n }", "function delete()\n {\n }", "protected function _delete()\n\t{\n\t}", "public function delete(){\n }", "public function delete(){\n $record = actualite::find($this->selectedId);\n $record->delete();\n\n /* update image file */\n Storage::delete('public/_actualite/'.$this->selectedId.'.png');\n /* $this->photo->storePubliclyAs('public/_actualite/'.$this->selectedId.'.png'); */\n\n session()->flash('message', 'actualite modifié avec succès');\n $this->emit('Deleted');\n $this->dispatchBrowserEvent('Deleted');\n $this->resetFields();\n }", "public function deleted(Edit $edit)\n {\n //\n }", "public function deleteAction()\n {\n \n }", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "public function delete()\n {\n //\n }", "public function del()\n {\n }", "public static function delete(){\r\n }", "function deleteAction()\r\n\t{\r\n\t\t$data['message'] = \"\";\r\n\t\t$MaNguoiDung = $_GET['MaNguoiDung']; \r\n\r\n\t\t//echo $MaNguoiDung;\r\n\t\tif (isset($MaNguoiDung)) {\r\n\r\n\t\t\t$this->model->load(\"Nguoidung\");\r\n\t\t\t$nguoidung = new Nguoidung_Model();\r\n\t\t\t$nguoidung->delete($MaNguoiDung);\r\n\t\t\t$data['message'] = \"xóa người dùng thành công\";\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$data['message'] = \"không tồn tại mã người dùng\";\r\n\t\t}\r\n\r\n\t\t$this->indexAction($data);\r\n\t\t\r\n\t}", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n }", "public function delete()\n {\n \n }", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "function Delete();", "public function delete()\n {\n\n }", "public function delete()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'detailfasilitaskesehatan', 'delete')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tif (!empty($_POST)) {\n\t\t\t$query = $this->podb->deleteFrom('detailfasilitaskesehatan')->where('id', $this->postring->valid($_POST['id'], 'sql'));\n\t\t\t$query->execute();\n\t\t\t$this->poflash->success('Detailfasilitaskesehatan has been successfully deleted', 'admin.php?mod=detailfasilitaskesehatan');\n\t\t}\n\t}", "public function delete(){\n $db = Database::getInstance() ;\n $db->query(\"DELETE FROM canciones WHERE idcancion=:idcan ;\",\n [\":idcan\"=>$this->idcancion]) ;\t\t\t\t \n }", "function delete() {\n }", "public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }", "public function deleteData(){\n //buatlah query\n $sqlQuery = \"DELETE FROM \" . $this->t_name . \" WHERE id = ?\";\n\n //persiapkan stmt\n $stmt = $this->conn->prepare($sqlQuery);\n\n //cukup converte id\n $this->id=htmlspecialchars(strip_tags($this->id));\n\n //bind\n $stmt->bindParam(1,$this->id);\n\n //eksekusi\n if($stmt->execute()){\n return true;\n }\n return false;\n }", "public abstract function delete();", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "abstract public function delete();", "public function delete() {\n\n }", "function index_delete() {\n $id = $this->delete('id'); // Memanggil data berdasarkan arraynya\n $this->db->where('id', $id);\n $delete = $this->db->delete('telepon'); \n if ($delete) {\n $this->response(array('status' => 'success'), 201);// Jika berhasil maka akan tampil\n } else {\n $this->response(array('status' => 'fail', 502));// Jika gagal maka akan tampil\n }\n }", "public function deleting(Seguimiento $Seguimiento){\n \n }", "function onDelete($param)\n {\n $key=$param['key'];\n \n // define duas acoes\n $action1 = new TAction(array($this, 'Delete'));\n \n // define os parametros de cada acao\n $action1->setParameter('key', $key);\n \n //encaminha a chave estrangeira\n $action1->setParameter('fk', filter_input(INPUT_GET, 'fk'));\n\n // exibe um dialogo ao usuario\n new TQuestion('Deseja realmente excluir o registro ?', $action1, $action2);\n }", "public function preDelete() { }", "private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}", "public function delete($id_rekap_nilai);", "public function delete(){ return false; }", "public function delete(){ return false; }", "public function delete(){ return false; }", "public function delete(){ return false; }", "public function delete_extraproduct(){\n if($this->uri->segment(3) == \"temp\"){\n $id = $this->uri->segment(4);\n $result = MU_Model::deletedRecordById(\"temp_table\",array(\"ID\" => $id));\n }else{\n $id = $this->uri->segment(3);\n $result = MU_Model::deletedRecordById(\"extra_acti\",array(\"extraproduct_id\" => $id));\n }\n if($result) echo 't';\n }", "public function delete()\n {\n try {\n parent::delete(null, $this->data['id']);\n } catch (Exception $e) {\n die('ERROR');\n }\n }", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete() {}", "public function delete(){\n $id = $_POST['id'];\n Cita::destroy($id);\n }", "public function delete(){\r\n\t\tif(!$this->input->is_ajax_request()) show_404();\r\n\r\n\t\t//$this->auth->set_access('delete');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\tif($this->input->post('ang_id') === NULL) ajax_response();\r\n\r\n\t\t$all_deleted = array();\r\n\t\tforeach($this->input->post('ang_id') as $row){\r\n\t\t\t//$row = uintval($row);\r\n\t\t\t//permanent delete row, check MY_Model, you can set flag with ->update_single_column\r\n\t\t\t$this->m_anggota->permanent_delete($row);\r\n\r\n\t\t\t//this is sample code if you cannot delete, but you must update status\r\n\t\t\t//$this->m_anggota->update_single_column('ang_deleted', 1, $row);\r\n\t\t\t$all_deleted[] = $row;\r\n\t\t}\r\n\t\twrite_log('anggota', 'delete', 'PK = ' . implode(\",\", $all_deleted));\r\n\r\n\t\tajax_response();\r\n\t}", "public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }", "function delete()\n{\n $data = [$_GET['id']];\n $succes = changeDB('DELETE FROM projecten WHERE id = ?', $data);\n if ($succes) {\n return page_show(\"project verwijderen gelukt\");\n }\n\n return page_show(\"project verwijderen gefaald\");\n\n\n}", "protected function _postDelete()\n\t{\n\t}", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "function delete($id);", "function delete($id)\n {\n }" ]
[ "0.75826776", "0.7582287", "0.75806457", "0.7529898", "0.7512215", "0.7502402", "0.7502402", "0.74460536", "0.74243456", "0.74122477", "0.73959243", "0.7381666", "0.7347854", "0.7342801", "0.7342801", "0.73366445", "0.73326606", "0.73280436", "0.7326541", "0.7326388", "0.73219043", "0.7315881", "0.73149115", "0.73113644", "0.7302388", "0.72835135", "0.72815645", "0.72469264", "0.7239242", "0.72385293", "0.72323453", "0.7225615", "0.7225615", "0.7225615", "0.7225615", "0.7225615", "0.7225615", "0.7225615", "0.7225615", "0.7225615", "0.7225615", "0.7225615", "0.7225615", "0.7225615", "0.7225615", "0.7225615", "0.7223444", "0.7221695", "0.72089285", "0.7201556", "0.7198348", "0.71927214", "0.71927214", "0.71927214", "0.71927214", "0.71927214", "0.71927214", "0.71927214", "0.71927214", "0.71927214", "0.71927214", "0.71866715", "0.7185426", "0.71818006", "0.7174742", "0.7159295", "0.7152294", "0.7150942", "0.7141354", "0.7135774", "0.7120403", "0.71114165", "0.71114165", "0.71114165", "0.71114165", "0.70928144", "0.7080842", "0.7080085", "0.70775336", "0.706929", "0.7063952", "0.70501405", "0.7049191", "0.7049191", "0.7049191", "0.7049191", "0.70461243", "0.70445", "0.70427644", "0.70412767", "0.70412767", "0.7041124", "0.7039057", "0.7035813", "0.7018394", "0.7012183", "0.7008576", "0.6999519", "0.69962406", "0.69949925", "0.6990883" ]
0.0
-1
/View workout category Function
public function allworkoutcategory() { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $allWorkout = DB::table('categories') ->orderBy('id','DESC') ->paginate(10); //$allWorkout = DB::table('workouts')->orderBy('id','DESC')->get(); return view('admin.allworkoutcategory')->with('allworkout',$allWorkout); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addWorkoutCategory()\n {\n return view('admin.addworkoutcategory');\n }", "function wc_marketplace_category() {\n global $wmp;\n $wmp->output_report_category();\n }", "public function getViewedCategory();", "function showCategory()\r\n {\r\n }", "public function get_category()\n {\n return 'Information Display';\n }", "function list_categories() {\n $project_parent_category = get_category_by_slug('project');\n $project_parent_category_id=$project_parent_category->term_id;\n $categories=get_the_category();\n $count = 0;\n foreach($categories as $category){\n if($category->category_parent==$project_parent_category_id){\n if ($count == 0) {\n echo '<div class=\"category-symbology\">';\n\n if(get_post_type(get_the_id()) == 'discussion') { echo '<i class=\"social-foundicon-chat\"> </i> '; }\n }\n echo \"<a class='one-category' href='/project/\". $category->slug . \"'>\" . $category->name . \"</a>\";\n if ($count == 0) {\n echo '</div>';\n } \n $count++;\n }\n }\n\n //emit a chat symbol for discussion\n if($count == 0 && get_post_type(get_the_id()) == 'discussion') {\n generate_discussion_w_no_category();\n }\n}", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function category() {\n\t\treturn static::get_thrive_advanced_label();\n\t}", "public function getCategory() {}", "public function vbd_report_category_wise()\n\t\t{\n\t\t\t\t$this->load->view('admin/header');\n\t\t\t\t$this->load->view('admin/nav');\n\t\t\t\t$data['get_state']=$this->Mod_report->get_state();\n\t\t\t\t$data['get_disease_category']=$this->Mod_report->get_disease_category();\n\t\t\t\t$data['get_institute']=$this->Mod_report->get_institute();\n\t\t\t\t$this->load->view('reports/vbd_report_category_wise',$data);\t\t\n\t\t\t\t$this->load->view('admin/footer');\t\n\n\t\t}", "function the_category() {\n\tglobal $discussion;\n\treturn $discussion['category'];\n}", "public function getCategoryList(){\n\t\t$recordLimit = Input::get('limit');\n\t\t$recordLimit = (!empty($recordLimit) && in_array($recordLimit, parent::$pagination_limits)) ? \n\t\t\t$recordLimit : parent::recordLimit;\n\t\t\t\n\t\t$colors = $this->shift->getCategoryColors();\n\t\t$categories = $this->shift->getCategories(null, $recordLimit == 'all' ? null : $recordLimit);\n\t\t\n\t\treturn View::make('admin.shifts.list_category')\n\t\t\t->withColors($colors)\n\t\t\t->withCategories($categories)\n\t\t\t//->withRecordlimit(parent::recordLimit);\n\t\t\t->withRecordlimit($recordLimit);\n\t}", "public function show(Workout $workout)\n {\n //\n }", "public function get_category()\n {\n return 'Graphical';\n }", "public function get_category()\n {\n return 'Graphical';\n }", "public function category() {\n\t\treturn static::get_thrive_basic_label();\n\t}", "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "public function getCategory();", "public function getCategory();", "public function category()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_index');\n $view->kategorie = $_GET['kategorie'];\n $view->title = 'Kategorie';\n $view->heading = 'Kategorie: '. $_GET['kategorie'];\n $view->vereine = $vereinRepository->getByCategory($view->kategorie);\n $view->display();\n }", "public function category()\n\t{\n\t\t$data['catResult'] = $this->ProcurementModel->category();\n\t\t$data['pagename'] = \"category\";\n\t\t$data['category'] = \"master\";\n\t\t$data['active_menu'] = \"procurement\";\n\t\t$this->load->view('Director',$data);\n\n\t}", "public function index()\n {\n \n return $OutComeList = OutComeList::with('OutcomeCategory.Project.ProjectCategory.Programmes.ProgramCategory')->get();\n //return OutComeListCollection::collection(OutComeList::with('OutcomeCategory')->get());\n }", "public function get_category_permastruct()\n {\n }", "public function get_category()\n {\n return 'New Features';\n }", "public function get_category()\n {\n return 'New Features';\n }", "function displayCategoryLinks() {\n\n\t$catquery = \"select distinct ngroup from nassets where type like '0tdn%'\";\n\t$cresults = mysql_query($catquery);\n\t$has_null = false;\n\t$categories = array();\n\twhile ($acRow = mysql_fetch_array($cresults)) {\n\t\t$thisgroup = $acRow['ngroup'];\n\t\t$categories[] = $thisgroup;\n\t}\n\t\n\n\techo \"<ul>View by Category<br>\";\n\t$size = count($categories);\n \tforeach ($categories as $category) {\n \t\techo \"<li><a href=\\\"menu2.php?category=$category\\\" target=\\\"menu2\\\">$category</a><br/></li>\";\n \t}\n\n\techo \"</ul>\";\n}", "public function HM_CategoCuentas()\n {\n }", "function display_cat()\n {\n $this->Admin_model->procedure = 'GET_POST_CAT';\n\n $rs = $this->Admin_model->get_post();\n $data['rows'] = $rs;\n $this->load->view('display_posts_cat', $data);\n\n }", "public function index()\n {\n $categories = Category::all();\n return view('jobCategories.index', compact('categories'));\n }", "public function getCategory()\n {\n }", "public function category() {\n\t\treturn $this->get_category();\n\t}", "public function getCategory()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Category (Linnworks API)');\n\t\t}", "function tc_category_list() {\r\n $post_terms = apply_filters( 'tc_cat_meta_list', $this -> _get_terms_of_tax_type( $hierarchical = true ) );\r\n $html = false;\r\n if ( false != $post_terms) {\r\n foreach( $post_terms as $term_id => $term ) {\r\n $html .= sprintf('<a class=\"%1$s\" href=\"%2$s\" title=\"%3$s\"> %4$s </a>',\r\n apply_filters( 'tc_category_list_class', 'btn btn-mini' ),\r\n get_term_link( $term_id , $term -> taxonomy ),\r\n esc_attr( sprintf( __( \"View all posts in %s\", 'customizr' ), $term -> name ) ),\r\n $term -> name\r\n );\r\n }//end foreach\r\n }//end if $postcats\r\n return apply_filters( 'tc_category_list', $html );\r\n }", "public function allProgramCategory()\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $allWorkout = DB::table('program_category')\n ->orderBy('id','DESC')\n ->paginate(10);\n //$allWorkout = DB::table('workouts')->orderBy('id','DESC')->get();\n return view('admin.allprogramcategory')->with('allworkout',$allWorkout);\n }\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function category(){\n \treturn view('categories.category');\n }", "public function workload_summary(){\n\t\tif($this->session->userdata('status') !== 'admin_logged_in'){\n\t\tredirect('pages/Login');\n\t\t}\n\t\t$this->M_auditTrail->auditTrailRead('Usecase Summary', $this->session->userdata['type']);\n\n\t\t$data = [\n\t\t\t'countUsecase' => $this->M_workloadGraph->getCountUsecase(),\n\t\t\t'countMember' => $this->M_workloadGraph->getCountMember(),\n\t\t\t'graphNodes' => $this->M_workloadGraph->get_nodes(),\n\t\t\t'graphLinks' => $this->M_workloadGraph->get_links(),\n\t\t\t'judul' => 'Workload Summary - INSIGHT',\n\t\t\t'konten' => 'adm_views/home/monitoringWorkload',\n\t\t\t'admModal' => [],\n\t\t\t'footerGraph' => ['workloadSummary/workloadGraph']\n\t\t];\n\n\t\t$this->load->view('adm_layout/master', $data);\n\t}", "function category( $args )\n {\n // set the subview, all, category, and user should use the same\n $subview = array('browse_result');\n $this->view->add('subviews',$subview);\n \n // do some fancy pantsy switching to get the right args right\n $tmp = $args['page'];\n $args['page'] = $args['category'];\n $args['category'] = $tmp;\n \n // check if a category is provided\n if( $args['category'] == null ){\n // just use all because there is no category\n $this->all( $args );\n \n // do nothing else\n return;\n }\n\t\t\n\t\t\n $category_model = $this->app->model('categories');\n\t\t$exists = $category_model->category_exists($args['category']);\n if($exists != null){\n\t\t\t// get from settings, 10 as default\n\t\t\t$limit = $this->settings->get('per_page');\n\t\t\t$limit = ( $limit != null ) ? $limit : 10;\n\t\t\t\n\t\t\t// find if user has decided on some number already\n\t\t\tif( isset( $_SESSION['listings_per_page'] )){\n\t\t\t\t$limit = $_SESSION['listings_per_page'];\n\t\t\t}\n\t\t\t\n\t\t\t// init page number\n\t\t\t$page = 0;\n\t\t\t// find page\n\t\t\tif( $args['page'] != null && is_numeric($args['page']) ){\n\t\t\t\t$page = ((int) $args['page'])-1;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// initialize category id to 0\n\t\t\t$category_id = 0;\n\t\t\t\n\t\t\t// initialize category name\n\t\t\t$category = 'Not found';\n\t\t\t\n\t\t\t\n\t\t\t/* ==================\n\t\t\t * Get category model\n\t\t\t */\n\t\t\t\n\t\t\t// get category return results\n\t\t\t$cat_result = $category_model->limit(1)->\n\t\t\t\tget_category( $args['category']);\n\t\t\t\t\t\n\t\t\t// check for results\n\t\t\tif( count($cat_result) > 0 ){\n\t\t\t\n\t\t\t\t// get the id\n\t\t\t\t$category_id = (int)$cat_result[0]['id'];\n\t\t\t\t\n\t\t\t\t// get the display name\n\t\t\t\t$category = $cat_result[0]['display_name']; \n\t\t\t}\n\t\t\t\n\t\t\t// set page title\n\t\t\t$this->view->add('page_title',\"Browsing category '$category'\");\n\t\t\t\n\t\t\t// Ok. Now get all the children and stuff\n\t\t\t$cat_result[0]['child_item'] = $category_model->limit(-1)->\n\t\t\t\tget_category_children($category_id);\n\t\t\t\n\t\t\t/* ======================\n\t\t\t * Get the Listings model\n\t\t\t */\n\t\t\t$listing_model = $this->app->model('listings');\n\t\t\t\n\t\t\t// get categories result\n\t\t\t$result = $listing_model->limit($limit)->page($page)->\n\t\t\t\tget_categories( $cat_result );\n\t\t\t\n\t\t\t\n\t\t\t// add category name to the view\n\t\t\t$this->view->add('category', $category);\n\t\t\t\n\t\t\t// add category's display name to the view\n\t\t\t$this->view->add('category_display_name', $args['category']);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$count = $listing_model->count_categories($cat_result);\n\t\t\t// set up counts\n\t\t\t$paginate = array(\n\t\t\t\t'page_count' => ((int)ceil($count/$limit)),\n\t\t\t\t'this_page' => $page+1\n\t\t\t);\n\t\t\t\n\t\t\t// add page count\n\t\t\t$this->view->add('paginate',$paginate);\n\t\t\t\n\t\t\t// add teh page action to the view\n\t\t\t$this->view->add('page_action', $this->app->form_path(\n\t\t\t\t'browse/category/'.$args['category']) \n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t// add results to the view\n\t\t\t$this->view->add('listing_results', $result);\n\t\t}else{\n\t\t\t$this->view->add('page_title','Category \"' . $args['category'] . '\" not found');\n\t\t}\n }", "public function index($how)\n {\n $categoryList = $this->museumCategoryRepository->getCategories($how);\n\n return view('museum.admin.category.index', compact('categoryList'));\n\n }", "public function categories() {\n\n $this->load->model('Model_Bird_Wiki');\n $result['categories'] = $this->Model_Bird_Wiki->get_categories();\n\n if($result!=false) {\n $this->load->view('category_main', $result);\n }\n else {\n echo \"Something went wrong !\";\n }\n\n }", "function showCategory($category){\n \n //echo 'gathering datas about ' . $category;\n \n $exercices = getExerciceNames($category);\n\n require './views/category.php';\n\n }", "public function showCategories(){\n return ArticleModel::showCategories();\n }", "public function index()\n {\n return view('SchoolAdmin::subject-category');\n }", "public function getCategory()\n {\n return \"Injection Flaws\"; //See category.php for list of all the categories\n }", "public function category_summary()\n\t{\n\t \t$categories = MainCategories::select('*')->orderBy('id', 'asc')->get();\n\t \t//echo \"<pre/>\";print_r($categories);\n\t \treturn view('admin.main_categories.category_summary', compact('categories'));\n\t}", "public function index()\n {\n return view('course.category.index');\n }", "public function index()\n\t{\n\t\treturn view('catalog.category.index');\n\t}", "public function getStoriesByCategory($category_name){\n\n\n }", "public function getCategory(): string;", "public function categoryList()\n {\n return view(\"Category::list\");\n }", "public function index()\n {\n $categories = Category::all()->toHierarchy();\n\n return view_backend('category.index', compact('categories'));\n }", "private function getCategory() {\n return '';\n }", "public function index()\n {\n $pagi = config('seting.paginate');\n $filters = request()->only('action', 'key');\n\n if($filters && $filters['action'] == 'search'){\n // for search\n $category = $this->categoryRepo->getCategoryBySearchName($filters['key'], $pagi);\n }\n else{\n\n $category = $this->categoryRepo->paginate('id','ASC', $pagi);\n }\n\n return view('categories.category', ['category' => $category]);\n }", "public function index(){\n $recup_collection = Category::with(['superCategory.collection'])->get();\n\n return view('admin/categorie/index',compact('recup_collection'))->with('i');\n }", "function getCategory() \n {\n return $this->instance->getCategory();\n }", "public function category()\n {\n return view('category');\n }", "public function categoly($cat) \n {\n $data['languages'] = Language::orderBy('created_at', 'DESC')->get();\n $data['categories'] = Category::orderBy('created_at', 'DESC')->get();\n\n $data['projectsByCategories'] = Project::where('category_id', $cat)->orderBy('created_at', 'DESC')->paginate(6);\n\n return view('pages.projects.showByOption', $data);\n }", "public function category(){\n\t\t$this->load->helper('url');\n\t\t$data['userLogin'] = $this->checkLogin();\n\t\tif($data['userLogin']){\n\t\t\t$data['user'] = $this->getUser();\n\t\t}\n\n\t\t$data['sidebar'] = $this->sidebar();\n\n\t\t$this->load->view('frontend/templates/header');\n\t\t$this->load->view('frontend/templates/navigation');\n\t\t$this->load->view('frontend/category', $data);\n\t\t$this->load->view('frontend/templates/sidebar');\n\t\t$this->load->view('frontend/templates/footer');\n\t}", "function the_category_ID($display = \\true)\n {\n }", "public function GetCategories()\n {\n \n \n global $PAGE;\n $output = '';\n \n \n if ($this->Is_Instructor) {\n $type = \" AND `type_instructor`=1\";\n } else {\n $type = \" AND `type_customer`=1\";\n }\n \n \n # GET THE CURRENTLY SELECTED CATEGORY\n # ============================================================================\n $default_selected_cid = ($this->Use_Common_Category) ? $this->Common_Category_Id : $this->Default_Category_Id;\n $eq_cat = (Get('eq')) ? GetEncryptQuery(Get('eq'), false) : null;\n $selected_cid = (isset($eq_cat['cid'])) ? $eq_cat['cid'] : $default_selected_cid;\n \n if ($this->Use_Common_Category) {\n $selected_common = (isset($eq_cat['special']) && $eq_cat['special'] == 'common') ? true : false;\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : $selected_common;\n } else {\n $selected_common = ($selected_cid == $this->Common_Category_Id) ? true : false;\n }\n \n if ($this->Use_Display_All_Category) {\n $selected_all = (isset($eq_cat['special']) && $eq_cat['special'] == 'all') ? true : false;\n $selected_all = ($selected_cid == $this->All_Category_Id) ? true : $selected_all;\n }\n //$selected_all = true;\n \n \n # GET ALL THE CATEGORIES\n # ============================================================================\n $records = $this->SQL->GetArrayAll(array(\n 'table' => $GLOBALS['TABLE_helpcenter_categories'],\n 'keys' => '*',\n 'where' => \"`active`=1 $type\",\n ));\n if ($this->Show_Query) echo \"<br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n \n \n # OUTPUT THE CATEGORIES MENU\n # ============================================================================\n $output .= '<div class=\"orange left_header\">HELP CENTER TOPICS</div><br />';\n $output .= '<div class=\"left_content\">';\n \n # OUTPUT COMMON CATEGORY\n if ($this->Use_Common_Category) {\n $eq = EncryptQuery(\"cat=Most Common;cid=0;special=common\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n $class = ($selected_common) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >Most Common</a></div><br />\";\n }\n \n # OUTPUT ALL DATABASE CATEGORIES\n foreach ($records as $record) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl($record['title']);\n $query_link = '/' . EncryptQuery(\"cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat={$record['title']};cid={$record['helpcenter_categories_id']}\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($record['helpcenter_categories_id'] == $selected_cid) ? 'faq_selected_category' : '';\n $output .= \"<div class='$class'><a href='{$link}' class='link_arrow' >{$record['title']}</a></div>\";\n }\n \n # OUTPUT DISPLAY ALL CATEGORY\n if ($this->Use_Display_All_Category) {\n \n # MAKE LINKS\n if ($this->Use_Seo_Urls) {\n $title = ProcessStringForSeoUrl('View All');\n $query_link = '/' . EncryptQuery(\"cid={$this->All_Category_Id}\");\n $link = \"{$PAGE['pagelink']}/{$title}\" . $query_link;\n } else {\n $eq = EncryptQuery(\"cat=View All;cid={$this->All_Category_Id};special=all\");\n $link = \"{$PAGE['pagelink']};eq=$eq\";\n }\n \n $class = ($selected_all) ? 'faq_selected_category' : '';\n $output .= \"<br /><div class='$class'><a href='{$link}' class='link_arrow' >View All</a></div>\";\n }\n \n $output .= '</div>';\n \n \n AddStyle(\"\n .faq_selected_category {\n background-color:#F2935B;\n color:#fff;\n }\n \");\n \n return $output;\n \n\n }", "function do_viewCategory() { \n $category = KTUtil::arrayGet($_REQUEST, \"fCategory\", $this->category);\n \n $oRegistry =& KTAdminNavigationRegistry::getSingleton();\n $aCategory = $oRegistry->getCategory($category);\t\t\n \n $aItems = $oRegistry->getItemsForCategory($category);\n $this->aBreadcrumbs[] = array(\"name\" => $aCategory[\"title\"], \"url\" => KTUtil::ktLink('admin.php',$category));\n\n \n $this->oPage->title = _kt(\"DMS Administration\") . \": \" . $aCategory[\"title\"];\n $oTemplating =& KTTemplating::getSingleton();\n $oTemplate = $oTemplating->loadTemplate(\"kt3/admin_items\");\n $aTemplateData = array(\n \"context\" => $this,\n \"category\" => $aCategory,\n \"items\" => $aItems, \n \"baseurl\" => $_SERVER['PHP_SELF'],\n );\n return $oTemplate->render($aTemplateData);\t\t\t\t\n }", "public function index()\n {\n $lawcategories = lawcategories::all();//fetch all created law categories\n return view('admin.lawcategory.show',compact('lawcategories'));//bind that categories variable to show blade\n }", "public function categories()\n {\n $result = $this->dtbs->list('category');\n $data['info'] = $result;\n $this->load->view('back/categories/anasehife',$data);\n }", "public function index()\n { \t\n \t$job_category = $this->getAllJobCategoryList(); \n \t$job_industry= app('jobready365\\Http\\Controllers\\JobIndustryController')->getAllJobIndustryList(); \n $township = app('jobready365\\Http\\Controllers\\TownshipController')->getAllTownshipCity();\n $city = app('jobready365\\Http\\Controllers\\HomeController')->getAllCity();\n \n return view('jobcategory.index', compact('job_category','township','city','job_industry'));\n }", "public function index()\n {\n return view('backend.category.show');\n }", "public function index()\n {\n return view('category.category');\n }", "public function index()\n {\n $categories = DB::table('categories')->get();\n return view('admin.dashboard.category',['categories'=>$categories, 'i'=>1]);\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "function print_categories( $thisId ) { \n $thisCat = get_the_category( $thisId );\n foreach( $thisCat as $cat ) {\n echo $cat->slug . \" \";\n }\n}", "public function categories()\n {\n $group_id = ee()->input->get('group_id') ? ee()->input->get('group_id') : ee()->publisher_category->get_first_group();\n\n $vars = ee()->publisher_helper_cp->get_category_vars($group_id);\n\n $vars = ee()->publisher_helper_cp->prep_category_vars($vars);\n\n // Load the file manager for the category image.\n ee()->publisher_helper_cp->load_file_manager();\n\n // Bail if there are no category groups defined.\n if (empty($vars['category_groups']))\n {\n show_error('No category groups found, please <a href=\"'. BASE.AMP .'D=cp&C=admin_content&M=edit_category_group\">create one</a>.');\n }\n\n return ee()->load->view('category/index', $vars, TRUE);\n }", "public function index()\n {\n $this->addBreadcrumb('Categories', null, 'circle-o-notch');\n $org = getDefaultOrg();\n $categories = Category::where('organization_id', '=', $org->id)->get();\n return $this->view('admin.categories.index', ['categories' => $categories]);\n }", "public function getCategoriesForListView(): Collection;", "public function showSubcategories(){\n return ArticleModel::showSubcategories();\n }", "public function category(){\n\tif ($this->session->userdata('logged_in')){\n\t\t$data['title'] = 'Category';\n\t\t$data['categoryList'] = $this->common_model->get_all('fr_category', '');\n\t\t$this->set_layout('category/category_list',$data);\n\t}else{\n\t\t$this->load->view('site/login');\n\t}\n}", "public function navcaregory(){\n\t\t$query=$this->db->get('tbl_category');\n\t\treturn $query->result();\n\t}", "public function categories()\n {\n return view('templates.them8.categories');\n }", "function view_category(){\n\t\t\t$this->layout = 'mobilelayout';\n\t\t\tglobal $loguser;\n\t\t\tif(!$this->isauthorizedpersn())\n\t\t\t\t$this->redirect('/');\n\t\t\t\t\n\t\t\t$this->set('title_for_layout','Category Management');\n\t\t\t\n\t\t\t$main_catdata = $this->Category->find('all');\n\t\t\t//$super_sub_catdata = $this->Category->find('all',array('conditions'=>array('category_parent <>'=>0)));\n\t\t\t// $sub_sub_catdata = $this->Category->find('all',array('conditions'=>array('category_parent <>'=>0,'category_sub_parent <>'=>0)));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->paginate = array('conditions'=>array('Category.category_name <>'=>''),'limit'=>10,'order'=>array('Category.id'=>'desc'));\n\t\t\t$super_sub_catdata = $this->paginate('Category');\n\t\t\t$pagecount = $this->params['paging']['Category']['count'];\n\t\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$this->set('main_catdata',$main_catdata);\n\t\t\t$this->set('super_sub_catdata',$super_sub_catdata);\n\t\t\t$this->set('pagecount',$pagecount);\n\t\t\t// $this->set('sub_sub_catdata',$sub_sub_catdata);\n\t\t\t\n\t\t\t// echo \"<pre>\";print_r($sub_sub_catdata);die;\n\t\t}", "public function listOfCategory()\n {\n //$sub_category = Categories::where('is_parent', 1)->orderBy('category_name')->get();\n return view('admin.category.categoryList');\n }", "function setup_cat()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'perms_view, def_view, id, name', 'from' => 'gallery_categories', 'where' => \"id={$this->ipsclass->input['cat']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $cat = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this category?\n if( ! $this->ipsclass->check_perms( $cat['perms_view'] ) )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); \n }\n\n return $cat;\n }", "public function index()\n {\n return view('admin.bounty.category')->with('categories',BountyCategory::all());\n }", "public function show_membership_categories()\n {\n $this->show_objects('Booking_membership_category');\n }", "public function show($project_id,$category_id,$task_id)\n {\n\n }", "public function index()\n\t{\n\t\t$opdcasecategories = Opdcasecategory::all();\n\n\t\treturn View::make('opdcasecategories.index', compact('opdcasecategories'));\n\t}", "public function categoryIndex()\n {\n $output = $this->product->getProductCategory();\n\n return view('product_category.index',compact('output'));\n }", "public function index()\n {\n //\n $datas = I_category::all();\n return view('masters.icrelmic',compact('datas'));\n\n }", "public function index()\n {\n $categories = Category::withCount('listings')->get();\n\n return view('category.index')->with('categories', $categories);\n }", "public function dashboardCpts()\n {\n\n $args = array(\n 'public' => true ,\n '_builtin' => false\n );\n\n $output = 'object';\n $operator = 'and';\n $post_types = get_post_types($args, $output, $operator);\n\n foreach ($post_types as $post_type) {\n $num_posts = wp_count_posts($post_type->name);\n $num = number_format_i18n($num_posts->publish);\n $text = _n($post_type->labels->singular_name, $post_type->labels->name, intval($num_posts->publish));\n\n if (current_user_can('edit_posts')) {\n $num = \"<a href='edit.php?post_type=$post_type->name'>$num\";\n $text = \"$text</a>\";\n }\n\n echo '<li class=\"post-count\">' . $num . ' ' . $text . '</li>';\n }\n }", "public function index()\n {\n\n return view('admin.category.listing');\n }", "public function cat(){\n $cat_id = intval(I('get.cat_id'));\n if(!$cat_id){\n http_response_code(404);\n }\n\n $display = cookie('display');\n if($display) {\n if (!preg_match(\"/^list|grid$/\", $display)) {\n die('hack out');\n }else{\n if($display == 'list') {\n $this->assign('display', 1);\n }else{\n $this->assign('display', 0);\n }\n }\n }\n $this->assign('cat_id', $cat_id);\n $mbx = D('Admin/cat')->parentList($cat_id);\n if($mbx){\n $this->assign('mbx',$mbx);\n }\n\n $cat_in_nav = M('cat')->field('cat_id,cat_name')->where('show_in_nav=1')->select();\n $this->assign('cat_in_nav',$cat_in_nav);\n $his = array_reverse(session('history'),true);\n $this->assign('history',$his);\n $sale = M('goods')->field('goods_id,goods_name,thumb_img,shop_price,goods_number')->order('goods_number desc')->limit(10)->select();\n $this->assign('sale',$sale);\n $this->assign('cattree',D('Admin/Cat')->gettree());\n\n $this->assign('cat_name', M('cat')->field('cat_name')->find($cat_id)['cat_name']);\n\n $this->display();\n }", "public function allVideoCategory()\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $allWorkout = DB::table('video_category')\n ->orderBy('id','DESC')\n ->paginate(10);\n //$allWorkout = DB::table('workouts')->orderBy('id','DESC')->get();\n return view('admin.allvideocategory')->with('allworkout',$allWorkout);\n }\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function indexCategory()\n {\n $categories = Category::all();\n return view('category')->with(\"categories\", $categories);\n }", "public function get_categories() {\n\t\treturn [ 'happyden' ];\n\t}", "function category() {\n // check session \n $this->check_session();\n \n // header data\n $header = $this->header_array('','','','Admin Category | Cytek Solutions Inc.','',base_url('admin/category'));\n // admin-navigation data\n $nav[\"page\"] = \"category\";\n $nav[\"inquiry\"] = $this->inquiry_model->pull_new_lead_cnt();\n // body data\n $body_data[\"categories\"] = $this->category_model->pull_categories();\n $body_data[\"subcategories\"] = $this->category_model->pull_subcategories();\n //view\n $this->load->view('header',$header);\n $this->load->view('admin-navigation',$nav);\n $this->load->view('category',$body_data);\n $this->load->view('script');\n $this->load->view('footer');\n }", "public function index()\n {\n\n $workouts = Workout::all();\n return view('workouts.workouts',[\n 'workouts' => $workouts\n ]);\n }", "function htheme_woocategory_shortcode( $atts ) {\r\n\r\n\t\t#IF WOOCOMMERCE CLASS EXIST - ADD WOO VISUAL COMPOSER ELEMENTS\r\n\t\tif ( class_exists( 'WooCommerce' ) ){\r\n\t\t\t#SETUP WOO CONTENT CLASS\r\n\t\t\t$htheme_data = $this->htheme_woo_content->htheme_get_woo_product_category($atts);\r\n\r\n\t\t\t#RETURN DATA/HTML\r\n\t\t\treturn $htheme_data;\r\n\t\t} else {\r\n\t\t\treturn 'WooCommerce required!';\r\n\t\t}\r\n\r\n\t}", "public function get_categorie(){\n\t\treturn $this->search_categorie;\n\t}", "public function listAction()\n {\n return view('blog.category.list');\n }", "public function addNutrationCategory()\n {\n return view('admin.addnutratoncategory');\n }" ]
[ "0.70076585", "0.6643182", "0.6540571", "0.6184498", "0.61589843", "0.60917133", "0.60839635", "0.60839635", "0.60839635", "0.6025001", "0.596794", "0.59064233", "0.5904465", "0.5903311", "0.5895543", "0.5882564", "0.5882564", "0.58481395", "0.58303297", "0.58261317", "0.58261317", "0.58204216", "0.58131635", "0.58056957", "0.57511", "0.5750011", "0.5750011", "0.5729318", "0.5726671", "0.57199043", "0.57150555", "0.5691271", "0.56843764", "0.5683543", "0.5656042", "0.5655632", "0.5615881", "0.56107956", "0.5600567", "0.5585748", "0.5579385", "0.5575206", "0.55681384", "0.55664855", "0.556408", "0.55583835", "0.5551669", "0.5547105", "0.5527962", "0.55259126", "0.5522808", "0.5517035", "0.55144155", "0.55088335", "0.55062586", "0.55055666", "0.550046", "0.54943496", "0.5488984", "0.5484868", "0.54823464", "0.5474909", "0.5473063", "0.5471466", "0.54668576", "0.5463884", "0.5459877", "0.54590756", "0.54546493", "0.54546493", "0.54483104", "0.54415005", "0.5441261", "0.54399973", "0.54397523", "0.5434071", "0.542861", "0.5424233", "0.5423298", "0.5421807", "0.5417955", "0.54100627", "0.54099435", "0.540714", "0.54048353", "0.5385884", "0.5383244", "0.53764826", "0.5376064", "0.5375269", "0.53750956", "0.53708565", "0.53702885", "0.5368992", "0.5365136", "0.53592217", "0.5357179", "0.53509253", "0.5349816", "0.534853" ]
0.65132195
3
/edit workout category Function for view form
public function editworkoutcategory($id) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $workout = Category::find($id); return view('admin.editworkoutcategory')->with('workout',$workout); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateworkoutcategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $workoutCategory = Category::find($id);\n $workoutCategory->Category = $request->name;\n $workoutCategory->save();\n Session::flash('success','Workout Category Updated succcessfully.');\n return redirect()->back()->with('workout',$workoutCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function edit()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/edit\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n\n } catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception->getMessage());\n }\n\n }", "public function addWorkoutCategory()\n {\n return view('admin.addworkoutcategory');\n }", "public function edit(Workout $workout)\n {\n //\n }", "public function editPost()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"edit_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryName = $this->input->post(\"name\");\n\n $categoryModel = new CategoriesModel();\n\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n if ($categoryModel->editCategory($categoryName, $categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category edited successfully!\",\"success\");\n } else {\n $this->view->redirect(\"/categories/manage\",\"You did not change anything ?\");\n }\n\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function editNutrationCategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = NutrationCategory::find($id);\n return view('admin.editnutrationcategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function edit(TripCategory $tripCategory)\n {\n //\n }", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "public function edit(Postcategory $postcategory)\n {\n //\n }", "function catedit()\r\n\t{\r\n\t\t$data['cat'] = $this->categeory_model->cat($this->uri->segment(4));\r\n\t\t$this->load->view('admin/edit',$data);\r\n\t}", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "function get_category_to_edit($id)\n {\n }", "public function formModify() {\n $categories=$this->model->listCategories();\n $this->view->display(\"view/form/ProductFormModify.php\", NULL, $categories); \n }", "public function edit(Category $category) {\n //not implemented\n }", "public function edit(Workout $workout)\n {\n $logged_user = Auth::user();\n $users = User::all();\n return view('Admin.Workouts.edit',compact('workout','users','logged_user'));\n }", "public function editProgramCategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = ProgramCategory::find($id);\n return view('admin.editprogramcategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function edit_category($category) {\n $this->category();\n $categories_sql_string = \"SELECT * FROM category WHERE id = \" . $category . \" limit 1\";\n $connection = new Database(\"sbrettsc_db\");\n $menu_array = $connection->get_array_from_query($categories_sql_string);\n $data = array(\"menu_array\" => array_shift($menu_array));\n\n $this->loadView(\"editors/category_editor\", $data);\n }", "public function edit_category($category_id){\n $category_info=DB::table('tbl_category')\n ->where('category_id',$category_id)\n ->first();\n $edit_category=view('admin.pages.edit_category') \n ->with('category_info',$category_info); \n return view('admin.admin_master')->with('admin_content',$edit_category);\n }", "public function edit(Category $Category)\n {\n //\n }", "public function editSpecialist($cat_id)\n {\n\n $specialistData = DB::table('specialists')\n ->join('departments', 'specialists.department_id', '=', 'departments.id')\n ->select('specialists.*', 'departments.name as deptName', 'departments.id as catID')\n /*->get();*/\n ->where('specialists.id',$cat_id)\n ->first();\n\n $editSpecialist=view('admin.specialist_edit')\n ->with('specialistData',$specialistData);\n\n return view('admin.master')\n ->with('main_content',$editSpecialist);\n\n return Redirect::to('/specialists');\n }", "public function edit($id)\n\t{\n\t\t$present_users = \\App\\User::where('category', '!=', 0)->orderBy('created_at', 'desc')->get();\n\t\t\n\t\t$data = \\App\\Work::find($id);\n\t\t$industries = \\App\\Industry::orderBy(\"sort\", 'asc')->get();\n\t\t$work_categories = \\App\\WorkCategory::orderBy('sort', 'asc')->get();\n\t\t$area_provinces = \\App\\AreaProvince::orderBy('sort', 'asc')->get(array('id','code', 'name', 'id'));\n\t\t$area_cities = null;\n\t\t$area_streets = null;\n\t\tif(!empty($data->province))\n\t\t{\n\t\t\t$area_cities = \\App\\AreaCity::where('provincecode', '=', $data->province)->orderBy('sort', 'asc')->get(array('id','code', 'name', 'id'));\n\t\t}\n\t\tif(!empty($data->city))\n\t\t{\n\t\t\t$area_streets = \\App\\AreaStreet::where('citycode', '=', $data->city)->orderBy('sort', 'asc')->get(array('id','code', 'name', 'id'));\n\t\t}\n\t\t\t\n\t\treturn view('admin.works.edit')->with('data', $data)->with('present_users', $present_users)->with('area_provinces', $area_provinces)->with('area_cities', $area_cities)->with('area_streets', $area_streets)->with('work_categories', $work_categories)->with('industries', $industries);\n\t}", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public function edit() {\n// user must be logged in\n if (User::is_logged_in()) {\n// preventing double submitting\n $token = md5(time());\n $_SESSION[$token] = true;\n\n $user_id = $_SESSION['user_id'];\n $is_admin = isset($_SESSION['is_admin']) && $_SESSION['is_admin'];\n $post_id = $_GET['post_id'];\n $post = Post::find($post_id);\n\n $description = $post['description'];\n $categoryId = $post['category'];\n $imageFile = $post['imageFile'];\n// user can edit only his post or he must be an admin\n if ($user_id == $post['authorId'] || $is_admin) {\n // get all categories for the select box in form\n $categories = Category::all();\n// show post edit form\n require_once('views/posts/edit.php');\n }\n }\n }", "public function edit(Category $edit){\n return $edit;\n }", "function editWorkOption(){\n\n if($this->session->has_userdata('userId')){\n\n if(! $this->_isUserAdmin()){\n\n $this->deniedAccess();\n }else{\n\n $workOptionId = $this->uri->segment(2);\n $this->Work_option_model->updateWorkOption($workOptionId);\n\n redirect(site_url('manage-work-options'));\n }\n }\n else{\n\n //redirect to home page\n redirect(site_url());\n }\n }", "function editAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\t\n\t\t$redirectUrl = $this->getRedirectUrl();\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t$error \t\t= array();\n\t\t\t$success \t= array();\n\t\t\t$contents \t= '';\n\t\t\t$formData \t= array();\n\t\t\t //Truyen du lieu hien co vao form\n\t\t\t$formData['fbulkid'] = array();\n\t\t\t$formData['fid'] = $myProductCat->id;\n\t\t\t$formData['fname'] = $myProductCat->name;\n\t\t\t$formData['forder'] = $myProductCat->order;\n\t\t\t$formData['fparentid'] = $myProductCat->parentid;\n\t\t\t$formData['fenable'] = $myProductCat->enable;\n\t\t\t$formData['fseourl'] = $myProductCat->seoUrl;\n\t\t\t$formData['fseotitle'] = $myProductCat->seoTitle;\n\t\t\t$formData['fseokeyword'] = $myProductCat->seoKeyword;\n\t\t\t$formData['fseodescription'] = $myProductCat->seoDescription;\n\t\t\t\n\t\t\tif(!empty($_POST['fsubmit']))//truong hop da nhan nut submit\n\t\t\t{\n if($_SESSION['productcategoryEditToken']==$_POST['ftoken'])//kiem tra token\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->editActionValidator($formData, $error))//kiem tra du lieu co hop le hay khong\n {\n //Cac thong tin khong ngon ngu:\n $myProductCat->order = (int)$formData['forder'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n if(strlen($formData['fseourl']) > 0)\n $myProductCat->seoUrl = Helper::codau2khongdau($formData['fseourl'], true);\n else\n $myProductCat->seoUrl = Helper::codau2khongdau(strip_tags($formData['fname']), true);\n //Cac thong tin lien quan ngon ngu: \n $myProductCat->name = $formData['fname']; \n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n \n if($myProductCat->updateData())//cap nhat database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succUpdate']);\n $this->registry->me->writelog('ProductCategoryedit', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n }\n else\n {\n $error[] = $this->registry->lang['controller']['errUpdate']; \n }\n }\n }\n $_SESSION['productcategoryEditToken'] = Helper::getSecurityToken();//Tao token moi\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t\t\t$this->registry->smarty->assign(array(\t'formData' \t=> $formData,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'subcategories' => $myProductCat->getSub(true),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'parentCategories' => Core_ProductCategory::getFullCategories(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectUrl'=> $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'success'\t=> $success,\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\t));\n\t\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'edit.tpl');\n\t\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategorylist',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_edit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t\t$this->registry->smarty->assign(array('redirect' => $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectMsg' => $redirectMsg,\n\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t}\n\t}", "public function edit(Category $Category)\n {\n echo \"i am in edit\";exit();\n //\n }", "public function edit($id = NULL){\n\t\tif ($id) {\n\t\t\t$this->data['category'] = $this->category_m->get($id);\n\t\t\tcount($this->data['category']) || $this->data['errors'][] = 'category could not be found';\n\t\t}\n\t\telse {\n\t\t\t$this->data ['category'] = $this->category_m->get_new();\n\t\t}\n\t\t\n\t\t// Set up the form\n\t\t$rules = $this->category_m->rules;\n\t\t$this->form_validation->set_rules($rules);\n\t\t\n\t\t// Process the form\n\t\tif ($this->form_validation->run() == TRUE) {\n\t\t\t$data = $this->category_m->array_from_post(array(\n\t\t\t\t'title', \n\t\t\t\t'description', \n\t\t\t\t'items_style'\n\t\t\t\t\n\t\t\t));\n\t\t\t$this->category_m->save($data, $id);\n\t\t\tredirect('admin/category');\n\t\t}\n\t\t\n\t\t$this->data['subview'] ='admin/category/edit';\n\t $this->load->view('admin/_layout_main', $this->data);\n }", "public function editCategory($editCategory) {\n if (isset($editCategory)) {\n\n $data = array(\n 'name' => $editCategory['name'],\n 'support_emails' => $editCategory['support_emails'],\n 'quantity_enabled' => $editCategory['quantity_enabled']\n );\n \n if (isset($editCategory['supplier_user'])) {\n $data['supplier_user'] = $editCategory['supplier_user'];\n }\n \n if (isset($editCategory['custom_fields'])) {\n $data['custom_fields'] = $editCategory['custom_fields'];\n } else {\n $data['custom_fields'] = NULL;\n }\n $this->db->where('id', $editCategory['category_id']);\n $this->db->update('categories', $data);\n return TRUE;\n } else {\n return False;\n }\n }", "public function edit(CourseCategory $courseCategory)\n {\n //\n }", "function edit_category($tbl_name){\n\t\t//print_r($_POST); die;\n\t\tunset($_POST['submitLog']);\n\t\t$this->db->where('id', $_POST['id']);\n\t\tunset($_POST['id']);\n\t\t$this->db->update($tbl_name,$_POST);\n\t\t// print_r($this->db->last_query());\n\t // die();\n\t}", "function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $up=false, $down=false, $thisparents=array()) {\n global $CFG, $USER, $OUTPUT;\n $mform =& $this->_form;\n\n static $str = NULL;\n static $config = NULL;\n\n if (is_null($config)) {\n $config = get_config('block_cam_mycourses');\n }\n\n if (is_null($str)) {\n $str = new stdClass;\n $str->spacer = $OUTPUT->spacer().' ';\n $str->full = get_string('full', 'block_cam_mycourses');\n $str->listing = get_string('listing', 'block_cam_mycourses');\n $str->no = get_string('no');\n $str->display = get_string('display', 'block_cam_mycourses');\n $str->cascade = get_string('cascade', 'block_cam_mycourses');\n $str->enrol = get_string('enrolled', 'block_cam_mycourses');\n $str->fullif = get_string('fullif', 'block_cam_mycourses');\n }\n $options = array(0 => $str->no,\n CAM_MYCOURSES_DISPLAYFULL => $str->full,\n CAM_MYCOURSES_DISPLAYFULLENROL => $str->fullif,\n CAM_MYCOURSES_DISPLAYLIST => $str->listing);\n if (!empty($category)) {\n\n if (!isset($category->context)) {\n $category->context = context_coursecat::instance($category->id);\n }\n\n // echo '<tr><td align=\"left\" class=\"name\">';\n $categoryprefix = '';\n for ($i=0; $i<$depth;$i++) {\n $categoryprefix .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';\n }\n //echo '</td>';\n $display = \"display_\".$category->id;\n $display = isset($config->$display) ? $config->$display : 0;\n $enrolled = \"enrol_\".$category->id;\n $enrolled = isset($config->$enrolled) ? $config->$enrolled : false;\n $cascade = \"cascade_\".$category->id;\n $cascade = isset($config->$cascade) ? $config->$cascade : false;\n $mform->addElement('header', 'header'.$category->id, $categoryprefix.format_string($category->name));\n $mform->addElement('select', 'display'.$category->id, $str->display, $options);\n $mform->setDefault('display'.$category->id, $display);\n $mform->addElement('checkbox', 'cascade'.$category->id, $str->cascade);\n $mform->setDefault('cascade'.$category->id, $cascade);\n $mform->addElement('checkbox', 'enrolled'.$category->id, $str->enrol);\n $mform->setDefault('enrolled'.$category->id, $enrolled);\n foreach($thisparents as $parentid) {\n $mform->disabledIf('display'.$category->id, 'cascade'.$parentid, 'checked');\n $mform->disabledIf('cascade'.$category->id, 'cascade'.$parentid, 'checked');\n $mform->disabledIf('enrolled'.$category->id, 'cascade'.$parentid, 'checked');\n }\n $mform->disabledIf('enrolled'.$category->id, 'display'.$category->id, 'eq', 3);\n } else {\n $category->id = '0';\n }\n\n if ($categories = get_categories($category->id)) { // Print all the children recursively\n $countcats = count($categories);\n $count = 0;\n $first = true;\n $last = false;\n if (!empty($category->id)) {\n $thisparents[] = $category->id;\n } else {\n $thisparents = array();\n }\n foreach ($categories as $cat) {\n $count++;\n if ($count == $countcats) {\n $last = true;\n }\n $up = $first ? false : true;\n $down = $last ? false : true;\n $first = false;\n\n $this->print_category_edit($cat, $displaylist, $parentslist, $depth+1, $up, $down, $thisparents);\n }\n }\n }", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "function edit_category_data($category_id)\n\t{\n\t\t$this->data['title'] \t= 'Edit Portfolio Category Data';\n\t\t$this->data['category']\t= $this->portfolio_model->get_category_by_id($category_id);\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/edit_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function edit(category $category)\n {\n return \"category\";\n //\n }", "public function actionCategoryEdit()\n {\n $this->_assertCanManageCategories();\n $category_id = $this->_input->filterSingle('faq_id', XenForo_Input::UINT);\n $viewParams = array('faqcategory' => $this->_getCategoryModel()->getById($category_id));\n return $this->responseView('Iversia_FAQ_ViewPublic_Category', 'iversia_faq_edit_category', $viewParams);\n }", "public function edit($id){\n $categorie=Blog_categories::find($id);\n return view ('blog_categories.edit',['categorie'=>$categorie]);\n}", "public function updateNutrationCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n 'tips' => 'required',\n ));\n $id = $request->id;\n $nutrationCategory = NutrationCategory::find($id);\n $nutrationCategory->nutration_category_name = $request->name;\n $nutrationCategory->tips = $request->tips;\n $nutrationCategory->save();\n Session::flash('success','Nutration Category Updated succcessfully.');\n return redirect()->back()->with('workout',$nutrationCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function edit_category($id)\n\t{\n\t\t$query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n $data['category']=$query; \n\t\t$data['title']=\"Dahboard || Great Wine Global\";\n $this->load->view('superpanel/header',$data);\n $this->load->view('superpanel/edit_categorie');\n $this->load->view('superpanel/footer');\n\t}", "public function edit($id)\n { \n //This Function Call CategoryHelpers.php Directory . \n $category = fetchCategoryTree(0,'','');\n $cat = Category::find($id);\n return view('admin.category.edit', compact('cat', 'category'));\n }", "public function edit(AwardCategory $awardCategory)\n {\n //\n }", "public function edit(CustomerCategory $customerCategory)\n {\n //\n }", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "function editcategeory()\r\n\t{ \r\n\t\t $id = $this->input->post('id');\r\n\t\t $parentid = $this->input->post('parentid');\r\n\t\t $catname = $this->input->post('catname');\r\n\t\t $this->categeory_model->editcategeory($id,$catname);\r\n\t\t redirect('admin/categeory/categeoryview/'.$parentid );\r\n\t}", "public function editAction() {\n $form = $this->view->form = new Whmedia_Form_Circle();\n $form->submit->setLabel('Edit Box');\n $list_id = (int) $this->_getParam('box_id');\n $circlesTable = Engine_Api::_()->getDbTable('circles', 'whmedia');\n $viewer = Engine_Api::_()->user()->getViewer();\n /* @var $list Whmedia_Model_Circle */\n $list = $circlesTable->find($list_id)->current();\n $form->populate($list->toArray());\n \n // Check post\n if( $this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost()) )\n {\n if( !$list || $list->user_id != $viewer->getIdentity() ) {\n return $this->_helper->Message('Missing box.', false, false)->setError();\n } \n // we will add the category\n $values = $form->getValues();\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\n try\n {\n \n $list->setFromArray($values);\n $list->save();\n\n $db->commit();\n }\n\n catch( Exception $e )\n {\n $db->rollBack(); \n throw $e;\n }\n\n return $this->_helper->Message(\"Changes saved.\");\n }\n\n // Output\n $this->renderScript('admin-settings/form.tpl');\n }", "public function edit(BlogCategory $blogCategory)\n {\n //\n }", "function edit($esta_categoria)\n {\n if($this->acceso(436)){\n // check if the categoria exists before trying to edit it\n $categoria = str_replace(\"%20\", \" \", $esta_categoria);\n $data['categoria'] = $this->Categoria_model->get_categoria($categoria);\n\n if(isset($data['categoria']['categoria']))\n {\n $this->load->library('form_validation');\n $this->form_validation->set_rules('categoria','Nombre','trim|required', array('required' => 'Este Campo no debe ser vacio'));\n $this->form_validation->set_rules('codigo_cat','Código','trim|required', array('required' => 'Este Campo no debe ser vacio'));\n if($this->form_validation->run()) \n {\n $params = array(\n 'categoria' => $this->input->post('categoria'),\n 'codigo_cat' => $this->input->post('codigo_cat'),\n );\n $this->Categoria_model->update_categoria($categoria,$params); \n redirect('categoria/index');\n }\n else\n {\n $data['_view'] = 'categoria/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The categoria you are trying to edit does not exist.');\n }\n }", "public function edit($id)\n {\n\n $category= BountyCategory::findOrFail($id);\n\n return view('admin.bounty.edit-category')->with('categories',$category);\n }", "public function editAction()\n {\n\n $request = $this->getRequest();\n\n $routeMatch = $this->getEvent()->getRouteMatch();\n $id = $routeMatch->getParam('exercise_id', 0);\n\n if ($id <= 0) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $exercise = $this->_exercise->getRow(array('exercise_id' => $id));\n\n if (!$exercise) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $workoutId = $exercise->workout_id;\n\n $workout = $this->_workout->getRow(array('workout_id' => $workoutId));\n\n if (!$workout) {\n return $this->redirect()->toRoute('hi-training/workout/list');\n }\n\n $typeId = $exercise->type_id;\n\n $type = $this->_exerciseType->getRow(array('type_id' => $typeId));\n\n// if (!$type) {\n// return $this->redirect()->toRoute('hi-training/workout/list');\n// }\n\n /**\n * Grid FORM\n */\n $form = new WorkoutExerciseGrid(\n array(\n 'view' => $this->_view,\n )\n );\n\n /**\n * BUILDING Row\n */\n $row = new WorkoutExerciseRow(\n array(\n 'model' => $this->_exercise,\n 'view' => $this->_view,\n )\n );\n\n //\n $row->setRowId($id);\n\n\n\n $row->setFieldOptions('type_id', array(\n 'values' => $this->_exerciseType->getBehaviour('nestedSet')->getResultSetForSelect(),\n 'onchange' => 'exerciseType(this);',\n ));\n $row->setFieldOptions('workout_id', array(\n 'value' => $workoutId,\n ));\n\n $row->addAction(\n 'saveEdit',\n 'submit',\n array(\n 'label' => 'save and continue editing',\n 'class' => 'actionImage',\n// 'image' => $this->_skinUrl . '/img/icons/record/save.png',\n )\n );\n\n //\n $row->build();\n\n //\n $form->addSubForm($row, $row->getName());\n\n //\n $this->_view->headScript()->appendScript(\n $this->_view->render(\n 'workout-exercise/edit.js',\n array(\n 'currentFormType' => $type['form_type'],\n 'back' => $this->url()->fromRoute('hi-training/workout-exercise/list/wildcard', array('workout_id' => $workoutId)),\n 'ajaxFormType' => $this->url()->fromRoute(\n 'hi-training/exercise-type/ajax-form-type/wildcard',\n array('type_id' => '')\n ),\n 'ajaxLastOfType' => $this->url()->fromRoute(\n 'hi-training/workout-exercise/ajax-last-of-type/wildcard',\n array('type_id' => '')\n ),\n )\n )\n );\n\n\n /**\n * POST\n */\n if ($this->getRequest()->isPost()) {\n\n $formData = $this->getRequest()->post()->toArray();\n\n if ($form->isValid($formData)) {\n\n if ( isset($formData['header']['formId'])\n && $formData['header']['formId'] == 'WorkoutExerciseGridForm') {\n\n if (isset($formData['WorkoutExerciseRow']['actions']['save'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $row = $this->_exercise->getRow(array('exercise_id' => $id))\n ->populate($formData['WorkoutExerciseRow']['row']);\n $row->save();\n\n return $this->redirect()->toRoute(\n 'hi-training/workout-exercise/list/wildcard',\n array('workout_id' => $workoutId)\n );\n }\n\n }\n\n if (isset($formData['WorkoutExerciseRow']['actions']['saveAdd'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $row = $this->_exercise->getRow(array('exercise_id' => $id))\n ->populate($formData['WorkoutExerciseRow']['row']);\n $row->save();\n\n return $this->redirect()->toRoute(\n 'hi-training/workout-exercise/add/wildcard',\n array('workout_id' => $workoutId)\n );\n }\n\n }\n\n if (isset($formData['WorkoutExerciseRow']['actions']['saveEdit'])) {\n\n if (is_array($formData['WorkoutExerciseRow']['row'])){\n $row = $this->_exercise->getRow(array('exercise_id' => $id))\n ->populate($formData['WorkoutExerciseRow']['row']);\n $row->save();\n\n return $this->redirect()->toRoute(\n 'hi-training/workout-exercise/edit/wildcard',\n array('exercise_id' => $id)\n );\n }\n\n }\n }\n }\n }\n\n return array(\n 'form' => $form,\n 'workout' => $workout,\n 'exercise' => $exercise,\n );\n }", "function shophead_edit($category_id = \"\")\n {\n $this->layout = 'admin_layout';\n $id = base64_decode($category_id);\n // pr($id);\n $this->loadModel('ProductCategory');\n $data = $this->ProductCategory->find('first', array('conditions' => array('ProductCategory.id' => $id)));\n if (!empty($data)) {\n if (!empty($this->request->data)) {\n $this->request->data = Sanitize::clean($this->request->data, array('encode' => false));\n $this->ProductCategory->set($this->request->data);\n if ($this->request->data['ProductCategory']['name'] == $data['ProductCategory']['name']) {\n unset($this->request->data['ProductCategory']['name']);\n }\n if ($this->ProductCategory->validates()) {\n if ($this->ProductCategory->save($this->request->data)) {\n $this->Session->write('flash', array(EDIT_RECORD, 'success'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n } else {\n $this->Session->write('flash', array(FAILURE_MSG, 'failure'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }\n }\n $this->request->data = $data;\n } else {\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }", "public function edit(ProductCategory $productCategory)\n {\n //\n }", "public function edit($id)\n {\n $data = $this->Category->findData($id);\n $catalogue = Catelog::get();\n\t\tif($data->in_home==\"on\"){\n\t\t\t$is_Selected=\"checked\";\n\t\t}else{\n\t\t\t$is_Selected=\"\";\n\t\t}\n $html = '<div class=\"form-group error\"></div>\n <label for=\"categories_name\">Name</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"text\" id=\"editcategories_name\" name=\"categories_name\" value=\"'.$data->categories_name.'\" class=\"form-control\" placeholder=\"Enter your category name\">\n </div>\n </div>\n <label for=\"catelogue_id\">Catalogue</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <select class=\"form-control\" id=\"editcatelogue_id\" name=\"catelogue_id\">\n <option value=\"\">-- Please select --</option>';\n foreach($catalogue as $key)\n {\n $status=\"\";\n if($data->catelogue_id==$key->id){\n $status=\"selected\";\n }\n $html .= '<option value=\"'.$key->id.'\" '.$status.'>'.$key->catelogue_name.'</option> ';\n }\n $html .= ' </select>\n </div>\n </div>\n <label for=\"image\">Images</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"file\" name=\"image_1\" id=\"image_1\" placeholder=\"Choose image\" > \n </div>\n </div>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <img src=\"'.asset('storage/category/'.$data->image).'\" name=\"old_img\" width=\"50px\" height=\"50px\"> \n </div>\n </div>\n <label for=\"description\">Description</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"text\" id=\"editDescription\" name=\"Description\" value=\"'.$data->description.'\" class=\"form-control\" placeholder=\"Enter your description\">\n </div>\n </div>\n\t\t\t\t <label for=\"description\">Show In Home</label>\n <div class=\"form-group\">\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"in_home\" name=\"in_home\" class=\"form-control\" '.$is_Selected.'>\n\t\t\t\t\t</div>\n <br>\n ';\n return response()->json(['html'=>$html]);\n }", "public function edit(Kategori $kategori)\n {\n //\n }", "public function Editar(){\n $ca = new Categoria();\n \n if(isset($_REQUEST['id'])){\n $ca = $this->model->Obtener($_REQUEST['id']);\n }\n \n require_once 'view/header.php';\n require_once 'view/categoria/editar.php';\n require_once 'view/footer.php';\n }", "public function edit($catgId){\n\t\t\tif($this->session->userdata('loggedIn_adminInfo')=='')redirect('admincp');\n\t\t\t$data['title'] \t\t= 'Projects 100K';\n\t\t\t$postedValue_fname \t= array();\n\t\t\tif($this->session->userdata('post_promotionData'))\n\t\t\t$data['postedValue'] \t\t= \t$this->session->userdata('post_promotionData');\n\t\t\t$promotionID\t\t\t\t= \tstr_replace(array('-', '_', '~'), array('+', '/', '='),$catgId);\t\t\t\n\t\t\t$data['promotionInfo']\t\t=\t$this->base_model->is_Record_Exists('tbl_promotion_mastercategory','',array('id'=>$this->encrypt->decode($promotionID)));\t\n\t\t\t$data['fieldInfo']\t\t\t=\t$this->base_model->get_All_Records('tbl_promotion_masterfields','',\n\t\t\t\t\t\t\t\t\t\t\tarray('promotionCategoryId'=>$this->encrypt->decode($promotionID)),'order','asc');\t\t\t\t\n\t\t\t$data['catg_uri_string']\t=\t$data['promotionInfo']->uri_string;\n\t\t\t$data['catgTitle']\t\t\t=\tstripslashes(ucwords($data['promotionInfo']->title));\n\t\t\t$data['hdnPromotionID']\t\t=\t$catgId;\n\t\t\t$this->session->unset_userdata('post_promotionFieldData');\n\t\t\t$this->load->view('templates/admincp/header', $data);\n\t\t\t$this->load->view('admincp/promotion/form', $data);\n\t\t}", "function edit_staff_category($id=NULL) \r\n {\r\n // Basis: To simplify THIRRA system, staff_category name === system_category name\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n\t\t$data['user_rights'] = $this->mthirra->get_user_rights($_SESSION['username']);\r\n $data['breadcrumbs'] = breadcrumbs('ehr_admin/admin_mgt','Admin','ehr_admin/admin_list_staffcategories','List Staff Categories'); \r\n\t\t$data['form_purpose'] = $this->uri->segment(3);\r\n\t\t$data['category_id'] = $this->uri->segment(4);\r\n\t\t$data['title'] = \"Add New / Edit Staff Category\";\r\n $data['now_id'] = time();\r\n //$data['now_date'] = date(\"Y-m-d\",$data['now_id']);\r\n //$data['now_time'] = date(\"H:i\",$data['now_id']);\r\n\t\t$data['users_list'] = $this->madmin_rdb->get_users_list();\r\n $data['systemuser_categories'] = $this->madmin_rdb->get_systemuser_categories();\r\n \r\n if(count($_POST)) {\r\n // User has posted the form\r\n $data['category_id'] = $this->input->post('category_id');\r\n $data['category_name'] = $this->input->post('category_name');\r\n $data['description'] = $this->input->post('description');\r\n $data['init_access_patients'] = $this->input->post('access_patients');\r\n $data['init_access_pharmacy'] = $this->input->post('access_pharmacy');\r\n $data['init_access_orders'] = $this->input->post('access_orders');\r\n $data['init_access_queue'] = $this->input->post('access_queue');\r\n $data['init_access_reports'] = $this->input->post('access_reports');\r\n $data['init_access_utilities'] = $this->input->post('access_utilities');\r\n $data['init_access_admin'] = $this->input->post('access_admin');\r\n } else {\r\n // First time form is displayed\r\n if ($data['form_purpose'] == \"new_category\") {\r\n // New user\r\n\t\t $data['category_info'] = array();\r\n $data['category_id'] = \"new_category\";\r\n $data['category_name'] = \"\";\r\n $data['description'] = \"\";\r\n $data['init_access_patients'] = \"\";\r\n $data['init_access_pharmacy'] = \"\";\r\n $data['init_access_orders'] = \"\";\r\n $data['init_access_queue'] = \"\";\r\n $data['init_access_reports'] = \"\";\r\n $data['init_access_utilities'] = \"\";\r\n $data['init_access_admin'] = \"\";\r\n } else {\r\n // Existing user\r\n\t\t $data['category_info'] = $this->madmin_rdb->get_one_staffcategory($data['category_id']);\r\n $data['category_id'] = $data['category_info']['category_id'];\r\n $data['category_name'] = $data['category_info']['category_name'];\r\n $data['description'] = $data['category_info']['description'];\r\n $data['sys_category_id']= $data['category_info']['sys_category_id'];\r\n $data['permission'] = $data['category_info']['permission'];\r\n $data['access_rights'] = $this->get_user_rights($data['permission']);\r\n $data['access_rights']['permission'] = $data['permission'];\r\n $data['init_access_patients'] = $data['access_rights']['section_patients'];\r\n $data['init_access_pharmacy'] = $data['access_rights']['section_pharmacy'];\r\n $data['init_access_orders'] = $data['access_rights']['section_orders'];\r\n $data['init_access_queue'] = $data['access_rights']['section_queue'];\r\n $data['init_access_reports'] = $data['access_rights']['section_reports'];\r\n $data['init_access_utilities'] = $data['access_rights']['section_utilities'];\r\n $data['init_access_admin'] = $data['access_rights']['section_admin'];\r\n } //endif ($data['form_purpose'] == \"new_category\")\r\n } //endif(count($_POST))\r\n \r\n\t\t$this->load->vars($data);\r\n // Run validation\r\n\t\tif ($this->form_validation->run('edit_staff_category') == FALSE){\r\n // Return to incomplete form\r\n if ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_ehr_wap\";\r\n $new_sidebar= \"ehr/sidebar_ehr_admin_wap\";\r\n //$new_body = \"ehr/emr_edit_systemuser_wap\";\r\n $new_body = \"ehr/ehr_admin_edit_staff_category_html\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n } else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_html\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_html\";\r\n $new_body = \"ehr/ehr_admin_edit_staff_category_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n }\r\n if($data['user_rights']['section_admin'] < 100){\r\n $new_body = \"ehr/ehr_access_denied_html\";\r\n }\r\n $this->load->view($new_header);\t\t\t\r\n $this->load->view($new_banner);\t\t\t\r\n $this->load->view($new_sidebar);\t\t\t\r\n $this->load->view($new_body);\t\t\t\r\n $this->load->view($new_footer);\t\t\t\r\n } else {\r\n //echo \"\\nValidated successfully.\";\r\n //echo \"<pre>\";\r\n //print_r($data);\r\n //echo \"</pre>\";\r\n //echo \"<br />Insert record\";\r\n // Generate permission\r\n $data['rights_decimal'] = 0;\r\n if(is_numeric($data['init_access_admin'])){ \r\n $data['rights_decimal'] += 1;\r\n }\r\n if(is_numeric($data['init_access_reports'])){ \r\n $data['rights_decimal'] += 2;\r\n }\r\n if(is_numeric($data['init_access_pharmacy'])){ \r\n $data['rights_decimal'] += 4;\r\n }\r\n if(is_numeric($data['init_access_orders'])){ \r\n $data['rights_decimal'] += 8;\r\n }\r\n if(is_numeric($data['init_access_patients'])){ \r\n $data['rights_decimal'] += 16;\r\n }\r\n if(is_numeric($data['init_access_queue'])){ \r\n $data['rights_decimal'] += 32;\r\n }\r\n /* Finance and Billing \r\n if(is_numeric($data['init_access_patients'])){ \r\n $data['rights_decimal'] += 64;\r\n }\r\n if(is_numeric($data['init_access_patients'])){ \r\n $data['rights_decimal'] += 128;\r\n }\r\n */\r\n if(is_numeric($data['init_access_utilities'])){ \r\n $data['rights_decimal'] += 256;\r\n }\r\n if($data['form_purpose'] == \"new_category\") {\r\n // Insert records\r\n $ins_cate_array['category_id'] = $data['now_id'];\r\n $ins_cate_array['category_name'] = $data['category_name'];\r\n $ins_cate_array['description'] = $data['description'];\r\n $ins_cate_array['permission'] = $data['rights_decimal'];\r\n //echo \"data['rights_decimal']\".$data['rights_decimal'];\r\n $ins_user_data = $this->madmin_wdb->insert_new_staffcategory($ins_cate_array);\r\n $this->session->set_flashdata('data_activity', 'Staff category added.');\r\n } else {\r\n // Update records\r\n $upd_cate_array['category_id'] = $data['category_id'];\r\n $upd_cate_array['category_name'] = $data['category_name'];\r\n $upd_cate_array['description'] = $data['description'];\r\n $upd_cate_array['permission'] = $data['rights_decimal'];\r\n //echo \"data['rights_decimal']\".$data['rights_decimal'];\r\n $upd_user_data = $this->madmin_wdb->update_staffcategory($upd_cate_array);\r\n $this->session->set_flashdata('data_activity', 'Staff category updated.');\r\n } //endif($data['form_purpose'] == \"new_category\")\r\n $new_page = base_url().\"index.php/ehr_admin/admin_list_staffcategories\";\r\n header(\"Status: 200\");\r\n header(\"Location: \".$new_page);\r\n } //endif ($this->form_validation->run('edit_staff_category') == FALSE)\r\n }", "public function edit_postAction() {\r\n\t\t$info = $this->getPost(array('id', 'sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$ret = Game_Service_Category::updateCategory($info, intval($info['id']));\r\n\t\tif (!$ret) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功.'); \t\t\r\n\t}", "public\n\tfunction edit( $id ) {\n\t\t$parent = Category::all();\n\t\t$subcat = Subcategory::all();\n\t\t$cat = Grandcategory::find( $id );\n\t\treturn view( \"admin.grandcategory.edit\", compact( \"cat\", 'parent', 'subcat' ) );\n\t}", "public function edit($id){\n\n //\n\n $categories = Category::pluck('name', 'id')->all();\n $category = Category::find($id);\n\n $sub_categories = Category::where(['parent_id' => $id])->orderBy('id', 'desc')->get();\n\n\n return view(\"admin.category.edit\", compact( 'categories','category','sub_categories'));\n\n }", "public function edit($category)\n { $categories=Category::all();\n $category = Category::find($category);\n return view('admin.category.edit',compact('category','categories'));\n }", "public function usecases_edit(Request $request) {\n $id = $request->id;\n $redirectFrom = \"\";\n if(isset($request->redirectfrom)){\n $redirectFrom = $request->redirectfrom;\n }\n $categories = Community::where('status',1)->get(); \n $board = Article::where('articleIdx', $id)->first();\n if(!$board){\n Session::flash('flash_error', 'Record you are looking to edit is not found or deleted.');\n return back();\n } \n $categoriesName = Community::where('communityIdx', $board->communityIdx)->get()->first();\n $communityNameLabel = \"\";\n if($categoriesName){\n $communityNameLabel = $categoriesName->communityName;\n }\n\n \n if(isset($request->redirectfrom)){\n Session::put('menu_item_parent', 'home');\n Session::put('menu_item_child', 'top_use_cases');\n }else{\n Session::put('menu_item_parent', 'usecases');\n Session::put('menu_item_child', $board->communityIdx);\n }\n \n Session::put('menu_item_child_child', '');\n\n $statusList = array(\n 0 => 'Unpublish',\n 1 => 'Publish'\n );\n\n $communityIdx = $board->communityIdx;\n $data = array( 'categories', 'id', 'board', 'communityIdx', 'statusList', 'communityNameLabel','redirectFrom');\n return view('admin.usecases_edit', compact($data));\n }", "public function edit(Category $category): View\n {\n// $category-;\n return view('admin.categories.edit', compact('category'));\n }", "public function edit($id)\n {\n $cat= MenuCategories::find($id);\n return view(\"dashboard.pages.supervisor.category.edit\", [ 'cat'=>$cat]);\n \n }", "public function edit(booksCategory $booksCategory)\n {\n //\n }", "public function edit(booksCategory $booksCategory)\n {\n //\n }", "public function edit_kategori(){\r\n $kategori['id_kategori'] = $this->uri->segment(4);\r\n $data = array(\r\n 'form_nama' => 'Edit Data Kategori Menu',\r\n 'komponen' => 'action',\r\n 't_kategori' => $this->Model_kategori->tampil_kategori($kategori),\r\n );\r\n $this->load->view('ini_user/header', $data, FALSE);\r\n $this->load->view('ini_user/menu');\r\n $this->load->view('ini_user/edit_kategori');\r\n $this->load->view('ini_user/footer');\r\n }", "public function createOrEdit($interview_category_id = NULL)\r\n {\r\n $interview_category = objToArr($this->AdminInterviewCategoryModel->get('interview_category_id', $interview_category_id));\r\n echo $this->load->view('admin/interview-categories/create-or-edit', compact('interview_category'), TRUE);\r\n }", "function action_edit($params) {\n $form_error =false;\n $category= model_category::load_by_id($params[0]);\n $id =$params[0];\n if(isset($_POST['form']['action1'])) {\n //Check if the \"Ok\" button is set.\n\n //Modify category name.\n if( model_category::editC($id,$_POST['form']['name'])){\n header('Location: ' . APP_URL . 'category/list');\n die;\n\n }\n $form_error =false;\n }\n if(isset($_POST['form']['action2'])) {\n @include_once APP_PATH . 'view/category_edit.tpl.php';\n }\n @include_once APP_PATH . 'view/category_edit.tpl.php';\n }", "public function edit() {\n\t\t$id = $this->input->get('id');\n\t\t$data = $this->kategori_m->get_by(array('id' => $id));\n\t\t$kode_induk = $data->kode_induk_kategori;\n\t\tif (!is_null($kode_induk)) {\n\t\t\t$id_induk = $this->kategori_m->get_by(array('kode_kategori' => $kode_induk))->id;\n\t\t\t$data->id_induk = $id_induk;\n\t\t} else {\n\t\t\t$data->id_induk = \"\";\n\t\t}\n\t\t$this->printOptionOnCombobox($data, $id);\n\t\techo json_encode($data);\n\t}", "public function edit($id_category){\n $category = \\App\\Models\\Category::find($id_category); // find the id and save it to variable category\n return view('category/edit', ['category' => $category]);\n }", "public function editworkout($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = Workout::find($id);\n return view('admin.editworkout')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function editAction()\n {\n $form = $this->getServiceLocator()->get('civcontent_category_form');\n \n // Grab copy of the existing entity\n $id = $this->params()->fromRoute('categoryid');\n $category = $this->getContentService()->getCategoryById($id);\n if (!$category)\n {\n $this->getResponse()->setStatusCode(404);\n return;\n }\n $form->bind($category);\n \n // Check if the request is a POST.\n $request = $this->getRequest();\n if ($request->isPost())\n {\n $data = (array) $request->getPost();\n $form->setData($data);\n if ($form->isValid())\n {\n // Persist changes.\n $this->getContentService()->persistCategory($category);\n \n // Redirect to content categories\n return $this->redirect()->toRoute('content/category', array(\n 'action' => 'index'\n ));\n }\n }\n \n // If a GET request, or invalid data then render/re-render the form\n return new ViewModel(array(\n 'form' => $form,\n 'id' => $id\n ));\n }", "public function editCategory($id){\n\t\t $categoryById = Category::find($id);\n\t\treturn view('admin.category.editCategory', ['categoryById'=>$categoryById]);\n\t}", "public function do_edit(Request $request,$id){\n\t\t$cat = new category();\n\t\t$c_name = $request->get(\"c_name\");\n\t\t// Sua ban ghi\n\t\t$cat->where(\"pk_category_news_id\",\"=\",$id)->update(array(\"c_name\"=>$c_name));\n\t\treturn redirect(url('admin/category-news'));\n\t}", "public function edit(CampaignCategory $campaignCategory)\n {\n //\n }", "function editMainCategory()\n\t{ \n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from products_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$sqlid=\"SELECT category_id,category_parent_id FROM category_table where category_id in(select category_id from products_table where category_id='\".$obj->records[0]['category_id'].\"')\";\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$sql1 = \"SELECT category_id,category_name FROM category_table where category_parent_id=0\";\n\t\t\n\t\t\t$query1 = new Bin_Query();\n\t\t\n\t\t\t$query1->executeQuery($sql1);\n\t\t\n\n\t\t\treturn Display_DManageProducts::displayCategory($query1->records,$query->records[0]['category_id']);\n\t\t\t\n\t\t// \t\t\treturn $category;\n\t }\n\t}", "public function change()\n\t{\n\t\t$result = $this->helper_categories_model->getCategories();\n\t\t$this->template\n\t\t\t->title('您期望添加到哪个分类')\n\t\t\t->set_layout(FALSE)\n\t\t\t->set('data', $result)\n\t\t\t->build('admin/helper/change');\n\t}", "public function editAction() {\n $this->_helper->layout->setLayout('admin-simple');\n\n if (!($category_id = $this->_getParam('category_id'))) {\n die('No identifier specified');\n }\n\n //FETCH PARAMETERS ACCORDING TO THIS CATEGORY\n $reviewCategories = Engine_Api::_()->getDbtable('reviewcats', 'sitestorereview')->reviewParams($category_id);\n\n //GENERATE A FORM\n $form = $this->view->form = new Sitestorereview_Form_Admin_Ratingparameter_Edit();\n $form->setAction($this->getFrontController()->getRouter()->assemble(array()));\n\n $form->setField($reviewCategories->toArray());\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n\n foreach ($values as $key => $value) {\n $reviewcat_id = explode('reviewcat_name_', $key);\n $reviewcat = Engine_Api::_()->getItem('sitestorereview_reviewcat', $reviewcat_id[1]);\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\n try {\n //EDIT CATEGORY NAMES\n $reviewcat->reviewcat_name = $value;\n $reviewcat->save();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => 10,\n 'parentRefresh' => 10,\n 'messages' => array('')\n ));\n }\n\n $this->renderScript('admin-ratingparameter/edit.tpl');\n }" ]
[ "0.69934815", "0.6759673", "0.6755315", "0.67062914", "0.67001015", "0.66443294", "0.6574874", "0.6564783", "0.65390974", "0.6490522", "0.64873505", "0.647618", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.6468072", "0.64410436", "0.64198166", "0.6394625", "0.6342839", "0.6332312", "0.63064176", "0.6305494", "0.6294862", "0.6294578", "0.6278874", "0.62596524", "0.6256396", "0.62302756", "0.6226818", "0.61820287", "0.61801076", "0.6179137", "0.6177419", "0.6166496", "0.61542225", "0.6152373", "0.6150362", "0.61437696", "0.61378413", "0.61369777", "0.6115803", "0.6115598", "0.6106303", "0.60887045", "0.6084807", "0.6070163", "0.6066431", "0.6056242", "0.60487545", "0.6036342", "0.60275185", "0.6024253", "0.6009182", "0.6006563", "0.6005466", "0.5986246", "0.5969754", "0.5964397", "0.5963657", "0.59606266", "0.5952755", "0.5950819", "0.5925346", "0.5925256", "0.5922287", "0.59149224", "0.5912367", "0.59077436", "0.59077436", "0.5901977", "0.59014815", "0.5890373", "0.58891964", "0.5887803", "0.58857894", "0.58747405", "0.5871782", "0.5871351", "0.58705825", "0.58682793", "0.5864107", "0.5862324" ]
0.7222749
0
/edit workout category Function for update form
public function updateworkoutcategory(Request $request) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $this->validate($request,array( 'name' => 'required', )); $id = $request->id; $workoutCategory = Category::find($id); $workoutCategory->Category = $request->name; $workoutCategory->save(); Session::flash('success','Workout Category Updated succcessfully.'); return redirect()->back()->with('workout',$workoutCategory); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Workout $workout)\n {\n //\n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "function edit_category($tbl_name){\n\t\t//print_r($_POST); die;\n\t\tunset($_POST['submitLog']);\n\t\t$this->db->where('id', $_POST['id']);\n\t\tunset($_POST['id']);\n\t\t$this->db->update($tbl_name,$_POST);\n\t\t// print_r($this->db->last_query());\n\t // die();\n\t}", "public function updateCate()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['upcategory'];\n\t\t\t$category_id = $_POST['upcategory_id'];\n\t\t\t$sql = \" update lib_book_species set category = '{$category}' where category in \n\t\t\t\t\t(select category from lib_category where category_id = {$category_id});\n\t\t\t\t\tupdate lib_category set category='\" . $category . \"' where category_id='\" . $category_id . \"';\n\t\t\t\t\t\";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Modify successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function editPost()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"edit_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryName = $this->input->post(\"name\");\n\n $categoryModel = new CategoriesModel();\n\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n if ($categoryModel->editCategory($categoryName, $categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category edited successfully!\",\"success\");\n } else {\n $this->view->redirect(\"/categories/manage\",\"You did not change anything ?\");\n }\n\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function editworkoutcategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = Category::find($id);\n return view('admin.editworkoutcategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "public function updateNutrationCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n 'tips' => 'required',\n ));\n $id = $request->id;\n $nutrationCategory = NutrationCategory::find($id);\n $nutrationCategory->nutration_category_name = $request->name;\n $nutrationCategory->tips = $request->tips;\n $nutrationCategory->save();\n Session::flash('success','Nutration Category Updated succcessfully.');\n return redirect()->back()->with('workout',$nutrationCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function edit(Postcategory $postcategory)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/edit\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n\n } catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception->getMessage());\n }\n\n }", "public function editCategory($editCategory) {\n if (isset($editCategory)) {\n\n $data = array(\n 'name' => $editCategory['name'],\n 'support_emails' => $editCategory['support_emails'],\n 'quantity_enabled' => $editCategory['quantity_enabled']\n );\n \n if (isset($editCategory['supplier_user'])) {\n $data['supplier_user'] = $editCategory['supplier_user'];\n }\n \n if (isset($editCategory['custom_fields'])) {\n $data['custom_fields'] = $editCategory['custom_fields'];\n } else {\n $data['custom_fields'] = NULL;\n }\n $this->db->where('id', $editCategory['category_id']);\n $this->db->update('categories', $data);\n return TRUE;\n } else {\n return False;\n }\n }", "function editWorkOption(){\n\n if($this->session->has_userdata('userId')){\n\n if(! $this->_isUserAdmin()){\n\n $this->deniedAccess();\n }else{\n\n $workOptionId = $this->uri->segment(2);\n $this->Work_option_model->updateWorkOption($workOptionId);\n\n redirect(site_url('manage-work-options'));\n }\n }\n else{\n\n //redirect to home page\n redirect(site_url());\n }\n }", "public function edit(Category $category) {\n //not implemented\n }", "function editCategory($category, $id) {\n $data = [\n 'name' => $_POST['name'],\n 'description' => $_POST['description']\n ];\n\n $stmt = $category->update($id, $data);\n header('location: confirm.php?action=Category&type=update&query='.$stmt);\n}", "public function edit(TripCategory $tripCategory)\n {\n //\n }", "function category_edit($id)\n\t{\n\t\tglobal $db;\n\t\t$ccnoprice = $_POST['ccnoprice'];\n\t\t$sSQL = \"UPDATE \".PREFIX.\"categories SET ccnoprice='\".$ccnoprice.\"', ccTemplate='\".mysql_real_escape_string($_POST['ccTemplate']).\"' WHERE id=\".$id;\n\t\t$db->query($sSQL);\n\t}", "public function editCategory()\r\n{\r\n $query_string = \"UPDATE categories \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"categoryname = :categoryname, \";\r\n $query_string .= \"categorydescription = :categorydescription \";\r\n $query_string .= \"WHERE categoryid = :categoryid\";\r\n\r\n return $query_string;\r\n}", "public function formModify() {\n $categories=$this->model->listCategories();\n $this->view->display(\"view/form/ProductFormModify.php\", NULL, $categories); \n }", "public function update(Request $request, Postcategory $postcategory)\n {\n //\n }", "public function update()\n {\n $model = $this->model()::findOrFail(request('_id'));\n $data = array_merge(request()->all(), ['slug' => request('name')]);\n $category = $model->update($data);\n return redirect()->route('admin.'.$this->table().'.index');\n }", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}", "public function edit(Category $Category)\n {\n //\n }", "public function edit_category($category) {\n $this->category();\n $categories_sql_string = \"SELECT * FROM category WHERE id = \" . $category . \" limit 1\";\n $connection = new Database(\"sbrettsc_db\");\n $menu_array = $connection->get_array_from_query($categories_sql_string);\n $data = array(\"menu_array\" => array_shift($menu_array));\n\n $this->loadView(\"editors/category_editor\", $data);\n }", "function editAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\t\n\t\t$redirectUrl = $this->getRedirectUrl();\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t$error \t\t= array();\n\t\t\t$success \t= array();\n\t\t\t$contents \t= '';\n\t\t\t$formData \t= array();\n\t\t\t //Truyen du lieu hien co vao form\n\t\t\t$formData['fbulkid'] = array();\n\t\t\t$formData['fid'] = $myProductCat->id;\n\t\t\t$formData['fname'] = $myProductCat->name;\n\t\t\t$formData['forder'] = $myProductCat->order;\n\t\t\t$formData['fparentid'] = $myProductCat->parentid;\n\t\t\t$formData['fenable'] = $myProductCat->enable;\n\t\t\t$formData['fseourl'] = $myProductCat->seoUrl;\n\t\t\t$formData['fseotitle'] = $myProductCat->seoTitle;\n\t\t\t$formData['fseokeyword'] = $myProductCat->seoKeyword;\n\t\t\t$formData['fseodescription'] = $myProductCat->seoDescription;\n\t\t\t\n\t\t\tif(!empty($_POST['fsubmit']))//truong hop da nhan nut submit\n\t\t\t{\n if($_SESSION['productcategoryEditToken']==$_POST['ftoken'])//kiem tra token\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->editActionValidator($formData, $error))//kiem tra du lieu co hop le hay khong\n {\n //Cac thong tin khong ngon ngu:\n $myProductCat->order = (int)$formData['forder'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n if(strlen($formData['fseourl']) > 0)\n $myProductCat->seoUrl = Helper::codau2khongdau($formData['fseourl'], true);\n else\n $myProductCat->seoUrl = Helper::codau2khongdau(strip_tags($formData['fname']), true);\n //Cac thong tin lien quan ngon ngu: \n $myProductCat->name = $formData['fname']; \n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n \n if($myProductCat->updateData())//cap nhat database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succUpdate']);\n $this->registry->me->writelog('ProductCategoryedit', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n }\n else\n {\n $error[] = $this->registry->lang['controller']['errUpdate']; \n }\n }\n }\n $_SESSION['productcategoryEditToken'] = Helper::getSecurityToken();//Tao token moi\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t\t\t$this->registry->smarty->assign(array(\t'formData' \t=> $formData,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'subcategories' => $myProductCat->getSub(true),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'parentCategories' => Core_ProductCategory::getFullCategories(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectUrl'=> $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'success'\t=> $success,\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\t));\n\t\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'edit.tpl');\n\t\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategorylist',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_edit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t\t$this->registry->smarty->assign(array('redirect' => $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectMsg' => $redirectMsg,\n\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t}\n\t}", "public function editNutrationCategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = NutrationCategory::find($id);\n return view('admin.editnutrationcategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function shophead_edit($category_id = \"\")\n {\n $this->layout = 'admin_layout';\n $id = base64_decode($category_id);\n // pr($id);\n $this->loadModel('ProductCategory');\n $data = $this->ProductCategory->find('first', array('conditions' => array('ProductCategory.id' => $id)));\n if (!empty($data)) {\n if (!empty($this->request->data)) {\n $this->request->data = Sanitize::clean($this->request->data, array('encode' => false));\n $this->ProductCategory->set($this->request->data);\n if ($this->request->data['ProductCategory']['name'] == $data['ProductCategory']['name']) {\n unset($this->request->data['ProductCategory']['name']);\n }\n if ($this->ProductCategory->validates()) {\n if ($this->ProductCategory->save($this->request->data)) {\n $this->Session->write('flash', array(EDIT_RECORD, 'success'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n } else {\n $this->Session->write('flash', array(FAILURE_MSG, 'failure'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }\n }\n $this->request->data = $data;\n } else {\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }", "public function edit($id)\n {\n $data = $this->Category->findData($id);\n $catalogue = Catelog::get();\n\t\tif($data->in_home==\"on\"){\n\t\t\t$is_Selected=\"checked\";\n\t\t}else{\n\t\t\t$is_Selected=\"\";\n\t\t}\n $html = '<div class=\"form-group error\"></div>\n <label for=\"categories_name\">Name</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"text\" id=\"editcategories_name\" name=\"categories_name\" value=\"'.$data->categories_name.'\" class=\"form-control\" placeholder=\"Enter your category name\">\n </div>\n </div>\n <label for=\"catelogue_id\">Catalogue</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <select class=\"form-control\" id=\"editcatelogue_id\" name=\"catelogue_id\">\n <option value=\"\">-- Please select --</option>';\n foreach($catalogue as $key)\n {\n $status=\"\";\n if($data->catelogue_id==$key->id){\n $status=\"selected\";\n }\n $html .= '<option value=\"'.$key->id.'\" '.$status.'>'.$key->catelogue_name.'</option> ';\n }\n $html .= ' </select>\n </div>\n </div>\n <label for=\"image\">Images</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"file\" name=\"image_1\" id=\"image_1\" placeholder=\"Choose image\" > \n </div>\n </div>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <img src=\"'.asset('storage/category/'.$data->image).'\" name=\"old_img\" width=\"50px\" height=\"50px\"> \n </div>\n </div>\n <label for=\"description\">Description</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"text\" id=\"editDescription\" name=\"Description\" value=\"'.$data->description.'\" class=\"form-control\" placeholder=\"Enter your description\">\n </div>\n </div>\n\t\t\t\t <label for=\"description\">Show In Home</label>\n <div class=\"form-group\">\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"in_home\" name=\"in_home\" class=\"form-control\" '.$is_Selected.'>\n\t\t\t\t\t</div>\n <br>\n ';\n return response()->json(['html'=>$html]);\n }", "public function update(Request $request, Workout $workout)\n {\n //\n }", "function edit_category_data($category_id)\n\t{\n\t\t$this->data['title'] \t= 'Edit Portfolio Category Data';\n\t\t$this->data['category']\t= $this->portfolio_model->get_category_by_id($category_id);\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/edit_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function edit(CourseCategory $courseCategory)\n {\n //\n }", "public function category_update(){ \n\n\n if (!has_role($this->session->userdata('user_id'), 'CATEGORY_UPDATE')) {\n redirect(base_url('page_not_found'));\n }\n\n $data['parent'] = $this->input->post('parent');\n $data['last_modified'] = date(\"Y-m-d H:i:s\");\n $data['name'] = $this->input->post('name');\n \n if(!$this->category_model->is_parent_category($data['parent'])){\n\n $this->session->set_flashdata('category_save_failed', \"Failed to update sub category!!\");\n }else{\n\n \n $category_id = $this->input->post('cat_id');\n\n\n\n\n if($this->category_model->update_category($category_id, $data)){\n\n $this->logger\n ->user($this->session->userdata('user_id')) //Set UserID, who created this Action\n ->user_details($this->user_model->getUserInfoByIpAddress())\n ->type('category_update') //Entry type like, Post, Page, Entry\n ->id($category_id) //Entry ID\n ->token('UPDATE') //Token identify Action\n ->comment($this->session->userdata('name'). ' update a category.')\n ->log(); //Add Database Entry\n\n $this->session->set_flashdata('category_save_success', \"Category information Updated Successfully!!\");\n } else {\n $this->session->set_flashdata('category_save_failed', \"Category update fialied!!\");\n }\n }\n redirect(base_url('categories'));\n }", "function get_category_to_edit($id)\n {\n }", "public function edit(Category $Category)\n {\n echo \"i am in edit\";exit();\n //\n }", "function modifyCategory()\n{\n global $connection;\n global $updateCategorySuccess, $updateCategoryError;\n $updateCategorySuccess = $updateCategoryError = '';\n\n if (isset($_POST['btn_save_category'])) {\n $category_id = $_POST['txt_userid'];\n\n $updateColumncategory = '';\n\n $category_name = htmlentities($_POST['category_name']);\n if (!empty($category_name)) {\n $updateColumncategory .= \"category = '$category_name',\";\n }\n\n $updateColumncategory = rtrim($updateColumncategory, ',');\n\n $query_update = \"UPDATE product_category SET $updateColumncategory WHERE id_category = '$category_id'\";\n $result_update = mysqli_query($connection, $query_update);\n\n if ($result_update) {\n $updateCategorySuccess = '<script language=\"javascript\">\n swal(\"Sukses!\", \"Kategoria u modifikua me sukses!\", \"success\")\n </script>';\n } else {\n $updateCategoryError = '<script language=\"javascript\">\n swal(\"Gabim!\", \"Ka ndodhur një gabim gjatë modifikimit të kategorisë! Provoni përsëri!\", \"error\")\n </script>';\n }\n }\n}", "public function updateProgramCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $programCategory = ProgramCategory::find($id);\n $programCategory->program_category_name = $request->name;\n $programCategory->tips = $request->tips;\n $programCategory->save();\n Session::flash('success','Program Category Updated succcessfully.');\n return redirect()->back()->with('workout',$programCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function update()\n {\n $category = CategoryService::load(\\Request::input('id'))->update(\\Request::all());\n \\Msg::success($category->name . ' has been <strong>updated</strong>');\n return redir('account/categories');\n }", "public function edit(AwardCategory $awardCategory)\n {\n //\n }", "public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }", "public function editCustomField($editCategory) {\n\n if (isset($editCategory)) {\n\n if (isset($editCategory['custom_fields'])) {\n $data['custom_fields'] = $editCategory['custom_fields'];\n } else {\n $data['custom_fields'] = NULL;\n }\n $this->db->where('id', $editCategory['category_id']);\n $this->db->update('categories', $data);\n return TRUE;\n } else {\n return False;\n }\n }", "public function edit($id = NULL){\n\t\tif ($id) {\n\t\t\t$this->data['category'] = $this->category_m->get($id);\n\t\t\tcount($this->data['category']) || $this->data['errors'][] = 'category could not be found';\n\t\t}\n\t\telse {\n\t\t\t$this->data ['category'] = $this->category_m->get_new();\n\t\t}\n\t\t\n\t\t// Set up the form\n\t\t$rules = $this->category_m->rules;\n\t\t$this->form_validation->set_rules($rules);\n\t\t\n\t\t// Process the form\n\t\tif ($this->form_validation->run() == TRUE) {\n\t\t\t$data = $this->category_m->array_from_post(array(\n\t\t\t\t'title', \n\t\t\t\t'description', \n\t\t\t\t'items_style'\n\t\t\t\t\n\t\t\t));\n\t\t\t$this->category_m->save($data, $id);\n\t\t\tredirect('admin/category');\n\t\t}\n\t\t\n\t\t$this->data['subview'] ='admin/category/edit';\n\t $this->load->view('admin/_layout_main', $this->data);\n }", "public function edit() {\n// user must be logged in\n if (User::is_logged_in()) {\n// preventing double submitting\n $token = md5(time());\n $_SESSION[$token] = true;\n\n $user_id = $_SESSION['user_id'];\n $is_admin = isset($_SESSION['is_admin']) && $_SESSION['is_admin'];\n $post_id = $_GET['post_id'];\n $post = Post::find($post_id);\n\n $description = $post['description'];\n $categoryId = $post['category'];\n $imageFile = $post['imageFile'];\n// user can edit only his post or he must be an admin\n if ($user_id == $post['authorId'] || $is_admin) {\n // get all categories for the select box in form\n $categories = Category::all();\n// show post edit form\n require_once('views/posts/edit.php');\n }\n }\n }", "public function edit(ProductCategory $productCategory)\n {\n //\n }", "public function edit_postAction() {\r\n\t\t$info = $this->getPost(array('id', 'sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$ret = Game_Service_Category::updateCategory($info, intval($info['id']));\r\n\t\tif (!$ret) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功.'); \t\t\r\n\t}", "public function categories_update($param = null)\r\n {\r\n if (isset($_POST[\"cat_id\"]) && !empty($_POST[\"cat_id\"])) {\r\n $action = $_POST[\"cat_id\"];\r\n $newValue = $_POST[\"cat_descr\"];\r\n $update = Category::find($action)->update(['cat_descr' => $newValue]);\r\n echo $update;\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }", "function update_categories(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "function edit_staff_category($id=NULL) \r\n {\r\n // Basis: To simplify THIRRA system, staff_category name === system_category name\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n\t\t$data['user_rights'] = $this->mthirra->get_user_rights($_SESSION['username']);\r\n $data['breadcrumbs'] = breadcrumbs('ehr_admin/admin_mgt','Admin','ehr_admin/admin_list_staffcategories','List Staff Categories'); \r\n\t\t$data['form_purpose'] = $this->uri->segment(3);\r\n\t\t$data['category_id'] = $this->uri->segment(4);\r\n\t\t$data['title'] = \"Add New / Edit Staff Category\";\r\n $data['now_id'] = time();\r\n //$data['now_date'] = date(\"Y-m-d\",$data['now_id']);\r\n //$data['now_time'] = date(\"H:i\",$data['now_id']);\r\n\t\t$data['users_list'] = $this->madmin_rdb->get_users_list();\r\n $data['systemuser_categories'] = $this->madmin_rdb->get_systemuser_categories();\r\n \r\n if(count($_POST)) {\r\n // User has posted the form\r\n $data['category_id'] = $this->input->post('category_id');\r\n $data['category_name'] = $this->input->post('category_name');\r\n $data['description'] = $this->input->post('description');\r\n $data['init_access_patients'] = $this->input->post('access_patients');\r\n $data['init_access_pharmacy'] = $this->input->post('access_pharmacy');\r\n $data['init_access_orders'] = $this->input->post('access_orders');\r\n $data['init_access_queue'] = $this->input->post('access_queue');\r\n $data['init_access_reports'] = $this->input->post('access_reports');\r\n $data['init_access_utilities'] = $this->input->post('access_utilities');\r\n $data['init_access_admin'] = $this->input->post('access_admin');\r\n } else {\r\n // First time form is displayed\r\n if ($data['form_purpose'] == \"new_category\") {\r\n // New user\r\n\t\t $data['category_info'] = array();\r\n $data['category_id'] = \"new_category\";\r\n $data['category_name'] = \"\";\r\n $data['description'] = \"\";\r\n $data['init_access_patients'] = \"\";\r\n $data['init_access_pharmacy'] = \"\";\r\n $data['init_access_orders'] = \"\";\r\n $data['init_access_queue'] = \"\";\r\n $data['init_access_reports'] = \"\";\r\n $data['init_access_utilities'] = \"\";\r\n $data['init_access_admin'] = \"\";\r\n } else {\r\n // Existing user\r\n\t\t $data['category_info'] = $this->madmin_rdb->get_one_staffcategory($data['category_id']);\r\n $data['category_id'] = $data['category_info']['category_id'];\r\n $data['category_name'] = $data['category_info']['category_name'];\r\n $data['description'] = $data['category_info']['description'];\r\n $data['sys_category_id']= $data['category_info']['sys_category_id'];\r\n $data['permission'] = $data['category_info']['permission'];\r\n $data['access_rights'] = $this->get_user_rights($data['permission']);\r\n $data['access_rights']['permission'] = $data['permission'];\r\n $data['init_access_patients'] = $data['access_rights']['section_patients'];\r\n $data['init_access_pharmacy'] = $data['access_rights']['section_pharmacy'];\r\n $data['init_access_orders'] = $data['access_rights']['section_orders'];\r\n $data['init_access_queue'] = $data['access_rights']['section_queue'];\r\n $data['init_access_reports'] = $data['access_rights']['section_reports'];\r\n $data['init_access_utilities'] = $data['access_rights']['section_utilities'];\r\n $data['init_access_admin'] = $data['access_rights']['section_admin'];\r\n } //endif ($data['form_purpose'] == \"new_category\")\r\n } //endif(count($_POST))\r\n \r\n\t\t$this->load->vars($data);\r\n // Run validation\r\n\t\tif ($this->form_validation->run('edit_staff_category') == FALSE){\r\n // Return to incomplete form\r\n if ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_ehr_wap\";\r\n $new_sidebar= \"ehr/sidebar_ehr_admin_wap\";\r\n //$new_body = \"ehr/emr_edit_systemuser_wap\";\r\n $new_body = \"ehr/ehr_admin_edit_staff_category_html\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n } else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_html\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_html\";\r\n $new_body = \"ehr/ehr_admin_edit_staff_category_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n }\r\n if($data['user_rights']['section_admin'] < 100){\r\n $new_body = \"ehr/ehr_access_denied_html\";\r\n }\r\n $this->load->view($new_header);\t\t\t\r\n $this->load->view($new_banner);\t\t\t\r\n $this->load->view($new_sidebar);\t\t\t\r\n $this->load->view($new_body);\t\t\t\r\n $this->load->view($new_footer);\t\t\t\r\n } else {\r\n //echo \"\\nValidated successfully.\";\r\n //echo \"<pre>\";\r\n //print_r($data);\r\n //echo \"</pre>\";\r\n //echo \"<br />Insert record\";\r\n // Generate permission\r\n $data['rights_decimal'] = 0;\r\n if(is_numeric($data['init_access_admin'])){ \r\n $data['rights_decimal'] += 1;\r\n }\r\n if(is_numeric($data['init_access_reports'])){ \r\n $data['rights_decimal'] += 2;\r\n }\r\n if(is_numeric($data['init_access_pharmacy'])){ \r\n $data['rights_decimal'] += 4;\r\n }\r\n if(is_numeric($data['init_access_orders'])){ \r\n $data['rights_decimal'] += 8;\r\n }\r\n if(is_numeric($data['init_access_patients'])){ \r\n $data['rights_decimal'] += 16;\r\n }\r\n if(is_numeric($data['init_access_queue'])){ \r\n $data['rights_decimal'] += 32;\r\n }\r\n /* Finance and Billing \r\n if(is_numeric($data['init_access_patients'])){ \r\n $data['rights_decimal'] += 64;\r\n }\r\n if(is_numeric($data['init_access_patients'])){ \r\n $data['rights_decimal'] += 128;\r\n }\r\n */\r\n if(is_numeric($data['init_access_utilities'])){ \r\n $data['rights_decimal'] += 256;\r\n }\r\n if($data['form_purpose'] == \"new_category\") {\r\n // Insert records\r\n $ins_cate_array['category_id'] = $data['now_id'];\r\n $ins_cate_array['category_name'] = $data['category_name'];\r\n $ins_cate_array['description'] = $data['description'];\r\n $ins_cate_array['permission'] = $data['rights_decimal'];\r\n //echo \"data['rights_decimal']\".$data['rights_decimal'];\r\n $ins_user_data = $this->madmin_wdb->insert_new_staffcategory($ins_cate_array);\r\n $this->session->set_flashdata('data_activity', 'Staff category added.');\r\n } else {\r\n // Update records\r\n $upd_cate_array['category_id'] = $data['category_id'];\r\n $upd_cate_array['category_name'] = $data['category_name'];\r\n $upd_cate_array['description'] = $data['description'];\r\n $upd_cate_array['permission'] = $data['rights_decimal'];\r\n //echo \"data['rights_decimal']\".$data['rights_decimal'];\r\n $upd_user_data = $this->madmin_wdb->update_staffcategory($upd_cate_array);\r\n $this->session->set_flashdata('data_activity', 'Staff category updated.');\r\n } //endif($data['form_purpose'] == \"new_category\")\r\n $new_page = base_url().\"index.php/ehr_admin/admin_list_staffcategories\";\r\n header(\"Status: 200\");\r\n header(\"Location: \".$new_page);\r\n } //endif ($this->form_validation->run('edit_staff_category') == FALSE)\r\n }", "public function update(Request $request, Category $category)\n {\n $category->exp_group_name = $request->exp_group_name;\n $category->exp_group_desc = $request->exp_group_desc;\n\n if ( $request->exp_group_status == '1' or $request->exp_group_status == '0')\n {\n \n $category->exp_group_status = $request->exp_group_status;\n }\n\n\n \n\n\n\n \n $category->save();\n return redirect()->route('admin.categories.index');\n }", "public function update(){\n $service_category = new OsServiceCategoryModel($this->params['service_category']['id']);\n $service_category->set_data($this->params['service_category']);\n if($service_category->save()){\n $response_html = __('Service Category Updated. ID: ', 'latepoint') . $service_category->id;\n $status = LATEPOINT_STATUS_SUCCESS;\n }else{\n $response_html = $service_category->get_error_messages();\n $status = LATEPOINT_STATUS_ERROR;\n }\n if($this->get_return_format() == 'json'){\n $this->send_json(array('status' => $status, 'message' => $response_html));\n }\n }", "public function edit(CustomerCategory $customerCategory)\n {\n //\n }", "public function edit($catgId){\n\t\t\tif($this->session->userdata('loggedIn_adminInfo')=='')redirect('admincp');\n\t\t\t$data['title'] \t\t= 'Projects 100K';\n\t\t\t$postedValue_fname \t= array();\n\t\t\tif($this->session->userdata('post_promotionData'))\n\t\t\t$data['postedValue'] \t\t= \t$this->session->userdata('post_promotionData');\n\t\t\t$promotionID\t\t\t\t= \tstr_replace(array('-', '_', '~'), array('+', '/', '='),$catgId);\t\t\t\n\t\t\t$data['promotionInfo']\t\t=\t$this->base_model->is_Record_Exists('tbl_promotion_mastercategory','',array('id'=>$this->encrypt->decode($promotionID)));\t\n\t\t\t$data['fieldInfo']\t\t\t=\t$this->base_model->get_All_Records('tbl_promotion_masterfields','',\n\t\t\t\t\t\t\t\t\t\t\tarray('promotionCategoryId'=>$this->encrypt->decode($promotionID)),'order','asc');\t\t\t\t\n\t\t\t$data['catg_uri_string']\t=\t$data['promotionInfo']->uri_string;\n\t\t\t$data['catgTitle']\t\t\t=\tstripslashes(ucwords($data['promotionInfo']->title));\n\t\t\t$data['hdnPromotionID']\t\t=\t$catgId;\n\t\t\t$this->session->unset_userdata('post_promotionFieldData');\n\t\t\t$this->load->view('templates/admincp/header', $data);\n\t\t\t$this->load->view('admincp/promotion/form', $data);\n\t\t}", "function edit($esta_categoria)\n {\n if($this->acceso(436)){\n // check if the categoria exists before trying to edit it\n $categoria = str_replace(\"%20\", \" \", $esta_categoria);\n $data['categoria'] = $this->Categoria_model->get_categoria($categoria);\n\n if(isset($data['categoria']['categoria']))\n {\n $this->load->library('form_validation');\n $this->form_validation->set_rules('categoria','Nombre','trim|required', array('required' => 'Este Campo no debe ser vacio'));\n $this->form_validation->set_rules('codigo_cat','Código','trim|required', array('required' => 'Este Campo no debe ser vacio'));\n if($this->form_validation->run()) \n {\n $params = array(\n 'categoria' => $this->input->post('categoria'),\n 'codigo_cat' => $this->input->post('codigo_cat'),\n );\n $this->Categoria_model->update_categoria($categoria,$params); \n redirect('categoria/index');\n }\n else\n {\n $data['_view'] = 'categoria/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The categoria you are trying to edit does not exist.');\n }\n }", "public function update_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n //category id\n $id = $this->input->post('category_id', true);\n if ($this->gallery_category_model->update_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_updated\"));\n redirect('admin_category/gallery_categories');\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }", "public function do_edit(Request $request,$id){\n\t\t$cat = new category();\n\t\t$c_name = $request->get(\"c_name\");\n\t\t// Sua ban ghi\n\t\t$cat->where(\"pk_category_news_id\",\"=\",$id)->update(array(\"c_name\"=>$c_name));\n\t\treturn redirect(url('admin/category-news'));\n\t}", "function editChoiceCategory($data,$id){\n\t\t$this->db->where('choice_category_id',$id);\n\t\t$query = $this->db->update(\"tbl_choice_category\",$data);\n\t\treturn $this->db->affected_rows();\n\t}", "public function update(CategoryEditRequest $request, Categ $categ)\n {\n //dd($categ);\n //dd($request);\n\n if($request->isMethod('post')){\n $categ->fill($request->all());\n $isOk=$categ->save();\n //$isOk=false;\n if($isOk){\n return redirect()->route('adminCateg')->with('success','запись обновлена');}\n else{\n return redirect()->route('adminCateg')->with('error','запись не обновлена');}\n }\n return view('news.admin.categ.update', ['categ'=>$categ]);\n }", "public function edit(BlogCategory $blogCategory)\n {\n //\n }", "function update_utility_bill_category($utility_bill_category_id = '')\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['timestamp']\t\t\t\t=\ttime();\n\t\t$data['updated_by']\t\t\t\t=\t$this->session->userdata('user_id');\n\n\t\t$this->db->where('utility_bill_category_id', $utility_bill_category_id);\n\t\t$this->db->update('utility_bill_category', $data);\n\n\t\t$this->session->set_flashdata('success', 'Utility bill category has been updated successfully.');\n\n\t\tredirect(base_url() . 'utility_bill_categories', 'refresh');\n\t}", "function action_edit($params) {\n $form_error =false;\n $category= model_category::load_by_id($params[0]);\n $id =$params[0];\n if(isset($_POST['form']['action1'])) {\n //Check if the \"Ok\" button is set.\n\n //Modify category name.\n if( model_category::editC($id,$_POST['form']['name'])){\n header('Location: ' . APP_URL . 'category/list');\n die;\n\n }\n $form_error =false;\n }\n if(isset($_POST['form']['action2'])) {\n @include_once APP_PATH . 'view/category_edit.tpl.php';\n }\n @include_once APP_PATH . 'view/category_edit.tpl.php';\n }", "public function edit(booksCategory $booksCategory)\n {\n //\n }", "public function edit(booksCategory $booksCategory)\n {\n //\n }", "public function editAction() {\n $form = $this->view->form = new Whmedia_Form_Circle();\n $form->submit->setLabel('Edit Box');\n $list_id = (int) $this->_getParam('box_id');\n $circlesTable = Engine_Api::_()->getDbTable('circles', 'whmedia');\n $viewer = Engine_Api::_()->user()->getViewer();\n /* @var $list Whmedia_Model_Circle */\n $list = $circlesTable->find($list_id)->current();\n $form->populate($list->toArray());\n \n // Check post\n if( $this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost()) )\n {\n if( !$list || $list->user_id != $viewer->getIdentity() ) {\n return $this->_helper->Message('Missing box.', false, false)->setError();\n } \n // we will add the category\n $values = $form->getValues();\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\n try\n {\n \n $list->setFromArray($values);\n $list->save();\n\n $db->commit();\n }\n\n catch( Exception $e )\n {\n $db->rollBack(); \n throw $e;\n }\n\n return $this->_helper->Message(\"Changes saved.\");\n }\n\n // Output\n $this->renderScript('admin-settings/form.tpl');\n }", "public function testUpdateItemSubCategory()\n {\n }", "public function edit_category($id = null)\n { \n //check if id is set\n if(isset($id))\n {\n $data['category'] = $this->blog_model->get_category($id); //get data of category\n $data['categories'] = $this->blog_model->get_category(); //get all categories from database (for parent purpose)\n\n //if category id desn't exist\n if($data['category'] == false)\n {\n $data['category_error'] = 'Category does not exist'; //set category_error variable\n \n }\n\n //validate form on category update\n $this->form_validation->set_rules('cat_name', 'Category Name', 'required|trim|htmlspecialchars|callback_validate_change_cat_name['.$id.']', array(\n 'required' => '%s is not provided!'\n ));\n $this->form_validation->set_rules('cat_desc', 'Category Description', 'trim|htmlspecialchars');\n\n //if form is not successfully validated\n if($this->form_validation->run() == FALSE)\n {\n if(isset($_POST['submit']))\n {\n $data['info'] = 'An Error occured!';\n }\n $data['cat_parent'] = $this->blog_model->get_category($data['category']['parent_id']); //get category parent\n $data['title'] = 'Edit Category';\n $data['page'] = 'category';\n $this->load->view('template/header',$data);\n $this->load->view('blog/edit_category');\n $this->load->view('template/footer');\n }\n else\n {\n $update = $this->blog_model->update_category($id, $_POST);\n if($update == true)\n {\n $data['category'] = $this->blog_model->get_category($id);\n $data['cat_parent'] = $this->blog_model->get_category($data['category']['parent_id']);\n $data['title'] = 'Edit Category';\n $data['page'] = 'category';\n $data['info'] = 'Category has been successfully updated!';\n $this->load->view('template/header',$data);\n $this->load->view('blog/edit_category');\n $this->load->view('template/footer');\n }\n else\n {\n $data['category'] = $this->blog_model->get_category($id);\n $data['cat_parent'] = $this->blog_model->get_category($data['category']['parent_id']);\n $data['title'] = 'Edit Category';\n $data['page'] = 'category';\n $data['info'] = 'You have made no changes!';\n $this->load->view('template/header',$data);\n $this->load->view('blog/edit_category');\n $this->load->view('template/footer');\n }\n }\n }\n else\n {\n header('location:'.base_url.'index.php/blog/category');\n }\n }", "public function update(Request $request ,Category $update){\n $update -> category_name_en = $request -> blog_category_name_en;\n $update -> category_name_lng = $request -> blog_category_name_lng;\n $update -> category_name_en_slug = strtolower(str_replace(' ' , '-' , $request -> blog_category_name_en));\n $update -> category_name_lng_slug = str_replace(' ' , '-' , $request -> blog_category_name_lng);\n $update -> update();\n return true;\n }", "public function edit(Workout $workout)\n {\n $logged_user = Auth::user();\n $users = User::all();\n return view('Admin.Workouts.edit',compact('workout','users','logged_user'));\n }", "public function update_category(Request $request){\n $data = array();\n $category_id=$request->category_id;\n $data['category_name']=$request->category_name;\n $data['category_description']=$request->category_description;\n\n//$data['publication_status']=$request->publication_status;\n DB::table('tbl_category')\n ->where('category_id',$category_id)\n ->update($data);\n\n Session::put('message','Category update Successfully!!');\n return Redirect::to('/edit-category/'.$category_id);\n }", "public function edit($id)\n\t{\n\t\t$present_users = \\App\\User::where('category', '!=', 0)->orderBy('created_at', 'desc')->get();\n\t\t\n\t\t$data = \\App\\Work::find($id);\n\t\t$industries = \\App\\Industry::orderBy(\"sort\", 'asc')->get();\n\t\t$work_categories = \\App\\WorkCategory::orderBy('sort', 'asc')->get();\n\t\t$area_provinces = \\App\\AreaProvince::orderBy('sort', 'asc')->get(array('id','code', 'name', 'id'));\n\t\t$area_cities = null;\n\t\t$area_streets = null;\n\t\tif(!empty($data->province))\n\t\t{\n\t\t\t$area_cities = \\App\\AreaCity::where('provincecode', '=', $data->province)->orderBy('sort', 'asc')->get(array('id','code', 'name', 'id'));\n\t\t}\n\t\tif(!empty($data->city))\n\t\t{\n\t\t\t$area_streets = \\App\\AreaStreet::where('citycode', '=', $data->city)->orderBy('sort', 'asc')->get(array('id','code', 'name', 'id'));\n\t\t}\n\t\t\t\n\t\treturn view('admin.works.edit')->with('data', $data)->with('present_users', $present_users)->with('area_provinces', $area_provinces)->with('area_cities', $area_cities)->with('area_streets', $area_streets)->with('work_categories', $work_categories)->with('industries', $industries);\n\t}", "function doEdit()\n {\n $dt = new lmbDate();\n $this->dt_up = $dt->getStamp();\n\n $node_id = $this->request->getInteger('id');\n $this->node = $node_id;\n $category['node_id'] = $node_id;\n $category['title'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_TITLE);\n $category['description'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_DESCR);\n $category['identifier'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_URI);\n\n $this->dt_cr = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_CREATE_DATE);\n $category['date_create'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_CREATE_DATE);\n $category['date_update'] = TreeItem::getAttrValueByNodeId($node_id, TreeItem::ID_UPDATE_DATE);\n $category['is_branch'] = TreeItem::getIsBranchByNodeId($node_id);\n\n $this->setFormDatasource($category, 'object_form');\n\n if($this->request->hasPost())\n {\n $this->_validateAndSave(false);\n //$this->_onAfterSave();\n }\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }" ]
[ "0.6806339", "0.67915225", "0.6783352", "0.6751382", "0.67282903", "0.67065406", "0.6692574", "0.65847135", "0.6567059", "0.65591395", "0.6540297", "0.6506003", "0.65053743", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411967", "0.6411762", "0.6396357", "0.6375292", "0.63688594", "0.63472575", "0.6344906", "0.63017976", "0.6289904", "0.62724525", "0.6264524", "0.62321085", "0.6201662", "0.617874", "0.61680675", "0.6165149", "0.6156815", "0.6156365", "0.6146117", "0.6143593", "0.6137387", "0.6128394", "0.61211413", "0.61202145", "0.61110854", "0.6106135", "0.6098655", "0.6098017", "0.6096603", "0.6089548", "0.6082736", "0.6069544", "0.606631", "0.60599256", "0.60580784", "0.60540664", "0.6050663", "0.60496074", "0.60393536", "0.6036917", "0.6028273", "0.60253733", "0.60191864", "0.6012012", "0.59935117", "0.5993165", "0.5985542", "0.5970993", "0.59545124", "0.59541357", "0.59522057", "0.59522057", "0.59495527", "0.5943338", "0.5942655", "0.5939973", "0.5937656", "0.5937552", "0.59260815", "0.59220636", "0.5914193", "0.5914193", "0.5914193", "0.5914193", "0.5914193", "0.5914193", "0.5914193" ]
0.7347392
0
/Edit workout category Function for delete
public function deleteworkoutcategory(Request $request) { $id = $request->workoutid; $getWorkout = Category::find($id); if($getWorkout->delete()){ return redirect()->back()->with('danger','Workout Category Deleted successfully'); } else{ return redirect()->back()->with('danger','Sorry! Workout Category is not deleted'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteNutrationCategory(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = NutrationCategory::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Nutration Category Deleted successfully');\n }\n else{\n return redirect()->back()->with('danger','Sorry! Nutration Category is not deleted');\n }\n }", "public function deleteProgramCategory(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = ProgramCategory::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Program Category Deleted successfully');\n }\n else{\n return redirect()->back()->with('danger','Sorry! Program Category is not deleted');\n }\n }", "function ciniki_foodmarket_categoryDelete(&$ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'category_id'=>array('required'=>'yes', 'blank'=>'yes', 'name'=>'Category'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'foodmarket', 'private', 'checkAccess');\n $rc = ciniki_foodmarket_checkAccess($ciniki, $args['tnid'], 'ciniki.foodmarket.categoryDelete');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the current settings for the category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_foodmarket_categories \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.foodmarket', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['category']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.5', 'msg'=>'Category does not exist.'));\n }\n $category = $rc['category'];\n\n // \n // Check for any child categories\n //\n $strsql = \"SELECT COUNT(id) AS children \"\n . \"FROM ciniki_foodmarket_categories \"\n . \"WHERE ciniki_foodmarket_categories.parent_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbSingleCount');\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.foodmarket', 'num');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.6', 'msg'=>'You still have ' . $rc['num'] . ' child categor' . ($rc['num']>1?'ies':'y') . '.'));\n }\n\n //\n // Check for items already in the category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_foodmarket_category_items \"\n . \"WHERE category_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.foodmarket', 'item');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.149', 'msg'=>'Unable to load item', 'err'=>$rc['err']));\n }\n $items = isset($rc['rows']) ? $rc['rows'] : array();\n \n //\n // Start transaction\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDelete');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.foodmarket');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Remove any items from the category first\n //\n foreach($items as $item) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.foodmarket.categoryitem', $item['id'], $item['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.foodmarket');\n return $rc;\n }\n }\n\n //\n // Remove the category\n //\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.foodmarket.category', $args['category_id'], $category['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.foodmarket');\n return $rc;\n }\n\n //\n // Commit the transaction\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.foodmarket');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'foodmarket');\n\n return array('stat'=>'ok');\n}", "public function updateworkoutcategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $workoutCategory = Category::find($id);\n $workoutCategory->Category = $request->name;\n $workoutCategory->save();\n Session::flash('success','Workout Category Updated succcessfully.');\n return redirect()->back()->with('workout',$workoutCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function product_category_delete(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\tmysql_q(\"DELETE FROM product_category WHERE id='\".add_slash($_r['id']).\"'\");\n\n\t\tredirect(\"product_category.htm\", \"\");\n\t}", "public function addWorkoutCategory()\n {\n return view('admin.addworkoutcategory');\n }", "public function delete_category() {\n $category_id = $_GET['category_id'];\n\n $data['delete_category'] = $this->Category_crud->get_category_by_id($category_id);\n $this->load->view('restaurant/category/delete_category_model', $data);\n\n if (isset($_POST['delete_category_yes'])) {\n $this->Category_crud->delete_category_sub_category_item($category_id);\n redirect(rest_path('Category'));\n }\n\n if (isset($_POST['delete_category_no'])) {\n $this->Category_crud->delete_category($category_id);\n redirect(rest_path('Category'));\n }\n }", "function ciniki_directory_categoryDelete(&$ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'category_id'=>array('required'=>'yes', 'default'=>'', 'blank'=>'yes', 'name'=>'Category'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'directory', 'private', 'checkAccess');\n $ac = ciniki_directory_checkAccess($ciniki, $args['tnid'], 'ciniki.directory.categoryDelete');\n if( $ac['stat'] != 'ok' ) {\n return $ac;\n }\n\n //\n // Get the category uuid\n //\n $strsql = \"SELECT uuid FROM ciniki_directory_categories \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \" \n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['category']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.directory.12', 'msg'=>'The category does not exist'));\n }\n $uuid = $rc['category']['uuid'];\n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Get the list of entries to remove from this category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_directory_category_entries \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND category_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'entry');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $entries = $rc['rows'];\n foreach($entries as $entry) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category_entry', \n $entry['id'], $entry['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n //\n // Delete the object\n //\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category', $args['category_id'], $uuid, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'directory');\n\n return array('stat'=>'ok');\n}", "function cat_delete_link()\n{\n return Parrot::getInstance()->getUrl(\"admin/category/\" . discussion::encode_title(cat_title()) . \"/delete\");\n}", "public function remove_category() {\n\t\t$this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(Request::get(\"cat\"));\n\t\t$this->model->categories->unlink($category);\n if(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\t\n\t}", "function delete_category($action, $id)\r\n{\r\n\tglobal $dropbox_cnf;\r\n\tglobal $_user, $is_courseAdmin, $is_courseTutor;\r\n\r\n\t// an additional check that might not be necessary\r\n\tif ($action=='deletereceivedcategory')\r\n\t{\r\n\t\t$sentreceived='received';\r\n\t\t$entries_table=$dropbox_cnf['tbl_post'];\r\n\t\t$id_field='file_id';\r\n\t}\r\n\telseif ($action=='deletesentcategory')\r\n\t{\r\n\t\t$sentreceived='sent';\r\n\t\t$entries_table=$dropbox_cnf['tbl_file'];\r\n\t\t$id_field='id';\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// step 1: delete the category\r\n\t$sql=\"DELETE FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"' AND $sentreceived='1'\";\r\n\t$result=api_sql_query($sql);\r\n\r\n\t// step 2: delete all the documents in this category\r\n\t$sql=\"SELECT * FROM \".$entries_table.\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t$result=api_sql_query($sql);\r\n\r\n\twhile ($row=mysql_fetch_array($result))\r\n\t{\r\n\t\t$dropboxfile=new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor);\r\n\t\tif ($action=='deletereceivedcategory')\r\n\t\t{\r\n\t\t\t$dropboxfile->deleteReceivedWork($row[$id_field]);\r\n\t\t}\r\n\t\tif ($action=='deletesentcategory')\r\n\t\t{\r\n\t\t\t$dropboxfile->deleteSentWork($row[$id_field]);\r\n\t\t}\r\n\t}\r\n}", "function delete_category($category_id)\n {\n $this->db->update('tbl_category',$this,array('category_id'=>$category_id));\n //echo $this->db->last_query();\n }", "function categoryRemove(){\n\tif(startSession() && isset($_SESSION['UserID']))\n\t{\n\t\t$CatID\t\t\t \t= strip_tags($_GET['id']);\t#int - primaryKey\n\n\t\t$db = pdo(); # pdo() creates and returns a PDO object\n\n\t\t$sql = \"DELETE FROM ma_Categories WHERE CatID = :CatID\";\n\n\t\t$stmt = $db->prepare($sql);\n\t\t//INTEGER EXAMPLE $stmt->bindValue(1, $id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':CatID', $CatID, PDO::PARAM_INT);\n\n\t\ttry {$stmt->execute();} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\t\t#feedback success or failure of update\n\n\t\tif ($stmt->rowCount() > 0)\n\t\t{//success! provide feedback, chance to change another!\n\t\t\tfeedback(\"Category Removed Successfully\",\"success\");\n\t\t}else{//Problem! Provide feedback!\n\t\t\tfeedback(\"Category Not Trashed!\",\"warning\");\n\t\t}\n\t\tmyRedirect(THIS_PAGE);\n\t}\n\t#script for expanding textarea\n}", "public function deletePost(){\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"delete_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n if ($categoryModel->deleteCategory($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category deleted successfully!\",\"success\");\n }\n } catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function deleteWorkout(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = Workout::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Workout Deleted successfully');\n }\n else{\n return redirect()->back()->with('danger','Sorry! Workout is not deleted');\n }\n }", "public function delete()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n try{\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/delete\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n\n }", "public function deleteVideoCategory(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = VideoCategory::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Video Category Deleted successfully');\n }\n else{\n return redirect()->back()->with('danger','Sorry! Video Category is not deleted');\n }\n }", "public function delete(){\n\n\t\t$sql = new Sql();\n\n\t\t$sql->query(\"DELETE FROM tb_categories WHERE idcategory=:idcategory\",array(\n\t\t\t\":idcategory\"=>$this->getidcategory()\n\t\t));\n\n\t\tCategory::updateFile();\n\t}", "function delete_MaterialCategory($id)\n {\n $this->db->where('id',$id);\n return $this->db->update('prj_mtrl_category',array('delete_status'=>'1'));\n }", "function delCategory($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "public function editworkoutcategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = Category::find($id);\n return view('admin.editworkoutcategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function deletecategory(){\n\t\n\t\t$id = $this->request->getParameter(\"actionid\");\n\t\t$modelCategory = new CaCategory();\n\t\t$modelCategory->delete($id);\n\t\n\t\t// generate view\n\t\t$this->redirect(\"catalogadmin/categories\");\n\t}", "public function remove_all_cat_field()\n\t{\n\t\t//Get logged in session admin id\n\t\t$user_id \t\t\t\t\t\t= ($this->session->userdata('user_id_hotcargo')) ? $this->session->userdata('user_id_hotcargo') : 1;\n\t\t$setting_data \t\t\t\t\t= $this->myaccount_model->get_account_data($user_id);\n\t\t$data['data']['setting_data'] \t= $setting_data;\n\t\t$data['data']['settings'] \t\t= $this->sitesetting_model->get_settings();\n\t\t$data['data']['dealer_id'] \t\t= $user_id;\n\t\t\n\t\t//getting all admin data \n\t\t$data['myaccount_data'] \t\t\t= $this->myaccount_model->get_account_data($user_id);\n\t\t\n\t\t\n\t\t//Get requested form type from url segment position 3\n\t\t$field_id \t\t\t\t\t= $this->uri->segment(3);\n\t\t\n\t\t//deleting query\n\t\t$this->mongo_db->where(array('form_type' => $field_id));\n\t\tif($this->mongo_db->delete_all('form_fields'))\n\t\t\t$this->session->set_flashdata('flash_message', 'info_deleted');\n\t\telse\n\t\t\t$this->session->set_flashdata('flash_message', 'info_delete_failed');\n\t\t\t\n\t\tredirect('control/data-forms');\n\t}", "public static function deleteCategoryController(){\n\n\n \t \t if (isset($_POST[\"editCategoryId\"])) {\n\n\n \t \t \t\t\t// NOTA: Se pasa un valor entero como array ya que el modelo de productos recibe de varios métodos\n \t \t\t\t\t\t$dataController = array(\"idcategory\"=>$_POST[\"editCategoryId\"]);\n\n \t \t\t\t\t\t// Esta variable se envía al modelos para proceder a eliminar la categoria\n \t \t\t\t\t\t$dataIdCategoryController = $_POST[\"editCategoryId\"];\n\n \t \t\t\t\t\t// VER PRODUCTOS ASOCIADOS A LA CATEGORIA\n\t\t\t\t\t\t// $answerProducts = productsModel::ViewProductById($dataController, \"productos\");\n\n\t\t\t\t\t\t// foreach ($answerProducts as $row => $item) {\n\n\t\t\t\t\t\t// $dataProductController = array(\"id\"=>$item[\"id\"], \"idcategory\"=>0, \"enable\"=> 1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// $answerDeleteProducts = productsModel::disableProductByIdCategory($dataProductController, \"productos\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$answerDeleteCategory = categorieModel::deleteCategoryModel($dataIdCategoryController, \"categorias\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t \t\tif ($answerDeleteCategory == 1) {\n\n\t \t\t\t\t\techo '<script >swal({\n\n\t\t\t\t\t\t\t\ttitle: \"¡OK!\",\n\t\t\t\t\t\t\t\ttext: \"¡Categoría eliminada correctamente!\",\n\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\tfunction(isConfirm){\n\n\t\t\t\t\t\t\t\t\tif (isConfirm) {\n\n\n\t\t\t\t\t\t\t\t\t\twindow.location = \"categories\";\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t</script>';\n\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\techo \"error\";\n\n\t \t\n\t\t\t\t\t\t\t\t }\n\t\t\t\t \t\t}\n\t\t\t\t}", "public function category_delete(Request $request)\n {\n $id = $request->id;\n\n $op = $request->op; // get operation number \n\n switch($op) {\n /** Event Categories */\n case 1:\n $model = new Category;\n $entity_id = 1;\n break;\n\n /** Sponsor Categories */\n case 2:\n $model = new SponsorCategory;\n $entity_id = 12;\n break;\n\n /** Offer Categories */\n case 3:\n $model = new OfferCategory;\n $entity_id = 7;\n break;\n\n /** Doctors Specialization Categories */\n case 4:\n $model = new DoctorsCategory;\n $entity_id = 11;\n break;\n\n default:\n return redirect()->back();\n break;\n }\n\n // delete from localization - Arabic version\n try {\n EntityLocalization::where('entity_id', $entity_id)->where('item_id', $id)->delete();\n } catch (\\Exception $ex) {\n return response()->json(['error', 'error deleting arabic']);\n }\n\n // delete from interests - English version\n try {\n $model::where('id', $id)->delete();\n } catch (\\Exception $ex) {\n return response()->json(['error', 'error deleting english']);\n }\n\n // return success response\n return response()->json(['success', 'success']);\n }", "public function delcategory() {\n extract($_GET);\n //print_r($_GET);die();\n // call to model function to del category from db\n $result = $this->dash_model->delcategory($mat_cat_id);\n\n echo json_encode($result);\n }", "public function deleteCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n /*删除分类下的子分类*/\n $key = $_REQUEST['id'];\n $condition['id'] = $key;\n $form = M(\"categoryinfo\");\n $data = $form->where($condition)->delete(); \n $data_all = $form->select();\n for ($i = 0;$i< count($data_all);$i++)\n {\n if ($data_all[$i]['father'] == $key) \n {\n $condition['id'] = $data_all[$i]['id'];\n $form->where($condition)->delete();\n }\n } \n /*删除分类下的菜品*/\n $food = M('foodinfo');\n $data_food = $food->select();\n for ($i = 0;$i< count($data_food);$i++)\n {\n if ($data_food[$i]['father'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n if ($data_food[$i]['category'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n } \n\t\t$this->redirect('/index.php/Admin/dish');\n //$this->display();\n }", "public function delete_category(){\n $query = \"DELETE FROM {$this->table} WHERE {$this->table}.cat_id = (:cat_id)\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_id', $this->cat_id);\n $stmt->execute();\n return $stmt;\n \n }", "public function deleteCategoryLangaugeAction(){\n $ebookers_obj = new Ep_Ebookers_Managelist();\n //to call a function to delete themes//\n $ebookers_obj->deleteCategoryLangauge($this->_request->getParams());\n //unset($_REQUEST);\n exit;\n }", "public function storeWorkoutCategory(Request $request)\n {\n $this->validate($request,array(\n 'categoryName' => 'required',\n ));\n\n $workoutCategory = new Category;\n\n $workoutCategory->category = $request->categoryName;\n\n $workoutCategory->save();\n\n if($workoutCategory->save()){\n return redirect()->back()->with('success','Workout category Saved successfully.');\n }\n else{\n return redirect()->back()->with('denger-success','Workout category is not saved.');\n }\n \n }", "public function deleteAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Game_Service_Category::getCategory($id);\r\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\r\n\t\t$result = Game_Service_Category::deleteCategory($id);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "function get_category_to_edit($id)\n {\n }", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "public function destroy($kw_category_id = 0, $id)\n {\n\n }", "public function supcat($id)\n{\n $this->categories->delCat($id);\n redirect('administration/categorie');\n}", "public function deleteWorklog(){\n\n }", "function delete_post()\n {\n $this->Admin_model->procedure = 'POST_DELETE';\n\n echo $this->p_post_id_delete;\n\n\n $rs = $this->Admin_model->delete($this->p_post_id_delete);\n\n //redirect('admin/Posts/display_cat');\n }", "function shophead_deleted($category_id = \"\")\n {\n $id = base64_decode($category_id);\n $categroy_data = $this->ProductCategory->find('first', array('conditions' => array('ProductCategory.id' => $id)));\n \n App::import('Model', 'ProductSubCategory');\n $this -> ProductSubCategory = new ProductSubCategory();\n $subcategories=$this->ProductSubCategory->find(\"list\",array('conditions'=>array(\"ProductSubCategory.product_category_id\"=>$id)));\n \n if(count($subcategories)==0){\n if (!empty($categroy_data)) {\n $new_business_data = $categroy_data['ProductCategory']['id'];\n if ($this->ProductCategory->delete($new_business_data)) {\n $this->Session->write('flash', array(DELETE_RECORD, 'success'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n } else {\n $this->Session->write('flash', array(FAILURE_MSG, 'failure'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n } else {\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }else{\n $this->Session->write('flash', array(CAT_CHILD_EXIST, 'failure'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }", "public function delete($admin) {\n //$categorie = Category::where('job_cat_id','=',$category)->first();\n Admin::where('id', $admin)->delete();\n // $categorie->delete();\n return redirect()->route('Manage_Admins');\n }", "public function delete_category($category_id){\n \n DB::table('tbl_category')\n ->where('category_id',$category_id)\n ->delete();\n return Redirect::to('/manage-category');\n }", "public function postCategoryMultiDelete(){\n\t\t$cat_ids = explode(',', Input::get('cat_ids'));\n\t\tif(count($cat_ids)){\n\t\t\ttry{\n\t\t\t\tforeach($cat_ids as $key => $value){\n\t\t\t\t\tif(!is_numeric($value))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\t$category = ShiftCategory::find($value);\n\t\t\t\t\t$this->shift->deleteCategory($category);\n\t\t\t\t}\n\t\t\t\treturn Redirect::back()->with('success', 'Selected category deleted successfully');\n\t\t\t}catch(\\Exception $e){\n\t\t\t\treturn Redirect::back()->with('error', $e->getMessage());\n\t\t\t}\n\t\t}else\n\t\t\treturn Redirect::back()->with('error', 'One or more category required to be selected before delete');\n\t}", "public function delete_assets_category() {\n\t\t\n\t\tif($this->input->post('type')=='delete_record') {\n\t\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t$id = $this->uri->segment(4);\n\t\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t$result = $this->Assets_model->delete_assets_category_record($id);\n\t\t\tif(isset($id)) {\n\t\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_deleted');\n\t\t\t} else {\n\t\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t\t}\n\t\t\t$this->output($Return);\n\t\t}\n\t}", "public function remove_post()\n {\n $input = $this->input->post();\n $data=$this->Category_model->deleteData($input);\n $this->response(['Item deleted successfully.'], REST_Controller::HTTP_OK);\n }", "public function delete_categoria($cat_id) {\n $conectar=parent::conexion();\n parent::set_names();\n $sql=\"UPDATE tm_categoria SET est=0 where cat_id=?\";\n $sql=$conectar->prepare($sql);\n // envia parametro\n $sql->bindValue(1,$cat_id);\n $sql->execute();\n // IMPORTANTE AGREGARLE EL PDO::FETCH_ASSOC PARA QUE HAGA BIEN LA CONSULTA\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n \n }", "public function travel_conditions_delete() {\n\t\tCheckAdminLoginSession();\n\t\t$id=$this->uri->segment(4);\n\t\t$this->admin_model->dataDelete($this->travel,$id);\n\t\t$this->session->set_flashdata('message','Your Travel Condition has been deleted successfully');\n redirect('admin/travel-conditions/lists','refresh');\n\t}", "public function delete($interview_category_id)\r\n {\r\n $this->checkIfDemo();\r\n $this->AdminInterviewCategoryModel->remove($interview_category_id);\r\n }", "public function destroy($id)//pass the id of law category as input parameter of the function\n {\n lawcategories::where('id',$id)->delete();//find relevant law cactegory from the database and delete it\n return redirect()->back();//redirect back to the previous page\n }", "private function delCategory($idx) {\n \t$query = Category::find()->where('ID != 1 && PARENTID='.$idx)->all();\n \tforeach($query as $items) {\n \t\t$this->delCategory($items['ID']);\n \t}\n\n \t$Postmodel = Products::findAll(['CATEGORYID'=>$idx]);\n \tforeach($Postmodel as $items) {\n \t\t$items->CATEGORYID = 0;\n \t\t$items->save();\n \t}\n \t$this->findModel_category($idx)->delete();\n }", "public function deleteCollageTypeWallpostAction()\n {\n try {\n \n \t$wallpost_obj = \\Extended\\wall_post::getRowObject( $this->getRequest()->getParam('wallpost_id') );\n \t\n \tswitch ( $wallpost_obj->getPost_update_type() ) {\n \t \n \t case \\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM_BY_SHARING :\n \t case \\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM :\n \t \t\n \t //Remove image files.\n \t foreach ( $wallpost_obj->getPhotoGroup()->getSocialisePhoto() as $photo )\n \t {\n \t @unlink(REL_IMAGE_PATH.\"/albums/user_\".$photo->getSocialise_photosPosted_by()->getId().\"/album_default/original_photos/\".$photo->getImage_name() );\n \t @unlink(REL_IMAGE_PATH.\"/albums/user_\".$photo->getSocialise_photosPosted_by()->getId().\"/album_default/gallery_thumbnails/thumbnail_\".$photo->getImage_name() );\n \t @unlink(REL_IMAGE_PATH.\"/albums/user_\".$photo->getSocialise_photosPosted_by()->getId().\"/album_default/popup_thumbnails/thumbnail_\".$photo->getImage_name() );\n \t @unlink(REL_IMAGE_PATH.\"/albums/user_\".$photo->getSocialise_photosPosted_by()->getId().\"/album_default/wall_thumbnails/thumbnail_\".$photo->getImage_name() );\n \t }\n \t \n \t //get photo_group id, call delete query on that,\n \t //the cascade in photo_group table will handle other associated\n \t //things need to be deleted.\n \t \\Extended\\photo_group::deletePhotoGroup( $wallpost_obj->getPhotoGroup()->getId() );\n \t \n \t \n \t break;\n \n \t case \\Extended\\wall_post::POST_UPDATE_TYPE_ALBUM :\n \t \t\n \t //Remove image files.\n \t foreach ( $wallpost_obj->getWall_postsSocialise_album()->getSocialise_albumsSocialise_photo() as $photo )\n \t {\n \t Helper_common::deleteDir( REL_IMAGE_PATH.\"/albums/user_\".$photo->getSocialise_photosPosted_by()->getId().\"/album_\".$photo->getSocialise_photosSocialise_album()->getAlbum_name().\"_\".$photo->getSocialise_photosSocialise_album()->getCreated_at_timestamp()->getTimeStamp() );\n \t }\n \t \n \t //get socialise_album_id, call delete query on that,\n \t //the cascade in socialise_album table will handle other associated\n \t //things need to be deleted.\n \t \\Extended\\socialise_album::deleteAlbum( $wallpost_obj->getWall_postsSocialise_album()->getId() );\n \t \n \t break;\n \t \n \t case \\Extended\\wall_post::POST_UPDATE_TYPE_PROFILE_PHOTO_CHANGED :\n \t \t\t\n \t \t//get socialise_photo_id, call delete query on that,\n \t \t//the cascade in socialise_photo table will handle other associated\n \t \t//things need to be deleted.\n \t \t\\Extended\\socialise_photo::deletephoto( $wallpost_obj->getSocialisePhoto()->getId(),$wallpost_obj->getWall_postsFrom_user()->getId());\n \t \t\t\n \t \tbreak;\n \t}\n \techo Zend_Json::decode( 1 );\n \t\n } catch (Exception $e) {\n echo Zend_Json::decode( 0 );\n }\n die;\n }", "public function delete()\n {\n if(($this->session->userdata('logged_in') != true) && ($this->session->userdata('logged_in_as') != 'admin'))\n {\n redirect('siteadmin', 'refresh');\n }\n \n $category_deletion_type = $this->input->post('category_deletion_type');\n \n /* starts to delete multiple categories */\n if ($category_deletion_type == 'multiple') \n {\n $category_id = $this->input->post('category_id');\n $c \t = 0;\n for( $i = 0; $i < count($category_id); $i++ )\n {\n $id = $category_id[$i];\n\n $check_category = $this->common_model->query_single_row_by_single_source('boutique_products', 'category_id', $id);\n if (count($check_category) == 0)\n {\n if( $this->common_model->delete_data('id', $id, 'boutique_categories') )\n $c++;\n }\n }\n if( $c == 0 )\n $this->session->set_flashdata('error_message', 'Could not delete any category!!');\n \n elseif( $c == 1 )\n $this->session->set_flashdata('success_message', 'A category was deleted successfully');\n \n elseif( $c > 1 )\n $this->session->set_flashdata('success_message', 'Multiple categories were deleted successfully');\n }\n /* ends to delete multiple category */\n \n /* starts to delete single category */\n else {\n $id = $this->input->post('single_category_id');\n $check_category = $this->common_model->query_single_row_by_single_source('boutique_products', 'category_id', $id);\n if (count($check_category) == 0)\n {\n if( $this->common_model->delete_data('id', $id, 'boutique_categories') )\n $this->session->set_flashdata('success_message', 'A category was deleted successfully');\n else\n $this->session->set_flashdata('error_message', 'Could not delete!! The category is in used');\n }\n else\n $this->session->set_flashdata('error_message', 'Could not delete the category!!');\n }\n /* ends to delete single category */ \n \n redirect(base_url().'category', 'refresh');\n }", "public function delete_leave_category($id) {\n $where = array('leave_category_id' => $id);\n // check existing leave category into tbl_application_list\n $check_existing_ctgry = $this->settings_model->check_by($where, 'tbl_application_list');\n // check existing leave category into tbl_attendance\n $check_into_attendace = $this->settings_model->check_by($where, ' tbl_attendance');\n if (!empty($check_into_attendace) || !empty($check_existing_ctgry)) { // if not empty do not delete this else delete\n // messages for user\n $type = \"error\";\n $message = \"Leave Category Information Already Used!\";\n set_message($type, $message);\n } else {\n $this->settings_model->_table_name = \"tbl_leave_category\"; //table name \n $this->settings_model->_primary_key = \"leave_category_id\"; //id\n $this->settings_model->delete($id);\n $type = \"success\";\n $message = \"Leave Category Information Successfully Delete!\";\n set_message($type, $message);\n }\n redirect('admin/settings/leave_category'); //redirect page\n }", "public function delete() {\n $sql = sprintf(\"DELETE FROM category WHERE id=%d\", $this->id);\n self::$connection->execute($sql);\n }", "private function clearCategories() {\n $sql = \"DELETE FROM project_category WHERE project_id = %d\";\n $sql = sprintf($sql, $this->id);\n self::$connection->execute($sql);\n }", "function delete_categories($id){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function deleteClean() {\n\n $id = $this->request->get('category_id');\n\n // check category valid\n $category = ApplicationCategory::find($id)->first();\n\n $next_id = $this->request->get('next_category_id');\n\n\n $category_next = ApplicationCategory::find($next_id)->first();\n\n // check if exists.\n\n DB::table('apps')\n ->where('category_id', $id)\n ->update(['category_id' => $next_id]);\n\n $category->delete();\n\n return redirect('/develop/categories');\n\n\n }", "public function sitestorecategoriesAction() {\n\n //GET NAVIGATION\n $this->view->navigation = $navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_sitestorecategories');\n\n //GET TASK\n if (isset($_POST['task'])) {\n $task = $_POST['task'];\n } elseif (isset($_GET['task'])) {\n $task = $_GET['task'];\n } else {\n $task = \"main\";\n }\n\n //GET CATEGORIES TABLE\n $tableCategories = Engine_Api::_()->getDbTable('categories', 'sitestore');\n\n //GET CATEGORIES TABLE NAME\n $tableCategoriesName = $tableCategories->info('name');\n\n //GET STORE TABLE\n $tableStore = Engine_Api::_()->getDbtable('stores', 'sitestore');\n\n if ($task == \"savecat\") {\n //GET CATEGORY ID\n $cat_id = $_GET['cat_id'];\n\n $cat_title_withoutparse = $_GET['cat_title'];\n\n //GET CATEGORY TITLE\n $cat_title = Engine_Api::_()->sitestore()->parseString($_GET['cat_title']);\n\n //GET CATEGORY DEPENDANCY\n $cat_dependency = $_GET['cat_dependency'];\n $subcat_dependency = $_GET['subcat_dependency'];\n if ($cat_title == \"\") {\n if ($cat_id != \"new\") {\n if ($cat_dependency == 0) {\n $row_ids = Engine_Api::_()->getDbtable('categories', 'sitestore')->getSubCategories($cat_id);\n foreach ($row_ids as $values) {\n $tableCategories->delete(array('subcat_dependency = ?' => $values->category_id, 'cat_dependency = ?' => $values->category_id));\n $tableCategories->delete(array('category_id = ?' => $values->category_id));\n }\n\n $tableStore->update(array('category_id' => 0, 'subcategory_id' => 0), array('category_id = ?' => $cat_id));\n $tableCategories->delete(array('category_id = ?' => $cat_id));\n\n //START SITESTOREREVIEW CODE\n if (Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitestorereview')) {\n Engine_Api::_()->sitestorereview()->deleteCategory($cat_id);\n }\n //END SITESTOREREVIEW CODE\n } else {\n $tableCategories->update(array('category_name' => $cat_title), array('category_id = ?' => $cat_id, 'cat_dependency = ?' => $cat_dependency));\n $tableStore->update(array('category_id' => 0, 'subcategory_id' => 0), array('category_id = ?' => $cat_id));\n $tableCategories->delete(array('cat_dependency = ?' => $cat_id, 'subcat_dependency = ?' => $cat_id));\n $tableCategories->delete(array('category_id = ?' => $cat_id));\n }\n }\n //SEND AJAX CONFIRMATION\n echo \"<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>\";\n echo \"window.parent.removecat('$cat_id');\";\n echo \"</script></head><body></body></html>\";\n exit();\n } else {\n if ($cat_id == 'new') {\n $row_info = $tableCategories->fetchRow($tableCategories->select()->from($tableCategoriesName, 'max(cat_order) AS cat_order'));\n $cat_order = $row_info['cat_order'] + 1;\n $row = $tableCategories->createRow();\n $row->category_name = $cat_title_withoutparse;\n $row->cat_order = $cat_order;\n $row->cat_dependency = $cat_dependency;\n $row->subcat_dependency = $subcat_dependency;\n $newcat_id = $row->save();\n } else {\n $tableCategories->update(array('category_name' => $cat_title_withoutparse), array('category_id = ?' => $cat_id));\n $newcat_id = $cat_id;\n }\n\n //SEND AJAX CONFIRMATION\n echo \"<html><head><meta http-equiv='Content-Type' content='text/html; charset=UTF-8'><script type='text/javascript'>\";\n echo \"window.parent.savecat_result('$cat_id', '$newcat_id', '$cat_title', '$cat_dependency', '$subcat_dependency');\";\n echo \"</script></head><body></body></html>\";\n exit();\n }\n } elseif ($task == \"changeorder\") {\n $divId = $_GET['divId'];\n $sitestoreOrder = explode(\",\", $_GET['sitestoreorder']);\n //RESORT CATEGORIES\n if ($divId == \"categories\") {\n for ($i = 0; $i < count($sitestoreOrder); $i++) {\n $cat_id = substr($sitestoreOrder[$i], 4);\n $tableCategories->update(array('cat_order' => $i + 1), array('category_id = ?' => $cat_id));\n }\n } elseif (substr($divId, 0, 7) == \"subcats\") {\n for ($i = 0; $i < count($sitestoreOrder); $i++) {\n $cat_id = substr($sitestoreOrder[$i], 4);\n $tableCategories->update(array('cat_order' => $i + 1), array('category_id = ?' => $cat_id));\n }\n } elseif (substr($divId, 0, 11) == \"treesubcats\") {\n for ($i = 0; $i < count($sitestoreOrder); $i++) {\n $cat_id = substr($sitestoreOrder[$i], 4);\n $tableCategories->update(array('cat_order' => $i + 1), array('category_id = ?' => $cat_id));\n }\n }\n }\n\n $categories = array();\n $category_info = Engine_Api::_()->getDbTable('categories', 'sitestore')->getCategories(1);\n foreach ($category_info as $value) {\n $sub_cat_array = array();\n $subcategories = Engine_Api::_()->getDbtable('categories', 'sitestore')->getAllCategories($value->category_id, 'subcategory_id', 0, 'subcategory_id', null, 0, 0);\n foreach ($subcategories as $subresults) {\n $subsubcategories = Engine_Api::_()->getDbtable('categories', 'sitestore')->getAllCategories($subresults->category_id, 'subsubcategory_id', 0, 'subsubcategory_id', null, 0, 0);\n $treesubarrays[$subresults->category_id] = array();\n foreach ($subsubcategories as $subsubcategoriesvalues) {\n $treesubarray = array('tree_sub_cat_id' => $subsubcategoriesvalues->category_id,\n 'tree_sub_cat_name' => $subsubcategoriesvalues->category_name,\n 'order' => $subsubcategoriesvalues->cat_order,\n 'count' => $subsubcategoriesvalues->count,);\n $treesubarrays[$subresults->category_id][] = $treesubarray;\n }\n\n $tmp_array = array('sub_cat_id' => $subresults->category_id,\n 'sub_cat_name' => $subresults->category_name,\n 'tree_sub_cat' => $treesubarrays[$subresults->category_id],\n 'count' => $subresults->count,\n 'order' => $subresults->cat_order);\n $sub_cat_array[] = $tmp_array;\n }\n\n $category_array = array('category_id' => $value->category_id,\n 'category_name' => $value->category_name,\n 'order' => $value->cat_order,\n 'count' => $value->count,\n 'sub_categories' => $sub_cat_array);\n $categories[] = $category_array;\n }\n\n include APPLICATION_PATH . '/application/modules/Sitestore/controllers/license/license2.php';\n }", "function delete_entry($entryID) {\r\n $this->db->where('id', $entryID);\r\n $this->db->delete('workHours');\r\n }", "function delete_kategori($id_kategori_point)\n {\n return $this->db->delete('kategori',array('id_kategori_point'=>$id_kategori_point));\n }", "function del_okAction($request, $params = null) \n {\n $this->getModel('users')->needPrivilege('manage_categories');\n $ns = $this->getModel('fonctions');\n $this->data['id'] = $ns->ifGet(\"int\", \"id\"); \n }", "function delete_campaign_list($id, $taxonomy) {\n if ($taxonomy === 'category') {\n require_once 'createsend-php-5.1.2/csrest_lists.php';\n $auth = array('api_key' => CM_API_KEY);\n $wrap = new CS_REST_Lists(get_term_meta($id, 'list_id', true), $auth);\n\n $result = $wrap->delete();\n }\n}", "function delete_category($FormID) {\r\n $conn = db_connect();\r\n\r\n $query = \"delete from PortfolioCategories\r\n where PortCatID='\".$FormID.\"'\";\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public function deleteCategory()\r\n{\r\n $query_string = \"DELETE FROM categories \";\r\n $query_string .= \"WHERE categoryid= :categoryid\";\r\n\r\n return $query_string;\r\n}", "function pnAddressBook_admin_updatecategories() {\r\n\r\n\t$output = new pnHTML();\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\tlist($id,$del,$name,$newname) = pnVarCleanFromInput('id','del','name','newname');\r\n\tif(is_array($del)) {\r\n $dels = implode(',',$del);\r\n }\r\n\r\n\t$modID = $modName = array();\r\n\r\n\tif(isset($id)) {\r\n\t\tforeach($id as $k=>$i) {\r\n \t$found = false;\r\n \tif(count($del)) {\r\n \tforeach($del as $d) {\r\n \tif($i == $d) {\r\n \t$found = true;\r\n \tbreak;\r\n \t}\r\n \t}\r\n \t}\r\n \tif(!$found) {\r\n \tarray_push($modID,$i);\r\n \tarray_push($modName,$name[$k]);\r\n }\r\n \t}\r\n\t}\r\n\r\n\t$pntable = pnDBGetTables();\r\n\t$cat_table = $pntable[pnaddressbook_categories];\r\n\t$cat_column = $pntable['pnaddressbook_categories_column'];\r\n\r\n\t$updates = array();\r\n foreach($modID as $k=>$id) {\r\n array_push($updates,\"UPDATE $cat_table\r\n SET $cat_column[name]='\".pnVarPrepForStore($modName[$k]).\"'\r\n WHERE $cat_column[nr]=$id\");\r\n\t}\r\n\r\n\t$error = '';\r\n\r\n\tif(pnModAPIFunc(__PNADDRESSBOOK__,'admin','updateCategories',array('updates'=>$updates))) {\r\n \tif (empty($error)) { $error .= 'UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\telse { $error .= ' - UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t}\r\n\r\n\t$delete = \"DELETE FROM $cat_table WHERE $cat_column[nr] IN ($dels)\";\r\n\tif(isset($dels)) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','deleteCategories',array('delete'=>$delete))) {\r\n if (empty($error)) { $error .= 'DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n }\r\n }\r\n\r\n\tif( (isset($newname)) && ($newname != '') ) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','addCategories',array('name'=>$newname))) {\r\n if (empty($error)) { $error .= 'INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t}\r\n }\r\n\r\n\t$args=array('msg'=>$error);\r\n\r\n\tpnRedirect(pnModURL(__PNADDRESSBOOK__, 'admin', 'categories',$args));\r\n\treturn true;\r\n}", "public function index()\n {\n /*$categories=Category::withTrashed()->get();\n\n foreach($categories as $cat){\n $cat->deleted_at = null;\n $cat->save();\n }*/\n\n /*$categories=Category::find(1);\n $categories->delete();*/\n\n\n /* $categories=Category::all();\n\n\n foreach($categories as $cat){\n $cat->delete();\n }*/\n return view('admin.category.index');\n }", "public function testUpdateItemSubCategory()\n {\n }", "function delete_workman($id)\n {\n return $this->db->delete('workman',array('id'=>$id));\n }", "public function edit(Workout $workout)\n {\n //\n }", "function deleting_categories (){\r\n if(isset($_GET['delete'])){\r\n $delete_cat_id_get = $_GET['delete'];\r\n $delete_cat_id_get = escape($delete_cat_id_get) ;\r\n $sql = \"DELETE FROM categories WHERE cat_id ='$delete_cat_id_get' \";\r\n $result = execute($sql);\r\n confirm($sql); \r\n redirect('categories.php');\r\n }\r\n \r\n}", "function deletecategeory()\r\n\t{\r\n //if check boxes are selected for deleting\r\n\t if (isset($_POST['remove']) && $_POST['remove']=='remove selected')\r\n\t {//get the values \r\n \t $removeid = array();\r\n \t $removeid = $_POST['removeid'];\r\n \t $parentid = $_POST['parentid'];\r\n \t \r\n \t \r\n \t //if no of check boxes selected > 0\r\n \t if (count($removeid) > 0)\r\n \t { //fetch each and every one check box item\r\n \t \t\r\n \t foreach ($removeid as $id)\r\n \t {\r\n $isroot = $this->categeory_model->isrootcategeory($id);\r\n\t //check whether the categeory is root\t\r\n\t if($isroot)\r\n\t {\r\n\t \t//fetch all sub categeories\r\n\t $query1 = $this->categeory_model->subcat($id);\r\n\t foreach ($query1->result() as $item):\t\r\n $this->deletesubcategeory($item->id);\r\n\t endforeach;\r\n\t //delete all subcategeories\r\n\t $this->categeory_model->deletesubcategeory($id);\t\t\t\t \r\n\t }\t\r\n\t else{\r\n\t $this->deletesubcategeory($id);\r\n }\r\n\t //delete categeory\t\r\n\t $this->categeory_model->deletecategeory($id);\r\n \t }//foreach\r\n \t }//if\r\n }//if\r\n\r\n else{\t\t\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 $isroot = $this->categeory_model->isrootcategeory($id);\r\n\t //check whether the categeory is root\t\r\n\t if($isroot)\r\n\t {\r\n\t\t//fetch all sub categeories\r\n\t $query1 = $this->categeory_model->subcat($id);\r\n\t foreach ($query1->result() as $item):\t\r\n $this->deletesubcategeory($item->id);\r\n\t endforeach;\r\n\t //delete all subcategeories\r\n\t $this->categeory_model->deletesubcategeory($id);\t\t \r\n\t }\t\r\n\t else{//sub categeory\r\n\t\t $this->deletesubcategeory($id);\r\n\t }\r\n\t $this->categeory_model->deletecategeory($id);\r\n }\r\n redirect('admin/categeory/categeoryview/'.$parentid);\r\n\t}", "public function delete() {\n\t\t$sql = 'delete from cart_categories where categories_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\t$sql = 'delete from cart_categories_description where categories_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\t$cats = $this->getSubCategories();\n\t\tforeach ($cats as $cat) {\n\t\t\t$cat->delete();\n\t\t}\n\t}", "public function delete_gallery_category_post()\n {\n prevent_author();\n\n $id = $this->input->post('category_id', true);\n\n //check if category has posts\n if ($this->gallery_image_model->get_category_image_count($id) > 0) {\n $this->session->set_flashdata('error', trans(\"msg_delete_images\"));\n redirect($this->agent->referrer());\n }\n\n if ($this->gallery_category_model->delete_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_deleted\"));\n redirect($this->agent->referrer());\n } else {\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }", "public function delete(): void\n {\n $query_lang = 'DELETE FROM '. rex::getTablePrefix() .'d2u_linkbox_categories '\n .'WHERE category_id = '. $this->category_id;\n $result_lang = rex_sql::factory();\n $result_lang->setQuery($query_lang);\n }", "public function updateNutrationCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n 'tips' => 'required',\n ));\n $id = $request->id;\n $nutrationCategory = NutrationCategory::find($id);\n $nutrationCategory->nutration_category_name = $request->name;\n $nutrationCategory->tips = $request->tips;\n $nutrationCategory->save();\n Session::flash('success','Nutration Category Updated succcessfully.');\n return redirect()->back()->with('workout',$nutrationCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function delete_category($category_id) {\n global $db;\n $query = \n ' DELETE FROM categories \n WHERE cat_categoryID = :category_id';\n $statement = $db->prepare($query);\n $statement->bindValue(':category_id', $category_id);\n $statement->execute();\n $statement->closeCursor();\n}", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}", "function delCategoryLink($object) { \n /* you can itentify the article with $object->reference->ShopId */ \n /* you can itentify the item with $object->Item->ShopId */ \n}", "function delete(){\n if(isset($_GET['id'])){\n eliminar_categoria($_GET['id']); \n }\n }", "public function delete_category($id)\n { \n\t $query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n @unlink(str_replace(base_url(),'',$query[0]->category_img));\n \n $query=$this->General_model->show_data_id('categories',$id,'category_Id','delete','');\n $this->session->set_flashdata('success','Product Category Deleted successfully'); \n redirect('superpanel/categorie');\n\t\n\t }", "public function deleteCategoryByAdmin($cb_id)\r\n\t{\r\n\t\t $this->controllercategories->deleteCategoryByAdmin($cb_id) ;\t\r\n\t}", "public function destroy( )\n\t{\n\t\t$tasksCatagories->delete();\n\n\t\treturn Redirect::route('tasksCatagories.index')->with('message', 'catagory deleted.');\n\t}", "public function deleted(AccountingDivisionCategory $accountingDivisionCategory)\n {\n //\n }", "public function page_delete_cat()\n\t{\n\t\tif (check_confirm())\n\t\t{\n\t\t\tif ($this->id > 0)\n\t\t\t{\n\t\t\t\t// On met a jour l'ordre des categories\n\t\t\t\t$sql = 'SELECT cat_order\n\t\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat\n\t\t\t\t\t\tWHERE cat_id = ' . $this->id;\n\t\t\t\t$cat_order = Fsb::$db->get($sql, 'cat_order');\n\t\t\t\tif (!$cat_order)\n\t\t\t\t{\n\t\t\t\t\tDisplay::message('no_result');\n\t\t\t\t}\n\n\t\t\t\tFsb::$db->update('smilies_cat', array(\n\t\t\t\t\t'cat_order' =>\tarray('(cat_order - 1)', 'is_field' => true),\n\t\t\t\t), 'WHERE cat_order > ' . $cat_order);\n\n\t\t\t\t// Suppression de la categorie\n\t\t\t\t$sql = 'DELETE FROM ' . SQL_PREFIX . 'smilies_cat\n\t\t\t\t\t\tWHERE cat_id = ' . $this->id;\n\t\t\t\tFsb::$db->query($sql);\n\n\t\t\t\t$sql = 'DELETE FROM ' . SQL_PREFIX . 'smilies\n\t\t\t\t\t\tWHERE smiley_cat = ' . $this->id;\n\t\t\t\tFsb::$db->query($sql);\n\t\t\t\tFsb::$db->destroy_cache('smilies_');\n\t\t\t}\n\n\t\t\tLog::add(Log::ADMIN, 'log_smiley_delete_cat');\n\t\t\tDisplay::message('adm_smiley_well_cat_delete', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t\telse if (Http::request('confirm_no', 'post'))\n\t\t{\n\t\t\tHttp::redirect('index.' . PHPEXT . '?p=posts_smiley');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tDisplay::confirmation(Fsb::$session->lang('adm_smiley_delete_cat_confirm'), 'index.' . PHPEXT . '?p=posts_smiley', array('mode' => $this->mode, 'id' => $this->id));\n\t\t}\n\t}", "function edit_category($tbl_name){\n\t\t//print_r($_POST); die;\n\t\tunset($_POST['submitLog']);\n\t\t$this->db->where('id', $_POST['id']);\n\t\tunset($_POST['id']);\n\t\t$this->db->update($tbl_name,$_POST);\n\t\t// print_r($this->db->last_query());\n\t // die();\n\t}", "function Specialities_Delete(){\n\t\t\n\t\t//when get id from url\n\t\tif(isset($_GET['Delete'])){\n\t\t\t\n\t\t\t// get id move to variable\n\t\t\t$get_id = $_GET['Delete'];\n\t\t\t\n\t\t\t//delete Specialities from table\n\t\t\t$this->Delete('specialities',$get_id,'Specialities?m');\n\t\t} // ifisset close\n\t}", "function action_delete($params) {\n $form_error =false;\n $category= model_category::load_by_id($params[0]);\n $id =$params[0];\n if(isset($_POST['form']['action'])) {\n //Check if the current category contains products.\n if($category::get_products_by_id($id)) {\n //If the category contains products,an error message appears.\n $form_error =TRUE;\n }\n else {\n if( model_category::deleteC($id)){\n header('Location: ' . APP_URL . 'category/list');\n die;\n }\n }\n }\n @include_once APP_PATH . 'view/category_delete.tpl.php';\n }", "function projectpentagon_remove() {\n\ndelete_option('projectpentagon_title');\n\ndelete_option('projectpentagon_name1');\n\ndelete_option('projectpentagon_name2');\n\ndelete_option('projectpentagon_name3');\n\ndelete_option('projectpentagon_name4');\n\ndelete_option('projectpentagon_name5');\n\ndelete_option('projectpentagon_color1');\n\ndelete_option('projectpentagon_color2');\n\ndelete_option('projectpentagon_color3');\n\ndelete_option('projectpentagon_color4');\n\ndelete_option('projectpentagon_color5');\n\ndelete_option('projectpentagon_category');\ndelete_option('projectpentagon-titleonpages');\n\n}", "function remove_utility_bill_category($utility_bill_category_id = '')\n\t{\n\t\t$this->db->where('utility_bill_category_id', $utility_bill_category_id);\n\t\t$this->db->delete('utility_bill_category');\n\n\t\t$this->session->set_flashdata('success', 'Utility bill category has been deleted successfully.');\n\n\t\tredirect(base_url() . 'utility_bill_categories', 'refresh');\n\t}", "public function remove_category($id) {\r\n\t\t\treturn parent::delete($id);\r\n\t\t}", "public function EliminarCategorias()\n\t{\n\n\t\t$sql = \" select codcategoria from productos where codcategoria = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcategoria\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\n\t\t\t$sql = \" delete from categorias where codcategoria = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codcategoria);\n\t\t\t$codcategoria = base64_decode($_GET[\"codcategoria\"]);\n\t\t\t$stmt->execute();\n\n\t\t\theader(\"Location: categorias?mesage=1\");\n\t\t\texit;\n\n\t\t}else {\n\n\t\t\theader(\"Location: categorias?mesage=2\");\n\t\t\texit;\n\t\t}\n\n\t}", "public function Eliminar(){\n \n \n if (!$this->model->igualar($_REQUEST['id'])) {//si una categoria no esta asignada la puede eliminar\n \n $this->model->Eliminar($_REQUEST['id']);\n header('Location: ?c=Categoria'); \n }\n else{\n \n header('Location: ?c=Categoria&error'); //de lo contrario no se podra eliminar asta que se elimine el cliente que la tiene\n }\n\n\n\n \n \n \n\n\n\n\n \n \n \n }", "public function clearGoogleCategoriesAction()\n {\n Mage::getSingleton('adminhtml/session')->setLatestSelectedGoogleCategoryId(NULL);\n Mage::getSingleton('adminhtml/session')->setLatestSelectedStoreCategoryId(NULL);\n Mage::getModel('googlemerchants/googlecategory')->truncateCategoriesTable();\n $this->_redirect('adminhtml/googlemerchants/downloadtxt');\n }", "public function delete_category()\r\n\t\t{\r\n\t\t\t$this->errno = DB_OK;\r\n\t\t\t\r\n\t\t\tif ( $this->cat_id == -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tSuch category hasn't been created\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"START TRANSACTION;\");\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tTransaction is needed despite the one query as delete is on cascade\r\n\t\t\t\r\n\t\t\tif ( ! ( $result = $this->con->query ( \"DELETE FROM category WHERE cat_id=$this->cat_id\" ) ) )\r\n\t\t\t{\t\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to connect\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( $this->con->affected_rows == 0 )\r\n\t\t\t{\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = CATEGORY_DONT_EXIST;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthis query should affect 1 row\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"COMMIT;\");\r\n\t\t\t\r\n\t\t}", "function do_delete(){\n\t\t// remove from fieldset:\n\t\t$fieldset = jcf_fieldsets_get( $this->fieldset_id );\n\t\tif( isset($fieldset['fields'][$this->id]) )\n\t\t\tunset($fieldset['fields'][$this->id]);\n\t\tjcf_fieldsets_update( $this->fieldset_id, $fieldset );\n\t\t\n\t\t// remove from fields array\n\t\tjcf_field_settings_update($this->id, NULL);\n\t}", "public function testDeleteCategoryUsingDELETE()\n {\n }", "function delete()\r\n {\r\n $sub_categories =& eZCompanyType::getByParentID( $this->ID );\r\n foreach ( $sub_categories as $category )\r\n {\r\n $category->delete();\r\n }\r\n $top_category = new eZCompanyType( 0 );\r\n $companies =& eZCompany::getByCategory( $this->ID );\r\n foreach ( $companies as $company )\r\n {\r\n $company->removeCategories();\r\n $top_category->addCompany( $company );\r\n }\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n $res[] = $db->query( \"DELETE FROM eZContact_CompanyType WHERE ID='$this->ID'\" );\r\n eZDB::finish( $res, $db );\r\n }", "function wp_update_category($catarr)\n {\n }", "function delete_multiple_blog_category()\n {\n $blog_categories = $this->input->post('table_records');\n $website_id = $this->input->post('website_id');\n foreach ($blog_categories as $blog_category):\n $this->db->where(array(\n 'id' => $blog_category,\n 'website_id' => $website_id\n ));\n $this->db->update($this->table_blog_category, array(\n 'is_deleted' => 1\n ));\n endforeach;\n }", "public function query_add_edit_cat()\n\t{\n\t\t$cat_name = trim(Http::request('cat_name', 'post'));\n\t\tif ($this->mode == 'add_cat')\n\t\t{\n\t\t\t$sql = 'SELECT MAX(cat_order) AS max_order\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat';\n\t\t\t$max_order = Fsb::$db->get($sql, 'max_order');\n\n\t\t\tFsb::$db->insert('smilies_cat', array(\n\t\t\t\t'cat_name' =>\t$cat_name,\n\t\t\t\t'cat_order' =>\t$max_order + 1,\n\t\t\t));\n\t\t\tFsb::$db->destroy_cache('smilies_');\n\n\t\t\tDisplay::message('adm_smiley_well_cat_add', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tFsb::$db->update('smilies_cat', array(\n\t\t\t\t'cat_name' =>\t$cat_name,\n\t\t\t), 'WHERE cat_id = ' . $this->id);\n\t\t\tFsb::$db->destroy_cache('smilies_');\n\n\t\t\tDisplay::message('adm_smiley_well_cat_edit', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t}", "function DeleteBonus($section) {\n\tglobal $dbconn, $config;\n\n\t$id = (isset($_REQUEST[\"id\"]) && !empty($_REQUEST[\"id\"])) ? intval($_REQUEST[\"id\"]) : 0;\n\tif (!$id) {\n\t\tListServices();\n\t\texit();\n\t}\n\t$strSQL = \"SELECT COUNT(id) AS cnt FROM \".BONUS_SETTINGS_TABLE;\n\t$rs = $dbconn->Execute($strSQL);\n\tif ($rs->fields[0] == 1) {\n\t\t/**\n\t\t * switch off bonus service\n\t\t */\n\t\t$dbconn->Execute(\"UPDATE \".SETTINGS_TABLE.\" SET value='0' WHERE name='use_listing_completion_bonus'\");\n\t}\n\t$dbconn->Execute(\"DELETE FROM \".BONUS_SETTINGS_TABLE.\" WHERE id='\".$id.\"'\");\n\n\theader(\"Location: \".$config[\"server\"].$config[\"site_root\"].\"/admin/admin_pay_services.php?sel=list_services&section=$section\");\n\texit();\n}" ]
[ "0.66179216", "0.62175333", "0.606527", "0.6050479", "0.6025807", "0.5908983", "0.58987623", "0.58845043", "0.58626807", "0.5849458", "0.58235", "0.5812783", "0.57931215", "0.57875305", "0.5775079", "0.5774425", "0.57559234", "0.57472736", "0.5708211", "0.5707082", "0.56997186", "0.56898755", "0.56816846", "0.5681554", "0.5657632", "0.5655254", "0.5638101", "0.5625207", "0.56216407", "0.5620899", "0.5574982", "0.5565848", "0.5563385", "0.5558254", "0.5516173", "0.55091536", "0.5505623", "0.5501267", "0.54829293", "0.5461791", "0.5451582", "0.544874", "0.54465944", "0.5445735", "0.543945", "0.54366803", "0.5429", "0.5422298", "0.5419422", "0.54180896", "0.54156184", "0.53992003", "0.5394113", "0.5393933", "0.53847337", "0.5383285", "0.5380622", "0.5377609", "0.5374002", "0.5362188", "0.5358174", "0.5348927", "0.5343165", "0.5341869", "0.53352976", "0.5331495", "0.5328989", "0.53280187", "0.5325285", "0.53137416", "0.5303938", "0.53038734", "0.53037834", "0.53001726", "0.529848", "0.5293249", "0.5292089", "0.52823883", "0.52769834", "0.5273133", "0.5266767", "0.5263886", "0.52628493", "0.52538204", "0.52522904", "0.52508986", "0.5242366", "0.5239572", "0.5237331", "0.523483", "0.52328634", "0.52311426", "0.5231077", "0.52296376", "0.52208906", "0.5219176", "0.5210697", "0.5207695", "0.52071255", "0.5203558" ]
0.67777485
0
/View program category Function
public function allProgramCategory() { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $allWorkout = DB::table('program_category') ->orderBy('id','DESC') ->paginate(10); //$allWorkout = DB::table('workouts')->orderBy('id','DESC')->get(); return view('admin.allprogramcategory')->with('allworkout',$allWorkout); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCategory()\r\n {\r\n }", "public function category() {\n\t\treturn static::get_thrive_basic_label();\n\t}", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function get_category()\n {\n return 'Fun and Games';\n }", "public function category() {\n\t\treturn static::get_thrive_advanced_label();\n\t}", "public function getCategory()\n {\n return \"Injection Flaws\"; //See category.php for list of all the categories\n }", "public function addProgramCategory()\n {\n return view('admin.addprogramcategory');\n }", "public function get_category()\n {\n return 'Information Display';\n }", "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "function showCategory($category){\n \n //echo 'gathering datas about ' . $category;\n \n $exercices = getExerciceNames($category);\n\n require './views/category.php';\n\n }", "public function category()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_index');\n $view->kategorie = $_GET['kategorie'];\n $view->title = 'Kategorie';\n $view->heading = 'Kategorie: '. $_GET['kategorie'];\n $view->vereine = $vereinRepository->getByCategory($view->kategorie);\n $view->display();\n }", "public function get_category()\n {\n return 'Graphical';\n }", "public function get_category()\n {\n return 'Graphical';\n }", "public function getViewedCategory();", "public function appCategory()\n {\n return File::get_app_category($this->getExtension());\n }", "public function HM_CategoCuentas()\n {\n }", "public function getCategory() {}", "function wc_marketplace_category() {\n global $wmp;\n $wmp->output_report_category();\n }", "public function get_category()\n {\n return 'New Features';\n }", "public function get_category()\n {\n return 'New Features';\n }", "function category(){\n\t\trequire('quizrooDB.php');\n\t\t$query = sprintf(\"SELECT cat_name FROM q_quiz_cat WHERE cat_id = %d\", GetSQLValueString($this->fk_quiz_cat, \"int\"));\n\t\t$getQuery = mysql_query($query, $quizroo) or die(mysql_error());\n\t\t$row_getQuery = mysql_fetch_assoc($getQuery);\n\t\treturn $row_getQuery['cat_name'];\n\t}", "public function category()\n\t{\n\t\t$data['catResult'] = $this->ProcurementModel->category();\n\t\t$data['pagename'] = \"category\";\n\t\t$data['category'] = \"master\";\n\t\t$data['active_menu'] = \"procurement\";\n\t\t$this->load->view('Director',$data);\n\n\t}", "function obtenerCategoriaProg()\n {\n //crea el objetoFunSeguridad que contiene todos los metodos del sistema de seguridad\n $this->objFunSeguridad = $this->create('sis_seguridad/MODSubsistema');\n $objParam = new CTParametro($aPostData['p'], null, $aPostFiles);\n $objParam->addParametro('codigo', 'pre_verificar_categoria');\n $objFunc = new MODSubsistema($objParam);\n $this->res = $objFunc->obtenerVariableGlobal($this->objParam);\n\n return $this->res->getDatos();\n }", "function setup_cat()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'perms_view, def_view, id, name', 'from' => 'gallery_categories', 'where' => \"id={$this->ipsclass->input['cat']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $cat = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this category?\n if( ! $this->ipsclass->check_perms( $cat['perms_view'] ) )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); \n }\n\n return $cat;\n }", "function showCategory()\n {\n echo '女装';\n }", "public function getCategory(): string;", "function get_catname($cat_id)\n {\n }", "public function getCategory();", "public function getCategory();", "public function Program()\n {\n /** Kategori */\n $data = Kategori::all();\n $Kategori = [];\n foreach ($data as $value) {\n $Kategori[ $value->id ] = $value->name;\n }\n /** level */\n $level = [\n '1' => '1',\n '2' => '2',\n '3' => '3',\n '4' => '4',\n '5' => '5',\n '6' => '6',\n '7' => '7',\n '8' => '8',\n '9' => '9',\n '10' => '10'\n ];\n /** Status */\n $status = [\n '0' => 'Non Aktif',\n '1' => 'Aktif'\n ];\n\n\n\t\treturn view('ManajemenAssessmen.cbt.program', compact('Kategori','level','status'));\n }", "function get_linkcatname($id = 0)\n {\n }", "public function getAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Game_Service_Category::getCategory(intval($id));\r\n\t\tif(!$info) $this->output(-1, '操作失败.');\r\n\t\t$this->output(0, '', $info);\r\n\t}", "function display_cat()\n {\n $this->Admin_model->procedure = 'GET_POST_CAT';\n\n $rs = $this->Admin_model->get_post();\n $data['rows'] = $rs;\n $this->load->view('display_posts_cat', $data);\n\n }", "function showCategory()\n\t {\n\t\t\n\t\t $res=mysql_query(\"select * from category\");\n\t\t while($data=mysql_fetch_array($res))\n\t\t {\n\t\t\t\n\t\t\techo '<option value=\"'.$data['cat_id'].'\">'.$data['cat_title'].'</option>';\n\t\t }\n\t\t \n\t }", "function get_cat_name($cat_id)\n {\n }", "public function get_category_permastruct()\n {\n }", "public function cat()\n {\n\n return view('commonmodule::index');\n }", "public function showCategories(){\n return ArticleModel::showCategories();\n }", "public function getCategory()\n {\n }", "public static function getActiveCategories(){}", "public function cat(){\n $cat_id = intval(I('get.cat_id'));\n if(!$cat_id){\n http_response_code(404);\n }\n\n $display = cookie('display');\n if($display) {\n if (!preg_match(\"/^list|grid$/\", $display)) {\n die('hack out');\n }else{\n if($display == 'list') {\n $this->assign('display', 1);\n }else{\n $this->assign('display', 0);\n }\n }\n }\n $this->assign('cat_id', $cat_id);\n $mbx = D('Admin/cat')->parentList($cat_id);\n if($mbx){\n $this->assign('mbx',$mbx);\n }\n\n $cat_in_nav = M('cat')->field('cat_id,cat_name')->where('show_in_nav=1')->select();\n $this->assign('cat_in_nav',$cat_in_nav);\n $his = array_reverse(session('history'),true);\n $this->assign('history',$his);\n $sale = M('goods')->field('goods_id,goods_name,thumb_img,shop_price,goods_number')->order('goods_number desc')->limit(10)->select();\n $this->assign('sale',$sale);\n $this->assign('cattree',D('Admin/Cat')->gettree());\n\n $this->assign('cat_name', M('cat')->field('cat_name')->find($cat_id)['cat_name']);\n\n $this->display();\n }", "private function getCategory() {\n return '';\n }", "public function get_cat_name() {\n $c = $this->cat;\n $tmp = \"\";\n switch($c) {\n case 1:\n $tmp = \"News\";\n break;\n case 2:\n $tmp = \"Eventi\";\n break;\n case 3:\n $tmp = \"Pubblicazioni\";\n break;\n }\n return $tmp;\n }", "function cat_title()\n{\n global $category;\n return $category[\"title\"];\n}", "function do_viewCategory() { \n $category = KTUtil::arrayGet($_REQUEST, \"fCategory\", $this->category);\n \n $oRegistry =& KTAdminNavigationRegistry::getSingleton();\n $aCategory = $oRegistry->getCategory($category);\t\t\n \n $aItems = $oRegistry->getItemsForCategory($category);\n $this->aBreadcrumbs[] = array(\"name\" => $aCategory[\"title\"], \"url\" => KTUtil::ktLink('admin.php',$category));\n\n \n $this->oPage->title = _kt(\"DMS Administration\") . \": \" . $aCategory[\"title\"];\n $oTemplating =& KTTemplating::getSingleton();\n $oTemplate = $oTemplating->loadTemplate(\"kt3/admin_items\");\n $aTemplateData = array(\n \"context\" => $this,\n \"category\" => $aCategory,\n \"items\" => $aItems, \n \"baseurl\" => $_SERVER['PHP_SELF'],\n );\n return $oTemplate->render($aTemplateData);\t\t\t\t\n }", "public function index()\n\t{\n\t\treturn view('catalog.category.index');\n\t}", "function category(){\n\n\t\t\t$header['title']=\"Find Page\";//title\n\t\t\t$data=[];//dataa\n\t\t\t$sidebar['getUpdate'] = $this->_actionModel->getAllDataByUpdate_time();\n\t\t\t$keyword = $_GET['cat'] ?? '';//get key\n\t\t\t$keyword = trim($keyword);//cat bo khaong trong 2 dau\n\t\t\t$data['keyword'] = $keyword;// key-> value\n\n\t\t\t$page = $_GET['page'] ?? '';//tim $_page\n\t\t\t$page = (is_numeric($page) && $page >0) ? $page : 1;//kiem tra xem co phai so khong\n\t\t\t//Chu thich lau qa =.=\n\t\t\t\n\t\t\t$dataLink =[\n\t\t\t\t'c' => 'action',\n\t\t\t\t'm' => 'category',\n\t\t\t\t'page'=> '{page}',\n\t\t\t\t'cat' => $keyword\n\t\t\t];//giong o tren r`\n\t\t\t$links = $this->_actionModel->create_link_manga($dataLink);//tao links\n\t\t\t//die($links);//die ra coi thu DL thoi \n\n\t\t\t$manga=$this->_actionModel->getAllDataMangaByKeywordCategory($keyword);//cai ten noi len tat ca\n\n\t\t\t$panigate = panigation(count($manga), $page, 4,$keyword,$links);//panigate la phan trang r`\n\t\t\t$data['mangas'] = $this->_actionModel->getDataMangaByCategory($panigate['keyword'],$panigate['start'],$panigate['limit']);//lay manga theo category con gif\n\t\t\t//echo\"<pre/>\";print_r($data['mangas']);die();//die ra coi DL thoi xoa di lay j coi du lieu ?? !\n\t\t\t$data['panigation'] = $panigate['panigationHtml']; //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadHeader($header); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadActionPage($data); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadSidebarPage($sidebar); //nhu o tren r` chu thich j` nua.\n\t\t\t$this->loadFooter(); //nhu o tren r` chu thich j` nua.\n\t\t}", "function my_separate_category() {\n return 1;\n }", "function the_category() {\n\tglobal $discussion;\n\treturn $discussion['category'];\n}", "function list_categories() {\n $project_parent_category = get_category_by_slug('project');\n $project_parent_category_id=$project_parent_category->term_id;\n $categories=get_the_category();\n $count = 0;\n foreach($categories as $category){\n if($category->category_parent==$project_parent_category_id){\n if ($count == 0) {\n echo '<div class=\"category-symbology\">';\n\n if(get_post_type(get_the_id()) == 'discussion') { echo '<i class=\"social-foundicon-chat\"> </i> '; }\n }\n echo \"<a class='one-category' href='/project/\". $category->slug . \"'>\" . $category->name . \"</a>\";\n if ($count == 0) {\n echo '</div>';\n } \n $count++;\n }\n }\n\n //emit a chat symbol for discussion\n if($count == 0 && get_post_type(get_the_id()) == 'discussion') {\n generate_discussion_w_no_category();\n }\n}", "public function getCategoria()\n {\n return \"Cliente com Risco\";\n }", "function article_category() {\n $category = Registry::get('category');\n return $category->title;\n}", "function categorianivel($padre)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT * FROM pages WHERE name!='' AND padre = %s\",\n\tGetSQLValueString($padre, \"int\"));\n\t\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\n\tif ($totalRows_ConsultaFuncion > 0) {\n\t\tdo {\n\t\t\t?> \n\t\t<div class=\"sub_cat\">\n\t\t\t<ul>\n\t\t\t\t<li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $row_ConsultaFuncion['name']?></li>\n\t\t\t</ul>\n\t\t</div>\n\t<?php\n\t\t} while ($row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion));\n\t}\n\t\t \n\tmysqli_free_result($ConsultaFuncion);\n}", "public function getCategory()\n\t\t{\n\t\t\t$this->layout = \"index\";\n\t\t\t$this->set('title', 'Category (Linnworks API)');\n\t\t}", "function get_category() {\n return self::CATEGORY_CLUSTER;\n }", "public function category() {\n\t\treturn $this->get_category();\n\t}", "public function getCategoria()\n {\n return \"Cliente com alta credibilidade\";\n }", "function displayCategoryLinks() {\n\n\t$catquery = \"select distinct ngroup from nassets where type like '0tdn%'\";\n\t$cresults = mysql_query($catquery);\n\t$has_null = false;\n\t$categories = array();\n\twhile ($acRow = mysql_fetch_array($cresults)) {\n\t\t$thisgroup = $acRow['ngroup'];\n\t\t$categories[] = $thisgroup;\n\t}\n\t\n\n\techo \"<ul>View by Category<br>\";\n\t$size = count($categories);\n \tforeach ($categories as $category) {\n \t\techo \"<li><a href=\\\"menu2.php?category=$category\\\" target=\\\"menu2\\\">$category</a><br/></li>\";\n \t}\n\n\techo \"</ul>\";\n}", "public function category_summary()\n\t{\n\t \t$categories = MainCategories::select('*')->orderBy('id', 'asc')->get();\n\t \t//echo \"<pre/>\";print_r($categories);\n\t \treturn view('admin.main_categories.category_summary', compact('categories'));\n\t}", "function unique_Category() {\n\t\t\n\t\tglobal $gesamt;\n\t\t\n\t\t$result = array_unique($gesamt);\n\t\tforeach ($result as $element){\n\t\t\techo \"<a href=\\\"load_page.php?cat=\" . $element .\"\\\">\". $element . \"</a><br>\";\n\t\t}\n\t}", "function yp_cat($domain, $map)\n{\n}", "function getDocumentCategoryTplInfo()\n\t{\n\t\t$oModuleModel = getModel('module');\n\t\t$oMemberModel = getModel('member');\n\t\t// Get information on the menu for the parameter settings\n\t\t$module_srl = Context::get('module_srl');\n\t\t$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);\n\t\t// Check permissions\n\t\t$grant = $oModuleModel->getGrant($module_info, Context::get('logged_info'));\n\t\tif(!$grant->manager) return new Object(-1,'msg_not_permitted');\n\n\t\t$category_srl = Context::get('category_srl');\n\t\t$category_info = $this->getCategory($category_srl);\n\t\tif(!$category_info)\n\t\t{\n\t\t\treturn new Object(-1, 'msg_invalid_request');\n\t\t}\n\n\t\t$this->add('category_info', $category_info);\n\t}", "public function category($type)\n {\n $this->lang->help->menu = $this->help->createModuleMenu();\n\n $this->lang->category = $this->lang->directory;\n $this->lang->tree->menu = $this->lang->help->menu;\n $this->lang->menuGroups->tree = 'help';\n\n $this->view->categoryBox = $this->help->getCategoryBox($type);\n $this->view->title = $this->lang->category->common;\n $this->view->type = $type;\n $this->view->root = $root;\n $this->view->children = $this->loadModel('tree')->getChildren(0, $type);\n\n $this->display();\n }", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function \tCProgram(){ \n\t\tparent::CElement(); \n\t\t$classtype = $this->attr( \"classtype\" );\n\t\t$this->event( \"oncprogramc_main\", \"{$classtype}.c_main\" );\n\t}", "function the_category_ID($display = \\true)\n {\n }", "public function get_category()\n {\n return C__CATG__EMERGENCY_PLAN;\n }", "public function run()\n {\n Category::truncate();\n \t$cateLists = ['Sportswear','Mens','Womens','Kids','Fashion','Households','Interiors','Clothing','Bags','Shoes'];\n \tforeach ($cateLists as $key => $value) {\n \t\t$cat = Category::create([\n \t\t\t\t'name'=> $value,\n \t\t\t]);\n \t}\n \t$list_sportswear = ['Nike','Under Armour','Adidas','Puma','Asics'];\n \tforeach ($list_sportswear as $key => $value) {\n \t\t$cat = Category::create([\n \t\t\t\t'name'=> $value,\n \t\t\t\t'category_id'=> 1\n \t\t\t]);\n \t}\n \t$list_mens=['Fendi','Guess','Valentino','Dior','Versace','Armani','Prada','Dolce And Gabbana','Chanel','Gucci'];\n \tforeach ($list_mens as $key => $value) {\n \t\t$cat = Category::create([\n \t\t\t\t'name'=> $value,\n \t\t\t\t'category_id'=> 11\n \t\t\t]);\n \t}\n \t$list_womens = ['Womens Fende','Womens Guess','Valentino','Womens Dior','Verace'];\n \tforeach ($list_womens as $key => $value) {\n \t\t$cat = Category::create([\n \t\t\t\t'name'=> $value,\n \t\t\t\t'category_id'=> 21\n \t\t\t]);\n \t}\n }", "function target_add_cat($cat)\n{\n\tif ($GLOBALS['VERBOSE']) pf('...'. $cat['name']);\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'cat (id, name, view_order, cat_opt) \n\t VALUES('. (int)$cat['id'] .','. _esc($cat['name']) .','. (int)$cat['view_order'] .', 3)');\n\t$GLOBALS['cat_map'][ $cat['id'] ] = $cat['id'];\n/*\nfud_use('cat.inc', true);\n$nc = new fud_cat;\n$nc->name = $c->name;\n$nc->description = $c->description;\n$nc->view_order = $c->disporder;\n$nc->cat_opt = 1|2;\t// This should be the default in cat.inc. Fix in next release and del this line.\n$GLOBALS['cat_map'][$c->fid] = $nc->add('LAST');\t// FIRST should also be defaulted.\n*/\n}", "public function getCategoryName()\n {\n return $this->cat->title;\n }", "public function get_categories()\n {\n return ['basic'];\n }", "public function listattr_cat()\n {\n $this->db->where('descripcion_atributo', 'Catalogo');\n $resultados = $this->db->get('atributos_b');\n\n return $resultados->result();\n }", "function getDocumentCategories()\n\t{\n\t\tif(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');\n\t\t$module_srl = Context::get('module_srl');\n\t\t$categories= $this->getCategoryList($module_srl);\n\t\t$lang = Context::get('lang');\n\t\t// No additional category\n\t\t$output = \"0,0,{$lang->none_category}\\n\";\n\t\tif($categories)\n\t\t{\n\t\t\tforeach($categories as $category_srl => $category)\n\t\t\t{\n\t\t\t\t$output .= sprintf(\"%d,%d,%s\\n\",$category_srl, $category->depth,$category->title);\n\t\t\t}\n\t\t}\n\t\t$this->add('categories', $output);\n\t}", "function showSubCategory()\n\t {\n\t\t\n\t\t $prolist=new Actions();\n\t\t $res=$prolist->fetchAll(\"category\");\n\t\t\t\t\t\t\n\t\t $parentdata=mysql_query(\"select * from category where cat_par_id='0'\");\n\t\t while($parent_sub_cat=mysql_fetch_array($parentdata))\n\t\t {\n\t\t\techo '<option value=\"'.$parent_sub_cat['cat_id'].'\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.ucfirst($parent_sub_cat['cat_title']).'</option>';\n\t\t \t\t\t\n\t\t\t if(mysql_num_rows(mysql_query(\"select * from category where cat_par_id='\".$parent_sub_cat['cat_id'].\"'\"))>0)\n\t\t\t {\n\t\t\t\tActions::$r++;\n\t\t\t\tActions::viewCategory($parent_sub_cat['cat_id']);\n\t\t\t } \n\t\t\t \n\t\t }\t\t\t\t\t\t\n\t\t \n\t }", "private function retrieve_category_description() {\n\t\treturn $this->retrieve_term_description();\n\t}", "public function getCodeStatutCateg() {\n return $this->codeStatutCateg;\n }", "public function GetCategory()\r\n {\r\n return AppHelper::GetCategory($this->Core);\r\n }", "public function categoryAction()\n\t{\n\t\t$id = (int) $this->getRequest()->getParam('id');\n\t\t$this->view->category = $this->_blogService->findCategory($id);\n\t}", "public function get_categories()\n {\n return ['general'];\n }", "public function get_categories()\n {\n return ['general'];\n }", "function get_cat_ID($cat_name)\n {\n }", "public function getCategoria()\n {\n return \"Cliente padrão\";\n }", "function ciniki_artcatalog_categoryList($ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'checkAccess');\n $rc = ciniki_artcatalog_checkAccess($ciniki, $args['tnid'], 'ciniki.artcatalog.categoryList'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Load the status maps for the text description of each status\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'maps');\n $rc = ciniki_artcatalog_maps($ciniki);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $maps = $rc['maps'];\n\n //\n // Get the settings for the artcatalog\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQueryDash'); \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_web_settings', \n 'tnid', $args['tnid'], 'ciniki.web', 'settings', 'page-gallery-artcatalog');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['settings']) ) {\n $settings = $rc['settings'];\n } else {\n $settings = array();\n }\n\n if( isset($settings['page-gallery-artcatalog-split']) \n && $settings['page-gallery-artcatalog-split'] == 'yes' \n ) {\n $strsql = \"SELECT DISTINCT type, type AS name, category \"\n . \"FROM ciniki_artcatalog \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY type, category COLLATE latin1_general_cs, category \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.artcatalog', array(\n array('container'=>'types', 'fname'=>'type', 'name'=>'type',\n 'fields'=>array('number'=>'type', 'name'),\n 'maps'=>array('name'=>$maps['item']['type'])),\n// 'maps'=>array('name'=>array('1'=>'Paintings', '2'=>'Photographs', '3'=>'Jewelry', '4'=>'Sculptures', '5'=>'Fibre Arts', '6'=>'Crafts', '8'=>'Pottery'))),\n array('container'=>'categories', 'fname'=>'category', 'name'=>'category',\n 'fields'=>array('type', 'name'=>'category')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['types']) ) {\n return array('stat'=>'ok', 'types'=>array());\n }\n return array('stat'=>'ok', 'types'=>$rc['types']);\n } else {\n $strsql = \"SELECT DISTINCT '0' AS type, category \"\n . \"FROM ciniki_artcatalog \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY category COLLATE latin1_general_cs, category \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.artcatalog', array(\n array('container'=>'categories', 'fname'=>'category', 'name'=>'category',\n 'fields'=>array('type', 'name'=>'category')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['categories']) ) {\n return array('stat'=>'ok', 'categories'=>array());\n }\n return array('stat'=>'ok', 'categories'=>$rc['categories']);\n }\n}", "public function show($category)\n {\n }", "function sportal_categories()\n{\n\tglobal $context, $scripturl, $txt;\n\n\tloadTemplate('PortalCategories');\n\n\t$context['categories'] = sportal_get_categories(0, true, true);\n\n\t$context['linktree'][] = array(\n\t\t'url' => $scripturl . '?action=portal;sa=categories',\n\t\t'name' => $txt['sp-categories'],\n\t);\n\n\t$context['page_title'] = $txt['sp-categories'];\n\t$context['sub_template'] = 'view_categories';\n}", "public function catalogos() \n\t{\n\t}", "function ag_cat_galleries_code($fnc_cat = false) {\t\n\tinclude_once(AG_DIR . '/functions.php');\n\t$cat = $fnc_cat;\n\t$code = '';\n\t\n\t// if is not called directly\n\tif(!$cat) {\n\t\tif(!isset($_POST['gallery_cat'])) {die('missing data');}\n\t\t$cat = $_POST['gallery_cat'];\n\t}\n\n\t$post_list = ag_cat_galleries($cat);\t\n\tif(!$post_list) {return false;}\n\t\n\tforeach($post_list as $post) {\n\t\t$code .= '\n\t\t<li style=\"background-image: url('.ag_thumb_src($post['img'], 200, 170, 70).');\" rel=\"'.$post['id'].'\" title=\"'. __('add to collection', 'ag_ml') .'\" ag-cats=\"'.$post['cats'].'\" ag-img=\"'.ag_thumb_src($post['img'], 500, 500, 70).'\">\n\t\t\t<div title=\"'.$post['title'].'\">'.$post['title'].'</div>\n\t\t</li>';\n\t}\n\n\t\n\tif($fnc_cat == false) {die( $code );}\n\telse {return $code;}\n}", "public function showCategory(){\n \t$form = M(\"categoryinfo\");\n \t$data = $form->select();\n \t$data = json_encode($data);\n \techo $data;\n \t//$this->display();\n }", "public function get_catR()\n {\n return $this->_catR;\n }", "public function showcategory() {\n // call to model function to get all category from db\n $result = $this->dash_model->showcategory();\n\n echo json_encode($result);\n }", "function ciniki_artcatalog_categoryDetails($ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'type'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Type'),\n 'category'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Category'),\n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'checkAccess');\n $rc = ciniki_artcatalog_checkAccess($ciniki, $args['tnid'], 'ciniki.artcatalog.categoryDetails'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Get the settings for the artcatalog\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQueryDash'); \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_artcatalog_settings', \n 'tnid', $args['tnid'], 'ciniki.artcatalog', 'settings', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['settings']) ) {\n $settings = $rc['settings'];\n } else {\n $settings = array();\n }\n \n $fields = array('synopsis', 'description');\n $details = array();\n foreach($fields as $f) {\n $details[$f] = '';\n if( isset($args['type']) && $args['type'] > 0\n && isset($settings['category-' . $f . '-' . $args['type'] . '-' . $args['category']]) ) {\n $details[$f] = $settings['category-' . $f . '-' . $args['type'] . '-' . $args['category']];\n } elseif( isset($settings['category-' . $f . '-' . $args['category']]) ) {\n $details[$f] = $settings['category-' . $f . '-' . $args['category']];\n }\n }\n\n return array('stat'=>'ok', 'details'=>$details);\n}", "public function stepCategory()\n {\n global $rlSmarty, $rlCategories, $page_info, $account_info, $sError, $config;\n\n parent::step();\n\n $GLOBALS['rlHook']->load('addListingGetCats');\n\n // Define allowed types\n $allowed_type_keys = $account_info['Abilities'];\n\n // \"Individual add listing page\" mode\n if ($page_info['Key'] != 'add_listing') {\n $individual_type_key = substr($page_info['Key'], 3);\n\n if (in_array($individual_type_key, $allowed_type_keys)) {\n $allowed_type_keys = array($individual_type_key);\n } else {\n $sError = true;\n }\n }\n\n // Adapt listing types array\n $allowed_types = $GLOBALS['rlListingTypes']->adaptTypes($allowed_type_keys);\n $rlSmarty->assign_by_ref('allowed_types', $allowed_types);\n\n // Existing membership plan mode\n $this->existingMembershipHandler($account_info);\n\n // Remove unnecessary steps\n if (!$this->singleStep) {\n unset($this->steps['photo'], $this->steps['checkout']);\n }\n }", "public function categories() {\n\n $this->load->model('Model_Bird_Wiki');\n $result['categories'] = $this->Model_Bird_Wiki->get_categories();\n\n if($result!=false) {\n $this->load->view('category_main', $result);\n }\n else {\n echo \"Something went wrong !\";\n }\n\n }", "function ver_categoria ( $uri ) {\n\tglobal $categorias;\n\t//ver si figura la variable cat en el url, en ese caso es categoria\n\t$cat = isset($_REQUEST['cat']) ? $_REQUEST['cat'] : 'none';\n\n\t$parseUrl = explode('/', $uri);\n\t$RequestURI = $parseUrl[1];\n\n\tfor ($i=0; $i < count($categorias); $i++) { \n\t\tif ( $categorias[$i]['slug'] == $RequestURI ) {\n\t\t$cat = $RequestURI;\n\t\tbreak;\n\t\t}\n\t}\n\n\treturn $cat;\n\n}", "public function category(){\n \treturn view('categories.category');\n }", "function displayCategory($catid)\n\t{\n\t\t$sql = \"SELECT category_id,category_name FROM category_table where category_parent_id=0\";\n\t\t\n\t\t$query = new Bin_Query();\n\t\t\n\t\t$query->executeQuery($sql);\n\n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql1='select * from products_table where product_id='.$id;\t\t\n\t\t\t$obj1=new Bin_Query();\t\t\t\n\t\t\t$obj1->executeQuery($sql1);\t\t\t\t\t\t\n\t\t\t$category=$obj1->records[0]['category_id'];\n\t\t\t\n\t\t\n\t \t}\n\t\t\n\t\treturn Display_DManageProducts::displayCategory($query->records,$category);\t\n\t}", "public function get_categories() {\n\t\treturn [ 'basic' ];\n\t}", "public function programSubCats()\n {\n return $this->hasMany(ProgramSubCat::class);\n }", "function pico_get_requests4category($mydirname, $cat_id = null)\n{\n\t(method_exists('MyTextSanitizer', 'sGetInstance') and $myts = &MyTextSanitizer::sGetInstance()) || $myts = &MyTextSanitizer::getInstance();\n\t$db = XoopsDatabaseFactory::getDatabaseConnection();\n\n\tinclude dirname(__DIR__) . '/include/configs_can_override.inc.php';\n\t$cat_options = [];\n\tforeach ($GLOBALS['xoopsModuleConfig'] as $key => $val) {\n\t\tif (empty($pico_configs_can_be_override[$key])) continue;\n\t\tforeach (explode(\"\\n\", @$_POST['cat_options']) as $line) {\n\t\t\tif (preg_match('/^' . $key . '\\:(.{1,100})$/', $line, $regs)) {\n\t\t\t\tswitch ($pico_configs_can_be_override[$key]) {\n\t\t\t\t\tcase 'text':\n\t\t\t\t\t\t$cat_options[$key] = trim($regs[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'int':\n\t\t\t\t\t\t$cat_options[$key] = (int)$regs[1];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'bool':\n\t\t\t\t\t\t$cat_options[$key] = (int)$regs[1] > 0 ? 1 : 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (0 === $cat_id) {\n\t\t// top category\n\t\t$cat_vpath = null;\n\t\t$pid = 0xffff;\n\t} else {\n\t\t// normal category\n\t\t$cat_vpath = trim($myts->stripSlashesGPC(@$_POST['cat_vpath']));\n\t\t$pid = (int)@$_POST['pid'];\n\t\t// check $pid\n\t\tif ($pid) {\n\t\t\t$sql = 'SELECT * FROM ' . $db->prefix($mydirname . '_categories') . \" c WHERE c.cat_id=$pid\";\n\t\t\tif (!$crs = $db->query($sql)) die(_MD_PICO_ERR_SQL . __LINE__);\n\t\t\tif ($db->getRowsNum($crs) <= 0) die(_MD_PICO_ERR_READCATEGORY);\n\t\t}\n\t}\n\n\treturn [\n 'cat_title' => $myts->stripSlashesGPC(@$_POST['cat_title']),\n 'cat_desc' => $myts->stripSlashesGPC(@$_POST['cat_desc']),\n 'cat_weight' => (int)@$_POST['cat_weight'],\n 'cat_vpath' => $cat_vpath,\n 'pid' => $pid,\n 'cat_options' => pico_common_serialize($cat_options),\n ];\n}" ]
[ "0.68127215", "0.67239016", "0.670923", "0.670923", "0.670923", "0.666228", "0.6455622", "0.64367336", "0.63847077", "0.6349411", "0.62409276", "0.62309605", "0.6222077", "0.6222077", "0.61962056", "0.6190804", "0.6189849", "0.6159506", "0.60971355", "0.60432327", "0.60432327", "0.6035003", "0.60210973", "0.600474", "0.59917504", "0.5979405", "0.59639734", "0.5959987", "0.5943728", "0.5943728", "0.5886071", "0.5874214", "0.5857937", "0.5844532", "0.58358765", "0.58228576", "0.581303", "0.5792864", "0.57820326", "0.5775438", "0.57693255", "0.5765585", "0.57597697", "0.57256466", "0.5720448", "0.57174766", "0.5717209", "0.5717161", "0.5704337", "0.5702693", "0.5701622", "0.5691792", "0.5668215", "0.56515676", "0.5643289", "0.56370103", "0.5620927", "0.561668", "0.5608726", "0.5593803", "0.5588987", "0.5554113", "0.5554028", "0.5552486", "0.5550066", "0.5550066", "0.55479556", "0.55440414", "0.5541244", "0.5539205", "0.5530147", "0.5527023", "0.5520966", "0.5518425", "0.5516393", "0.55149764", "0.55128735", "0.5509512", "0.55078274", "0.5501999", "0.5500833", "0.5500833", "0.54945534", "0.5487829", "0.54803634", "0.5473171", "0.547286", "0.5469178", "0.54685616", "0.545819", "0.54581845", "0.54544705", "0.54535174", "0.5452205", "0.54460347", "0.5440898", "0.54375", "0.5435046", "0.54342246", "0.54307497", "0.5430064" ]
0.0
-1
/Edit program category Function for view Form
public function editProgramCategory($id) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $workout = ProgramCategory::find($id); return view('admin.editprogramcategory')->with('workout',$workout); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function formModify() {\n $categories=$this->model->listCategories();\n $this->view->display(\"view/form/ProductFormModify.php\", NULL, $categories); \n }", "public function addProgramCategory()\n {\n return view('admin.addprogramcategory');\n }", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function Editar(){\n $ca = new Categoria();\n \n if(isset($_REQUEST['id'])){\n $ca = $this->model->Obtener($_REQUEST['id']);\n }\n \n require_once 'view/header.php';\n require_once 'view/categoria/editar.php';\n require_once 'view/footer.php';\n }", "public function edit()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/edit\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n\n } catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception->getMessage());\n }\n\n }", "function catedit()\r\n\t{\r\n\t\t$data['cat'] = $this->categeory_model->cat($this->uri->segment(4));\r\n\t\t$this->load->view('admin/edit',$data);\r\n\t}", "function editMainCategory()\n\t{ \n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from products_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$sqlid=\"SELECT category_id,category_parent_id FROM category_table where category_id in(select category_id from products_table where category_id='\".$obj->records[0]['category_id'].\"')\";\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$sql1 = \"SELECT category_id,category_name FROM category_table where category_parent_id=0\";\n\t\t\n\t\t\t$query1 = new Bin_Query();\n\t\t\n\t\t\t$query1->executeQuery($sql1);\n\t\t\n\n\t\t\treturn Display_DManageProducts::displayCategory($query1->records,$query->records[0]['category_id']);\n\t\t\t\n\t\t// \t\t\treturn $category;\n\t }\n\t}", "public function edit_category($category) {\n $this->category();\n $categories_sql_string = \"SELECT * FROM category WHERE id = \" . $category . \" limit 1\";\n $connection = new Database(\"sbrettsc_db\");\n $menu_array = $connection->get_array_from_query($categories_sql_string);\n $data = array(\"menu_array\" => array_shift($menu_array));\n\n $this->loadView(\"editors/category_editor\", $data);\n }", "public function edit(Category $Category)\n {\n echo \"i am in edit\";exit();\n //\n }", "public function updateProgramCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $programCategory = ProgramCategory::find($id);\n $programCategory->program_category_name = $request->name;\n $programCategory->tips = $request->tips;\n $programCategory->save();\n Session::flash('success','Program Category Updated succcessfully.');\n return redirect()->back()->with('workout',$programCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function page_add_edit_cat()\n\t{\n\t\t// Edition\n\t\t$cat_name = '';\n\t\tif ($this->mode == 'edit_cat')\n\t\t{\n\t\t\t$sql = 'SELECT cat_name\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat\n\t\t\t\t\tWHERE cat_id = ' . $this->id;\n\t\t\t$result = Fsb::$db->query($sql);\n\t\t\t$data = Fsb::$db->row($result);\n\t\t\tif (!$data)\n\t\t\t{\n\t\t\t\t$this->mode = 'add_cat';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tFsb::$db->free($result);\n\t\t\t\t$cat_name = $data['cat_name'];\n\t\t\t}\n\t\t}\n\n\t\tFsb::$tpl->set_switch('smileys_add_cat');\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'L_ADD_EDIT' =>\t\t($this->mode == 'add_cat') ? Fsb::$session->lang('adm_smiley_add_cat') : Fsb::$session->lang('adm_smiley_edit_cat'),\n\t\t\t'CAT_NAME' =>\t\t$cat_name,\n\n\t\t\t'U_ACTION' =>\t\tsid('index.' . PHPEXT . '?p=posts_smiley&amp;mode=' . $this->mode . '&amp;id=' . $this->id),\n\t\t));\n\t}", "function get_category_to_edit($id)\n {\n }", "function editAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\t\n\t\t$redirectUrl = $this->getRedirectUrl();\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t$error \t\t= array();\n\t\t\t$success \t= array();\n\t\t\t$contents \t= '';\n\t\t\t$formData \t= array();\n\t\t\t //Truyen du lieu hien co vao form\n\t\t\t$formData['fbulkid'] = array();\n\t\t\t$formData['fid'] = $myProductCat->id;\n\t\t\t$formData['fname'] = $myProductCat->name;\n\t\t\t$formData['forder'] = $myProductCat->order;\n\t\t\t$formData['fparentid'] = $myProductCat->parentid;\n\t\t\t$formData['fenable'] = $myProductCat->enable;\n\t\t\t$formData['fseourl'] = $myProductCat->seoUrl;\n\t\t\t$formData['fseotitle'] = $myProductCat->seoTitle;\n\t\t\t$formData['fseokeyword'] = $myProductCat->seoKeyword;\n\t\t\t$formData['fseodescription'] = $myProductCat->seoDescription;\n\t\t\t\n\t\t\tif(!empty($_POST['fsubmit']))//truong hop da nhan nut submit\n\t\t\t{\n if($_SESSION['productcategoryEditToken']==$_POST['ftoken'])//kiem tra token\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->editActionValidator($formData, $error))//kiem tra du lieu co hop le hay khong\n {\n //Cac thong tin khong ngon ngu:\n $myProductCat->order = (int)$formData['forder'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n if(strlen($formData['fseourl']) > 0)\n $myProductCat->seoUrl = Helper::codau2khongdau($formData['fseourl'], true);\n else\n $myProductCat->seoUrl = Helper::codau2khongdau(strip_tags($formData['fname']), true);\n //Cac thong tin lien quan ngon ngu: \n $myProductCat->name = $formData['fname']; \n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n \n if($myProductCat->updateData())//cap nhat database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succUpdate']);\n $this->registry->me->writelog('ProductCategoryedit', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n }\n else\n {\n $error[] = $this->registry->lang['controller']['errUpdate']; \n }\n }\n }\n $_SESSION['productcategoryEditToken'] = Helper::getSecurityToken();//Tao token moi\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t\t\t$this->registry->smarty->assign(array(\t'formData' \t=> $formData,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'subcategories' => $myProductCat->getSub(true),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'parentCategories' => Core_ProductCategory::getFullCategories(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectUrl'=> $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'success'\t=> $success,\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\t));\n\t\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'edit.tpl');\n\t\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategorylist',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_edit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t\t$this->registry->smarty->assign(array('redirect' => $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectMsg' => $redirectMsg,\n\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t}\n\t}", "public function actionCategoryEdit()\n {\n $this->_assertCanManageCategories();\n $category_id = $this->_input->filterSingle('faq_id', XenForo_Input::UINT);\n $viewParams = array('faqcategory' => $this->_getCategoryModel()->getById($category_id));\n return $this->responseView('Iversia_FAQ_ViewPublic_Category', 'iversia_faq_edit_category', $viewParams);\n }", "public function editAction() {\n $this->_helper->layout->setLayout('admin-simple');\n\n if (!($category_id = $this->_getParam('category_id'))) {\n die('No identifier specified');\n }\n\n //FETCH PARAMETERS ACCORDING TO THIS CATEGORY\n $reviewCategories = Engine_Api::_()->getDbtable('reviewcats', 'sitestorereview')->reviewParams($category_id);\n\n //GENERATE A FORM\n $form = $this->view->form = new Sitestorereview_Form_Admin_Ratingparameter_Edit();\n $form->setAction($this->getFrontController()->getRouter()->assemble(array()));\n\n $form->setField($reviewCategories->toArray());\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n\n foreach ($values as $key => $value) {\n $reviewcat_id = explode('reviewcat_name_', $key);\n $reviewcat = Engine_Api::_()->getItem('sitestorereview_reviewcat', $reviewcat_id[1]);\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\n try {\n //EDIT CATEGORY NAMES\n $reviewcat->reviewcat_name = $value;\n $reviewcat->save();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => 10,\n 'parentRefresh' => 10,\n 'messages' => array('')\n ));\n }\n\n $this->renderScript('admin-ratingparameter/edit.tpl');\n }", "public function editPost()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"edit_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryName = $this->input->post(\"name\");\n\n $categoryModel = new CategoriesModel();\n\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n if ($categoryModel->editCategory($categoryName, $categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category edited successfully!\",\"success\");\n } else {\n $this->view->redirect(\"/categories/manage\",\"You did not change anything ?\");\n }\n\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category) {\n //not implemented\n }", "function EditarCategoria($params=null){\n $id_categoria= $params[':ID'];\n $this->modelo->GetCategoria($id_categoria);\n $this->vista->mostrarCategoriaEdit($id_categoria); \n }", "public function query_add_edit_cat()\n\t{\n\t\t$cat_name = trim(Http::request('cat_name', 'post'));\n\t\tif ($this->mode == 'add_cat')\n\t\t{\n\t\t\t$sql = 'SELECT MAX(cat_order) AS max_order\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat';\n\t\t\t$max_order = Fsb::$db->get($sql, 'max_order');\n\n\t\t\tFsb::$db->insert('smilies_cat', array(\n\t\t\t\t'cat_name' =>\t$cat_name,\n\t\t\t\t'cat_order' =>\t$max_order + 1,\n\t\t\t));\n\t\t\tFsb::$db->destroy_cache('smilies_');\n\n\t\t\tDisplay::message('adm_smiley_well_cat_add', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tFsb::$db->update('smilies_cat', array(\n\t\t\t\t'cat_name' =>\t$cat_name,\n\t\t\t), 'WHERE cat_id = ' . $this->id);\n\t\t\tFsb::$db->destroy_cache('smilies_');\n\n\t\t\tDisplay::message('adm_smiley_well_cat_edit', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t}", "public function edit(category $category)\n {\n return \"category\";\n //\n }", "public function change()\n\t{\n\t\t$result = $this->helper_categories_model->getCategories();\n\t\t$this->template\n\t\t\t->title('您期望添加到哪个分类')\n\t\t\t->set_layout(FALSE)\n\t\t\t->set('data', $result)\n\t\t\t->build('admin/helper/change');\n\t}", "function display_category_form($category = ''){\n\t// This form can be used for inserting or editing categries\n\t// To insert, don't pass any parameters\n\t// To update, pass an array containing a category\n\t$edit = is_array($category);\n?>\n<form method='post'\n action='<?php echo $edit?'edit_category.php':'insert_category.php'; ?>'>\n<table border='0'>\n <tr>\n <td>Category Name:</td>\n\t<td><input type='text' name='catname' size='40' maxlength='40'\n\t value='<?php echo $edit?$category['catname']:''; ?>' /></td>\n </tr>\n <tr>\n <td <?php if (!$edit) echo \"colspan='2'\"; ?> align='center'>\n<?php\nif ($edit)\n\techo \"<input type='hidden' name='catid' value='\" . $category['catid']\n\t\t. \"' />\";\n?>\n\t <input type='submit'\n\t value=\"<?php echo $edit?'Rename':'Add'; ?> Category\" /></td>\n\t </form>\n<?php\n\tif ($edit)\n\t\techo '<form method=\"post\" action=\"/myPHP/ShoppingCart/model/admin/delete_category.php\">\n\t\t\t\t<td align=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"catid\" value=\"' . $category['catid'] .'\" />\n\t\t\t\t<input type=\"submit\" value=\"Delete Category\" />\n\t\t\t \t</td>\n\t\t\t</form>';\n?>\n\n\n<?php\n}", "public function edit(Category $Category)\n {\n //\n }", "function addExtraCategoryFields($tag, $edit_form = false) {\n\t\tif($this->checkPermissions()) {\n\t\t\t$form_row_title = __('This category is a course', lepress_textdomain);\n\t\t\t$form_row_desc = __('Is this category a course for students ?', lepress_textdomain);\n\t\t\t$form_row_title2 = __('Open access course', lepress_textdomain);\n\t\t\t$form_row_desc2 = __('Can participant subscribe to this course without teacher\\'s verification ?', lepress_textdomain);\n\t\t\t$form_row_title3 = __('Course teachers', lepress_textdomain);\n\t\t\t$form_row_desc3 = __('Choose additional teachers for this course (Only current WordPress installation users).', lepress_textdomain);\n\t\t\t$form_row_title4 = __('Advertise this course', lepress_textdomain);\n\t\t\t$form_row_desc4 = __('Advertise this course on LePress Courses Sitewide widget ?', lepress_textdomain);\n\t\t\t$form_row_title5 = __('Close this course', lepress_textdomain);\n\t\t\t$form_row_desc5 = __('Close this course <b>CAUTION!</b> Cannot be undone! no changes can be made to course data!', lepress_textdomain);\n\t\t\t\n\t\t\tglobal $current_user;\n\t\t\tget_currentuserinfo();\n\t\t\tif(function_exists('get_users')) {\n\t\t\t\t$users = get_users(array('role' => 'lepress_teacher', 'exclude' => array($current_user->ID)));\n\t\t\t} else {\n\t\t\t\t$users = get_users_of_blog();\n\t\t\t}\n\t\t\t//Get also super admins, they are allowed to be teachers too\n\t\t\tif(is_super_admin()) {\n\t\t\t\tforeach(get_super_admins() as $super_user_login) {\n\t\t\t\t\t$user = get_user_by('login', $super_user_login);\n\t\t\t\t\t$users[] = $user;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//If new category page\n\t\t\tif(!$edit_form) {\n\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course\" name=\"lepress-course\" value=\"1\"/>';\n\t\t\t\techo '<label for=\"lepress-course\">'.$form_row_title.'</label>';\n\t\t\t\techo '<p>'.$form_row_desc.'</p>';\n\t\t\t\techo '</div>';\n\n\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course-open-access\" name=\"lepress-course-open-access\" value=\"1\" />';\n\t\t\t\techo '<label for=\"lepress-course-open-access\">'.$form_row_title2.'</label>';\n\t\t\t\techo '<p>'.$form_row_desc2.'</p>';\n\t\t\t\techo '</div>';\n\n\t\t\t\techo '<div style=\"margin:0 0 10px; padding: 8px;\">';\n\t\t\t\techo '<input type=\"hidden\" value=\"'.$current_user->ID.'\" name=\"lepress-course-teachers['.$current_user->ID.']\" />';\n\t\t\t\techo '<label><b>'.$form_row_title3.'</b></label>';\n\t\t\t\tforeach($users as $user) {\n\t\t\t\t\tif($user->ID != $current_user->ID) {\n\t\t\t\t\t\t$userdata = get_userdata($user->ID);\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"lepress-course-teachers['.$user->ID.']\" value=\"0\"/>';\n\t\t\t\t\t\techo '<div style=\"margin-left: 4px;\"><input type=\"checkbox\" class=\"lepress-teacher\" value=\"'.$user->ID.'\" name=\"lepress-course-teachers['.$user->ID.']\" /> '.(!empty($userdata->user_firstname) ? $userdata->user_firstname : $userdata->user_login).' '.$userdata->user_lastname.'</div>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Found only one user - current user\n\t\t\t\tif(count($users) <= 1) {\n\t\t\t\t\techo '<p><b>'.__('No LePress teachers found', lepress_textdomain).' <a href=\"'.admin_url().'user-new.php'.'\">'.__('Add here', lepress_textdomain).'</a></b></p>';\n\t\t\t\t}\n\t\t\t\techo '<p>'.$form_row_desc3.'</p>';\n\t\t\t\techo '</div>';\n\t\t\t\t\n\t\t\t\t//IF multisite, add advertise checkbox\n\t\t\t\tif(is_multisite()) {\n\t\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course-advertise\" name=\"lepress-course-advertise\" value=\"1\" />';\n\t\t\t\t\techo '<label for=\"lepress-course-advertise\">'.$form_row_title4.'</label>';\n\t\t\t\t\techo '<p>'.$form_row_desc4.'</p>';\n\t\t\t\t\techo '</div>';\n\t\t\t\t}\t\t\t\n\t\t\t} else { //If edit category page\n\t\t\t\t$course_meta = new CourseMeta($tag->term_id);\n\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course\">'.$form_row_title.'</label></th>';\n\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course\" value=\"0\"/>';\n\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course\" '.($course_meta->getIsCourse() ? 'checked=checked':'').' '.($course_meta->hasSubscriptions() ? 'disabled=\"disabled\"' : '').' name=\"lepress-course\" value=\"1\"/><br />';\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc.' '.__('You <b>cannot change</b> this, if course has <b>active subscriptions</b>', lepress_textdomain).'</span></td>';\n\t\t\t\techo '</tr>';\n\n\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title2.'</label></th>';\n\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-open-access\" value=\"0\" />';\n\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course-open-access\" '.($course_meta->getAccessType() ? 'checked=checked':'').' name=\"lepress-course-open-access\" value=\"1\"/><br />';\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc2.'</span></td>';\n\t\t\t\techo '</tr>';\n\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title3.'</label></th>';\n\t\t\t\techo '<td>';\n\t\t\t\tforeach($users as $user) {\n\t\t\t\t\tif($user->ID != $current_user->ID) {\n\t\t\t\t\t\t$userdata = get_userdata($user->ID);\n\t\t\t\t\t\t$isTeacher = $course_meta->isTeacher($user->ID) ? 'checked=\"checked\"' : '';\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"lepress-course-teachers['.$user->ID.']\" value=\"0\"/>';\n\t\t\t\t\t\techo '<div><input class=\"lepress-edit-form-field\" type=\"checkbox\" value=\"'.$user->ID.'\" '.$isTeacher.' name=\"lepress-course-teachers['.$user->ID.']\" /> '.(!empty($userdata->user_firstname) ? $userdata->user_firstname : $userdata->user_login).' '.$userdata->user_lastname.'</div>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Found only one user - current user\n\t\t\t\tif(count($users) <= 1) {\n\t\t\t\t\techo '<p><b>'.__('No LePress teachers found', lepress_textdomain).' <a href=\"'.admin_url().'user-new.php'.'\">'.__('Add here', lepress_textdomain).'</a></b></p>';\n\t\t\t\t}\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc3.'</span></td>';\n\t\t\t\techo '</tr>';\n\t\t\t\t\n\t\t\t\t//IF is multisite, add advertise checkbox\n\t\t\t\tif(is_multisite()) {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title4.'</label></th>';\n\t\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-advertise\" value=\"0\" />';\n\t\t\t\t\techo '<input class=\"lepress-edit-form-field\" type=\"checkbox\" id=\"lepress-course-advertise\" '.($course_meta->getAdvertise() ? 'checked=checked':'').' name=\"lepress-course-advertise\" value=\"1\"/><br />';\n\t\t\t\t\techo '<span class=\"description\">'.$form_row_desc4.'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$course_meta->getIsClosed()) {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-locked\">'.$form_row_title5.'</label></th>';\n\t\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-locked\" value=\"0\" />';\n\t\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course-locked\" '.($course_meta->getIsClosed() ? 'checked=checked':'').' name=\"lepress-course-locked\" value=\"1\"/><br />';\n\t\t\t\t\techo '<span class=\"description\">'.$form_row_desc5.'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t} else {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-locked\">'.__('Export', lepress_textdomain).'</label></th>';\n\t\t\t\t\techo '<td>';\n\t\t\t\t\techo '<a href=\"\">'.__('Export current state',lepress_textdomain).'</a><br />';\n\t\t\t\t\techo '<a href=\"'.add_query_arg(array('page' => 'lepress-import-export', 'export_tpl' => $tag->term_id), admin_url().'admin.php').'\">'.__('Export as template (all assignments without students related information)', lepress_textdomain).'</a><br />';\n\t\t\t\t\techo '<span class=\"description\">'.__('Export this course data. \"Export current state\" exports also classbook, \"Export as template\" exports assginments and creates a new template.', lepress_textdomain).'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public function editAction($cat_id)\n\t{\n\t\t$this->oView->box_title = \"Edit Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\t\t\t\t\n\t\t$this->oView->link_url = site_url('dashboard/category/edit/'.$cat_id);\n\t\t$this->oView->cat_id = $cat_id;\n\t\t\n\t\t$objCat = new Category();\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\n\t\t\t$objCat->update($cat_id,$data);\n\t\t\n\t\t}\n\n\t\t$rowCat = $objCat->get($cat_id);\n\t\t\n\t\t$rowParentCat = $objCat->get($rowCat['parent_id']);\n\t\t$rowCat['parent_code'] = $rowParentCat['code'];\n\t\tif ($rowParentCat['code'] == 0) \n\t\t\t$rowCat['parent_code'] = \"ROOT\";\n\t\t\n\t\t$this->oView->rowCat = $rowCat;\t\t\n\t\t\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function edit(Categoria $categoria)\n {\n //\n }", "public function edit(Categoria $categoria)\n {\n //\n }", "public function edit(Categoria $categoria)\n {\n //\n }", "public function create()\n {\n if (!isset(request()->program)) {\n $category = Programs::all();\n } else {\n $category = Programs::where(\"id\", request()->program)->first();\n }\n return view(\"admin/action/create\", compact(\"category\"));\n }", "public function edit(Category $edit){\n return $edit;\n }", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "public function edit($id)\n {\n $cat= MenuCategories::find($id);\n return view(\"dashboard.pages.supervisor.category.edit\", [ 'cat'=>$cat]);\n \n }", "public function add_category() {\n $this->category();\n $this->loadView(\"editors/category_editor\");\n }", "function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $up=false, $down=false, $thisparents=array()) {\n global $CFG, $USER, $OUTPUT;\n $mform =& $this->_form;\n\n static $str = NULL;\n static $config = NULL;\n\n if (is_null($config)) {\n $config = get_config('block_cam_mycourses');\n }\n\n if (is_null($str)) {\n $str = new stdClass;\n $str->spacer = $OUTPUT->spacer().' ';\n $str->full = get_string('full', 'block_cam_mycourses');\n $str->listing = get_string('listing', 'block_cam_mycourses');\n $str->no = get_string('no');\n $str->display = get_string('display', 'block_cam_mycourses');\n $str->cascade = get_string('cascade', 'block_cam_mycourses');\n $str->enrol = get_string('enrolled', 'block_cam_mycourses');\n $str->fullif = get_string('fullif', 'block_cam_mycourses');\n }\n $options = array(0 => $str->no,\n CAM_MYCOURSES_DISPLAYFULL => $str->full,\n CAM_MYCOURSES_DISPLAYFULLENROL => $str->fullif,\n CAM_MYCOURSES_DISPLAYLIST => $str->listing);\n if (!empty($category)) {\n\n if (!isset($category->context)) {\n $category->context = context_coursecat::instance($category->id);\n }\n\n // echo '<tr><td align=\"left\" class=\"name\">';\n $categoryprefix = '';\n for ($i=0; $i<$depth;$i++) {\n $categoryprefix .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';\n }\n //echo '</td>';\n $display = \"display_\".$category->id;\n $display = isset($config->$display) ? $config->$display : 0;\n $enrolled = \"enrol_\".$category->id;\n $enrolled = isset($config->$enrolled) ? $config->$enrolled : false;\n $cascade = \"cascade_\".$category->id;\n $cascade = isset($config->$cascade) ? $config->$cascade : false;\n $mform->addElement('header', 'header'.$category->id, $categoryprefix.format_string($category->name));\n $mform->addElement('select', 'display'.$category->id, $str->display, $options);\n $mform->setDefault('display'.$category->id, $display);\n $mform->addElement('checkbox', 'cascade'.$category->id, $str->cascade);\n $mform->setDefault('cascade'.$category->id, $cascade);\n $mform->addElement('checkbox', 'enrolled'.$category->id, $str->enrol);\n $mform->setDefault('enrolled'.$category->id, $enrolled);\n foreach($thisparents as $parentid) {\n $mform->disabledIf('display'.$category->id, 'cascade'.$parentid, 'checked');\n $mform->disabledIf('cascade'.$category->id, 'cascade'.$parentid, 'checked');\n $mform->disabledIf('enrolled'.$category->id, 'cascade'.$parentid, 'checked');\n }\n $mform->disabledIf('enrolled'.$category->id, 'display'.$category->id, 'eq', 3);\n } else {\n $category->id = '0';\n }\n\n if ($categories = get_categories($category->id)) { // Print all the children recursively\n $countcats = count($categories);\n $count = 0;\n $first = true;\n $last = false;\n if (!empty($category->id)) {\n $thisparents[] = $category->id;\n } else {\n $thisparents = array();\n }\n foreach ($categories as $cat) {\n $count++;\n if ($count == $countcats) {\n $last = true;\n }\n $up = $first ? false : true;\n $down = $last ? false : true;\n $first = false;\n\n $this->print_category_edit($cat, $displaylist, $parentslist, $depth+1, $up, $down, $thisparents);\n }\n }\n }", "public function edit_category($id)\n\t{\n\t\t$query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n $data['category']=$query; \n\t\t$data['title']=\"Dahboard || Great Wine Global\";\n $this->load->view('superpanel/header',$data);\n $this->load->view('superpanel/edit_categorie');\n $this->load->view('superpanel/footer');\n\t}", "function question_category_form($course, $current, $recurse=1, $showhidden=false, $showquestiontext=false) {\n global $CFG;\n\n/// Make sure the default category exists for this course\n get_default_question_category($course->id);\n\n/// Get all the existing categories now\n $catmenu = question_category_options($course->id, true);\n\n $strcategory = get_string(\"category\", \"quiz\");\n $strshow = get_string(\"show\", \"quiz\");\n $streditcats = get_string(\"editcategories\", \"quiz\");\n\n echo \"<table><tr><td style=\\\"white-space:nowrap;\\\">\";\n echo \"<strong>$strcategory:</strong>&nbsp;\";\n echo \"</td><td>\";\n popup_form (\"edit.php?courseid=$course->id&amp;cat=\", $catmenu, \"catmenu\", $current, \"\", \"\", \"\", false, \"self\");\n echo \"</td><td align=\\\"right\\\">\";\n echo \"<form method=\\\"get\\\" action=\\\"$CFG->wwwroot/question/category.php\\\">\";\n echo \"<div>\";\n echo \"<input type=\\\"hidden\\\" name=\\\"id\\\" value=\\\"$course->id\\\" />\";\n echo \"<input type=\\\"submit\\\" value=\\\"$streditcats\\\" />\";\n echo '</div>';\n echo \"</form>\";\n echo '</td></tr></table>';\n\n echo '<form method=\"get\" action=\"edit.php\" id=\"displayoptions\">';\n echo \"<fieldset class='invisiblefieldset'>\";\n echo \"<input type=\\\"hidden\\\" name=\\\"courseid\\\" value=\\\"{$course->id}\\\" />\\n\";\n question_category_form_checkbox('recurse', $recurse);\n question_category_form_checkbox('showhidden', $showhidden);\n question_category_form_checkbox('showquestiontext', $showquestiontext);\n echo '<noscript><div class=\"centerpara\"><input type=\"submit\" value=\"'. get_string('go') .'\" />';\n echo '</div></noscript></fieldset></form>';\n}", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "public function edit(CourseCategory $courseCategory)\n {\n //\n }", "public function edit(PageCategory $pageCategory)\n {\n //\n }", "public function edit($id)\n { \n //This Function Call CategoryHelpers.php Directory . \n $category = fetchCategoryTree(0,'','');\n $cat = Category::find($id);\n return view('admin.category.edit', compact('cat', 'category'));\n }", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public function edit($id = NULL){\n\t\tif ($id) {\n\t\t\t$this->data['category'] = $this->category_m->get($id);\n\t\t\tcount($this->data['category']) || $this->data['errors'][] = 'category could not be found';\n\t\t}\n\t\telse {\n\t\t\t$this->data ['category'] = $this->category_m->get_new();\n\t\t}\n\t\t\n\t\t// Set up the form\n\t\t$rules = $this->category_m->rules;\n\t\t$this->form_validation->set_rules($rules);\n\t\t\n\t\t// Process the form\n\t\tif ($this->form_validation->run() == TRUE) {\n\t\t\t$data = $this->category_m->array_from_post(array(\n\t\t\t\t'title', \n\t\t\t\t'description', \n\t\t\t\t'items_style'\n\t\t\t\t\n\t\t\t));\n\t\t\t$this->category_m->save($data, $id);\n\t\t\tredirect('admin/category');\n\t\t}\n\t\t\n\t\t$this->data['subview'] ='admin/category/edit';\n\t $this->load->view('admin/_layout_main', $this->data);\n }", "function realstate_form($catId = null) {\n if ($catId!= null) {\n // We check if the category is the same as our plugin\n if (osc_is_this_category('realstate_plugin', $catId)) {\n $conn = getConnection() ;\n $data = $conn->osc_dbFetchResults('SELECT * FROM %st_item_house_property_type_attr', DB_TABLE_PREFIX);\n $p_type = array();\n foreach ($data as $d) {\n $p_type[$d['fk_c_locale_code']][$d['pk_i_id']] = $d['s_name'];\n }\n unset($data);\n include_once 'item_edit.php';\n }\n }\n}", "public function edit($proid)\n {\n $cate=Product_category::find($proid);\n //echo \"<pre>\";print_r($cate);die();\n return view('admin.products.edit_category',['cate'=>$cate]);\n }", "public function editProgram($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = Program::find($id);\n $categories = ProgramCategory::all();\n //dd($workout);\n return view('admin.editprogram')->with('workout',$workout)->with('programCategories',$categories);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function edit($esta_categoria)\n {\n if($this->acceso(436)){\n // check if the categoria exists before trying to edit it\n $categoria = str_replace(\"%20\", \" \", $esta_categoria);\n $data['categoria'] = $this->Categoria_model->get_categoria($categoria);\n\n if(isset($data['categoria']['categoria']))\n {\n $this->load->library('form_validation');\n $this->form_validation->set_rules('categoria','Nombre','trim|required', array('required' => 'Este Campo no debe ser vacio'));\n $this->form_validation->set_rules('codigo_cat','Código','trim|required', array('required' => 'Este Campo no debe ser vacio'));\n if($this->form_validation->run()) \n {\n $params = array(\n 'categoria' => $this->input->post('categoria'),\n 'codigo_cat' => $this->input->post('codigo_cat'),\n );\n $this->Categoria_model->update_categoria($categoria,$params); \n redirect('categoria/index');\n }\n else\n {\n $data['_view'] = 'categoria/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The categoria you are trying to edit does not exist.');\n }\n }", "public function edit(TripCategory $tripCategory)\n {\n //\n }", "public function edit(Postcategory $postcategory)\n {\n //\n }", "public function edit() {\n// user must be logged in\n if (User::is_logged_in()) {\n// preventing double submitting\n $token = md5(time());\n $_SESSION[$token] = true;\n\n $user_id = $_SESSION['user_id'];\n $is_admin = isset($_SESSION['is_admin']) && $_SESSION['is_admin'];\n $post_id = $_GET['post_id'];\n $post = Post::find($post_id);\n\n $description = $post['description'];\n $categoryId = $post['category'];\n $imageFile = $post['imageFile'];\n// user can edit only his post or he must be an admin\n if ($user_id == $post['authorId'] || $is_admin) {\n // get all categories for the select box in form\n $categories = Category::all();\n// show post edit form\n require_once('views/posts/edit.php');\n }\n }\n }", "function editar_categoria($id,$nome_categoria){\n\t\t$bd = new bd_connection();\n\t\t\n\t\t// inclui uma nova cidade\n\t\t$retorno = $bd->editarCategoria($id,$nome_categoria);\n\t\t\n\t\tif($retorno) {\n\t\t\t// ecluido com sucesso\n\t\t\techo \"<script>window.alert('\".$nome_categoria.\" foi editada com sucesso.');</script>\";\n\t\t}\n\t\telse { // falha ao excluir\n\t\t\techo \"<script>window.alert('Falha ao editar esta Categoria!');</script>\";\n\t\t}\n\r\n\t\t//volta para a pagina de cidades\n\t\techo\"<script>window.open('adm.php?pg=2','_self')</script>\";\n\t\n\t}", "public function edit($id)\n {\n $data = $this->Category->findData($id);\n $catalogue = Catelog::get();\n\t\tif($data->in_home==\"on\"){\n\t\t\t$is_Selected=\"checked\";\n\t\t}else{\n\t\t\t$is_Selected=\"\";\n\t\t}\n $html = '<div class=\"form-group error\"></div>\n <label for=\"categories_name\">Name</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"text\" id=\"editcategories_name\" name=\"categories_name\" value=\"'.$data->categories_name.'\" class=\"form-control\" placeholder=\"Enter your category name\">\n </div>\n </div>\n <label for=\"catelogue_id\">Catalogue</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <select class=\"form-control\" id=\"editcatelogue_id\" name=\"catelogue_id\">\n <option value=\"\">-- Please select --</option>';\n foreach($catalogue as $key)\n {\n $status=\"\";\n if($data->catelogue_id==$key->id){\n $status=\"selected\";\n }\n $html .= '<option value=\"'.$key->id.'\" '.$status.'>'.$key->catelogue_name.'</option> ';\n }\n $html .= ' </select>\n </div>\n </div>\n <label for=\"image\">Images</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"file\" name=\"image_1\" id=\"image_1\" placeholder=\"Choose image\" > \n </div>\n </div>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <img src=\"'.asset('storage/category/'.$data->image).'\" name=\"old_img\" width=\"50px\" height=\"50px\"> \n </div>\n </div>\n <label for=\"description\">Description</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"text\" id=\"editDescription\" name=\"Description\" value=\"'.$data->description.'\" class=\"form-control\" placeholder=\"Enter your description\">\n </div>\n </div>\n\t\t\t\t <label for=\"description\">Show In Home</label>\n <div class=\"form-group\">\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"in_home\" name=\"in_home\" class=\"form-control\" '.$is_Selected.'>\n\t\t\t\t\t</div>\n <br>\n ';\n return response()->json(['html'=>$html]);\n }", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}", "function editAction($categoryId)\n {\n $category = $this->category->findByPk($categoryId);\n $this->set(\"category\", $category);\n $this->set(\"categoryJson\", JsonView::php2js($category));\n $this->set(\"categoryExtraFields\", $this->extraField->getCategoryFields($categoryId));\n $this->set(\"categoriesSelect\", $this->category->createOptionsList());\n }", "public function edit_postAction() {\r\n\t\t$info = $this->getPost(array('id', 'sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$ret = Game_Service_Category::updateCategory($info, intval($info['id']));\r\n\t\tif (!$ret) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功.'); \t\t\r\n\t}", "public function edit(BlogCategory $blogCategory)\n {\n //\n }", "function addExtraCategoryFields_editForm($tag) {\n\t\t$this->addExtraCategoryFields($tag, true);\n\t}", "public function editView() {\n Template_Module::setFullWidth(true);\n $this->edit = true;\n $this->addView();\n // cestak obrázků\n $this->imagePath = $this->category()->getModule()->getDataDir(true);\n }", "public function edit($id){\n $categorie=Blog_categories::find($id);\n return view ('blog_categories.edit',['categorie'=>$categorie]);\n}", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "public function edit($slug){\n if(!checkRole(getUserGrade(2))){\n prepareBlockUserMessage();\n return back();\n }\n $record = LmsCategory::getRecordWithSlug($slug);\n if($isValid = $this->isValidRecord($record))\n return redirect($isValid);\n\n $data['record'] \t\t= $record;\n $data['active_class'] = 'lms';\n $data['title'] = getPhrase('edit_category');\n \t// return view('lms.lmsclasscontent.add-edit', $data);\n $view_name = getTheme().'::lms.lmsclasscontent.add-edit';\n return view($view_name, $data);\n }", "function print_category_edit(html_table $table, coursecat $category, $depth = -1, $up = false, $down = false) {\n global $OUTPUT;\n\n static $str = null;\n\n if (is_null($str)) {\n $str = new stdClass;\n $str->edit = new lang_string('edit');\n $str->delete = new lang_string('delete');\n $str->moveup = new lang_string('moveup');\n $str->movedown = new lang_string('movedown');\n $str->edit = new lang_string('editthiscategory');\n $str->hide = new lang_string('hide');\n $str->show = new lang_string('show');\n $str->cohorts = new lang_string('cohorts', 'cohort');\n $str->spacer = $OUTPUT->spacer().' ';\n }\n\n if ($category->id) {\n\n $categorycontext = context_coursecat::instance($category->id);\n\n $attributes = array();\n $attributes['class'] = $category->visible ? '' : 'dimmed';\n $attributes['title'] = $str->edit;\n $categoryurl = new moodle_url('/course/manage.php', array('id' => $category->id, 'sesskey' => sesskey()));\n $categoryname = $category->get_formatted_name();\n $categorypadding = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', $depth);\n $categoryname = $categorypadding . html_writer::link($categoryurl, $categoryname, $attributes);\n\n $icons = array();\n if (has_capability('moodle/category:manage', $categorycontext)) {\n // Edit category.\n $icons[] = $OUTPUT->action_icon(\n new moodle_url('/course/editcategory.php', array('id' => $category->id)),\n new pix_icon('t/edit', $str->edit, 'moodle', array('class' => 'iconsmall')),\n null, array('title' => $str->edit)\n );\n // Delete category.\n $icons[] = $OUTPUT->action_icon(\n new moodle_url('/course/manage.php', array('deletecat' => $category->id, 'sesskey' => sesskey())),\n new pix_icon('t/delete', $str->delete, 'moodle', array('class' => 'iconsmall')),\n null, array('title' => $str->delete)\n );\n // Change visibility.\n if (!empty($category->visible)) {\n $icons[] = $OUTPUT->action_icon(\n new moodle_url('/course/manage.php', array('hidecat' => $category->id, 'sesskey' => sesskey())),\n new pix_icon('t/hide', $str->hide, 'moodle', array('class' => 'iconsmall')),\n null, array('title' => $str->hide)\n );\n } else {\n $icons[] = $OUTPUT->action_icon(\n new moodle_url('/course/manage.php', array('showcat' => $category->id, 'sesskey' => sesskey())),\n new pix_icon('t/show', $str->show, 'moodle', array('class' => 'iconsmall')),\n null, array('title' => $str->show)\n );\n }\n // Cohorts.\n if (has_any_capability(array('moodle/cohort:manage', 'moodle/cohort:view'), $categorycontext)) {\n $icons[] = $OUTPUT->action_icon(\n new moodle_url('/cohort/index.php', array('contextid' => $categorycontext->id)),\n new pix_icon('t/cohort', $str->cohorts, 'moodle', array('class' => 'iconsmall')),\n null, array('title' => $str->cohorts)\n );\n }\n // Move up/down.\n if ($up) {\n $icons[] = $OUTPUT->action_icon(\n new moodle_url('/course/manage.php', array('moveupcat' => $category->id, 'sesskey' => sesskey())),\n new pix_icon('t/up', $str->moveup, 'moodle', array('class' => 'iconsmall')),\n null, array('title' => $str->moveup)\n );\n } else {\n $icons[] = $str->spacer;\n }\n if ($down) {\n $icons[] = $OUTPUT->action_icon(\n new moodle_url('/course/manage.php', array('movedowncat' => $category->id, 'sesskey' => sesskey())),\n new pix_icon('t/down', $str->movedown, 'moodle', array('class' => 'iconsmall')),\n null, array('title' => $str->movedown)\n );\n } else {\n $icons[] = $str->spacer;\n }\n }\n\n $actions = '';\n if (has_capability('moodle/category:manage', $categorycontext)) {\n $popupurl = new moodle_url(\"manage.php?movecat=$category->id&sesskey=\".sesskey());\n $tempdisplaylist = array(0 => get_string('top')) + coursecat::make_categories_list('moodle/category:manage', $category->id);\n $select = new single_select($popupurl, 'movetocat', $tempdisplaylist, $category->parent, null, \"moveform$category->id\");\n $select->set_label(get_string('frontpagecategorynames'), array('class' => 'accesshide'));\n $actions = $OUTPUT->render($select);\n }\n\n $table->data[] = new html_table_row(array(\n // Category name.\n new html_table_cell($categoryname),\n // Course count.\n new html_table_cell($category->coursecount),\n // Icons.\n new html_table_cell(join(' ', $icons)),\n // Actions.\n new html_table_cell($actions)\n ));\n }\n\n if ($categories = $category->get_children()) {\n // Print all the children recursively.\n $countcats = count($categories);\n $count = 0;\n $first = true;\n $last = false;\n foreach ($categories as $cat) {\n $count++;\n if ($count == $countcats) {\n $last = true;\n }\n $up = $first ? false : true;\n $down = $last ? false : true;\n $first = false;\n\n print_category_edit($table, $cat, $depth+1, $up, $down);\n }\n }\n}", "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 }", "static public function ControllerEditarCategoria(){\n //evaluamos igual si viene una categoria\n if(isset($_POST[\"editarCategoria\"])){\n //validaciones\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarCategoria\"])){\n //tabla y arreglos\n\t\t\t\t$tabla = \"categorias\";\n\n\t\t\t\t$datos = array(\"categoria\"=>$_POST[\"editarCategoria\"],\n\t\t\t\t\t\t\t \"id\"=>$_POST[\"idCategoria\"]);\n //lo enviamos al modelo\n\t\t\t\t$respuesta = ModeloCategorias::ModeloEditarCategoria($tabla, $datos);\n //si edita que envie una respuesta\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"La categoría ha sido cambiada correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"categorias\";\n\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</script>';\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n // en caso contrarios\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡La categoría no puede ir vacía o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"categorias\";\n\n\t\t\t\t\t\t\t}\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 }", "public static function viewCategoryUpdate($cat_id,$par)\n\t {\n\t\t\t\t\n\t\t\t\t\n\t\t $nsubdata=mysql_query(\"select * from category where cat_par_id='$cat_id'\");\n\t\t\t\twhile($sub_cat=mysql_fetch_array($nsubdata))\n\t\t\t\t{\n\t\t\t\t\tif($sub_cat['cat_id']==$par)\n\t\t\t\t\t{\n\t\t\t\t\t echo '<option selected=\"selected\" value=\"'.$sub_cat['cat_id'].'\" style=\"margin-left:'.Actions::$s*Actions::$r.'px;\">'.ucfirst($sub_cat['cat_title']).'</option>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t echo '<option value=\"'.$sub_cat['cat_id'].'\" style=\"margin-left:'.Actions::$s*Actions::$r.'px;\">'.ucfirst($sub_cat['cat_title']).'</option>';\n\t\t\t\t\t}\n\t\t\t\t\t if(mysql_num_rows(mysql_query(\"select * from category where cat_par_id='\".$sub_cat['cat_id'].\"'\"))>0)\n\t\t\t {\n\t\t\t\t\t\t\tActions::$r++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t Actions::viewCategoryUpdate($sub_cat['cat_id'],$par);\n\t\t\t\t\t }\n\t\t\t\t\t \t \t\n\t\t\t\t\t \n\t\t\t\t\n\t\t\t\t}\n\t\t\tActions::$r--;\t\n\n\t }", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "public function edit(booksCategory $booksCategory)\n {\n //\n }", "public function edit(booksCategory $booksCategory)\n {\n //\n }", "function edit_category($tbl_name){\n\t\t//print_r($_POST); die;\n\t\tunset($_POST['submitLog']);\n\t\t$this->db->where('id', $_POST['id']);\n\t\tunset($_POST['id']);\n\t\t$this->db->update($tbl_name,$_POST);\n\t\t// print_r($this->db->last_query());\n\t // die();\n\t}", "public function edit(Catowner $catowner)\n {\n //\n }", "public function editSpecialist($cat_id)\n {\n\n $specialistData = DB::table('specialists')\n ->join('departments', 'specialists.department_id', '=', 'departments.id')\n ->select('specialists.*', 'departments.name as deptName', 'departments.id as catID')\n /*->get();*/\n ->where('specialists.id',$cat_id)\n ->first();\n\n $editSpecialist=view('admin.specialist_edit')\n ->with('specialistData',$specialistData);\n\n return view('admin.master')\n ->with('main_content',$editSpecialist);\n\n return Redirect::to('/specialists');\n }", "function categoryEdit($str=''){\n\tif(startSession() && isset($_SESSION['UserID']))\n\t{\n\n\t\t$myCatID = ($_GET[\"id\"]);\n\t\t# ADD - DateCreated, DateAssigned, LastUpdated to table\n\t\t$sql = \"select CatID, CatTitle, CatType, CatSort, CatDescription, CatVisible\n\t\t\tFROM ma_Categories WHERE CatID = $myCatID ;\";\n\n\t\t$result = mysqli_query(IDB::conn(),$sql) or die(trigger_error(mysqli_error(IDB::conn()), E_USER_ERROR));\n\n\t\tif (mysqli_num_rows($result) > 0)//at least one record!\n\t\t{//show results\n\n\t\t# shows details from a single customer, and preloads their first name in a form.\n\t\t$str .= '\n\t\t<script type=\"text/javascript\" src=\"' . VIRTUAL_PATH . 'include/util.js\"></script>\n\n\t\t<script type=\"text/javascript\">\n\n\t\t\tfunction checkForm(thisForm)\n\n\t\t\t{//check form data for valid info\n\t\t\t\tif(empty(thisForm.FirstName,\"Please Enter Customer\\'s First Name\")){return false;}\n\t\t\t\tif(empty(thisForm.LastName,\"Please Enter Customer\\'s Last Name\")){return false;}\n\t\t\t\tif(!isEmail(thisForm.Email,\"Please Enter a Valid Email\")){return false;}\n\t\t\t\treturn true;//if all is passed, submit!\n\t\t\t}\n\n\t\t</script>';\n\n\n\t\t$str .= '<form action=\"' . THIS_PAGE . '\" method=\"post\" onsubmit=\"return checkForm(this);\">';\n\n\t\t\twhile ($row = mysqli_fetch_assoc($result))\n\t\t\t{//dbOut() function - 'wrapper' to strip slashes, etc. of data leaving db\n\t\t\t\t$catID \t\t\t\t\t\t= dbOut($row['CatID']);\n\t\t\t\t$catTitle \t\t\t= dbOut($row['CatTitle']);\n\t\t\t\t$catType \t\t\t\t\t= dbOut($row['CatType']);\n\t\t\t\t$catSort \t\t\t\t= dbOut($row['CatSort']);\n\t\t\t\t$catDescription\t\t= dbOut($row['CatDescription']);\n\t\t\t\t$catVisible \t\t\t= dbOut($row['CatVisible']);\n\n\t\t\t\t$str .= '<form action=\"' . THIS_PAGE . '\" method=\"post\"\n\t\t\t\t\tonsubmit=\"return checkForm(this);\">\n\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"CatID\" value=\"' . $catID . '\" />\n\n\t\t\t\t\t\t\t<h4 align=\"center\">Edit Catagory (' . $catTitle . ')</h4>\n\n\t\t\t\t\t\t\t<!-- inner container -->\n\t\t\t\t\t\t\t<div class=\"class=\"col-sm-9 pull-right\" style=\"background-color: #aaa;\">\n\n\t\t\t\t\t\t\t\t<!-- left container -->\n\t\t\t\t\t\t\t\t<div class=\"col-sm-8 pull-left\" style=\"background-color: #ddd ;\">\n\n\t\t\t\t\t\t\t\t\t<div class=\"row \">\n\t\t\t\t\t\t\t\t\t\t<div class=\"pull-middle\">\n\n\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatType\" required>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"IC\" select=\"select\">Category Type: IC</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"OOC\" >Category Type: OOC</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"organization\" select=\"select\">Group By: Indivual</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"team\" >Group By: Group/Team</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"person\" >Group By: Organization</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"0\" select=\"select\">Visible: Yes</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"1\" >Visible: No</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\tclass=\"col-sm-12\"\n\t\t\t\t\t\t\t\t\t\t\ttype=\"text\"\n\n\t\t\t\t\t\t\t\t\t\t\tname=\"CatTitle\"\n\t\t\t\t\t\t\t\t\t\t\tvalue=\"' . $catTitle . '\"\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"Team/Group/Character Name here\"/>\n\t\t\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\t\t\tname=\"CatDescription\"\n\n\t\t\t\t\t\t\t\t\t\t\tclass=\"autoExpand col-sm-12\"\n\t\t\t\t\t\t\t\t\t\t\trows=\"3\"\n\t\t\t\t\t\t\t\t\t\t\tdata-min-rows=\"3\"\n\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"Catagroy Description\"\n\t\t\t\t\t\t\t\t\t\t\t>' . $catDescription . '</textarea>\n\t\t\t\t\t\t\t\t\t</div><!-- end container-->\n\n\t\t\t\t\t\t\t\t</div><!-- end inner container -->\n\n\t\t\t\t\t\t\t<div class=\"clearfix\">\n\t\t\t\t\t\t\t\t<br /><br />\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\t\t\tstyle=\"background-color: #a0a;\">\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"act\" value=\"categoryRevise\" />\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t<input class=\"btn btn-primary btn-xs outline\" type=\"submit\" value=\"Edit Catagory\">\n\n\t\t\t\t\t\t\t\t&nbsp; &nbsp;\n\n\t\t\t\t\t\t\t\t<a class=\"btn btn-primary btn-xs outline\" href=\"' . THIS_PAGE . '\">Exit Event</a>';\n\n\t\t\t\t\t\t\t\tif(startSession() && isset($_SESSION['UserID'])){\n\t\t\t\t\t\t\t\t\t$str .= '&nbsp; &nbsp;\n\n\t\t\t\t\t\t\t\t\t<!-- set to invisible actually -->\n\t\t\t\t\t\t\t\t\t<a class=\"btn btn-primary btn-xs outline\" href=\"' . THIS_PAGE . '?act=categoryRemove&id=' . $catID . '&categoryName=' . formatUrl($catTitle) . '\">Remove Catagory</a>';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$str .= '</div>\n\n\t\t\t\t\t\t</form>';\n\n\t\t\t\t\t}\n\n\t\t\t\t}else{//no records\n\t\t\t\t\t$str .= '<div align=\"center\">\n\t\t\t\t\t\t<h3>Currently No Events Listed in the Timeline.</h3>\n\t\t\t\t\t</div>';\n\t\t\t\t}\n\n\t\t\treturn $str;\n\n\t\t\t@mysqli_free_result($result); //free resources\n\n\t\t} else { #redirect back to timeline\n\n\t\t\t#myRedirect('index.php');\n\t\t}\n}", "public function edit_category($category_id){\n $category_info=DB::table('tbl_category')\n ->where('category_id',$category_id)\n ->first();\n $edit_category=view('admin.pages.edit_category') \n ->with('category_info',$category_info); \n return view('admin.admin_master')->with('admin_content',$edit_category);\n }", "public function editAction() {\n $id = (int) $this->params()->fromRoute('id', 0);\n\n if (!$id) {\n return $this->redirect()->toRoute('category', array('action' => 'add'));\n }\n $page = (int) $this->params()->fromRoute('page', 0);\n\n $session = new Container('User');\n $form = new CategoryForm('CategoryForm');\n $category = $this->getCategoryTable()->getCategory($id);\n $form->get('id')->setValue($id);\n $form->bind($category);\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $data = $request->getPost();\n $category->exchangeArray($data);\n $form->setInputFilter($category->getInputFilter());\n $form->setData($data);\n\n if ($form->isValid()) {\n $validatorName = new \\Zend\\Validator\\Db\\NoRecordExists(\n array(\n 'table' => 'category',\n 'field' => 'title',\n 'adapter' => $this->getAdapter(),\n 'exclude' => array(\n 'field' => 'id',\n 'value' => $id,\n )\n )\n );\n if ($validatorName->isValid(trim($category->title))) {\n $no_duplicate_data = 1;\n } else {\n $flashMessage = $this->flashMessenger()->getErrorMessages();\n if (empty($flashMessage)) {\n $this->flashMessenger()->setNamespace('error')->addMessage('Category Name already Exists.');\n }\n $no_duplicate_data = 0;\n }\n\n if ($no_duplicate_data == 1) {\n $data->updated_date = time();\n $data->updated_by = $session->offsetGet('userId');\n\n $categoryId = $this->getCategoryTable()->saveCategory($category);\n// $this->getServiceLocator()->get('Zend\\Log')->info('Level created successfully by user ' . $session->offsetGet('userId'));\n $this->flashMessenger()->setNamespace('success')->addMessage('Category updated successfully');\n\n return $this->redirect()->toRoute('category');\n }\n }\n }\n return array('form' => $form, 'id' => $id, 'page' => $page);\n }", "function edit_category_data($category_id)\n\t{\n\t\t$this->data['title'] \t= 'Edit Portfolio Category Data';\n\t\t$this->data['category']\t= $this->portfolio_model->get_category_by_id($category_id);\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/edit_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function edit($id)\n {\n $sidebar_items = array(\n \"Category List\" => array('url' => URL::route('categories.index'), 'icon' => '<i class=\"fa fa-product-hunt\" aria-hidden=\"true\"></i>'),\n 'Add Category' => array('url' => URL::route('categories.create'), 'icon' => '<i class=\"fa fa-plus-circle\"></i>'),\n 'It products' => array('url' => URL::route('categories.show', ['id'=>$id]), 'icon' => '<i class=\"fa fa-plus-circle\"></i>'),\n );\n//\n $FillableDropdown = new FillableDropdown();\n// $active = $FillableDropdown->active($default = false);\n $activeField = $FillableDropdown->orderActiveKeyValue($default = 1);\n\n $category = Category::findOrFail($id);\n $categories = Category::all()->pluck('name', 'id');\n $categories = array_add($categories, '', 'parent');\n\n if($category){\n\n $parent = $category->parent()->get();\n\n if(count($parent) > 0){\n if($parent[0]->id){\n $parentCategoryId = $parent[0]->id;\n }\n }else{\n $parentCategoryId = $id;\n\n }\n\n if(isset($category->active)){\n $activeSlected = $category->active;\n }else{\n $activeSlected = 0;\n\n }\n\n }\n\n $categoryParentData = Category::select('name', 'id')\n ->where('parent_id', null)\n ->get();\n\n $categoryChildData = Category::select('name', 'id')\n ->whereNotNull('parent_id')\n ->get();\n\n// dd($activeField);\n// dd($activeField, $activeSlected);\n\n return view('admin/category.edit', compact('sidebar_items', 'category', 'categories', 'parentCategoryId', 'activeSlected',\n 'categoryParentData', 'categoryChildData', 'activeField'));\n\n }", "public function editCategory($cat_id)\n {\n // get category by cat_id..\n $category = DB::table('categories')->where('id',$cat_id)->first();\n return view('admin.category.edit_category',compact('category'));\n }", "function action_edit($params) {\n $form_error =false;\n $category= model_category::load_by_id($params[0]);\n $id =$params[0];\n if(isset($_POST['form']['action1'])) {\n //Check if the \"Ok\" button is set.\n\n //Modify category name.\n if( model_category::editC($id,$_POST['form']['name'])){\n header('Location: ' . APP_URL . 'category/list');\n die;\n\n }\n $form_error =false;\n }\n if(isset($_POST['form']['action2'])) {\n @include_once APP_PATH . 'view/category_edit.tpl.php';\n }\n @include_once APP_PATH . 'view/category_edit.tpl.php';\n }" ]
[ "0.69252604", "0.6846754", "0.6837912", "0.6709462", "0.6661503", "0.664688", "0.66090596", "0.64908993", "0.6467321", "0.64135224", "0.6387015", "0.63678974", "0.63644814", "0.63365185", "0.6296625", "0.62937313", "0.625918", "0.6256656", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.6225534", "0.62109524", "0.6195221", "0.61870503", "0.61830395", "0.6166389", "0.6157841", "0.61541164", "0.61440253", "0.6133944", "0.6102136", "0.6102136", "0.6102136", "0.60701495", "0.6065885", "0.60533077", "0.60352474", "0.6028784", "0.6012196", "0.6007828", "0.6005947", "0.59919465", "0.59896296", "0.59838754", "0.5975315", "0.5974424", "0.59525484", "0.5944047", "0.5922793", "0.59137005", "0.59075123", "0.59041655", "0.5899791", "0.58984524", "0.58979917", "0.58972573", "0.5888908", "0.5887078", "0.5883745", "0.5879486", "0.58743966", "0.58618844", "0.58538544", "0.5847094", "0.58404475", "0.5836396", "0.58360094", "0.5833006", "0.5831484", "0.5829694", "0.5818303", "0.5818303", "0.581232", "0.58083045", "0.5804528", "0.58027744", "0.58002156", "0.57870317", "0.5785092", "0.5784385", "0.57799864", "0.57775134" ]
0.63124186
14
/Edit program category Function for update Form
public function updateProgramCategory(Request $request) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $this->validate($request,array( 'name' => 'required', )); $id = $request->id; $programCategory = ProgramCategory::find($id); $programCategory->program_category_name = $request->name; $programCategory->tips = $request->tips; $programCategory->save(); Session::flash('success','Program Category Updated succcessfully.'); return redirect()->back()->with('workout',$programCategory); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function formModify() {\n $categories=$this->model->listCategories();\n $this->view->display(\"view/form/ProductFormModify.php\", NULL, $categories); \n }", "function editMainCategory()\n\t{ \n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from products_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$sqlid=\"SELECT category_id,category_parent_id FROM category_table where category_id in(select category_id from products_table where category_id='\".$obj->records[0]['category_id'].\"')\";\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$sql1 = \"SELECT category_id,category_name FROM category_table where category_parent_id=0\";\n\t\t\n\t\t\t$query1 = new Bin_Query();\n\t\t\n\t\t\t$query1->executeQuery($sql1);\n\t\t\n\n\t\t\treturn Display_DManageProducts::displayCategory($query1->records,$query->records[0]['category_id']);\n\t\t\t\n\t\t// \t\t\treturn $category;\n\t }\n\t}", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "function edit_category($tbl_name){\n\t\t//print_r($_POST); die;\n\t\tunset($_POST['submitLog']);\n\t\t$this->db->where('id', $_POST['id']);\n\t\tunset($_POST['id']);\n\t\t$this->db->update($tbl_name,$_POST);\n\t\t// print_r($this->db->last_query());\n\t // die();\n\t}", "public function updateCate()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['upcategory'];\n\t\t\t$category_id = $_POST['upcategory_id'];\n\t\t\t$sql = \" update lib_book_species set category = '{$category}' where category in \n\t\t\t\t\t(select category from lib_category where category_id = {$category_id});\n\t\t\t\t\tupdate lib_category set category='\" . $category . \"' where category_id='\" . $category_id . \"';\n\t\t\t\t\t\";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Modify successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function Editar(){\n $ca = new Categoria();\n \n if(isset($_REQUEST['id'])){\n $ca = $this->model->Obtener($_REQUEST['id']);\n }\n \n require_once 'view/header.php';\n require_once 'view/categoria/editar.php';\n require_once 'view/footer.php';\n }", "function pnAddressBook_admin_updatecategories() {\r\n\r\n\t$output = new pnHTML();\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\tlist($id,$del,$name,$newname) = pnVarCleanFromInput('id','del','name','newname');\r\n\tif(is_array($del)) {\r\n $dels = implode(',',$del);\r\n }\r\n\r\n\t$modID = $modName = array();\r\n\r\n\tif(isset($id)) {\r\n\t\tforeach($id as $k=>$i) {\r\n \t$found = false;\r\n \tif(count($del)) {\r\n \tforeach($del as $d) {\r\n \tif($i == $d) {\r\n \t$found = true;\r\n \tbreak;\r\n \t}\r\n \t}\r\n \t}\r\n \tif(!$found) {\r\n \tarray_push($modID,$i);\r\n \tarray_push($modName,$name[$k]);\r\n }\r\n \t}\r\n\t}\r\n\r\n\t$pntable = pnDBGetTables();\r\n\t$cat_table = $pntable[pnaddressbook_categories];\r\n\t$cat_column = $pntable['pnaddressbook_categories_column'];\r\n\r\n\t$updates = array();\r\n foreach($modID as $k=>$id) {\r\n array_push($updates,\"UPDATE $cat_table\r\n SET $cat_column[name]='\".pnVarPrepForStore($modName[$k]).\"'\r\n WHERE $cat_column[nr]=$id\");\r\n\t}\r\n\r\n\t$error = '';\r\n\r\n\tif(pnModAPIFunc(__PNADDRESSBOOK__,'admin','updateCategories',array('updates'=>$updates))) {\r\n \tif (empty($error)) { $error .= 'UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\telse { $error .= ' - UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t}\r\n\r\n\t$delete = \"DELETE FROM $cat_table WHERE $cat_column[nr] IN ($dels)\";\r\n\tif(isset($dels)) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','deleteCategories',array('delete'=>$delete))) {\r\n if (empty($error)) { $error .= 'DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n }\r\n }\r\n\r\n\tif( (isset($newname)) && ($newname != '') ) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','addCategories',array('name'=>$newname))) {\r\n if (empty($error)) { $error .= 'INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t}\r\n }\r\n\r\n\t$args=array('msg'=>$error);\r\n\r\n\tpnRedirect(pnModURL(__PNADDRESSBOOK__, 'admin', 'categories',$args));\r\n\treturn true;\r\n}", "function editAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\t\n\t\t$redirectUrl = $this->getRedirectUrl();\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t$error \t\t= array();\n\t\t\t$success \t= array();\n\t\t\t$contents \t= '';\n\t\t\t$formData \t= array();\n\t\t\t //Truyen du lieu hien co vao form\n\t\t\t$formData['fbulkid'] = array();\n\t\t\t$formData['fid'] = $myProductCat->id;\n\t\t\t$formData['fname'] = $myProductCat->name;\n\t\t\t$formData['forder'] = $myProductCat->order;\n\t\t\t$formData['fparentid'] = $myProductCat->parentid;\n\t\t\t$formData['fenable'] = $myProductCat->enable;\n\t\t\t$formData['fseourl'] = $myProductCat->seoUrl;\n\t\t\t$formData['fseotitle'] = $myProductCat->seoTitle;\n\t\t\t$formData['fseokeyword'] = $myProductCat->seoKeyword;\n\t\t\t$formData['fseodescription'] = $myProductCat->seoDescription;\n\t\t\t\n\t\t\tif(!empty($_POST['fsubmit']))//truong hop da nhan nut submit\n\t\t\t{\n if($_SESSION['productcategoryEditToken']==$_POST['ftoken'])//kiem tra token\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->editActionValidator($formData, $error))//kiem tra du lieu co hop le hay khong\n {\n //Cac thong tin khong ngon ngu:\n $myProductCat->order = (int)$formData['forder'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n if(strlen($formData['fseourl']) > 0)\n $myProductCat->seoUrl = Helper::codau2khongdau($formData['fseourl'], true);\n else\n $myProductCat->seoUrl = Helper::codau2khongdau(strip_tags($formData['fname']), true);\n //Cac thong tin lien quan ngon ngu: \n $myProductCat->name = $formData['fname']; \n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n \n if($myProductCat->updateData())//cap nhat database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succUpdate']);\n $this->registry->me->writelog('ProductCategoryedit', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n }\n else\n {\n $error[] = $this->registry->lang['controller']['errUpdate']; \n }\n }\n }\n $_SESSION['productcategoryEditToken'] = Helper::getSecurityToken();//Tao token moi\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t\t\t$this->registry->smarty->assign(array(\t'formData' \t=> $formData,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'subcategories' => $myProductCat->getSub(true),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'parentCategories' => Core_ProductCategory::getFullCategories(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectUrl'=> $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'success'\t=> $success,\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\t));\n\t\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'edit.tpl');\n\t\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategorylist',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_edit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t\t$this->registry->smarty->assign(array('redirect' => $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectMsg' => $redirectMsg,\n\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t}\n\t}", "public function editAction() {\n $this->_helper->layout->setLayout('admin-simple');\n\n if (!($category_id = $this->_getParam('category_id'))) {\n die('No identifier specified');\n }\n\n //FETCH PARAMETERS ACCORDING TO THIS CATEGORY\n $reviewCategories = Engine_Api::_()->getDbtable('reviewcats', 'sitestorereview')->reviewParams($category_id);\n\n //GENERATE A FORM\n $form = $this->view->form = new Sitestorereview_Form_Admin_Ratingparameter_Edit();\n $form->setAction($this->getFrontController()->getRouter()->assemble(array()));\n\n $form->setField($reviewCategories->toArray());\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n\n foreach ($values as $key => $value) {\n $reviewcat_id = explode('reviewcat_name_', $key);\n $reviewcat = Engine_Api::_()->getItem('sitestorereview_reviewcat', $reviewcat_id[1]);\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\n try {\n //EDIT CATEGORY NAMES\n $reviewcat->reviewcat_name = $value;\n $reviewcat->save();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => 10,\n 'parentRefresh' => 10,\n 'messages' => array('')\n ));\n }\n\n $this->renderScript('admin-ratingparameter/edit.tpl');\n }", "public function edit(Category $Category)\n {\n echo \"i am in edit\";exit();\n //\n }", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function edit_category($category) {\n $this->category();\n $categories_sql_string = \"SELECT * FROM category WHERE id = \" . $category . \" limit 1\";\n $connection = new Database(\"sbrettsc_db\");\n $menu_array = $connection->get_array_from_query($categories_sql_string);\n $data = array(\"menu_array\" => array_shift($menu_array));\n\n $this->loadView(\"editors/category_editor\", $data);\n }", "public function editPost()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"edit_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryName = $this->input->post(\"name\");\n\n $categoryModel = new CategoriesModel();\n\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n if ($categoryModel->editCategory($categoryName, $categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category edited successfully!\",\"success\");\n } else {\n $this->view->redirect(\"/categories/manage\",\"You did not change anything ?\");\n }\n\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function edit()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/edit\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n\n } catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception->getMessage());\n }\n\n }", "public function categories_update($param = null)\r\n {\r\n if (isset($_POST[\"cat_id\"]) && !empty($_POST[\"cat_id\"])) {\r\n $action = $_POST[\"cat_id\"];\r\n $newValue = $_POST[\"cat_descr\"];\r\n $update = Category::find($action)->update(['cat_descr' => $newValue]);\r\n echo $update;\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }", "public function query_add_edit_cat()\n\t{\n\t\t$cat_name = trim(Http::request('cat_name', 'post'));\n\t\tif ($this->mode == 'add_cat')\n\t\t{\n\t\t\t$sql = 'SELECT MAX(cat_order) AS max_order\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat';\n\t\t\t$max_order = Fsb::$db->get($sql, 'max_order');\n\n\t\t\tFsb::$db->insert('smilies_cat', array(\n\t\t\t\t'cat_name' =>\t$cat_name,\n\t\t\t\t'cat_order' =>\t$max_order + 1,\n\t\t\t));\n\t\t\tFsb::$db->destroy_cache('smilies_');\n\n\t\t\tDisplay::message('adm_smiley_well_cat_add', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tFsb::$db->update('smilies_cat', array(\n\t\t\t\t'cat_name' =>\t$cat_name,\n\t\t\t), 'WHERE cat_id = ' . $this->id);\n\t\t\tFsb::$db->destroy_cache('smilies_');\n\n\t\t\tDisplay::message('adm_smiley_well_cat_edit', 'index.' . PHPEXT . '?p=posts_smiley', 'posts_smiley');\n\t\t}\n\t}", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "function display_category_form($category = ''){\n\t// This form can be used for inserting or editing categries\n\t// To insert, don't pass any parameters\n\t// To update, pass an array containing a category\n\t$edit = is_array($category);\n?>\n<form method='post'\n action='<?php echo $edit?'edit_category.php':'insert_category.php'; ?>'>\n<table border='0'>\n <tr>\n <td>Category Name:</td>\n\t<td><input type='text' name='catname' size='40' maxlength='40'\n\t value='<?php echo $edit?$category['catname']:''; ?>' /></td>\n </tr>\n <tr>\n <td <?php if (!$edit) echo \"colspan='2'\"; ?> align='center'>\n<?php\nif ($edit)\n\techo \"<input type='hidden' name='catid' value='\" . $category['catid']\n\t\t. \"' />\";\n?>\n\t <input type='submit'\n\t value=\"<?php echo $edit?'Rename':'Add'; ?> Category\" /></td>\n\t </form>\n<?php\n\tif ($edit)\n\t\techo '<form method=\"post\" action=\"/myPHP/ShoppingCart/model/admin/delete_category.php\">\n\t\t\t\t<td align=\"center\">\n\t\t\t\t<input type=\"hidden\" name=\"catid\" value=\"' . $category['catid'] .'\" />\n\t\t\t\t<input type=\"submit\" value=\"Delete Category\" />\n\t\t\t \t</td>\n\t\t\t</form>';\n?>\n\n\n<?php\n}", "public function edit(Category $category) {\n //not implemented\n }", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "function EditarCategoria($params=null){\n $id_categoria= $params[':ID'];\n $this->modelo->GetCategoria($id_categoria);\n $this->vista->mostrarCategoriaEdit($id_categoria); \n }", "function editCategory($category, $id) {\n $data = [\n 'name' => $_POST['name'],\n 'description' => $_POST['description']\n ];\n\n $stmt = $category->update($id, $data);\n header('location: confirm.php?action=Category&type=update&query='.$stmt);\n}", "public function editCategory()\r\n{\r\n $query_string = \"UPDATE categories \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"categoryname = :categoryname, \";\r\n $query_string .= \"categorydescription = :categorydescription \";\r\n $query_string .= \"WHERE categoryid = :categoryid\";\r\n\r\n return $query_string;\r\n}", "private function update($cat){\r\n\t\tif(!$this->acceptUpdates) return;//do not allow health coach to change answers\r\n\t\tif(!isset($this->categories[$cat])) throw new Exception(\"Invalid category\");\r\n\r\n\t\t$sql=\"UPDATE `u_mod_ifocus` SET \";\r\n\t\t$comma=false;\r\n\t\tforeach($this->data[$cat] as $key=>$value){\r\n\t\t\tif($comma) $sql.=\" , \";\r\n\t\t\t$sql.=\"`\".$key.\"`='\".$this->dbOb->escape_string($value).\"'\";\r\n\t\t\t$comma=true;\r\n\t\t}\r\n\t\tif(!$comma) return; //cant update a section we have no data for\r\n\t\tif(!$this->id) return; //can't update a record we haven't loaded\r\n\r\n\t\t$sql .= \", last_completed = '\" . $cat . \"'\";\r\n\r\n\t\tif($cat==\"biometric_data\"){\r\n\t\t\tif(!$this->isCompleted()) $sql.=\", date_completed=NOW() \";\r\n\t\t\t//upon completion reward points for Health Assessment Questions\r\n\t\t\t$im=new IncentivePointsModel();\r\n\t\t\tif($this->data[\"preventative_health\"][\"q12\"]==1){\r\n\t\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"FluShot\");\r\n\t\t\t}\r\n\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"Complete\");\r\n\t\t}\r\n\r\n\t\t$sql .= \" ,date_updated=NOW() WHERE id = '\" . $this->data['id'] . \"'\";\r\n\t\t$this->dbOb->update($sql);\r\n\t}", "function realstate_form($catId = null) {\n if ($catId!= null) {\n // We check if the category is the same as our plugin\n if (osc_is_this_category('realstate_plugin', $catId)) {\n $conn = getConnection() ;\n $data = $conn->osc_dbFetchResults('SELECT * FROM %st_item_house_property_type_attr', DB_TABLE_PREFIX);\n $p_type = array();\n foreach ($data as $d) {\n $p_type[$d['fk_c_locale_code']][$d['pk_i_id']] = $d['s_name'];\n }\n unset($data);\n include_once 'item_edit.php';\n }\n }\n}", "function get_category_to_edit($id)\n {\n }", "public function update_cat_att()\n\t\t{\n\t\t\t$id=$this->input->post('cat_id');\n\t\t\t$cat_name=$this->input->post('cat_edit_name');\n\t\t\t$update=$this->db->where(\"f_att_id\",$id)->update('food_attribute',array(\"f_att_name\"=>$cat_name));\n\t\t\tif($update)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t}", "public function editAction($cat_id)\n\t{\n\t\t$this->oView->box_title = \"Edit Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\t\t\t\t\n\t\t$this->oView->link_url = site_url('dashboard/category/edit/'.$cat_id);\n\t\t$this->oView->cat_id = $cat_id;\n\t\t\n\t\t$objCat = new Category();\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\n\t\t\t$objCat->update($cat_id,$data);\n\t\t\n\t\t}\n\n\t\t$rowCat = $objCat->get($cat_id);\n\t\t\n\t\t$rowParentCat = $objCat->get($rowCat['parent_id']);\n\t\t$rowCat['parent_code'] = $rowParentCat['code'];\n\t\tif ($rowParentCat['code'] == 0) \n\t\t\t$rowCat['parent_code'] = \"ROOT\";\n\t\t\n\t\t$this->oView->rowCat = $rowCat;\t\t\n\t\t\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "public static function viewCategoryUpdate($cat_id,$par)\n\t {\n\t\t\t\t\n\t\t\t\t\n\t\t $nsubdata=mysql_query(\"select * from category where cat_par_id='$cat_id'\");\n\t\t\t\twhile($sub_cat=mysql_fetch_array($nsubdata))\n\t\t\t\t{\n\t\t\t\t\tif($sub_cat['cat_id']==$par)\n\t\t\t\t\t{\n\t\t\t\t\t echo '<option selected=\"selected\" value=\"'.$sub_cat['cat_id'].'\" style=\"margin-left:'.Actions::$s*Actions::$r.'px;\">'.ucfirst($sub_cat['cat_title']).'</option>';\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t echo '<option value=\"'.$sub_cat['cat_id'].'\" style=\"margin-left:'.Actions::$s*Actions::$r.'px;\">'.ucfirst($sub_cat['cat_title']).'</option>';\n\t\t\t\t\t}\n\t\t\t\t\t if(mysql_num_rows(mysql_query(\"select * from category where cat_par_id='\".$sub_cat['cat_id'].\"'\"))>0)\n\t\t\t {\n\t\t\t\t\t\t\tActions::$r++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t Actions::viewCategoryUpdate($sub_cat['cat_id'],$par);\n\t\t\t\t\t }\n\t\t\t\t\t \t \t\n\t\t\t\t\t \n\t\t\t\t\n\t\t\t\t}\n\t\t\tActions::$r--;\t\n\n\t }", "function category_edit($id)\n\t{\n\t\tglobal $db;\n\t\t$ccnoprice = $_POST['ccnoprice'];\n\t\t$sSQL = \"UPDATE \".PREFIX.\"categories SET ccnoprice='\".$ccnoprice.\"', ccTemplate='\".mysql_real_escape_string($_POST['ccTemplate']).\"' WHERE id=\".$id;\n\t\t$db->query($sSQL);\n\t}", "public function page_add_edit_cat()\n\t{\n\t\t// Edition\n\t\t$cat_name = '';\n\t\tif ($this->mode == 'edit_cat')\n\t\t{\n\t\t\t$sql = 'SELECT cat_name\n\t\t\t\t\tFROM ' . SQL_PREFIX . 'smilies_cat\n\t\t\t\t\tWHERE cat_id = ' . $this->id;\n\t\t\t$result = Fsb::$db->query($sql);\n\t\t\t$data = Fsb::$db->row($result);\n\t\t\tif (!$data)\n\t\t\t{\n\t\t\t\t$this->mode = 'add_cat';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tFsb::$db->free($result);\n\t\t\t\t$cat_name = $data['cat_name'];\n\t\t\t}\n\t\t}\n\n\t\tFsb::$tpl->set_switch('smileys_add_cat');\n\t\tFsb::$tpl->set_vars(array(\n\t\t\t'L_ADD_EDIT' =>\t\t($this->mode == 'add_cat') ? Fsb::$session->lang('adm_smiley_add_cat') : Fsb::$session->lang('adm_smiley_edit_cat'),\n\t\t\t'CAT_NAME' =>\t\t$cat_name,\n\n\t\t\t'U_ACTION' =>\t\tsid('index.' . PHPEXT . '?p=posts_smiley&amp;mode=' . $this->mode . '&amp;id=' . $this->id),\n\t\t));\n\t}", "public function edit($id)\n {\n $data = $this->Category->findData($id);\n $catalogue = Catelog::get();\n\t\tif($data->in_home==\"on\"){\n\t\t\t$is_Selected=\"checked\";\n\t\t}else{\n\t\t\t$is_Selected=\"\";\n\t\t}\n $html = '<div class=\"form-group error\"></div>\n <label for=\"categories_name\">Name</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"text\" id=\"editcategories_name\" name=\"categories_name\" value=\"'.$data->categories_name.'\" class=\"form-control\" placeholder=\"Enter your category name\">\n </div>\n </div>\n <label for=\"catelogue_id\">Catalogue</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <select class=\"form-control\" id=\"editcatelogue_id\" name=\"catelogue_id\">\n <option value=\"\">-- Please select --</option>';\n foreach($catalogue as $key)\n {\n $status=\"\";\n if($data->catelogue_id==$key->id){\n $status=\"selected\";\n }\n $html .= '<option value=\"'.$key->id.'\" '.$status.'>'.$key->catelogue_name.'</option> ';\n }\n $html .= ' </select>\n </div>\n </div>\n <label for=\"image\">Images</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"file\" name=\"image_1\" id=\"image_1\" placeholder=\"Choose image\" > \n </div>\n </div>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <img src=\"'.asset('storage/category/'.$data->image).'\" name=\"old_img\" width=\"50px\" height=\"50px\"> \n </div>\n </div>\n <label for=\"description\">Description</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"text\" id=\"editDescription\" name=\"Description\" value=\"'.$data->description.'\" class=\"form-control\" placeholder=\"Enter your description\">\n </div>\n </div>\n\t\t\t\t <label for=\"description\">Show In Home</label>\n <div class=\"form-group\">\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"in_home\" name=\"in_home\" class=\"form-control\" '.$is_Selected.'>\n\t\t\t\t\t</div>\n <br>\n ';\n return response()->json(['html'=>$html]);\n }", "public function edit(Category $Category)\n {\n //\n }", "function modifyCategory()\n{\n global $connection;\n global $updateCategorySuccess, $updateCategoryError;\n $updateCategorySuccess = $updateCategoryError = '';\n\n if (isset($_POST['btn_save_category'])) {\n $category_id = $_POST['txt_userid'];\n\n $updateColumncategory = '';\n\n $category_name = htmlentities($_POST['category_name']);\n if (!empty($category_name)) {\n $updateColumncategory .= \"category = '$category_name',\";\n }\n\n $updateColumncategory = rtrim($updateColumncategory, ',');\n\n $query_update = \"UPDATE product_category SET $updateColumncategory WHERE id_category = '$category_id'\";\n $result_update = mysqli_query($connection, $query_update);\n\n if ($result_update) {\n $updateCategorySuccess = '<script language=\"javascript\">\n swal(\"Sukses!\", \"Kategoria u modifikua me sukses!\", \"success\")\n </script>';\n } else {\n $updateCategoryError = '<script language=\"javascript\">\n swal(\"Gabim!\", \"Ka ndodhur një gabim gjatë modifikimit të kategorisë! Provoni përsëri!\", \"error\")\n </script>';\n }\n }\n}", "public function change()\n\t{\n\t\t$result = $this->helper_categories_model->getCategories();\n\t\t$this->template\n\t\t\t->title('您期望添加到哪个分类')\n\t\t\t->set_layout(FALSE)\n\t\t\t->set('data', $result)\n\t\t\t->build('admin/helper/change');\n\t}", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "public function editCategory($editCategory) {\n if (isset($editCategory)) {\n\n $data = array(\n 'name' => $editCategory['name'],\n 'support_emails' => $editCategory['support_emails'],\n 'quantity_enabled' => $editCategory['quantity_enabled']\n );\n \n if (isset($editCategory['supplier_user'])) {\n $data['supplier_user'] = $editCategory['supplier_user'];\n }\n \n if (isset($editCategory['custom_fields'])) {\n $data['custom_fields'] = $editCategory['custom_fields'];\n } else {\n $data['custom_fields'] = NULL;\n }\n $this->db->where('id', $editCategory['category_id']);\n $this->db->update('categories', $data);\n return TRUE;\n } else {\n return False;\n }\n }", "public function update()\n {\n $category = CategoryService::load(\\Request::input('id'))->update(\\Request::all());\n \\Msg::success($category->name . ' has been <strong>updated</strong>');\n return redir('account/categories');\n }", "public function updateCategory(){\n\t\t \n\t\t$file_id = $this->category_model->updateCategory($_POST['id'],$_POST['name']);\n\t\t echo $file_id;\n\t\t\t\t\n }", "public function testUpdateItemSubCategory()\n {\n }", "static public function ctrEditarCategorias(){\n if (isset($_POST[\"editarCategoria\"])) {\n\n if (preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarCategoria\"])){\n\t\t\t\t\t$tabla1 = \"categorias\";\n\t\t\t\t\t$respuesta1 = ModeloCategorias::MdlMostrarCategorias123($tabla1);\n\n\t\t\t\t\tforeach ($respuesta1 as $key => $value) {\t\n\t\t\t\t\t\tif(strtoupper($_POST[\"editarCategoria\"]) == strtoupper($value[\"categoria\"])){\n\t\t\t\t\t\t\t$respuesta12 = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif($respuesta12){\n\n\t\t\t\t\t\techo'<script>\n\t\t\t\n\t\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: \"¡La categoria ya existe en la bd!\",\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\t}).then(function(result){\n\t\t\t\t\t\t\t\t\t\tif (result.value) {\n\t\t\t\n\t\t\t\t\t\t\t\t\t\twindow.location = \"categorias\";\n\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\n\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\n\t\t\t\t\t\t$tabla = \"categorias\";\n\t\t\t\t\t\t$datos = array(\"categoria\"=>$_POST[\"editarCategoria\"],\n\t\t\t\t\t\t\t\t\t\t\"id_categoria\"=>$_POST[\"idCategoria\"]); \n\t\t\t\t\t\t$respuesta = ModeloCategorias::mdlEditarCategoria($tabla,$datos);\n\n\t\t\t\t\t\tif ($respuesta == \"ok\") {\n\t\t\t\t\t\t\techo '<script>\n\n\t\t\t\t\t\t\tswal({\n\n\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\ttitle: \"¡La categoria a sido cambiada correctamente!\",\n\t\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\n\t\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\n\t\t\t\t\t\t\t\t\twindow.location = \"categorias\";\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t</script>';\n\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t}else{\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype: \"error\",\n\t\t\t\t\t\t\ttitle: \"¡El nombre no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\t\tshowConfirmButton: true,\n\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t\t}).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\twindow.location = \"categorias\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\n\t\t}", "public function edit_postAction() {\r\n\t\t$info = $this->getPost(array('id', 'sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$ret = Game_Service_Category::updateCategory($info, intval($info['id']));\r\n\t\tif (!$ret) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功.'); \t\t\r\n\t}", "public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }", "public function edit(Categoria $categoria)\n {\n //\n }", "public function edit(Categoria $categoria)\n {\n //\n }", "public function edit(Categoria $categoria)\n {\n //\n }", "function editar_categoria($id,$nome_categoria){\n\t\t$bd = new bd_connection();\n\t\t\n\t\t// inclui uma nova cidade\n\t\t$retorno = $bd->editarCategoria($id,$nome_categoria);\n\t\t\n\t\tif($retorno) {\n\t\t\t// ecluido com sucesso\n\t\t\techo \"<script>window.alert('\".$nome_categoria.\" foi editada com sucesso.');</script>\";\n\t\t}\n\t\telse { // falha ao excluir\n\t\t\techo \"<script>window.alert('Falha ao editar esta Categoria!');</script>\";\n\t\t}\n\r\n\t\t//volta para a pagina de cidades\n\t\techo\"<script>window.open('adm.php?pg=2','_self')</script>\";\n\t\n\t}", "function saveCat()\n {\n //update stuff\n }", "public function edit(CourseCategory $courseCategory)\n {\n //\n }", "function action_edit($params) {\n $form_error =false;\n $category= model_category::load_by_id($params[0]);\n $id =$params[0];\n if(isset($_POST['form']['action1'])) {\n //Check if the \"Ok\" button is set.\n\n //Modify category name.\n if( model_category::editC($id,$_POST['form']['name'])){\n header('Location: ' . APP_URL . 'category/list');\n die;\n\n }\n $form_error =false;\n }\n if(isset($_POST['form']['action2'])) {\n @include_once APP_PATH . 'view/category_edit.tpl.php';\n }\n @include_once APP_PATH . 'view/category_edit.tpl.php';\n }", "function categoryEdit($str=''){\n\tif(startSession() && isset($_SESSION['UserID']))\n\t{\n\n\t\t$myCatID = ($_GET[\"id\"]);\n\t\t# ADD - DateCreated, DateAssigned, LastUpdated to table\n\t\t$sql = \"select CatID, CatTitle, CatType, CatSort, CatDescription, CatVisible\n\t\t\tFROM ma_Categories WHERE CatID = $myCatID ;\";\n\n\t\t$result = mysqli_query(IDB::conn(),$sql) or die(trigger_error(mysqli_error(IDB::conn()), E_USER_ERROR));\n\n\t\tif (mysqli_num_rows($result) > 0)//at least one record!\n\t\t{//show results\n\n\t\t# shows details from a single customer, and preloads their first name in a form.\n\t\t$str .= '\n\t\t<script type=\"text/javascript\" src=\"' . VIRTUAL_PATH . 'include/util.js\"></script>\n\n\t\t<script type=\"text/javascript\">\n\n\t\t\tfunction checkForm(thisForm)\n\n\t\t\t{//check form data for valid info\n\t\t\t\tif(empty(thisForm.FirstName,\"Please Enter Customer\\'s First Name\")){return false;}\n\t\t\t\tif(empty(thisForm.LastName,\"Please Enter Customer\\'s Last Name\")){return false;}\n\t\t\t\tif(!isEmail(thisForm.Email,\"Please Enter a Valid Email\")){return false;}\n\t\t\t\treturn true;//if all is passed, submit!\n\t\t\t}\n\n\t\t</script>';\n\n\n\t\t$str .= '<form action=\"' . THIS_PAGE . '\" method=\"post\" onsubmit=\"return checkForm(this);\">';\n\n\t\t\twhile ($row = mysqli_fetch_assoc($result))\n\t\t\t{//dbOut() function - 'wrapper' to strip slashes, etc. of data leaving db\n\t\t\t\t$catID \t\t\t\t\t\t= dbOut($row['CatID']);\n\t\t\t\t$catTitle \t\t\t= dbOut($row['CatTitle']);\n\t\t\t\t$catType \t\t\t\t\t= dbOut($row['CatType']);\n\t\t\t\t$catSort \t\t\t\t= dbOut($row['CatSort']);\n\t\t\t\t$catDescription\t\t= dbOut($row['CatDescription']);\n\t\t\t\t$catVisible \t\t\t= dbOut($row['CatVisible']);\n\n\t\t\t\t$str .= '<form action=\"' . THIS_PAGE . '\" method=\"post\"\n\t\t\t\t\tonsubmit=\"return checkForm(this);\">\n\n\t\t\t\t\t\t\t<input type=\"hidden\" name=\"CatID\" value=\"' . $catID . '\" />\n\n\t\t\t\t\t\t\t<h4 align=\"center\">Edit Catagory (' . $catTitle . ')</h4>\n\n\t\t\t\t\t\t\t<!-- inner container -->\n\t\t\t\t\t\t\t<div class=\"class=\"col-sm-9 pull-right\" style=\"background-color: #aaa;\">\n\n\t\t\t\t\t\t\t\t<!-- left container -->\n\t\t\t\t\t\t\t\t<div class=\"col-sm-8 pull-left\" style=\"background-color: #ddd ;\">\n\n\t\t\t\t\t\t\t\t\t<div class=\"row \">\n\t\t\t\t\t\t\t\t\t\t<div class=\"pull-middle\">\n\n\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatType\" required>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"IC\" select=\"select\">Category Type: IC</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"OOC\" >Category Type: OOC</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"organization\" select=\"select\">Group By: Indivual</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"team\" >Group By: Group/Team</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"person\" >Group By: Organization</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t\t\t\t<select class=\"selectpicker\" name=\"CatSort\" required>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"0\" select=\"select\">Visible: Yes</option>\n\t\t\t\t\t\t\t\t\t\t\t\t<option value=\"1\" >Visible: No</option>\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\t\t\t\tclass=\"col-sm-12\"\n\t\t\t\t\t\t\t\t\t\t\ttype=\"text\"\n\n\t\t\t\t\t\t\t\t\t\t\tname=\"CatTitle\"\n\t\t\t\t\t\t\t\t\t\t\tvalue=\"' . $catTitle . '\"\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"Team/Group/Character Name here\"/>\n\t\t\t\t\t\t\t\t\t</div><!-- END Container -->\n\n\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t<textarea\n\t\t\t\t\t\t\t\t\t\t\tname=\"CatDescription\"\n\n\t\t\t\t\t\t\t\t\t\t\tclass=\"autoExpand col-sm-12\"\n\t\t\t\t\t\t\t\t\t\t\trows=\"3\"\n\t\t\t\t\t\t\t\t\t\t\tdata-min-rows=\"3\"\n\n\t\t\t\t\t\t\t\t\t\t\tplaceholder=\"Catagroy Description\"\n\t\t\t\t\t\t\t\t\t\t\t>' . $catDescription . '</textarea>\n\t\t\t\t\t\t\t\t\t</div><!-- end container-->\n\n\t\t\t\t\t\t\t\t</div><!-- end inner container -->\n\n\t\t\t\t\t\t\t<div class=\"clearfix\">\n\t\t\t\t\t\t\t\t<br /><br />\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\talign=\"center\"\n\t\t\t\t\t\t\t\tstyle=\"background-color: #a0a;\">\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"act\" value=\"categoryRevise\" />\n\n\n\n\n\n\n\n\t\t\t\t\t\t\t\t<input class=\"btn btn-primary btn-xs outline\" type=\"submit\" value=\"Edit Catagory\">\n\n\t\t\t\t\t\t\t\t&nbsp; &nbsp;\n\n\t\t\t\t\t\t\t\t<a class=\"btn btn-primary btn-xs outline\" href=\"' . THIS_PAGE . '\">Exit Event</a>';\n\n\t\t\t\t\t\t\t\tif(startSession() && isset($_SESSION['UserID'])){\n\t\t\t\t\t\t\t\t\t$str .= '&nbsp; &nbsp;\n\n\t\t\t\t\t\t\t\t\t<!-- set to invisible actually -->\n\t\t\t\t\t\t\t\t\t<a class=\"btn btn-primary btn-xs outline\" href=\"' . THIS_PAGE . '?act=categoryRemove&id=' . $catID . '&categoryName=' . formatUrl($catTitle) . '\">Remove Catagory</a>';\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$str .= '</div>\n\n\t\t\t\t\t\t</form>';\n\n\t\t\t\t\t}\n\n\t\t\t\t}else{//no records\n\t\t\t\t\t$str .= '<div align=\"center\">\n\t\t\t\t\t\t<h3>Currently No Events Listed in the Timeline.</h3>\n\t\t\t\t\t</div>';\n\t\t\t\t}\n\n\t\t\treturn $str;\n\n\t\t\t@mysqli_free_result($result); //free resources\n\n\t\t} else { #redirect back to timeline\n\n\t\t\t#myRedirect('index.php');\n\t\t}\n}", "function alterarCategoria() {\n\n\t\t$codigoParaAlterar = $_POST['textCodigoCategoria'];\n\t\t$nomeEdicaoCategoria = $_POST['textCategoria'];\n\n\t\tif (true){\n\n\t\t\techo '<div class=\"alert alert-success\"><strong> A categoria \"'.$nomeEdicaoCategoria.'\" editado com sucesso!'.$codigoParaAlterar.'</strong> </div>';\n\n\t\t}else{\n\n\t\t\techo \"<div class='alert alert-danger espacoForm'><strong>Edição não realizada!</strong> Ocorreu um erro.</div>\";\n\n\t\t}\n\n\n\t}", "public function edit(Postcategory $postcategory)\n {\n //\n }", "public function edit(category $category)\n {\n return \"category\";\n //\n }", "public function edit(PageCategory $pageCategory)\n {\n //\n }", "static public function ctrEditarCategoria(){\n\t\n\tif(isset($_POST[\"editarCategoria\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/',$_POST[\"editarCategoria\"])){\n\n\t\t\t\t$tabla=\"categorias\";\n\n\t\t\t\t$datos= array('categoria' => $_POST[\"editarCategoria\"], 'idCategoria'=>$datos=$_POST[\"idCategoria\"]); \n\t\t\t\t\n\n\t\t\t\t$respuesta=ModelCategoria::mdlEditarCategoria($tabla, $datos);\n\n\n\t\t\t\tif($respuesta==\"ok\"){\n\n\t\t\t\t\techo '<script> \n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype:\"success\",\n\t\t\t\t\t\t\ttitle:\"¡La categoria ha sido editada correctamente!\",\n\t\t\t\t\t\t\tshowConfirmButton:true,\n\t\t\t\t\t\t\tconfirmButtonText:\"cerrar\",\n\t\t\t\t\t\t\tclaseOnConfirm:false\n\t\t\t\t\t\t\t}).then((result)=>{\n\n\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\twindow.location=\"categorias\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t </script>';\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse{\n\n\t\t\t\techo '<script> \n\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttype:\"error\",\n\t\t\t\t\t\t\ttitle:\"¡La categoria no puede ir vacia o llevar caracteres especiales!\",\n\t\t\t\t\t\t\tshowConfirmButton:true,\n\t\t\t\t\t\t\tconfirmButtonText:\"cerrar\",\n\t\t\t\t\t\t\tclaseOnConfirm:false\n\t\t\t\t\t\t\t}).then((result)=>{\n\n\t\t\t\t\t\t\t\tif(result.value){\n\t\t\t\t\t\t\t\t\twindow.location=\"categorias\";\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t});\n\n\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t </script>';\n\n\n\t\t\t}\n\n\t\t}\n\n\n\n}", "function shophead_edit($category_id = \"\")\n {\n $this->layout = 'admin_layout';\n $id = base64_decode($category_id);\n // pr($id);\n $this->loadModel('ProductCategory');\n $data = $this->ProductCategory->find('first', array('conditions' => array('ProductCategory.id' => $id)));\n if (!empty($data)) {\n if (!empty($this->request->data)) {\n $this->request->data = Sanitize::clean($this->request->data, array('encode' => false));\n $this->ProductCategory->set($this->request->data);\n if ($this->request->data['ProductCategory']['name'] == $data['ProductCategory']['name']) {\n unset($this->request->data['ProductCategory']['name']);\n }\n if ($this->ProductCategory->validates()) {\n if ($this->ProductCategory->save($this->request->data)) {\n $this->Session->write('flash', array(EDIT_RECORD, 'success'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n } else {\n $this->Session->write('flash', array(FAILURE_MSG, 'failure'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }\n }\n $this->request->data = $data;\n } else {\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }", "public function actionCategoryEdit()\n {\n $this->_assertCanManageCategories();\n $category_id = $this->_input->filterSingle('faq_id', XenForo_Input::UINT);\n $viewParams = array('faqcategory' => $this->_getCategoryModel()->getById($category_id));\n return $this->responseView('Iversia_FAQ_ViewPublic_Category', 'iversia_faq_edit_category', $viewParams);\n }", "function edit($esta_categoria)\n {\n if($this->acceso(436)){\n // check if the categoria exists before trying to edit it\n $categoria = str_replace(\"%20\", \" \", $esta_categoria);\n $data['categoria'] = $this->Categoria_model->get_categoria($categoria);\n\n if(isset($data['categoria']['categoria']))\n {\n $this->load->library('form_validation');\n $this->form_validation->set_rules('categoria','Nombre','trim|required', array('required' => 'Este Campo no debe ser vacio'));\n $this->form_validation->set_rules('codigo_cat','Código','trim|required', array('required' => 'Este Campo no debe ser vacio'));\n if($this->form_validation->run()) \n {\n $params = array(\n 'categoria' => $this->input->post('categoria'),\n 'codigo_cat' => $this->input->post('codigo_cat'),\n );\n $this->Categoria_model->update_categoria($categoria,$params); \n redirect('categoria/index');\n }\n else\n {\n $data['_view'] = 'categoria/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The categoria you are trying to edit does not exist.');\n }\n }", "static public function ControllerEditarCategoria(){\n //evaluamos igual si viene una categoria\n if(isset($_POST[\"editarCategoria\"])){\n //validaciones\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarCategoria\"])){\n //tabla y arreglos\n\t\t\t\t$tabla = \"categorias\";\n\n\t\t\t\t$datos = array(\"categoria\"=>$_POST[\"editarCategoria\"],\n\t\t\t\t\t\t\t \"id\"=>$_POST[\"idCategoria\"]);\n //lo enviamos al modelo\n\t\t\t\t$respuesta = ModeloCategorias::ModeloEditarCategoria($tabla, $datos);\n //si edita que envie una respuesta\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"La categoría ha sido cambiada correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"categorias\";\n\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</script>';\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n // en caso contrarios\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡La categoría no puede ir vacía o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"categorias\";\n\n\t\t\t\t\t\t\t}\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 }", "function fm_update_category($name, $catid = NULL, $groupid = 0) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($catid != NULL) {\r\n\t\t$update->id = $catid;\r\n\t\t$update->name = $name;\r\n\t\t$update->timemodified = time();\r\n\t\tif (!update_record('fmanager_categories', $update)) {\r\n\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\t$new->name = $name;\r\n\t\tif ($groupid == 0){\r\n\t\t\t$new->owner = $USER->id;\r\n\t\t\t$new->ownertype = OWNERISUSER;\r\n\t\t} else {\r\n\t\t\t$new->owner = $groupid;\r\n\t\t\t$new->ownertype = OWNERISGROUP;\r\n\t\t}\r\n\t\t$new->timemodified = time();\r\n\t\tif (!insert_record('fmanager_categories', $new)) {\r\n\t\t\terror(get_string(\"errnoinsert\",'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "public function edit(booksCategory $booksCategory)\n {\n //\n }", "public function edit(booksCategory $booksCategory)\n {\n //\n }", "function update_categories(){\n\t\t\tprint_r($this->input->post());\n\t\t}", "function display_addcategory_form($category_name='', $id='')\r\n{\r\n\tglobal $dropbox_cnf;\r\n\r\n\t$title=get_lang('AddNewCategory');\r\n\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\t// retrieve the category we are editing\r\n\t\t$sql=\"SELECT * FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t\t$result=api_sql_query($sql);\r\n\t\t$row=mysql_fetch_array($result);\r\n\r\n\t\tif ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked)\r\n\t\t{\r\n\t\t\t$category_name=$row['cat_name'];\r\n\t\t}\r\n\t\tif ($row['received']=='1')\r\n\t\t{\r\n\t\t\t$target='received';\r\n\t\t}\r\n\t\tif ($row['sent']=='1')\r\n\t\t{\r\n\t\t\t$target='sent';\r\n\t\t}\r\n\t\t$title=get_lang('EditCategory');\r\n\r\n\t}\r\n\r\n\tif ($_GET['action']=='addreceivedcategory')\r\n\t{\r\n\t\t$target='received';\r\n\t}\r\n\tif ($_GET['action']=='addsentcategory')\r\n\t{\r\n\t\t$target='sent';\r\n\t}\r\n\r\n\r\n\techo \"<form name=\\\"add_new_category\\\" method=\\\"post\\\" action=\\\"\".api_get_self().\"?view=\".$_GET['view'].\"\\\">\\n\";\r\n\techo '<strong>'.$title.'</strong>';\r\n\tif (isset($id) AND $id<>'')\r\n\t{\r\n\t\techo '<input name=\"edit_id\" type=\"hidden\" value=\"'.$id.'\">';\r\n\t}\r\n\techo '<input name=\"target\" type=\"hidden\" value=\"'.$target.'\">';\r\n\techo \"<table border=\\\"0\\\">\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo get_lang('CategoryName').': ';\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"text\\\" name=\\\"category_name\\\" value=\\\"\".$category_name.\"\\\" />\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"\\t<tr>\\n\";\r\n\techo \"\\t<td valign=\\\"top\\\">\\n\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t<td>\\n\";\r\n\techo \"<input type=\\\"submit\\\" name=\\\"StoreCategory\\\" value=\\\"\".get_lang('Ok').\"\\\">\";\r\n\techo \"\\t</td>\\n\";\r\n\techo \"\\t</tr>\\n\";\r\n\techo \"</table>\\n\";\r\n\techo \"</form>\";\r\n}", "function addExtraCategoryFields($tag, $edit_form = false) {\n\t\tif($this->checkPermissions()) {\n\t\t\t$form_row_title = __('This category is a course', lepress_textdomain);\n\t\t\t$form_row_desc = __('Is this category a course for students ?', lepress_textdomain);\n\t\t\t$form_row_title2 = __('Open access course', lepress_textdomain);\n\t\t\t$form_row_desc2 = __('Can participant subscribe to this course without teacher\\'s verification ?', lepress_textdomain);\n\t\t\t$form_row_title3 = __('Course teachers', lepress_textdomain);\n\t\t\t$form_row_desc3 = __('Choose additional teachers for this course (Only current WordPress installation users).', lepress_textdomain);\n\t\t\t$form_row_title4 = __('Advertise this course', lepress_textdomain);\n\t\t\t$form_row_desc4 = __('Advertise this course on LePress Courses Sitewide widget ?', lepress_textdomain);\n\t\t\t$form_row_title5 = __('Close this course', lepress_textdomain);\n\t\t\t$form_row_desc5 = __('Close this course <b>CAUTION!</b> Cannot be undone! no changes can be made to course data!', lepress_textdomain);\n\t\t\t\n\t\t\tglobal $current_user;\n\t\t\tget_currentuserinfo();\n\t\t\tif(function_exists('get_users')) {\n\t\t\t\t$users = get_users(array('role' => 'lepress_teacher', 'exclude' => array($current_user->ID)));\n\t\t\t} else {\n\t\t\t\t$users = get_users_of_blog();\n\t\t\t}\n\t\t\t//Get also super admins, they are allowed to be teachers too\n\t\t\tif(is_super_admin()) {\n\t\t\t\tforeach(get_super_admins() as $super_user_login) {\n\t\t\t\t\t$user = get_user_by('login', $super_user_login);\n\t\t\t\t\t$users[] = $user;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//If new category page\n\t\t\tif(!$edit_form) {\n\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course\" name=\"lepress-course\" value=\"1\"/>';\n\t\t\t\techo '<label for=\"lepress-course\">'.$form_row_title.'</label>';\n\t\t\t\techo '<p>'.$form_row_desc.'</p>';\n\t\t\t\techo '</div>';\n\n\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course-open-access\" name=\"lepress-course-open-access\" value=\"1\" />';\n\t\t\t\techo '<label for=\"lepress-course-open-access\">'.$form_row_title2.'</label>';\n\t\t\t\techo '<p>'.$form_row_desc2.'</p>';\n\t\t\t\techo '</div>';\n\n\t\t\t\techo '<div style=\"margin:0 0 10px; padding: 8px;\">';\n\t\t\t\techo '<input type=\"hidden\" value=\"'.$current_user->ID.'\" name=\"lepress-course-teachers['.$current_user->ID.']\" />';\n\t\t\t\techo '<label><b>'.$form_row_title3.'</b></label>';\n\t\t\t\tforeach($users as $user) {\n\t\t\t\t\tif($user->ID != $current_user->ID) {\n\t\t\t\t\t\t$userdata = get_userdata($user->ID);\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"lepress-course-teachers['.$user->ID.']\" value=\"0\"/>';\n\t\t\t\t\t\techo '<div style=\"margin-left: 4px;\"><input type=\"checkbox\" class=\"lepress-teacher\" value=\"'.$user->ID.'\" name=\"lepress-course-teachers['.$user->ID.']\" /> '.(!empty($userdata->user_firstname) ? $userdata->user_firstname : $userdata->user_login).' '.$userdata->user_lastname.'</div>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Found only one user - current user\n\t\t\t\tif(count($users) <= 1) {\n\t\t\t\t\techo '<p><b>'.__('No LePress teachers found', lepress_textdomain).' <a href=\"'.admin_url().'user-new.php'.'\">'.__('Add here', lepress_textdomain).'</a></b></p>';\n\t\t\t\t}\n\t\t\t\techo '<p>'.$form_row_desc3.'</p>';\n\t\t\t\techo '</div>';\n\t\t\t\t\n\t\t\t\t//IF multisite, add advertise checkbox\n\t\t\t\tif(is_multisite()) {\n\t\t\t\t\techo '<div class=\"form-field lepress-field\">';\n\t\t\t\t\techo '<input type=\"checkbox\" id=\"lepress-course-advertise\" name=\"lepress-course-advertise\" value=\"1\" />';\n\t\t\t\t\techo '<label for=\"lepress-course-advertise\">'.$form_row_title4.'</label>';\n\t\t\t\t\techo '<p>'.$form_row_desc4.'</p>';\n\t\t\t\t\techo '</div>';\n\t\t\t\t}\t\t\t\n\t\t\t} else { //If edit category page\n\t\t\t\t$course_meta = new CourseMeta($tag->term_id);\n\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course\">'.$form_row_title.'</label></th>';\n\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course\" value=\"0\"/>';\n\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course\" '.($course_meta->getIsCourse() ? 'checked=checked':'').' '.($course_meta->hasSubscriptions() ? 'disabled=\"disabled\"' : '').' name=\"lepress-course\" value=\"1\"/><br />';\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc.' '.__('You <b>cannot change</b> this, if course has <b>active subscriptions</b>', lepress_textdomain).'</span></td>';\n\t\t\t\techo '</tr>';\n\n\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title2.'</label></th>';\n\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-open-access\" value=\"0\" />';\n\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course-open-access\" '.($course_meta->getAccessType() ? 'checked=checked':'').' name=\"lepress-course-open-access\" value=\"1\"/><br />';\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc2.'</span></td>';\n\t\t\t\techo '</tr>';\n\n\t\t\t\techo '<tr>';\n\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title3.'</label></th>';\n\t\t\t\techo '<td>';\n\t\t\t\tforeach($users as $user) {\n\t\t\t\t\tif($user->ID != $current_user->ID) {\n\t\t\t\t\t\t$userdata = get_userdata($user->ID);\n\t\t\t\t\t\t$isTeacher = $course_meta->isTeacher($user->ID) ? 'checked=\"checked\"' : '';\n\t\t\t\t\t\techo '<input type=\"hidden\" name=\"lepress-course-teachers['.$user->ID.']\" value=\"0\"/>';\n\t\t\t\t\t\techo '<div><input class=\"lepress-edit-form-field\" type=\"checkbox\" value=\"'.$user->ID.'\" '.$isTeacher.' name=\"lepress-course-teachers['.$user->ID.']\" /> '.(!empty($userdata->user_firstname) ? $userdata->user_firstname : $userdata->user_login).' '.$userdata->user_lastname.'</div>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Found only one user - current user\n\t\t\t\tif(count($users) <= 1) {\n\t\t\t\t\techo '<p><b>'.__('No LePress teachers found', lepress_textdomain).' <a href=\"'.admin_url().'user-new.php'.'\">'.__('Add here', lepress_textdomain).'</a></b></p>';\n\t\t\t\t}\n\t\t\t\techo '<span class=\"description\">'.$form_row_desc3.'</span></td>';\n\t\t\t\techo '</tr>';\n\t\t\t\t\n\t\t\t\t//IF is multisite, add advertise checkbox\n\t\t\t\tif(is_multisite()) {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-open-access\">'.$form_row_title4.'</label></th>';\n\t\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-advertise\" value=\"0\" />';\n\t\t\t\t\techo '<input class=\"lepress-edit-form-field\" type=\"checkbox\" id=\"lepress-course-advertise\" '.($course_meta->getAdvertise() ? 'checked=checked':'').' name=\"lepress-course-advertise\" value=\"1\"/><br />';\n\t\t\t\t\techo '<span class=\"description\">'.$form_row_desc4.'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!$course_meta->getIsClosed()) {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-locked\">'.$form_row_title5.'</label></th>';\n\t\t\t\t\techo '<td><input type=\"hidden\" name=\"lepress-course-locked\" value=\"0\" />';\n\t\t\t\t\techo '<input type=\"checkbox\" class=\"lepress-edit-form-field\" id=\"lepress-course-locked\" '.($course_meta->getIsClosed() ? 'checked=checked':'').' name=\"lepress-course-locked\" value=\"1\"/><br />';\n\t\t\t\t\techo '<span class=\"description\">'.$form_row_desc5.'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t} else {\n\t\t\t\t\techo '<tr class=\"form-field\">';\n\t\t\t\t\techo '<th scope=\"row\" valign=\"top\"><label for=\"lepress-course-locked\">'.__('Export', lepress_textdomain).'</label></th>';\n\t\t\t\t\techo '<td>';\n\t\t\t\t\techo '<a href=\"\">'.__('Export current state',lepress_textdomain).'</a><br />';\n\t\t\t\t\techo '<a href=\"'.add_query_arg(array('page' => 'lepress-import-export', 'export_tpl' => $tag->term_id), admin_url().'admin.php').'\">'.__('Export as template (all assignments without students related information)', lepress_textdomain).'</a><br />';\n\t\t\t\t\techo '<span class=\"description\">'.__('Export this course data. \"Export current state\" exports also classbook, \"Export as template\" exports assginments and creates a new template.', lepress_textdomain).'</span></td>';\n\t\t\t\t\techo '</tr>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}", "function multi_entry_category_update()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ($this->input->get_post('entry_ids') === FALSE OR $this->input->get_post('type') === FALSE)\n\t\t{\n\t\t\treturn $this->dsp->no_access_message($this->lang->line('unauthorized_to_edit'));\n\t\t}\n\n\t\tif ($this->input->get_post('category') === FALSE OR ! is_array($_POST['category']) OR count($_POST['category']) == 0)\n\t\t{\n\t\t\treturn $this->output->show_user_error('submission', $this->lang->line('no_categories_selected'));\n\t\t}\n\n\t\t/** ---------------------------------\n\t\t/**\t Fetch categories\n\t\t/** ---------------------------------*/\n\n\t\t// We do this first so we can destroy the category index from\n\t\t// the $_POST array since we use a separate table to store categories in\n\t\t\n\t\t$this->api->instantiate('channel_categories');\n\n\t\tforeach ($_POST['category'] as $cat_id)\n\t\t{\n\t\t\t$this->api_channel_categories->cat_parents[] = $cat_id;\n\t\t}\n\n\t\tif ($this->api_channel_categories->assign_cat_parent == TRUE)\n\t\t{\n\t\t\t$this->api_channel_categories->fetch_category_parents($_POST['category']);\n\t\t}\n\n\t\t$this->api_channel_categories->cat_parents = array_unique($this->api_channel_categories->cat_parents);\n\n\t\tsort($this->api_channel_categories->cat_parents);\n\n\t\tunset($_POST['category']);\n\n\t\t$ids = array();\n\n\t\tforeach (explode('|', $_POST['entry_ids']) as $entry_id)\n\t\t{\n\t\t\t$ids[] = $this->db->escape_str($entry_id);\n\t\t}\n\n\t\tunset($_POST['entry_ids']);\n\n\t\t$entries_string = implode(\"','\", $ids);\n\n\t\t/** -----------------------------\n\t\t/**\t Get Category Group IDs\n\t\t/** -----------------------------*/\n\t\t$query = $this->db->query(\"SELECT DISTINCT exp_channels.cat_group FROM exp_channels, exp_channel_titles\n\t\t\t\t\t\t\t WHERE exp_channel_titles.channel_id = exp_channels.channel_id\n\t\t\t\t\t\t\t AND exp_channel_titles.entry_id IN ('\".$entries_string.\"')\");\n\n\t\t$valid = 'n';\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$valid = 'y';\n\t\t\t$last = explode('|', $query->row('cat_group') );\n\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$valid_cats = array_intersect($last, explode('|', $row['cat_group']));\n\n\t\t\t\tif (count($valid_cats) == 0)\n\t\t\t\t{\n\t\t\t\t\t$valid = 'n';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($valid == 'n')\n\t\t{\n\t\t\treturn $this->dsp->show_user_error($this->lang->line('no_category_group_match'));\n\t\t}\n\n\t\t/** -----------------------------\n\t\t/**\t Remove Valid Cats, Then Add...\n\t\t/** -----------------------------*/\n\n\t\t$valid_cat_ids = array();\n\t\t$query = $this->db->query(\"SELECT cat_id FROM exp_categories\n\t\t\t\t\t\t\t WHERE group_id IN ('\".implode(\"','\", $valid_cats).\"')\n\t\t\t\t\t\t\t AND cat_id IN ('\".implode(\"','\", $this->api_channel_categories->cat_parents).\"')\");\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM exp_category_posts WHERE cat_id = \".$row['cat_id'].\" AND entry_id IN ('\".$entries_string.\"')\");\n\t\t\t\t$valid_cat_ids[] = $row['cat_id'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->input->get_post('type') == 'add')\n\t\t{\n\t\t\t$insert_cats = array_intersect($this->api_channel_categories->cat_parents, $valid_cat_ids);\n\t\t\t// How brutish...\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t\tforeach($insert_cats as $val)\n\t\t\t\t{\n\t\t\t\t\t$this->db->query($this->db->insert_string('exp_category_posts', array('entry_id' => $id, 'cat_id' => $val)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t/** ---------------------------------\n\t\t/**\t Clear caches if needed\n\t\t/** ---------------------------------*/\n\n\t\tif ($this->config->item('new_posts_clear_caches') == 'y')\n\t\t{\n\t\t\t$this->functions->clear_caching('all');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->functions->clear_caching('sql');\n\t\t}\n\t\t\n\t\t$this->session->set_flashdata('message_success', $this->lang->line('multi_entries_updated'));\n\t\t$this->functions->redirect(BASE.AMP.'C=content_edit');\n\t}", "function addExtraCategoryFields_editForm($tag) {\n\t\t$this->addExtraCategoryFields($tag, true);\n\t}", "function wp_update_category($catarr)\n {\n }", "public function ActualizarCategorias()\n\t{\n\n\t\tself::SetNames();\n\t\tif(empty($_POST[\"codcategoria\"]) or empty($_POST[\"nomcategoria\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\t\t$sql = \" select nomcategoria from categorias where codcategoria != ? and nomcategoria = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codcategoria\"], $_POST[\"nomcategoria\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\t\t\t$sql = \" update categorias set \"\n\t\t\t.\" nomcategoria = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codcategoria = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $nomcategoria);\n\t\t\t$stmt->bindParam(2, $codcategoria);\n\n\t\t\t$codcategoria = strip_tags(strtoupper($_POST[\"codcategoria\"]));\n\t\t\t$nomcategoria = strip_tags(strtoupper($_POST[\"nomcategoria\"]));\n\t\t\t$stmt->execute();\n\n\t\t\techo \"<div class='alert alert-info'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<span class='fa fa-check-square-o'></span> LA CATEGORIA DE PRODUCTO FUE ACTUALIZADA EXITOSAMENTE\";\n\t\t\techo \"</div>\";\t\t\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"2\";\n\t\t\texit;\n\t\t}\n\t}", "public function multi_entry_category_update()\n {\n // Does the user have permission?\n if ( !ee()->publisher_helper->allowed_group('can_access_content'))\n {\n show_error(lang('unauthorized_access'));\n }\n\n $entries = ee()->input->post('entry_ids', TRUE);\n $cat_ids = ee()->input->post('category', TRUE);\n $type = ee()->input->post('type', TRUE);\n $entry_ids = array();\n\n if ( !$entries || !$type)\n {\n show_error(lang('unauthorized_to_edit'));\n }\n\n if ( !$cat_ids || !is_array($cat_ids) || empty($cat_ids))\n {\n return ee()->output->show_user_error('submission', lang('no_categories_selected'));\n }\n\n // For the entries affected, sync publisher_category_posts to category_posts\n\n foreach (explode('|', trim($entries)) as $entry_id)\n {\n $entry_ids[] = $entry_id;\n }\n\n // default states\n $default_language_id = ee()->publisher_model->default_language_id;;\n $default_view_status = ee()->publisher_setting->default_view_status();\n $states = array();\n\n foreach($entry_ids as $entry_id)\n {\n // we'll always have a state for the default language and status\n $states = array(array(\n 'publisher_lang_id' => $default_language_id,\n 'publisher_status' => $default_view_status\n ));\n\n if ($type == 'add')\n {\n // Adding categories\n // ----------------------------------------------------------------\n\n // We want to add categories to all the open and draft versions\n // of an entry without changing existing category selections\n\n // for each entry, look up existing distinct states\n $query = ee()->db->distinct()\n ->select('publisher_lang_id, publisher_status')\n ->where('entry_id', $entry_id)\n ->get('publisher_titles');\n\n if ($query->num_rows() > 0)\n {\n $result = $query->result_array();\n\n foreach($result as $row)\n {\n if (FALSE === ($row['publisher_lang_id'] == $default_language_id && $row['publisher_status'] == $default_view_status))\n {\n $states[] = array(\n 'publisher_lang_id' => $row['publisher_lang_id'],\n 'publisher_status' => $row['publisher_status']\n );\n }\n }\n }\n\n // build an an array of records to insert into publisher_category_posts\n $data = array();\n\n foreach($states as $state)\n {\n // add the new categories\n foreach($cat_ids as $cat_id)\n {\n $data[] = array(\n 'entry_id' => $entry_id,\n 'cat_id' => $cat_id,\n 'publisher_lang_id' => $state['publisher_lang_id'],\n 'publisher_status' => $state['publisher_status']\n );\n }\n }\n\n // delete any relationships with the newly added categories that already exist\n // for this entry so that we don't end up with duplicate rows\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n\n // (re)insert the categories with the appropriate states\n ee()->db->insert_batch('publisher_category_posts', $data);\n }\n\n elseif($type == 'remove')\n {\n // Removing categories\n // ----------------------------------------------------------------\n\n // we're simply removing the selected categories from all versions of the entry\n ee()->db->where('entry_id', $entry_id)\n ->where_in('cat_id', $cat_ids)\n ->delete('publisher_category_posts');\n }\n }\n }", "public function edit($id = NULL){\n\t\tif ($id) {\n\t\t\t$this->data['category'] = $this->category_m->get($id);\n\t\t\tcount($this->data['category']) || $this->data['errors'][] = 'category could not be found';\n\t\t}\n\t\telse {\n\t\t\t$this->data ['category'] = $this->category_m->get_new();\n\t\t}\n\t\t\n\t\t// Set up the form\n\t\t$rules = $this->category_m->rules;\n\t\t$this->form_validation->set_rules($rules);\n\t\t\n\t\t// Process the form\n\t\tif ($this->form_validation->run() == TRUE) {\n\t\t\t$data = $this->category_m->array_from_post(array(\n\t\t\t\t'title', \n\t\t\t\t'description', \n\t\t\t\t'items_style'\n\t\t\t\t\n\t\t\t));\n\t\t\t$this->category_m->save($data, $id);\n\t\t\tredirect('admin/category');\n\t\t}\n\t\t\n\t\t$this->data['subview'] ='admin/category/edit';\n\t $this->load->view('admin/_layout_main', $this->data);\n }", "public function edit(Catowner $catowner)\n {\n //\n }", "public function edit($catgId){\n\t\t\tif($this->session->userdata('loggedIn_adminInfo')=='')redirect('admincp');\n\t\t\t$data['title'] \t\t= 'Projects 100K';\n\t\t\t$postedValue_fname \t= array();\n\t\t\tif($this->session->userdata('post_promotionData'))\n\t\t\t$data['postedValue'] \t\t= \t$this->session->userdata('post_promotionData');\n\t\t\t$promotionID\t\t\t\t= \tstr_replace(array('-', '_', '~'), array('+', '/', '='),$catgId);\t\t\t\n\t\t\t$data['promotionInfo']\t\t=\t$this->base_model->is_Record_Exists('tbl_promotion_mastercategory','',array('id'=>$this->encrypt->decode($promotionID)));\t\n\t\t\t$data['fieldInfo']\t\t\t=\t$this->base_model->get_All_Records('tbl_promotion_masterfields','',\n\t\t\t\t\t\t\t\t\t\t\tarray('promotionCategoryId'=>$this->encrypt->decode($promotionID)),'order','asc');\t\t\t\t\n\t\t\t$data['catg_uri_string']\t=\t$data['promotionInfo']->uri_string;\n\t\t\t$data['catgTitle']\t\t\t=\tstripslashes(ucwords($data['promotionInfo']->title));\n\t\t\t$data['hdnPromotionID']\t\t=\t$catgId;\n\t\t\t$this->session->unset_userdata('post_promotionFieldData');\n\t\t\t$this->load->view('templates/admincp/header', $data);\n\t\t\t$this->load->view('admincp/promotion/form', $data);\n\t\t}", "function process_edit_category($parent_id, $title, $alias, $description, $date_add, $date_modify, $enabled, $id){\n\t\t $sql = \" Update category SET\n\t\t\t\t\t `parent_id` = ?, \n\t\t\t\t\t `title` = ?, \n\t\t\t\t\t `alias` = ?, \n\t\t\t\t\t `description` = ?, \n\t\t\t\t\t `date_add` = ?, \n\t\t\t\t\t `date_modify` = ?, \n\t\t\t\t\t `enabled` = ?\n\t\t\t\t WHERE cat_id = ?\";\n\t\t if($this->dbObj->SqlQueryInputResult($sql, array($parent_id, $this->dbObj->fix_quotes_dquotes($title), $alias, $description, $date_add, $date_modify, $enabled, $id)) <> FALSE){\n\t\t\t return true;\n\t\t }\n\t }" ]
[ "0.7168806", "0.68563706", "0.68045294", "0.67021406", "0.66843504", "0.6539066", "0.65129566", "0.6509204", "0.65071285", "0.6467194", "0.6461227", "0.6446446", "0.64327765", "0.63985825", "0.6393049", "0.6384055", "0.63766485", "0.6357264", "0.63523203", "0.6347449", "0.6340649", "0.63341933", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.630937", "0.6302701", "0.62459606", "0.6243362", "0.6241167", "0.6240267", "0.6225636", "0.62228715", "0.62130165", "0.6210964", "0.61917394", "0.6190681", "0.618698", "0.61811155", "0.61771154", "0.6175051", "0.61701906", "0.6165722", "0.6158344", "0.61516416", "0.6148988", "0.61411816", "0.61361265", "0.61302865", "0.6122487", "0.6116302", "0.61122054", "0.61122054", "0.61122054", "0.6090985", "0.608024", "0.6077133", "0.60582453", "0.60538805", "0.605324", "0.6044236", "0.6043208", "0.6042596", "0.6036594", "0.6032514", "0.6011262", "0.60044146", "0.600031", "0.59991455", "0.5999079", "0.5999079", "0.59911764", "0.5971098", "0.5970309", "0.59692115", "0.59612596", "0.5953705", "0.5953548", "0.59431714", "0.59427106", "0.5932282", "0.59159553", "0.5903814" ]
0.6705095
3
/Edit program category Function for delete video
public function deleteProgramCategory(Request $request) { $id = $request->workoutid; $getWorkout = ProgramCategory::find($id); if($getWorkout->delete()){ return redirect()->back()->with('danger','Program Category Deleted successfully'); } else{ return redirect()->back()->with('danger','Sorry! Program Category is not deleted'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cat_delete_link()\n{\n return Parrot::getInstance()->getUrl(\"admin/category/\" . discussion::encode_title(cat_title()) . \"/delete\");\n}", "private function deleteVideo()\n {\n try \n {\n global $cbvid;\n \n $request = $_REQUEST;\n #pex($request,true);\n if(!isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video id not provided\");\n\n if( isset($request['videoid']) && !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n $cbvid->delete_video( (int)$request['videoid'] );\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"video deleted successfully\", \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n } \n }", "public function deleteAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET VIEWER INFO\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n $listingtype_id = $this->_listingType->listingtype_id;\n $this->view->listingType = $this->_listingType;\n\n //GET TAB ID\n $this->view->tab_selected_id = $tab_selected_id = $this->_getParam('content_id');\n $this->view->format_form = $this->_getParam('format', null);\n\n //GET VIDEO OBJECT\n $this->view->sitereview_video = $sitereview_video = Engine_Api::_()->getItem('sitereview_video', $this->getRequest()->getParam('video_id'));\n\n //GET VIDEO TITLE\n $this->view->title = $sitereview_video->title;\n\n //GET LISTING ID\n $listing_id = $sitereview_video->listing_id;\n\n //GET NAVIGATION \n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitereview_main');\n\n //GET SITEREVIEW SUBJECT\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n $can_edit = $sitereview->authorization()->isAllowed($viewer, 'edit_listtype_' . $sitereview->listingtype_id);\n\n if (!$sitereview_video) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_(\"Video doesn't exists or not authorized to delete\");\n return;\n }\n\n //VIDEO OWNER AND LISTING OWNER CAN DELETE VIDEO\n if ($viewer_id != $sitereview_video->owner_id && $can_edit != 1) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n if (!$this->getRequest()->isPost()) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid request method');\n return;\n }\n\n $db = $sitereview_video->getTable()->getAdapter();\n $db->beginTransaction();\n\n try {\n\n Engine_Api::_()->getDbtable('videoratings', 'sitereview')->delete(array('videorating_id =?' => $this->getRequest()->getParam('video_id')));\n\n $sitereview_video->delete();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n\n\n\n\n $this->view->status = true;\n if ($this->view->format_form == 'smoothbox') {\n $this->_forwardCustom('success', 'utility', 'core', array(\n 'smoothboxClose' => true,\n 'parentRefresh' => '500',\n 'parentRefreshTime' => '500',\n 'format' => 'smoothbox',\n 'messages' => Zend_Registry::get('Zend_Translate')->_('You have successfully deleted this video.')\n ));\n } else {\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n if ($can_edit) {\n return $this->_gotoRouteCustom(array('action' => 'edit', 'listing_id' => $sitereview->listing_id), \"sitereview_videospecific_listtype_$listingtype_id\", true);\n } else {\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview->getSlug(), 'tab' => $tab_selected_id), \"sitereview_entry_view_listtype_$listingtype_id\", true);\n }\n } else {\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview->getSlug(), 'tab' => $tab_selected_id), \"sitereview_entry_view_listtype_$listingtype_id\", true);\n }\n }\n }", "protected function _delete()\r\n\t{\r\n\t\tEngine_Api::_() -> getDbTable('favorites', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from favorite table\r\n\t\tEngine_Api::_() -> getDbTable('favorites', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from rating table\r\n\t\tEngine_Api::_() -> getDbTable('ratings', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from watchlater table\r\n\t\tEngine_Api::_() -> getDbTable('watchlaters', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// update video count in signature table\r\n\t\t$signatureTbl = Engine_Api::_() -> getDbTable('signatures', 'ynvideo');\r\n\t\t$signature = $signatureTbl -> fetchRow($signatureTbl -> select() -> where('user_id = ?', $this -> owner_id));\r\n\t\tif ($signature)\r\n\t\t{\r\n\t\t\t$signature -> video_count = new Zend_Db_Expr('video_count - 1');\r\n\t\t}\r\n\t\t$signature -> save();\r\n\r\n\t\t// remove video from playlists\r\n\t\t$playlistAssocTbl = Engine_Api::_() -> getDbTable('playlistassoc', 'ynvideo');\r\n\t\t$playlistAssocs = $playlistAssocTbl -> fetchAll($playlistAssocTbl -> select() -> where('video_id = ?', $this -> getIdentity()));\r\n\t\tforeach ($playlistAssocs as $playlistAssoc)\r\n\t\t{\r\n\t\t\t$playlistAssoc -> delete();\r\n\t\t}\r\n\r\n\t\tparent::_delete();\r\n\t}", "function del()\n {\n $id = $this->uri->rsegment(3);\n $this->_del($id);\n \n $this->session->set_flashdata('message', 'Xóa thành công');\n redirect(admin_url('video'));\n }", "function deleteVideo()\n{\n global $connection;\n if (isset($_POST['btn_delete'])) {\n $idVideo = $_POST['btn_delete'];\n $data = videoCurrentFileTitle($idVideo, $connection);\n $videoTitle = $data['videoTitle'];\n $podcast_location = '../../../upload_podcast/';\n $video_location = '../../../upload_video/';\n $trailerTitle = $data['trailerTitle'];\n $trailer_location = '../../../trail_video/';\n $thumbnailTitle = $data['thumbnailTitle'];\n $thumbnail_location = '../../../thumbnail_video/';\n $superCategorie = $data['superCategorie'];\n \n if ($superCategorie == 1 || $superCategorie == 3) {\n $videoPath = $video_location.$videoTitle;\n } else {\n $videoPath = $podcast_location.$videoTitle;\n }\n \n $trailerPath = $trailer_location.$trailerTitle;\n $thumbnailPath = $thumbnail_location.$thumbnailTitle;\n \n \n global $deleteVideoResponse;\n $deleteVideoResponse = \"\";\n if (empty($idVideo)) {\n $deleteVideoResponse = '<script language=\"javascript\">swal(\"Errore!\", \"È necessario selezionare un video!\", \"error\").then(function() {\n location.reload();\n })</script>';\n } else {\n $query = \"DELETE FROM videos\n WHERE id_video = '$idVideo'\";\n $result = mysqli_query($connection, $query);\n if ($result) {\n unlink($videoPath);\n unlink($trailerPath);\n unlink($thumbnailPath);\n $deleteVideoResponse = '<script language=\"javascript\">swal(\"Successo!\", \"Il video è stato eliminato!\", \"success\".then(function() {\n location.reload();\n }))</script>';\n } else {\n $deleteVideoResponse = '<script language=\"javascript\">swal(\"Errore!\", \"Il video non è stato eliminato!\", \"error\").then(function() {\n location.reload();\n })</script>';\n }\n }\n }\n}", "function remove_video_files($vdetails)\r\n{\r\n global $cbvid;\r\n return $cbvid->remove_files($vdetails);\r\n}", "function deleteTitle($parameter) // suppression du titre de la playlist, le parameter étant l'id du titre\n\t\t\t\t{\n\t\t\t\t\t$request = $_SESSION['mac'].\" playlistcontrol cmd:delete track_id:$parameter\\n\";\n\t\t\t\t\t$mySqueezeCLI = new SqueezeCLI($request);\n\t\t\t\t\t\n\t\t\t\t\treturn true;\n\t\t\t\t}", "function delete_video_acepcion_lse($id_imagen) {\n\t\n\t\t$imagen=$this->datos_imagen($id_imagen);\n\t\t\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t\n\t\t$qDelete = \"DELETE FROM imagenes WHERE id_imagen='$id_imagen'\";\t\n\t\t$result = mysql_query($qDelete); \n\t\t\n\t\t$qDelete1 = \"DELETE FROM palabra_imagen WHERE id_imagen='$id_imagen'\";\t\n\t\t$result1 = mysql_query($qDelete1);\n\t\t\n\t\tunlink('../../repositorio/LSE_acepciones/'.$imagen['imagen']);\n\t\t\n\t\tif (file_exists('../../importar/videos/acepciones/'.$imagen['id_palabra'].'.flv')) { \n\t\t\tunlink('../../importar/videos/acepciones/'.$imagen['id_palabra'].'.flv');\n\t\t}\n\t\tmysql_close($connection);\n\t\treturn mysql_error();\t\t\n\t}", "public function delete($video_id);", "function cs_pb_video($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$video_element_size = '25';\n\t\t$video_url = '';\n\t\t$video_width = '';\n\t\t$video_height = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$video_element_size = $cs_node->video_element_size;\n\t\t\t$video_url = $cs_node->video_url;\n\t\t\t$video_width = $cs_node->video_width;\n\t\t\t$video_height = $cs_node->video_height;\n\t\t\t\t$counter = $post->ID.$count_node;\n}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $video_element_size?>\" item=\"video\" data=\"<?php echo element_size_data_array_index($video_element_size)?>\" >\n \t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"video_element_size[]\" class=\"item\" value=\"<?php echo $video_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> &nbsp; \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp; \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n \t<div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Video Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n <div class=\"opt-conts\">\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Video URL</label></li>\n <li class=\"to-field\">\n \t<input type=\"text\" name=\"video_url[]\" class=\"txtfield\" value=\"<?php echo $video_url?>\" />\n <p>Enter Video URL (Youtube, Vimeo or any other supported by wordpress)</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Width</label></li>\n <li class=\"to-field\"><input type=\"text\" name=\"video_width[]\" class=\"txtfield\" value=\"<?php echo $video_width?>\" /></li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Height</label></li>\n <li class=\"to-field\"><input type=\"text\" name=\"video_height[]\" class=\"txtfield\" value=\"<?php echo $video_height?>\" /></li>\n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"video\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "public function delete_video($arr_where){\n\n\t\t$str_select=\"video_file,video_img\";\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->where($arr_where);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$video=$query->row_array();\n\n\t\t$this->db->where($arr_where);\n\t\tif($this->db->delete($this->_table)){\n\n\t\t\tif(is_array($video) && (element('video_file',$video,'') != ''))\n\t\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.element('video_file',$video,''));\n\n\t\t\tif(is_array($video) && (element('video_img',$video,'') != '')){\n\n\t\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.element('video_img',$video,''));\n\t\t\t\t@unlink(PUBPATH.DIR_PUBLIC_IMG.\"_thumbs/\".element('video_img',$video,''));\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n\t}", "function remove_video_log($vdetails)\r\n{\r\n global $cbvid;\r\n return $cbvid->remove_log($vdetails);\r\n}", "function remove_video_thumbs($vdetails)\r\n{\r\n global $cbvid;\r\n return $cbvid->remove_thumbs($vdetails);\r\n}", "public function deleteVideoCategory(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = VideoCategory::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Video Category Deleted successfully');\n }\n else{\n return redirect()->back()->with('danger','Sorry! Video Category is not deleted');\n }\n }", "private function removeVideoFromGroup()\n {\n try\n {\n $request = $_REQUEST;\n\n if(!isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg('provide group id');\n else if(!is_numeric($request['group_id'])) \n throw_error_msg('invalid group id'); \n else\n $gid = (int)$request['group_id'];\n\n if(!isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg('provide video id');\n else if(!is_numeric($request['videoid'])) \n throw_error_msg('invalid video id'); \n else\n $vid = (int)$request['videoid'];\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n global $cbgroup; \n $id = $cbgroup->remove_group_video($vid,$gid,true);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg())\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'video removed from group', \"data\" => array());\n $this->response($this->json($data));\n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "function delete()\n\t{\n\tglobal $db, $config_vars;\n\n// \t\t$result = new phreak_error();\n// \t$result->set_object_id($this->id);\n// \t$result->set_operation('delete');\n\n\n\t\t//check if the object is in the database\n\t\tif (isset($this->id))\n\t\t{\n\n\t\t\tif ($this->check_perm('delete')) //Authorisation is okay\n\t\t\t{\n\n\t\t\t\t//remove views for this picture\n\t\t\t\t$sql = 'DELETE FROM ' . $config_vars['table_prefix'] . \"views WHERE content_id = \" . $this->id;\n\t\t\t\tif (!$result = $db->sql_query($sql))\n\t\t\t\t{\n\t\t\t\t\t$error = new phreak_error(E_WARNING,SQL_ERROR,__LINE__,__FILE__,'delete',$this->id,0,0,$sql);\n\t\t\t\t\t$error->commit();\n//\t\t\t\t\terror_report(SQL_ERROR, 'delete' , __LINE__, __FILE__,$sql);\n\t\t\t\t}\n\n\n\n\n\t\t\t\t// remove from content table\n\t\t\t\t$sql = \"DELETE FROM \" . $config_vars['table_prefix'] . \"content WHERE id = \" . $this->id;\n\t\t\t\tif (!$result = $db->sql_query($sql))\n\t\t\t\t{\n\t\t\t\t\t$error = new phreak_error(E_WARNING,SQL_ERROR,__LINE__,__FILE__,'delete',$this->id,0,0,$sql);\n\t\t\t\t\t$error->commit();\n//\t\t\t\t\terror_report(SQL_ERROR, 'delete' , __LINE__, __FILE__,$sql);\n\t\t\t\t}\n\n\t\t\t\t$this->clear_content_in_cat();\n\n\t\t\t\tif (is_file($this->file))\n\t\t\t\t{\n\t\t\t\t\tif (!unlink($this->file))\n\t\t\t\t\t{\n\t\t\t\t\t\t$error = new phreak_error(E_WARNING,FILE_ERROR,__LINE__,__FILE__,'delete');\n\t\t\t\t\t\t$error->commit();\n//\t\t\t\t\t\terror_report(FILE_ERROR, 'delete' , __LINE__, __FILE__);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif (is_file($this->get_thumbfile()))\n\t\t\t\t{\n\t\t\t\t\tif (!unlink($this->get_thumbfile()))\n\t\t\t\t\t{\n\t\t\t\t\t\t$error = new phreak_error(E_WARNING,FILE_ERROR,__LINE__,__FILE__,'delete');\n\t\t\t\t\t\t$error->commit();\n//\t\t\t\t\t\terror_report(FILE_ERROR, 'delete' , __LINE__, __FILE__);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tunset($this->id);\n\n\t\t\t\t// decrase content amount\n\t\t\t\tforeach ($this->cat_ids as $id)\n\t\t\t\t{\n\t\t\t\t\t$this->remove_from_cat = new categorie;\n\t\t\t\t\t$this->remove_from_cat->generate_from_id($id);\n\t\t\t\t\t$this->remove_from_cat->set_content_amount($this->remove_from_cat->get_content_amount()-1);\n\t\t\t\t\t$this->remove_from_cat->commit();\n\t\t\t\t}\n\n\n\t\t\t\t// remove from content_in_cat table\n\n\n\t\t\t\tunset($this->file);\n\t\t\t\tunset($this->cat_ids);\n\t\t\t\tunset($this->place_in_cat);\n\n\n\n\n\t\t\t\treturn OP_SUCCESSFUL;\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn OP_NP_MISSING_DELETE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn OP_NOT_IN_DB;\n\t\t}\n\n\t}", "function delete_video_thumb($file_dir,$file)\r\n{\r\n global $LANG;\r\n if($file_dir!=NULL){\r\n $path = THUMBS_DIR.'/'.$file_dir.'/'.$file;\r\n }\r\n else{\r\n $path = THUMBS_DIR.'/'.$file; \r\n }\r\n \r\n if(file_exists($path))\r\n {\r\n unlink($path);\r\n e(lang('video_thumb_delete_msg'),'m');\r\n }else{\r\n e(lang('video_thumb_delete_err'));\r\n }\r\n}", "public function delete(){\n\n\t\t$sql = new Sql();\n\n\t\t$sql->query(\"DELETE FROM tb_categories WHERE idcategory=:idcategory\",array(\n\t\t\t\":idcategory\"=>$this->getidcategory()\n\t\t));\n\n\t\tCategory::updateFile();\n\t}", "public function excluirVideoPorId($idVideo){\r\n \r\n $sql = mysql_query(\"DELETE FROM video_galeria WHERE id_video='$idVideo'\") or die(mysql_error());\r\n \r\n if($sql == true){\r\n\t\r\n\treturn true; \r\n\t\r\n }else{\r\n\t\r\n\treturn false; \r\n }\r\n\t\r\n}", "function deleteallvideos()\n\t{\n\t\t$obj = new clsdbaccess();\n\t\t$mysqli = $obj->db_connect();\t\t\t\n\t\tif(!($stmt = $mysqli->prepare(\"DELETE FROM videoinventory\"))){\n\t\t\techo \"Prepare failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\t\t\n\t\tif(!$stmt->execute()){\n\t\t\techo \"Execute failed: \" . $mysqli->connect_errno . \" \" . $mysqli->connect_error;\n\t\t}\t\t\t\t\n\t\t$stmt->fetch();\t\t\n\t}", "public function removeAction() {\r\n if (empty($_POST['photo_id']))\r\n die('error');\r\n //GET PHOTO ID AND ITEM\r\n $photo_id = (int) $this->_getParam('photo_id');\r\n $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n $db = Engine_Api::_()->getDbTable('chanelphotos', 'sesvideo')->getAdapter();\r\n $db->beginTransaction();\r\n try {\r\n $photo->delete();\r\n $db->commit();\r\n } catch (Exception $e) {\r\n $db->rollBack();\r\n throw $e;\r\n }\r\n }", "function delete_category($action, $id)\r\n{\r\n\tglobal $dropbox_cnf;\r\n\tglobal $_user, $is_courseAdmin, $is_courseTutor;\r\n\r\n\t// an additional check that might not be necessary\r\n\tif ($action=='deletereceivedcategory')\r\n\t{\r\n\t\t$sentreceived='received';\r\n\t\t$entries_table=$dropbox_cnf['tbl_post'];\r\n\t\t$id_field='file_id';\r\n\t}\r\n\telseif ($action=='deletesentcategory')\r\n\t{\r\n\t\t$sentreceived='sent';\r\n\t\t$entries_table=$dropbox_cnf['tbl_file'];\r\n\t\t$id_field='id';\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// step 1: delete the category\r\n\t$sql=\"DELETE FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"' AND $sentreceived='1'\";\r\n\t$result=api_sql_query($sql);\r\n\r\n\t// step 2: delete all the documents in this category\r\n\t$sql=\"SELECT * FROM \".$entries_table.\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t$result=api_sql_query($sql);\r\n\r\n\twhile ($row=mysql_fetch_array($result))\r\n\t{\r\n\t\t$dropboxfile=new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor);\r\n\t\tif ($action=='deletereceivedcategory')\r\n\t\t{\r\n\t\t\t$dropboxfile->deleteReceivedWork($row[$id_field]);\r\n\t\t}\r\n\t\tif ($action=='deletesentcategory')\r\n\t\t{\r\n\t\t\t$dropboxfile->deleteSentWork($row[$id_field]);\r\n\t\t}\r\n\t}\r\n}", "function DeleteCategory()\n{\n if (isset($_POST['deletebtn'])) {\n global $connection;\n\n $connesione = $_POST['deleteImp'];\n\n $delete_query = \"DELETE FROM video_category WHERE id_category='$connesione'\";\n $delete_result = mysqli_query($connection, $delete_query);\n\n if ($delete_result) {\n return header('Location: video_categorie.php?delete=true');\n } else {\n return header('Location: video_categorie.php?delete=false');\n }\n }\n}", "function delete_group_videos($gid) {\n global $db;\n $group = $this->get_group_details($gid);\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (userid() != $group['userid'] && !has_access('admin_access', true))\n e(lang(\"you_cant_del_grp_vdos\"));\n else {\n $db->delete(tbl($this->gp_vdo_tbl), array(\"group_id\"), array($gid));\n e(lang(\"vdo_multi_del_erro\"), \"m\");\n }\n }", "function hello_world_remove() {\ndelete_option('ernaehrungsnews_anzahl');\ndelete_option('ernaehrungsnews_trimmer');\ndelete_option('ernaehrungsnews_kategorieId');\n\n}", "function product_category_delete(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\tmysql_q(\"DELETE FROM product_category WHERE id='\".add_slash($_r['id']).\"'\");\n\n\t\tredirect(\"product_category.htm\", \"\");\n\t}", "public function removeCoverAction(){\r\n\t\t$chanel_id = $this->_getParam('chanel_id', '0');\r\n\t\tif ($chanel_id == 0)\r\n\t\t\treturn;\r\n\t\t$chanel = Engine_Api::_()->getItem('sesvideo_chanel', $chanel_id);\t\t\r\n\t\tif(!$chanel)\r\n\t\t\treturn;\r\n\t\tif(isset($chanel->cover_id) && $chanel->cover_id>0){\r\n\t\t\t$im = Engine_Api::_()->getItem('storage_file', $chanel->cover_id);\r\n\t\t\t$chanel->cover_id = 0;\r\n\t\t\t$chanel->save();\r\n\t\t\t$im->delete();\r\n\t\t}\r\n\t\techo \"true\";die;\r\n\t}", "public function deletecategory(){\n\t\n\t\t$id = $this->request->getParameter(\"actionid\");\n\t\t$modelCategory = new CaCategory();\n\t\t$modelCategory->delete($id);\n\t\n\t\t// generate view\n\t\t$this->redirect(\"catalogadmin/categories\");\n\t}", "public function delete_media() {\n $id = $this->input->post('media_id');\n $valors = array();\n $resultat = $this->media_model->delete_media($id);\n if ($resultat > 0) {\n $filename = 'videos/' . $id . '.mp4';\n $filenameImg = 'img/' . $id . '.jpg';\n if (file_exists($filename)) {\n unlink($filename);\n }\n if (file_exists($filenameImg)) {\n unlink($filenameImg);\n }\n $resultat = \"Se ha borrado un registro con éxito\";\n } else {\n $resultat = \"No se ha borrado ningún registro\";\n }\n\n $this->load->view(\"admin.php\", array(\"data\" => $valors, \"error\" => $resultat));\n }", "public function delete($episode);", "function remove_group_video($vid, $gid, $update_group = false) {\n global $db, $cbvid;\n $group = $this->get_details($gid);\n $video = $cbvid->get_video_details($vid);\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (!$video)\n e(lang(\"class_vdo_del_err\"));\n elseif ($video['userid'] != userid())\n e(lang(\"you_cant_del_this_vdo\"));\n elseif (!$this->is_group_video($vid, $gid))\n return false;\n else {\n $db->delete(tbl($this->gp_vdo_tbl), array(\"videoid\", \"group_id\"), array($vid, $gid));\n e(lang(\"video_removed\"), \"m\");\n if ($update_group)\n $this->update_group_videos_count($gid);\n }\n }", "public function deleteCategoryLangaugeAction(){\n $ebookers_obj = new Ep_Ebookers_Managelist();\n //to call a function to delete themes//\n $ebookers_obj->deleteCategoryLangauge($this->_request->getParams());\n //unset($_REQUEST);\n exit;\n }", "public function delete($film) {\n //Connection with the database\n try {\n $conn = DBConnect::getInstance();\n }\n catch (PDOException $e) {\n echo \"Error connecting database: \" . $e->getMessage() . \" \";\n error_log(\"Error in delete in ApplicationADO: \" . $e->getMessage() . \" \");\n die();\n }\n\n\n $cons=\"delete from `\".ApplicationADO::$tableName.\"` where \".ApplicationADO::$colNameId.\" = ?\";\n $arrayValues= [$film->getId()];\n\n $conn->execution($cons, $arrayValues);\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 deleteAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Game_Service_Category::getCategory($id);\r\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\r\n\t\t$result = Game_Service_Category::deleteCategory($id);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "function videoCategory($categoryId, $catName, $clientKey){\n\t?>\n<div id=\"div-<?php echo $catName; ?>\" class=\"border-bg\" style=\"padding-bottom: 0px !important;\">\n<div class=\"page-header\">\n<h4>\n<span class=\"icons thirty2 <?php echo \"icon\".$catName; ?>\"></span>&nbsp;&nbsp;<?php echo $catName; ?>\n<ul class=\"nav nav-pills pull-right hide-videos\">\n<li class=\"dropdown pull-right\">\n<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\"><i class=\"fa fa-ellipsis-v color-a\"></i></a>\n<ul class=\"dropdown-menu\" role=\"menu\"><li><a class=\"pointer\" onclick=\"hideVideos('div-islam')\">Hide these videos</a></li></ul>\n</li>\n</ul> </h4>\n</div> \n<ul id=\"islam\" class=\"media\">\n <?php\n\t\n\t\n\t$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, \"https://www.googleapis.com/youtube/v3/videos?part=snippet,statistics,contentDetails&chart=mostPopular&regionCode=PK&videoCategoryId=\".$categoryId.\"&maxResults=6&key=\".$clientKey.\"\");\ncurl_setopt($ch, CURLOPT_HEADER, 0);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n$output = curl_exec($ch);\necho curl_error($ch);\ncurl_close($ch);\n \n$searchResponse = json_decode($output,true);\n// print_r($searchResponse);\n\tforeach ($searchResponse['items'] as $searchResult) {\n\t$videoId = $searchResult['id'];\n\t$videoTitle =$searchResult['snippet']['title'];\n\t$thumb= $searchResult['snippet']['thumbnails']['high']['url'];\n\t$duration=$searchResult['contentDetails']['duration'];\n\t$publishedAt=$searchResult['snippet']['publishedAt'];\n\t$viewCount=$searchResult['statistics']['viewCount'];\n\t?>\n\n <li class=\"homethumb hov\">\n <div class=\"mediathumb\">\n <a title=\"<?php echo $videoTitle ?>\" href=\"video/<?php echo $videoId; ?>\">\n <img src=\"<?php echo $thumb ?>\" alt=\"<?php echo $videoTitle; ?>\">\n <span class=\"duration\"><?php fix_duration($duration); ?></span>\n </a> \n </div> \n <h4><a title=\"<?php echo $videoTitle; ?>\" href=\"video/<?php echo $videoId; ?>\" class=\"medialink\"><?php echo shortString($videoTitle, 33); ?></a></h4>\n <div class=\"viewsanduser\">Posted <?php publushDateFix($publishedAt); ?><br>Views: <?php echo number_format($viewCount); ?></div> \n </li> \n\t\n\t\t<?php\n\t\t\n\t\t}\n?>\n\n</ul>\n<div id=\"unhide\" align=\"center\" style=\"display:none\"><a class=\"unhide\" onclick=\"unhide('div-islam')\">Click here to Unhide this section</a></div>\n</div>\n<?php\n}", "function delete_episode($id_user, $id_parcours, $id_episode) {\n\tglobal $wpdb;\n\n \t$updated = $wpdb->delete( \n\t 'tracking', \n\t array( 'id_user' => $id_user , 'id_episode' => $id_episode , 'id_parcours' => $id_parcours ), \n\t array( \n\t '%d' , '%d', '%d'\n\t )\n\t);\n\n\treturn $updated;\n}", "private function deleteFavorite()\n {\n try\n {\n $request = $_REQUEST;\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"Video Id not provided.\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"Video Id is not numeric.\");\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\"));\n\n $video_id = mysql_clean($request['videoid']);\n global $cbvid;\n $cbvid->action->remove_favorite($video_id);\n \n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'removed from favorites succesfully', \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function delete_category($id)\n { \n\t $query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n @unlink(str_replace(base_url(),'',$query[0]->category_img));\n \n $query=$this->General_model->show_data_id('categories',$id,'category_Id','delete','');\n $this->session->set_flashdata('success','Product Category Deleted successfully'); \n redirect('superpanel/categorie');\n\t\n\t }", "public function delete_assets_category() {\n\t\t\n\t\tif($this->input->post('type')=='delete_record') {\n\t\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t$id = $this->uri->segment(4);\n\t\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t$result = $this->Assets_model->delete_assets_category_record($id);\n\t\t\tif(isset($id)) {\n\t\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_deleted');\n\t\t\t} else {\n\t\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t\t}\n\t\t\t$this->output($Return);\n\t\t}\n\t}", "function delete( $catID = -1 )\r\n {\r\n if ( $catID == -1 )\r\n $catID = $this->ID;\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $alternatives =& $this->alternatives();\r\n if ( is_array( $alternatives ) )\r\n {\r\n foreach ( $alternatives as $alternative )\r\n {\r\n $alternative->delete();\r\n }\r\n }\r\n\r\n $res[] = $db->query( \"DELETE FROM eZQuiz_Question WHERE ID='$this->ID'\" );\r\n eZDB::finish( $res, $db );\r\n\r\n }", "public function delcategory() {\n extract($_GET);\n //print_r($_GET);die();\n // call to model function to del category from db\n $result = $this->dash_model->delcategory($mat_cat_id);\n\n echo json_encode($result);\n }", "public function deletePlaylistVideosAction()\n {\n\t\t$userSession\t= new Container('fo_user');\n\t\t$request\t\t= $this->getRequest();\n\t\tif(!isset($userSession->userSession['_id']) || trim($userSession->userSession['_id']) == '') {\n\t\t\techo \"-1\";\n\t\t\tdie();\n\t\t}\n\t\tif($request->isPost()) {\n\t\t\t$formData\t= $request->getPost();\n\t\t\tif(isset($formData['id']) && trim($formData['id']) != '') {\n\t\t\t\t$result\t= $this->deletePlaylistVideo($formData);\n\t\t\t\techo \"1\";\t//\tSuccess\n\t\t\t} else {\n\t\t\t\techo \"0\";\t//\timproper request\n\t\t\t}\n\t\t} else {\n\t\t\techo \"0\";\t//\timproper request\n\t\t}\n\t\treturn $this->getResponse();\n }", "public function delete_gallery_category_post()\n {\n prevent_author();\n\n $id = $this->input->post('category_id', true);\n\n //check if category has posts\n if ($this->gallery_image_model->get_category_image_count($id) > 0) {\n $this->session->set_flashdata('error', trans(\"msg_delete_images\"));\n redirect($this->agent->referrer());\n }\n\n if ($this->gallery_category_model->delete_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_deleted\"));\n redirect($this->agent->referrer());\n } else {\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }", "public function destroy()\n {\n // DB::table('video_uploaded')->delete();\n }", "function local_mediacore_course_delete_event_handler($course) {\n global $DB;\n $DB->delete_records('config_plugins',\n array(\n 'plugin' => MEDIACORE_LOCAL_COURSELTI_SETTING_NAME,\n 'name' => (string)$course->id,\n )\n );\n return TRUE;\n}", "public function remove_category() {\n\t\t$this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(Request::get(\"cat\"));\n\t\t$this->model->categories->unlink($category);\n if(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\t\n\t}", "public function destroy($id, Request $request)\n {\n //\n LikeVideo::where('video_id', $id)->delete();\n $slid = Slider::where('video_id', $id)->get();\n if(count($slid)) {\n foreach ($slid as $key => $value) {\n $slider_u = $value->image;\n $slider_u = str_replace('/storage/app/', '', $slider_u);\n Storage::delete($slider_u);\n }\n }\n \n Slider::where('video_id', $id)->delete();\n $video = Video::find($id);\n if($video->thumbnail) {\n $thumbnail_u = $video->thumbnail;\n $thumbnail_u = str_replace('/storage/app/', '', $thumbnail_u);\n Storage::delete($thumbnail_u);\n }\n if($video->thumbnail_detail) {\n $thumbnail_detail_u = $video->thumbnail_detail;\n $thumbnail_detail_u = str_replace('/storage/app/', '', $thumbnail_detail_u);\n Storage::delete($thumbnail_detail_u);\n }\n if($video->video) {\n // $video_u = $video->video;\n // $video_u = str_replace('/storage/app/', '', $video_u);\n $video_u = '/var/www/html'.$video->video;\n $video_u = str_replace('/playlist.m3u8', '', $video_u);\n $command = 'rm -rf '.$video_u;\n exec($command.\" 2>&1\", $output);\n\n // Storage::delete($video_u);\n }\n Video::destroy($id);\n ViewVideo::where('video_id',$id)->delete();\n return redirect(route('push.videos.index').'?channel_id='.@$request->channel_id);\n }", "public function addVideo(){\n if (isset($_POST[\"add_video\"])) {\n $movie = $this->model('Movie');\n $system = $this->model('System');\n\n $video_name = $_POST[\"video_title\"];\n $video_url = $_POST[\"video_url\"];\n $video_category = $_POST[\"selected_category\"];\n $video_description = $_POST[\"video_description\"];\n $video_sef_url = $system->seflink($video_name);\n\n $movie->addVideo($video_name,$video_url,$video_category,$video_description,$video_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/videos');\n }", "function delete( $catID = -1 )\r\n {\r\n if ( $catID == -1 )\r\n $catID = $this->ID;\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n// $answers =& $this->answers();\r\n\r\n if ( is_array ( $answers ) )\r\n {\r\n foreach ( $answers as $answer )\r\n {\r\n $answer->delete();\r\n }\r\n }\r\n\r\n $res[] = $db->query( \"DELETE FROM eZQuiz_Alternative WHERE ID='$catID'\" );\r\n eZDB::finish( $res, $db );\r\n }", "function video_actions($gid, $vid, $case) {\n global $db;\n\n //getting group details\n $group = $this->get_group_details($gid);\n\n\n if (!$group)\n e(lang(\"grp_exist_error\"));\n elseif (!$this->is_group_video($vid, $gid))\n e(lang(\"class_vdo_del_err\"));\n elseif (userid() != $group['userid'] && !has_access(\"admin_access\"))\n e(lang(\"grp_owner_err1\"));\n else\n switch ($case) {\n case \"activate\":\n case \"active\": {\n $db->update(tbl($this->gp_vdo_tbl), array(\"approved\"), array(\"yes\"), \"videoid ='$vid' AND group_id='$gid'\");\n $this->update_group_videos_count($gid);\n e(lang(\"class_vdo_act_msg\"), \"m\");\n }\n break;\n\n case \"deactivate\":\n case \"deactive\":\n case \"unactivate\":\n case \"unactive\": {\n $db->update(tbl($this->gp_vdo_tbl), array(\"approved\"), array(\"no\"), \"videoid ='$vid' AND group_id='$gid'\");\n $this->update_group_videos_count($gid);\n e(lang(\"class_vdo_act_msg1\"), \"m\");\n }\n break;\n\n case \"delete\": {\n //Delete video\n $db->delete(tbl($this->gp_vdo_tbl), array(\"videoid\", \"group_id\"), array($vid, $gid));\n\n $total_videos = $this->total_videos($gid);\n //Update Stat\n $db->update(tbl($this->gp_tbl), array(\"total_videos\"), array($total_videos), \" group_id='\" . $gid . \"'\");\n e(lang(\"class_vdo_del_msg\"), \"m\");\n }\n break;\n }\n }", "function deleteVideoBought($userId, $idVideo, $connection)\n{\n $query = \"DELETE FROM video_buy_idVideos\n WHERE id_user = '$userId'\n AND id_video = '$idVideo'\";\n $result = mysqli_query($connection, $query);\n if ($result) {\n echo '<script language=\"javascript\">alert(\"L\\'abbonamento a questo video è stato cancellato\")</script>';\n }\n}", "public function remove_audio()\n {\n // Load all groups\n $groups = Group::loadMultiple();\n foreach ($groups as $group) {\n $group_type_id = $group->getGroupType()->id();\n if($group_type_id == \"program\") {\n echo \"Process program \" . $group->label() . PHP_EOL;\n\n $audio_contents = $group->getContent(null, [\"type\"=>\"program-group_media-audio\"]);\n foreach($audio_contents as $audio_content) {\n echo \"Delete group audio \" . $audio_content->label() . PHP_EOL;\n $audio_content->delete();\n }\n }\n else if($group_type_id == \"project\") {\n echo \"Process project \" . $group->label() . PHP_EOL;\n $audio_contents = $group->getContent(null, [\"type\"=>\"project-group_media-audio\"]);\n foreach($audio_contents as $audio_content) {\n echo \"Delete group audio \" . $audio_content->label() . PHP_EOL;\n $audio_content->delete();\n }\n }\n }\n }", "function deletePlayback($cam, $path) {\n\t$query = sprintf(\"DELETE FROM Playbacks WHERE nodename='%s' AND recordfolder='%s'\",\n\t\tmysql_real_escape_string($cam),\n\t\tmysql_real_escape_string($path)\n\t);\n\tdb_query($query);\n\t\n\tsendPiCam($cam, 'DELPLAYBACK,' . $path);\t\n}", "function filesRemove($option, $cid, $cat_id){\n\tglobal $mainframe, $jlistConfig;\n\t$database = &JFactory::getDBO();\n jimport('joomla.filesystem.file');\n\n\t$database->setQuery(\"SELECT url_download FROM #__jdownloads_files WHERE file_id = '$cid'\");\n\t$url_download = $database->loadResult();\n\t$database->setQuery(\"SELECT cat_id FROM #__jdownloads_files WHERE file_id = '$cid'\");\n\t$cat_id = $database->loadResult();\n\t$database->setQuery(\"SELECT cat_dir FROM #__jdownloads_cats WHERE cat_id = '$cat_id'\");\n\t$cat_dir = $database->loadResult();\n\t//remove file\n\tJFile::delete(JPATH_SITE.'/'.$jlistConfig['files.uploaddir'].'/'.$cat_dir.'/'.$url_download);\n\t//update db\n\t$database->setQuery(\"UPDATE #__jdownloads_files SET url_download = '', size = '', published = 0 WHERE file_id = '$cid'\");\n\t$database->query();\n\t//redirect to edit\n\t$mainframe->redirect('index.php?option=com_jdownloads&task=files.edit&hidemainmenu=1&cid='.$cid.'&cat_id='.$cat_id,JText::_('COM_JDOWNLOADS_BACKEND_FILESEDIT_REMOVE_OK'));\n}", "function video_unpreferito()\n{\n if (isset($_POST['unpreferito'])) {\n global $connection;\n $user_id = $_SESSION['users_id'];\n $unpreferito = $_POST['unpreferito'];\n\n if ($unpreferito !=\"\" && $unpreferito != null) {\n $query_delete = \"DELETE FROM prefiriti WHERE preferiti_video='$unpreferito' AND preferiti_userid='$user_id'\";\n \n mysqli_query($connection, $query_delete);\n }\n return header('Location: video_details.php?id='.$unpreferito);\n }\n}", "public function postDelete($video)\n {\n // Declare the rules for the form validation\n $rules = array(\n 'id' => 'required|integer'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n $id = $video->id;\n $video->delete();\n\n // Was the video video deleted?\n $video = Video::find($id);\n if(empty($video))\n {\n // Redirect to the video videos management page\n return Redirect::to('admin/videos')->with('success', Lang::get('admin/videos/messages.delete.success'));\n }\n }\n // There was a problem deleting the video video\n return Redirect::to('admin/videos')->with('error', Lang::get('admin/videos/messages.delete.error'));\n }", "function deleteCategoryMeta($cat_id) {\n\t\t$course_meta = new CourseMeta($cat_id);\n\t\t$course_meta->delete();\n\t}", "public function getDelete($video)\n {\n // Title\n $title = Lang::get('admin/videos/title.video_delete');\n\n // Show the page\n return View::make('admin/videos/delete', compact('video', 'title'));\n }", "public function destroy()\n\t{\n\t\t$ids = \\Input::get('id');\n\t\tforeach ($ids as $id) {\n\t\t\t$category = Category::find($id);\n\t\t\tif (!$category)\n\t\t\t\tcontinue;\n// foreach ($category->pages as $page) {\n// if ($page->is_home) {\n// \\Session::flash('manager_error_message', \\Lang::get('manager.messages.menu_containing_home_page_cant_be_removed'));\n// return \\Redirect::back();\n// }\n// }\n\t\t\t$category->removeImage('image');\n\t\t\t$category->removeImage('image_desc');\n\t\t\tCategory::destroy($id);\n\t\t}\n\t\t\\Session::flash('manager_success_message', \\Lang::get('manager.messages.entities_deleted'));\n\t\treturn \\Redirect::back();\n\t}", "function categoryRemove(){\n\tif(startSession() && isset($_SESSION['UserID']))\n\t{\n\t\t$CatID\t\t\t \t= strip_tags($_GET['id']);\t#int - primaryKey\n\n\t\t$db = pdo(); # pdo() creates and returns a PDO object\n\n\t\t$sql = \"DELETE FROM ma_Categories WHERE CatID = :CatID\";\n\n\t\t$stmt = $db->prepare($sql);\n\t\t//INTEGER EXAMPLE $stmt->bindValue(1, $id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':CatID', $CatID, PDO::PARAM_INT);\n\n\t\ttry {$stmt->execute();} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\t\t#feedback success or failure of update\n\n\t\tif ($stmt->rowCount() > 0)\n\t\t{//success! provide feedback, chance to change another!\n\t\t\tfeedback(\"Category Removed Successfully\",\"success\");\n\t\t}else{//Problem! Provide feedback!\n\t\t\tfeedback(\"Category Not Trashed!\",\"warning\");\n\t\t}\n\t\tmyRedirect(THIS_PAGE);\n\t}\n\t#script for expanding textarea\n}", "public function deleteVideo(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = Video::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Video Deleted successfully');\n }\n else{\n return redirect()->back()->with('danger','Sorry! Video is not deleted');\n }\n }", "function projectpentagon_remove() {\n\ndelete_option('projectpentagon_title');\n\ndelete_option('projectpentagon_name1');\n\ndelete_option('projectpentagon_name2');\n\ndelete_option('projectpentagon_name3');\n\ndelete_option('projectpentagon_name4');\n\ndelete_option('projectpentagon_name5');\n\ndelete_option('projectpentagon_color1');\n\ndelete_option('projectpentagon_color2');\n\ndelete_option('projectpentagon_color3');\n\ndelete_option('projectpentagon_color4');\n\ndelete_option('projectpentagon_color5');\n\ndelete_option('projectpentagon_category');\ndelete_option('projectpentagon-titleonpages');\n\n}", "static public function ctrDeletePart(){\n\n\t\tif(isset($_GET[\"idPart\"])){\n\n\t\t\t$table =\"parts\";\n\t\t\t$data = $_GET[\"idPart\"];\n\n\t\t\tif($_GET[\"image\"] != \"\" && $_GET[\"image\"] != \"views/img/parts/default/anonymous.png\"){\n\n\t\t\t\tunlink($_GET[\"image\"]);\n\t\t\t\trmdir('views/img/parts/'.$_GET[\"code\"]);\n\n\t\t\t}\n\n\t\t\t$answer = PartsModel::mdlDeletePart($table, $data);\n\n\t\t\tif($answer == \"ok\"){\n\n\t\t\t\techo'<script>\n\n\t\t\t\tswal({\n\t\t\t\t\t type: \"success\",\n\t\t\t\t\t title: \"The Part has been successfully deleted\",\n\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t confirmButtonText: \"Close\"\n\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\twindow.location = \"parts\";\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\n\t\t\t\t</script>';\n\n\t\t\t}\t\t\n\t\t\n\t\t}\n\n\t}", "function teamdelete(){\n $this->auth(COMP_ADM_LEVEL);\n $team_id = $this->uri->segment(3);\n $contest_id = urldecode($this->uri->segment(4));\n $this->m_key->removeTeam($team_id);\n $this->m_team->delete($team_id, $contest_id);\n $this->teams($contest_id);\n }", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "function delete(){\n if(isset($_GET['id'])){\n eliminar_categoria($_GET['id']); \n }\n }", "public static function deleteCategoryController(){\n\n\n \t \t if (isset($_POST[\"editCategoryId\"])) {\n\n\n \t \t \t\t\t// NOTA: Se pasa un valor entero como array ya que el modelo de productos recibe de varios métodos\n \t \t\t\t\t\t$dataController = array(\"idcategory\"=>$_POST[\"editCategoryId\"]);\n\n \t \t\t\t\t\t// Esta variable se envía al modelos para proceder a eliminar la categoria\n \t \t\t\t\t\t$dataIdCategoryController = $_POST[\"editCategoryId\"];\n\n \t \t\t\t\t\t// VER PRODUCTOS ASOCIADOS A LA CATEGORIA\n\t\t\t\t\t\t// $answerProducts = productsModel::ViewProductById($dataController, \"productos\");\n\n\t\t\t\t\t\t// foreach ($answerProducts as $row => $item) {\n\n\t\t\t\t\t\t// $dataProductController = array(\"id\"=>$item[\"id\"], \"idcategory\"=>0, \"enable\"=> 1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// $answerDeleteProducts = productsModel::disableProductByIdCategory($dataProductController, \"productos\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$answerDeleteCategory = categorieModel::deleteCategoryModel($dataIdCategoryController, \"categorias\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t \t\tif ($answerDeleteCategory == 1) {\n\n\t \t\t\t\t\techo '<script >swal({\n\n\t\t\t\t\t\t\t\ttitle: \"¡OK!\",\n\t\t\t\t\t\t\t\ttext: \"¡Categoría eliminada correctamente!\",\n\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\tfunction(isConfirm){\n\n\t\t\t\t\t\t\t\t\tif (isConfirm) {\n\n\n\t\t\t\t\t\t\t\t\t\twindow.location = \"categories\";\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t</script>';\n\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\techo \"error\";\n\n\t \t\n\t\t\t\t\t\t\t\t }\n\t\t\t\t \t\t}\n\t\t\t\t}", "function deleting_categories (){\r\n if(isset($_GET['delete'])){\r\n $delete_cat_id_get = $_GET['delete'];\r\n $delete_cat_id_get = escape($delete_cat_id_get) ;\r\n $sql = \"DELETE FROM categories WHERE cat_id ='$delete_cat_id_get' \";\r\n $result = execute($sql);\r\n confirm($sql); \r\n redirect('categories.php');\r\n }\r\n \r\n}", "function delete_post()\n {\n $this->Admin_model->procedure = 'POST_DELETE';\n\n echo $this->p_post_id_delete;\n\n\n $rs = $this->Admin_model->delete($this->p_post_id_delete);\n\n //redirect('admin/Posts/display_cat');\n }", "public function deletePlaylistVideo($array) {\n\t\t$conn\t\t= $this->connect();\n\t\t$collection\t= $conn->snapstate->playlist_media;\n\t\t$query\t\t= array('_id' => new \\MongoID($array['id']));\n\t\t$results\t= $collection->remove($query);\n\t}", "public function widget( $args, $instance ) {\n$title = apply_filters( 'widget_title', $instance['title'] );\n$youtubeurl = apply_filters( 'widget_catno', $instance['catno'] );\n$viewmore = apply_filters( 'widget_spantext', $instance['viewmore'] );\n$sviewmore = apply_filters( 'widget_spantext', $instance['sviewmore'] );\n\n\t\t\t $video_url1=split('[&]',$youtubeurl);\n\t $url_array=explode(\"=\",$video_url1[0]);\n\t\t $path=$url_array[1];\n\n// before and after widget arguments are defined by themes\necho $args['before_widget'];\nif ( ! empty( $title ) )\necho $args['before_title'] . $title . $args['after_title'];\n\n$taxonomy = 'ygallery_category';\n//$taxonomy = 'category';\n$orderby = 'name';\n$show_count = 0; // 1 for yes, 0 for no\n$pad_counts = 0; // 1 for yes, 0 for no\n$hierarchical = 1; // 1 for yes, 0 for no\n$title = '';\n$empty = 0;\n\n$args = array(\n 'taxonomy' => $taxonomy,\n 'orderby' => $orderby,\n 'show_count' => $show_count,\n 'pad_counts' => $pad_counts,\n 'hierarchical' => $hierarchical,\n 'title_li' => $title,\n 'hide_empty' => $empty\n);\n\n\n $categories = get_categories($args); \n foreach ($categories as $category) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\techo '<li><a href=\"' .get_site_url() . '/video-categories/?category='.$category->slug.'\">' . $category->cat_name . '('.$category->category_count.')</a></li>';\n\t\t\t\t\n\t\t\t\t//echo $term->name.\",\"; \n\t\t\t}\n\t\techo '</ul>';\n\n\nif($viewmore&&$sviewmore)\n{\n?>\n<a href=\"http://chicagomalayaleeassociation.org/video-gallery/\" class=\"video_category_video\" >\n<?php \necho $viewmore; \n?>\n</a>\n<?php\n}\n// This is where you run the code and display the output\n//echo __( 'Hello, World!', 'yggallery_kalamela_widget_domain' );\necho $args['after_widget'];\n}", "public function EliminarCategorias()\n\t{\n\n\t\t$sql = \" select codcategoria from productos where codcategoria = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcategoria\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\n\t\t\t$sql = \" delete from categorias where codcategoria = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codcategoria);\n\t\t\t$codcategoria = base64_decode($_GET[\"codcategoria\"]);\n\t\t\t$stmt->execute();\n\n\t\t\theader(\"Location: categorias?mesage=1\");\n\t\t\texit;\n\n\t\t}else {\n\n\t\t\theader(\"Location: categorias?mesage=2\");\n\t\t\texit;\n\t\t}\n\n\t}", "function removeFromSlideshow()\r\n\t{\r\n\t\t$art_object_id = $this->input->post('art_object_id');\r\n\t\t\r\n\t\t$result = $this->artobject_model->deleteFromSlideshow($art_object_id);\r\n\t\tif($result)\r\n\t\t{\r\n\t\t\t$url = base_url('admin/manageArt/0/slideshowDeleted');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$url = base_url('admin/manageArt/0/slideshowDeletedFailed');\r\n\t\t}\r\n\t\tredirect($url);\r\n\t}", "function delete( $catID=-1 )\r\n {\r\n\r\n if ( $catID == -1 )\r\n $catID = $this->ID;\r\n\r\n $category = new eZImageCategory( $catID );\r\n\r\n $categoryList = $category->getByParent( $category );\r\n\r\n foreach ( $categoryList as $category )\r\n {\r\n $category->delete();\r\n }\r\n\r\n foreach ( $this->images() as $image )\r\n {\r\n $image->delete();\r\n }\r\n\r\n $categoryID = $category->id();\r\n\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->begin( );\r\n\r\n $res1 = $db->query( \"DELETE FROM eZImageCatalogue_Category WHERE ID='$categoryID'\" );\r\n $res2 = $db->query( \"DELETE FROM eZImageCatalogue_CategoryPermission WHERE ObjectID='$this->ID'\" );\r\n\r\n if ( ( $res1 == false ) || ( $res2 == false ) )\r\n $db->rollback( );\r\n else\r\n $db->commit();\r\n\r\n }", "public function delete() { \n\n\t\t$id = Dba::escape($this->id); \n\t\n\t\t$sql = \"DELETE FROM `playlist_data` WHERE `playlist` = '$id'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t$sql = \"DELETE FROM `playlist` WHERE `id`='$id'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t$sql = \"DELETE FROM `object_count` WHERE `object_type`='playlist' AND `object_id`='$id'\"; \n\t\t$db_results = Dba::query($sql); \n \n\t\treturn true;\n\t\n\t}", "function deleteAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');//lay id cua record can xoa\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t//tien hanh xoa\n\t\t\tif($myProductCat->delete())\n\t\t\t{\n\t\t\t\t$redirectMsg = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succDelete']);\n\t\t\t\t\n\t\t\t\t$this->registry->me->writelog('ProductCategorydelete', $myProductCat->id, array('name' => $myProductCat->name[$langCode])); \t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$redirectMsg = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['errDelete']);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t}\n\t\t\n\t\t$this->registry->smarty->assign(array('redirect' => $this->getRedirectUrl(),\n\t\t\t\t\t\t\t\t\t\t\t\t'redirectMsg' => $redirectMsg,\n\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t\t\n\t}", "public function deleteCollageTypeWallpostAction()\n {\n try {\n \n \t$wallpost_obj = \\Extended\\wall_post::getRowObject( $this->getRequest()->getParam('wallpost_id') );\n \t\n \tswitch ( $wallpost_obj->getPost_update_type() ) {\n \t \n \t case \\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM_BY_SHARING :\n \t case \\Extended\\wall_post::POST_UPDATE_TYPE_GROUP_IN_DEFAULT_ALBUM :\n \t \t\n \t //Remove image files.\n \t foreach ( $wallpost_obj->getPhotoGroup()->getSocialisePhoto() as $photo )\n \t {\n \t @unlink(REL_IMAGE_PATH.\"/albums/user_\".$photo->getSocialise_photosPosted_by()->getId().\"/album_default/original_photos/\".$photo->getImage_name() );\n \t @unlink(REL_IMAGE_PATH.\"/albums/user_\".$photo->getSocialise_photosPosted_by()->getId().\"/album_default/gallery_thumbnails/thumbnail_\".$photo->getImage_name() );\n \t @unlink(REL_IMAGE_PATH.\"/albums/user_\".$photo->getSocialise_photosPosted_by()->getId().\"/album_default/popup_thumbnails/thumbnail_\".$photo->getImage_name() );\n \t @unlink(REL_IMAGE_PATH.\"/albums/user_\".$photo->getSocialise_photosPosted_by()->getId().\"/album_default/wall_thumbnails/thumbnail_\".$photo->getImage_name() );\n \t }\n \t \n \t //get photo_group id, call delete query on that,\n \t //the cascade in photo_group table will handle other associated\n \t //things need to be deleted.\n \t \\Extended\\photo_group::deletePhotoGroup( $wallpost_obj->getPhotoGroup()->getId() );\n \t \n \t \n \t break;\n \n \t case \\Extended\\wall_post::POST_UPDATE_TYPE_ALBUM :\n \t \t\n \t //Remove image files.\n \t foreach ( $wallpost_obj->getWall_postsSocialise_album()->getSocialise_albumsSocialise_photo() as $photo )\n \t {\n \t Helper_common::deleteDir( REL_IMAGE_PATH.\"/albums/user_\".$photo->getSocialise_photosPosted_by()->getId().\"/album_\".$photo->getSocialise_photosSocialise_album()->getAlbum_name().\"_\".$photo->getSocialise_photosSocialise_album()->getCreated_at_timestamp()->getTimeStamp() );\n \t }\n \t \n \t //get socialise_album_id, call delete query on that,\n \t //the cascade in socialise_album table will handle other associated\n \t //things need to be deleted.\n \t \\Extended\\socialise_album::deleteAlbum( $wallpost_obj->getWall_postsSocialise_album()->getId() );\n \t \n \t break;\n \t \n \t case \\Extended\\wall_post::POST_UPDATE_TYPE_PROFILE_PHOTO_CHANGED :\n \t \t\t\n \t \t//get socialise_photo_id, call delete query on that,\n \t \t//the cascade in socialise_photo table will handle other associated\n \t \t//things need to be deleted.\n \t \t\\Extended\\socialise_photo::deletephoto( $wallpost_obj->getSocialisePhoto()->getId(),$wallpost_obj->getWall_postsFrom_user()->getId());\n \t \t\t\n \t \tbreak;\n \t}\n \techo Zend_Json::decode( 1 );\n \t\n } catch (Exception $e) {\n echo Zend_Json::decode( 0 );\n }\n die;\n }", "function delete(){\n\t\t$eventDet = $this->get_full_details();\n\t\t//print_r($eventDet);\n\t\t#unlink all images for the event\n\t\tif ($eventDet->news_image_logo) { \n\t\t\t//unlink($this->imgPath.$eventDet->news_image_logo);\n\t\t}\n\t\tif ($eventDet->news_photo1) { \n\t\t\tunlink($this->imgPath.$eventDet->news_photo1);\n\t\t}\n\t\tif ($eventDet->news_photo2) { \n\t\t\tunlink($this->imgPath.$eventDet->news_photo2);\n\t\t}\n\t\tif ($eventDet->news_photo3) { \n\t\t\tunlink($this->imgPath.$eventDet->news_photo3);\n\t\t}\t\t\t\t\t\t\n\t\t\n\t\t#remove event entry from the db\n\t\tglobal $db;\n\t\t$sQl = \"delete from cms_news where id = '\".$this->event_id.\"'\";\n\t\tif ($db->query($sQl)){\n\t\t\t$this->message = \"Event \".$eventDet->news_title.\" deleted successfully\";\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$this->error = \"Cannot delete Event \".$eventDet->news_title.\"\";\n\t\t\treturn false;\n\t\t}\n\t}", "public function destroy(Request $request, $id)\n {\n try{\n\n $video = Video::find($id);\n\n @unlink($this->getAssetPath($video->thumbnail,'uploads'));\n @unlink($this->getAssetPath($video->video,'uploads'));\n $video->categories()->detach();\n $video->tags()->detach();\n $video->delete();\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was deleted successfully !!\");\n return redirect()->back();\n } catch(\\Exception $e) {\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not deleted the video\");\n Log::warning(\"Can not deleted Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n }", "public function delete($slug){\n if(!checkRole(getUserGrade(2)))\n {\n prepareBlockUserMessage();\n return back();\n }\n $record = LmsCategory::where('slug', $slug)->first();\n\n try{\n $this->setSettings();\n\n $examSettings = $this->getSettings();\n $path = IMAGE_PATH_UPLOAD_LMS_CATEGORIES;\n $r = $record;\n if(!env('DEMO_MODE')) {\n $record->delete();\n $this->deleteFile($r->image, $path);\n }\n\n $response['status'] = 1;\n $response['message'] = getPhrase('category_deleted_successfully');\n }\n catch ( \\Illuminate\\Database\\QueryException $e) {\n $response['status'] = 0;\n if(getSetting('show_foreign_key_constraint','module'))\n $response['message'] = $e->errorInfo;\n else\n $response['message'] = getPhrase('this_record_is_in_use_in_other_modules');\n }\n\n return json_encode($response);\n }", "public function delete_activities(){\n if($this->uri->segment(3) == \"temp\"){\n $id = $this->uri->segment(4);\n $result = MU_Model::deletedRecordById(\"temp_table\",array(\"ID\"=>$id));\n }else{\n $id = $this->uri->segment(3);\n $result = MU_Model::deletedRecordById(\"activities\",array(\"act_id\"=>$id));\n }\n if($result) echo 't';\n }", "public function delete_category(){\n $query = \"DELETE FROM {$this->table} WHERE {$this->table}.cat_id = (:cat_id)\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_id', $this->cat_id);\n $stmt->execute();\n return $stmt;\n \n }", "public function destroy(Video $video)\n {\n //\n $video->delete();\n\n if ($video->image != \"defaultCategory.png\") {\n $destinationPath = 'image/';\n File::delete($destinationPath . $video->image);\n }\n\n $destinationPath = 'videos/';\n File::delete($destinationPath . $video->videoFile);\n\n return redirect()->route('video.index')->with('success', 'Video and files was deleted!');\n }", "function testDeletingCategory()\n {\n \n $this->tester->seeRecord('common\\models\\Category', ['description' => 'abc']);\n\n $category = Category::find()->where(['description' => 'abc'])->One();\n $category->delete();\n\n $this->tester->dontseeRecord('common\\models\\Category', ['description' => 'abc']);;\n }", "public function destroy() {\n\n /* Right mgmt start */\n $rightId = 77;\n $currentChannelId = $this->rightObj->getCurrnetChannelId($rightId);\n if (!$this->rightObj->checkRights($currentChannelId, $rightId))\n return 'You are not authorized to access.';\n /* Right mgmt end */\n\n\n if (isset($_GET['option'])) {\n $id = $_GET['option'];\n }\n $delArr = explode(',', $id);\n\n foreach ($delArr as $d) {\n $valid = '0';\n $deleteAl = [\n\n 'valid' => $valid,\n 'updated_at' => date('Y-m-d H:i:s')\n ];\n DB::table('magazine')\n ->where('magazine_id', $d)\n ->update($deleteAl);\n \n $deleteAl = [\n\n 'status' => $valid,\n 'updated_at' => date('Y-m-d H:i:s')\n ];\n DB::table('magazine_list')\n ->where('m_id', $d)\n ->update($deleteAl); \n\n }\n return;\n }", "public function delete(){\n\t $this->model->clear()->filter(array('preview_master_id' => WaxUrl::get(\"id\")))->delete();\n\t parent::delete();\n\t}", "function dialogue_delete_instance($id) {\n global $DB;\n\n if (! $dialogue = $DB->get_record('dialogue', array('id' => $id))) {\n return false;\n }\n if (! $cm = get_coursemodule_from_instance('dialogue', $dialogue->id)) {\n return false;\n }\n $entryids = $DB->get_records('dialogue_entries', array('dialogueid' => $dialogue->id), null, 'id');\n if ($entryids) {\n $entryids = array_keys($entryids);\n list($insql, $inparams) = $DB->get_in_or_equal($entryids);\n $DB->delete_records_select('dialogue_read', \"entryid $insql\", $inparams);\n }\n $DB->delete_records('dialogue_entries', array('dialogueid' => $dialogue->id));\n $DB->delete_records('dialogue_conversations', array('dialogueid' => $dialogue->id));\n $DB->delete_records('dialogue', array('id' => $dialogue->id));\n // now get rid of all files\n $context = get_context_instance(CONTEXT_MODULE, $cm->id);\n $fs = get_file_storage();\n $fs->delete_area_files($context->id);\n\n return true;\n}", "public function deleteAction() {\n $this->_helper->layout->setLayout('admin-simple');\n\n if (!($category_id = $this->_getParam('category_id'))) {\n die('No identifier specified');\n }\n\n //GENERATE FORM\n $form = $this->view->form = new Sitestorereview_Form_Admin_Ratingparameter_Delete();\n $form->setAction($this->getFrontController()->getRouter()->assemble(array()));\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n\n foreach ($values as $key => $value) {\n if ($value == 1) {\n $reviewcat_id = explode('reviewcat_name_', $key);\n $reviewcat = Engine_Api::_()->getItem('sitestorereview_reviewcat', $reviewcat_id[1]);\n\n Engine_Api::_()->sitestorereview()->deleteReviewCategory($reviewcat_id[1]);\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\n try {\n //DELETE THE REVIEW PARAMETERS\n $reviewcat->delete();\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n }\n\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => 10,\n 'parentRefresh' => 10,\n 'messages' => array('')\n ));\n }\n $this->renderScript('admin-ratingparameter/delete.tpl');\n }", "public function destroy($id)\n {\n $video = Video::find($id);\n if (!$video){ Alert::warning('عذراً','ﻻ يوجد فيديو بنفس المواصفات'); return redirect('/dashboard/videos');}\n Video::find($id)->delete();\n Alert::success('عظيم','تم حذف فيديو بنجاح');\n return redirect('/dashboard/videos');\n }", "function cmd_delete($db, $params, $computer) {\n if (!isset($params['name'])) {\n throw new NuboException(ERROR_MISSING_PARAMETER);\n }\n $result = $db->select('SELECT file_id FROM tbl_file WHERE filename=:name LIMIT 1', ['name/text' => $params['name']]);\n if (($row = reset($result)) !== false) {\n $id = $row['file_id'];\n $db->execute('DELETE FROM tbl_file WHERE file_id=:id', ['id/int' => $id]);\n @unlink(buildArchiveName($id));\n }\n return [];\n }", "function cms_delete($id) {\n GLOBAL $db;\n// удаление данных о статье\n $db -> query(\"DELETE FROM content WHERE id='$id'\");\n $db -> query(\"DELETE FROM content WHERE pid = '$id'\");\n// удаление информации о статьях из \"связанных\" таблиц\n $db -> query(\"UPDATE items SET article=REPLACE(article,'|\".$id.\"|','|') WHERE article LIKE '%|\".$id.\"|%'\");\n $db -> query(\"UPDATE spec SET article=REPLACE(article,'|\".$id.\"|','|') WHERE article LIKE '%|\".$id.\"|%'\");\n\n}", "function remove()\n\t{\n\t$app = JFactory::getApplication();\n $pks = JFactory::getApplication()->input->getVar('cid', array(), 'post', 'array');\n $model = $this->getModel('match');\n $model->delete($pks);\n\t\n $this->setRedirect('index.php?option=com_sportsmanagement&view=matches'); \n \n }", "function deleteactivity() {\n $this->auth(WL_ADM_LEVEL);\n $activity_id = $this->uri->segment(3);\n $this->m_activities->delete($activity_id);\n $this->activities();\n }", "public function lecteurVideoAction($ListeDesVideos){\n\t\n\t\t$html ='<script>\n\t\t\t\t var tab = [];\n\t\t </script>';\n\t\t$i = 0;\n\t\tforeach ($ListeDesVideos as $Liste) {\n\t\t\t\t\n\t\t\tif($Liste['format'] == \"video/mp4\" || $Liste['format'] == \"video/m4v\") {\n\t\t\t\t$html .='<script>\n \t\t tab['.$i++.'] = {\n\t \"title\":\"'. $Liste['titre'] .' <span class=\\'supprimerVideoIns'.$i.'\\' > </span>\",\n\t\t \"m4v\":\"/simens/public/videos/'. $Liste['nom'] .'\",\n\t\t };\n\t\n\t\t setTimeout(function() {\n\t $(function () {\n\t\t $(\".supprimerVideoIns'.$i.'\").click(function () { return false; });\n\t\t $(\".supprimerVideoIns'.$i.'\").dblclick(function () { supprimerVideo('.$Liste['id'].'); return false; });\n\t });\n }, 1000);\n \t\t </script>';\n\t\t\t}\n\t\t\telse\n\t\t\tif($Liste['format'] == \"video/webm\") {\n\t\t\t\t$html .='<script>\n \t\t tab['.$i++.'] = {\n\t \"title\":\"'. $Liste['titre'] .'<span class=\\'supprimerVideoIns'.$i.'\\' > </span>\",\n\t\t \"webmv\":\"/simens/public/videos/'. $Liste['nom'] .'\",\n\t\t };\n\t\t \n\t\t setTimeout(function() {\n\t $(function () {\n\t\t $(\".supprimerVideoIns'.$i.'\").click(function () { return false; });\n\t\t $(\".supprimerVideoIns'.$i.'\").dblclick(function () { supprimerVideo('.$Liste['id'].'); return false; });\n\t });\n }, 1000);\n \t\t </script>';\n\t\t\t}\n\t\t}\n\t\n\t\t$html .='<script>\n\t\t\t\t $(document).ready(function(){\n\t\n\t new jPlayerPlaylist({\n\t\t jPlayer: \"#jquery_jplayer_1\",\n\t\t cssSelectorAncestor: \"#jp_container_1\"\n\t },\n\t\t\t\t tab\n\t\t\t\t ,{\n\t\t swfPath: \"../../dist/jplayer\",\n\t\t supplied: \"webmv, ogv, m4v\",\n\t\t useStateClassSkin: true,\n\t\t autoBlur: false,\n\t\t smoothPlayBar: true,\n\t\t keyEnabled: true\n\t });\n\t\n });\n\t\n\t\t\t\tscriptAjoutVideo();\n\t\t </script>';\n\t\t\t\n\t\t$html .='\n\t\n\t\t<form id=\"my_form_video\" method=\"post\" action=\"/simens/public/consultation/ajouter-video\" enctype=\"multipart/form-data\">\n\t\t<div id=\"jp_container_1\" class=\"jp-video jp-video-270p\" role=\"application\" aria-label=\"media player\" style=\"margin: auto;\">\n\t <div class=\"jp-type-playlist\">\n\t\t<div id=\"jquery_jplayer_1\" class=\"jp-jplayer\"></div>\n\t\t<div class=\"jp-gui\">\n\t\t\t<div class=\"jp-video-play\">\n\t\t\t\t<button class=\"jp-video-play-icon\" role=\"button\" tabindex=\"0\">play</button>\n\t\t\t</div>\n\t\t\t<div class=\"jp-interface\">\n\t\t\t\t<div class=\"jp-progress\">\n\t\t\t\t\t<div class=\"jp-seek-bar\">\n\t\t\t\t\t\t<div class=\"jp-play-bar\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"jp-current-time\" role=\"timer\" aria-label=\"time\">&nbsp;</div>\n\t\t\t\t<div class=\"jp-duration\" role=\"timer\" aria-label=\"duration\">&nbsp;</div>\n\t\t\t\t<div class=\"jp-controls-holder\">\n\t\t\t\t\t<div class=\"jp-controls\">\n\t\t\t\t\t\t<button class=\"jp-previous\" role=\"button\" tabindex=\"0\">previous</button>\n\t\t\t\t\t\t<button class=\"jp-play\" role=\"button\" tabindex=\"0\">play</button>\n\t\t\t\t\t\t<button class=\"jp-next\" role=\"button\" tabindex=\"0\">next</button>\n\t\t\t\t\t\t<button class=\"jp-stop\" role=\"button\" tabindex=\"0\">stop</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"jp-volume-controls\">\n\t\t\t\t\t\t<button class=\"jp-mute\" role=\"button\" tabindex=\"0\">mute</button>\n\t\t\t\t\t\t<button class=\"jp-volume-max\" role=\"button\" tabindex=\"0\">max volume</button>\n\t\t\t\t\t\t<div class=\"jp-volume-bar\">\n\t\t\t\t\t\t\t<div class=\"jp-volume-bar-value\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"jp-toggles\">\n\t\t\t\t\t\t<button class=\"jp-full-screen\" role=\"button\" tabindex=\"0\">full screen</button>\n\t\t\t\t\t</div>\n\t\n\t\t\t\t <div class=\"jp-toggles2\" id=\"jp-toggles-video\" >\n\t\t\t\t <div class=\"jp-ajouter-video\">\n\t\t\t\t <input type=\"file\" name=\"fichier-video\" id=\"fichier-video\">\n\t\t\t\t </div>\n\t\t\t\t\t</div>\n\t\n\t\t\t\t</div>\n\t\t\t\t<div class=\"jp-details\">\n\t\t\t\t\t<div class=\"jp-title\" aria-label=\"title\">&nbsp;</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\"jp-playlist\">\n\t\t\t<ul>\n\t\t\t\t<li>&nbsp;</li>\n\t\t\t</ul>\n\t\t</div>\n\t </div>\n </div>\n\t\t</form>';\n\t\treturn $html;\n\t}", "public function eliminarVideoController($datos)\n {\n //eliminado los datos\n $respuesta = @GestorVideosModel::eliminarVideoModel($datos, 'videos');\n if ($respuesta == 'ok') {\n //eliminado el video del servidor\n unlink($datos['rutaVideo']);\n\n echo 'ok';\n } else {\n echo 'error';\n }\n }", "function deleteCat(){\n if (isset($_GET['delete'])) {\n global $conn;\n $deletecat=$_GET['delete'];\n $dquery=\"DELETE FROM categores WHERE cat_id={$deletecat}\";\n $dquery_run=mysqli_query($conn,$dquery);\n if (!$dquery_run) {\n echo \"<h1>Delte Query Problrm</h1>\";\n }\n header(\"Location: catagoires.php\");\n }\n }", "function delete_blog_option($id, $option)\n {\n }", "function delete_advertisment( $category_id )\n\t{\n\n\t\t\t$full_image = $this -> get_category_image_icon( $category_id );\n\t\t\tif( $full_image != \"\" && file_exists( $full_image ) && $full_image != $category_image_icon )\n\t\t\t{\n\t\t\t\tunlink( $full_image );\n\t\t\t}\n\t\t\t\n\t\t\n\t\t$q = \"DELETE FROM title_dev_categories WHERE category_id = \".$category_id;\n\t\t$r = $this -> db -> deleteRecord( $q );\n\t\tif( $r )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function destroy($id)\n {\n $category= Category::find($id);\n\n if(Storage::disk(\"public\")->exists(\"category/\".$category->image)){\n Storage::disk(\"public\")->delete(\"category/\".$category->image);\n }\n\n if(Storage::disk(\"public\")->exists(\"category/slider/\".$category->image)){\n Storage::disk(\"public\")->delete(\"category/slider/\".$category->image);\n }\n\n $category->delete();\n\n\n\n Toastr::success(\"Category Delete successfully\",'success');\n return redirect()->route('admin.category.index');\n }" ]
[ "0.63882744", "0.63852364", "0.6378514", "0.6290865", "0.6265053", "0.6234889", "0.6171267", "0.61005694", "0.605339", "0.6045303", "0.60394335", "0.6023272", "0.5996328", "0.59894025", "0.59632385", "0.59167844", "0.5886778", "0.5874059", "0.5808132", "0.5797629", "0.57596254", "0.57541466", "0.57510245", "0.5742057", "0.5683268", "0.5638229", "0.5632193", "0.5627621", "0.5619351", "0.5618709", "0.5618182", "0.5616052", "0.55990535", "0.5595784", "0.5589099", "0.55857056", "0.5553049", "0.5506988", "0.55013174", "0.550056", "0.54995066", "0.5497793", "0.5493421", "0.54919684", "0.54918367", "0.5490209", "0.5487119", "0.54804003", "0.5470516", "0.54522383", "0.54455775", "0.54441303", "0.5443977", "0.54388976", "0.54313093", "0.54146963", "0.5414554", "0.5414187", "0.54085034", "0.54053974", "0.54045254", "0.540329", "0.54022944", "0.5394913", "0.5391966", "0.5389204", "0.5374047", "0.53720784", "0.53671104", "0.53655005", "0.53578234", "0.5353958", "0.53487253", "0.53485036", "0.53439826", "0.53408104", "0.53380525", "0.5337871", "0.5333531", "0.5332009", "0.5329936", "0.53245723", "0.5322833", "0.5312126", "0.5306038", "0.5305203", "0.5305065", "0.5295617", "0.529206", "0.52854586", "0.5279181", "0.5277023", "0.5270238", "0.5269178", "0.5263663", "0.5261453", "0.52581125", "0.5254114", "0.5250541", "0.52499855", "0.52486515" ]
0.0
-1
/view video category Function
public function allVideoCategory() { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $allWorkout = DB::table('video_category') ->orderBy('id','DESC') ->paginate(10); //$allWorkout = DB::table('workouts')->orderBy('id','DESC')->get(); return view('admin.allvideocategory')->with('allworkout',$allWorkout); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $module = $this->params('module');\n $slug = $this->params('slug');\n\n // Get config\n $config = Pi::service('registry')->config->read($module);\n\n // Get category information from model\n $category = $this->getModel('category')->find($slug, 'slug');\n $category = Pi::api('category', 'video')->canonizeCategory($category);\n\n // Check category\n if (!$category || $category['status'] != 1) {\n $this->getResponse()->setStatusCode(404);\n $this->terminate(__('The category not found.'), '', 'error-404');\n $this->view()->setLayout('layout-simple');\n return;\n }\n // Update Hits\n $this->getModel('category')->increment('hits', ['id' => $category['id']]);\n // category list\n $categoriesJson = Pi::api('category', 'video')->categoryListJson();\n // Check display type\n switch ($category['display_type']) {\n case 'video':\n $template = 'video-angular';\n break;\n\n case 'subcategory':\n // Get info\n $list = [];\n $where = ['status' => 1, 'parent' => $category['id']];\n $order = ['display_order ASC', 'time_create DESC', 'title ASC'];\n $select = $this->getModel('category')->select()->where($where)->order($order);\n $rowSet = $this->getModel('category')->selectWith($select);\n // Make list\n foreach ($rowSet as $row) {\n $list[$row->id] = Pi::api('category', 'video')->canonizeCategory($row);\n }\n // Set view\n $this->view()->assign('list', $list);\n // Set template\n $template = 'category-single';\n break;\n }\n\n // Save statistics\n if (Pi::service('module')->isActive('statistics')) {\n Pi::api('log', 'statistics')->save('video', 'category', $category['id']);\n }\n\n // Set view\n $this->view()->headTitle($category['seo_title']);\n $this->view()->headDescription($category['seo_description'], 'set');\n $this->view()->headKeywords($category['seo_keywords'], 'set');\n $this->view()->setTemplate($template);\n $this->view()->assign('config', $config);\n $this->view()->assign('category', $category);\n $this->view()->assign('categoriesJson', $categoriesJson);\n $this->view()->assign('pageType', 'category');\n }", "public function actionVideo()\n {\n\n $arrParams = Yii::$app->request->queryParams;\n $arrParams['ArticleSearch']['category_id'] = Article::CAT_VIDEO;\n $searchModel = new ArticleSearch();\n $dataProvider = $searchModel->search($arrParams);\n $dataProvider->sort = [\n 'defaultOrder'=>['published_at'=>SORT_DESC]\n ];\n\n return $this->render('index_video', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ]);\n }", "public function videoCategory() {\n $this->loadModel('VideoCategories');\n $data = $this->VideoCategories->find('all');\n $this->paginate = [ ];\n $videoCategories = $this->paginate($data);\n\n $this->set(compact('videoCategories'));\n \n }", "public function viewAction() {\n\n //IF SITEREVIEWVIDEO SUBJECT IS NOT THEN RETURN\n if (!$this->_helper->requireSubject('sitereview_video')->isValid())\n return;\n\n //GET LOGGED IN USER INFORMATION\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n //GET VIDEO ITEM\n $sitereview_video = Engine_Api::_()->getItem('sitereview_video', $this->getRequest()->getParam('video_id'));\n\n //GET SITEREVIEW ITEM\n $sitereview = Engine_Api::_()->getItem('sitereview_listing', $sitereview_video->listing_id);\n $this->view->can_create = 1;\n $can_edit = 1;\n\n if (Engine_Api::_()->sitereview()->hasPackageEnable()) {\n if (!Engine_Api::_()->sitereviewpaidlisting()->allowPackageContent($sitereview->package_id, \"video\"))\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n //CHECKING THE USER HAVE THE PERMISSION TO VIEW THE VIDEO OR NOT\n if ($viewer_id != $sitereview_video->owner_id && $can_edit != 1 && ($sitereview_video->search != 1 || $sitereview_video->status != 1)) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n $params = array();\n\n //GET LISTING CATEGORY TABLE\n $tableCategory = Engine_Api::_()->getDbTable('categories', 'sitereview');\n\n $category_id = $sitereview->category_id;\n if (!empty($category_id)) {\n\n $params['categoryname'] = Engine_Api::_()->getItem('sitereview_category', $category_id)->getCategorySlug();\n\n $subcategory_id = $sitereview->subcategory_id;\n\n if (!empty($subcategory_id)) {\n\n $params['subcategoryname'] = Engine_Api::_()->getItem('sitereview_category', $subcategory_id)->getCategorySlug();\n\n $subsubcategory_id = $sitereview->subsubcategory_id;\n\n if (!empty($subsubcategory_id)) {\n\n $params['subsubcategoryname'] = Engine_Api::_()->getItem('sitereview_category', $subsubcategory_id)->getCategorySlug();\n }\n }\n }\n\n $params['location'] = $sitereview->location;\n\n $params['tag'] = $sitereview->getKeywords(', ');\n\n $params['listing_type_title'] = ucfirst($this->_listingType->title_plural);\n\n $params['listing_title'] = $sitereview->getTitle();\n\n //SET META KEYWORDS\n Engine_Api::_()->sitereview()->setMetaKeywords($params);\n\n //CHECK THE VERSION OF THE CORE MODULE\n $coremodule = Engine_Api::_()->getDbtable('modules', 'core')->getModule('core');\n $coreversion = $coremodule->version;\n $checkVersion = Engine_Api::_()->sitereview()->checkVersion($coreversion, '4.1.0');\n if ($checkVersion == 0) {\n $this->_helper->content->render();\n } else {\n $this->_helper->content\n ->setNoRender()\n ->setEnabled()\n ;\n }\n }", "public function index()\n {\n $cat = Video::all();\n return view('admin.video.index', compact('cat'));\n }", "function videoCategory($categoryId, $catName, $clientKey){\n\t?>\n<div id=\"div-<?php echo $catName; ?>\" class=\"border-bg\" style=\"padding-bottom: 0px !important;\">\n<div class=\"page-header\">\n<h4>\n<span class=\"icons thirty2 <?php echo \"icon\".$catName; ?>\"></span>&nbsp;&nbsp;<?php echo $catName; ?>\n<ul class=\"nav nav-pills pull-right hide-videos\">\n<li class=\"dropdown pull-right\">\n<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\"><i class=\"fa fa-ellipsis-v color-a\"></i></a>\n<ul class=\"dropdown-menu\" role=\"menu\"><li><a class=\"pointer\" onclick=\"hideVideos('div-islam')\">Hide these videos</a></li></ul>\n</li>\n</ul> </h4>\n</div> \n<ul id=\"islam\" class=\"media\">\n <?php\n\t\n\t\n\t$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, \"https://www.googleapis.com/youtube/v3/videos?part=snippet,statistics,contentDetails&chart=mostPopular&regionCode=PK&videoCategoryId=\".$categoryId.\"&maxResults=6&key=\".$clientKey.\"\");\ncurl_setopt($ch, CURLOPT_HEADER, 0);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n$output = curl_exec($ch);\necho curl_error($ch);\ncurl_close($ch);\n \n$searchResponse = json_decode($output,true);\n// print_r($searchResponse);\n\tforeach ($searchResponse['items'] as $searchResult) {\n\t$videoId = $searchResult['id'];\n\t$videoTitle =$searchResult['snippet']['title'];\n\t$thumb= $searchResult['snippet']['thumbnails']['high']['url'];\n\t$duration=$searchResult['contentDetails']['duration'];\n\t$publishedAt=$searchResult['snippet']['publishedAt'];\n\t$viewCount=$searchResult['statistics']['viewCount'];\n\t?>\n\n <li class=\"homethumb hov\">\n <div class=\"mediathumb\">\n <a title=\"<?php echo $videoTitle ?>\" href=\"video/<?php echo $videoId; ?>\">\n <img src=\"<?php echo $thumb ?>\" alt=\"<?php echo $videoTitle; ?>\">\n <span class=\"duration\"><?php fix_duration($duration); ?></span>\n </a> \n </div> \n <h4><a title=\"<?php echo $videoTitle; ?>\" href=\"video/<?php echo $videoId; ?>\" class=\"medialink\"><?php echo shortString($videoTitle, 33); ?></a></h4>\n <div class=\"viewsanduser\">Posted <?php publushDateFix($publishedAt); ?><br>Views: <?php echo number_format($viewCount); ?></div> \n </li> \n\t\n\t\t<?php\n\t\t\n\t\t}\n?>\n\n</ul>\n<div id=\"unhide\" align=\"center\" style=\"display:none\"><a class=\"unhide\" onclick=\"unhide('div-islam')\">Click here to Unhide this section</a></div>\n</div>\n<?php\n}", "public function actionVideo()\n {\n $title = '微站设置/视频设置';\n //title of webpage,you can find title in /web/pub/top.php eg:wechat demo\n $keywords = 'wechat demo';\n //title of webpage,you can find title in /web/pub/top.php eg:''\n $description = '';\n return $this -> render('video',[\n 'title' => $title,//title of webpage,you can find title in the head of /web/pub/top.php\n 'keywords' => $keywords,//keywords of webpage,you can find keywords in the head of /web/pub/top.php\n 'description' => $description//description of webpage,you can find description in the head of /web/pub/top.php\n ]);\n }", "public function index($categoryId=null)\n {\n if(isset($categoryId)){\n $category = Category::find($categoryId);\n $videos = $category->videos;\n }\n else{\n $videos = Video::orderBy('created_at', 'desc')->get();\n }\n\n\n $categories = Category::where('status',1)->orderBy('name')->get();\n\n return view('adminCMS.videos.videos',compact('videos','categories', 'categoryId'));\n }", "public function Videos(){\n if(!isset($_SESSION[\"oturum\"])){\n header(\"location: \" . URL . \"login\" );\n }\n\n //Model Connections\n $movies = $this->model('Movie');\n $categories = $this->model('Categories');\n\n //Load data from model to views.\n $getVideos = $movies->getAllVideos();\n $getCategories = $categories->getAllCat();\n\n //Load views\n require VIEW_PATH . \"templates/header-yonetim.php\";\n require VIEW_PATH . \"videos/index.php\";\n require VIEW_PATH . \"templates/footer-yonetim.php\";\n }", "public function index()\n {\n $videoCategories = VideoCategory::withCount('videos')->get();\n return view('adminVideo.category.index', compact('videoCategories'));\n }", "public function category_videos( $category=null )\n\t{\n\t\t$CI =& get_instance();\n\t\t$this->category = ($category != null) ? $category : $this->category;\n\t\t$this->products_string_to_int();\n\n\t\t$result = $CI->db->where(\"pv.category_id\",$this->category)->from(\"products_category_video AS pv\")->join(\"media_videos AS mv\",\"mv.id = pv.video_id\",\"left\")->get()->result();\n\t\treturn $result;\n\t}", "public function video(){\n\t\t$data=array();\n\t\t$this->load->view('administrador/admin_video',$data);\n\t}", "public function indexAction()\n {\n $module = $this->params('module');\n\n // Get config\n $config = Pi::service('registry')->config->read($module);\n\n // category list\n $categoriesJson = Pi::api('category', 'video')->categoryListJson();\n\n // Save statistics\n if (Pi::service('module')->isActive('statistics')) {\n Pi::api('log', 'statistics')->save('video', 'index');\n }\n\n // Check homepage type\n switch ($config['homepage_type']) {\n default:\n case 'list':\n $this->view()->setTemplate('video-angular');\n $this->view()->assign('config', $config);\n $this->view()->assign('categoriesJson', $categoriesJson);\n $this->view()->assign('pageType', 'all');\n break;\n\n case 'category':\n case 'custom':\n // Set title\n $title = (!empty($config['homepage_title'])) ? $config['homepage_title'] : __('List of videos');\n\n // Set info\n $categories = [];\n $where = ['status' => 1];\n $order = ['display_order DESC', 'title ASC', 'id DESC'];\n $select = $this->getModel('category')->select()->where($where)->order($order);\n $rowSet = $this->getModel('category')->selectWith($select);\n\n // Make list\n foreach ($rowSet as $row) {\n $categories[$row->id] = Pi::api('category', 'video')->canonizeCategory($row);\n }\n\n // Set category tree\n $categoryTree = [];\n if (!empty($categories)) {\n $categoryTree = Pi::api('category', 'video')->makeTreeOrder($categories);\n }\n\n // Set view\n $this->view()->setTemplate('video-category-index');\n $this->view()->assign('config', $config);\n $this->view()->assign('categories', $categories);\n $this->view()->assign('categoryTree', $categoryTree);\n $this->view()->assign('productTitleH1', $title);\n $this->view()->assign('showIndexDesc', 1);\n $this->view()->assign('isHomepage', 1);\n break;\n }\n }", "function show_list_video($arr_cate_id,$menu_class,$cate_lang,$width,$height,$skin_media='default.zip'){\n\n\t\t$str_select=\"*\";\n\t\t$arr_where=array($this->_table.'.video_public'=>1,'category_sub.menu_class'=>$menu_class,'category_sub.cate_lang'=>$cate_lang,'category_sub.cate_public'=>1);\n\t\t$str_order=$this->_table.'.video_order asc';\n\t\t$str_order_1=$this->_table.'.video_update_date desc';\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->join('category_sub',$this->_table.'.cate_id=category_sub.cate_id');\n\t\t$this->db->where($arr_where);\n\t\t$this->db->where_in($this->_table.'.cate_id',$arr_cate_id);\n\t\t$this->db->order_by($str_order);\n\t\t$this->db->order_by($str_order_1);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$arr_video=$query->result_array();\n\n\t\t$string_video='';\n\t\t$string_youtube='';\n\n\t\tif(is_array($arr_video) && !empty($arr_video)){\n\n\t\t\t$string_flashvars=\"netstreambasepath=\".base_url();\n\t\t\t$string_flashvars.= \"&amp;skin=\".base_url().DIR_PUBLIC.\"mediaplayer/skin/\".$skin_media;\n\t\t\t$string_flashvars.= \"&amp;config=\".base_url().DIR_PUBLIC.\"mediaplayer/config/config.xml\";\n\t\t\t$string_flashvars.= \"&amp;playlist=\";\n\t\t\t$string_flashvars_json=\"[[JSON]][\";\n\n\t\t\t$string_flashvars_temp=\"\";\n\t\t\tforeach($arr_video as $key=> $value){\n\n\t\t\t\tif(preg_match(\"/youtube.com/\",element('video_file',$value,''))){\n\n\t\t\t\t\t$string_youtube.=\"<div class='object_video_youtube'><iframe width='\".$width.\"' height='\".$height.\"' src='\".element('video_file',$value,'').\"' frameborder='0' allowfullscreen></iframe></div>\";\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\t$string_flashvars_temp.= \"{\";\n\t\t\t\t\t$string_flashvars_temp.= \"\\\"file\\\":\\\"\".base_src_video(element('video_file',$value,'')).\"\\\",\";\n\t\t\t\t\t$string_flashvars_temp.= \"\\\"title\\\":\\\"\".element('video_name',$value,'').\"\\\"\";\n\t\t\t\t\tif(element('video_img',$value,'') != \"\")\n\t\t\t\t\t\t$string_flashvars_temp.= \",\\\"image\\\":\\\"\".base_src_img(element('video_img',$value,'')).\"\\\"\";\n\t\t\t\t\t$string_flashvars_temp.= \"},\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$string_flashvars_temp=$string_flashvars_json.substr($string_flashvars_temp,0,-1);\n\t\t\t$string_flashvars_temp.= \"]\";\n\t\t\t$string_flashvars_temp=rawurlencode($string_flashvars_temp);\n\n\t\t\t$string_flashvars.=$string_flashvars_temp;\n\n\t\t\t$string_video=\"<object width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' \";\n\t\t\t$string_video.= \"codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden'>\";\n\n\t\t\t$string_video.= \"<param name='movie' value='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf'>\";\n\t\t\t$string_video.= \"<param name='quality' value='high'>\";\n\t\t\t$string_video.= \"<param name='allowscriptaccess' value='always'>\";\n\t\t\t$string_video.= \"<param name='wmode' value='transparent'>\";\n\t\t\t$string_video.= \"<param name='allowfullscreen' value='true'>\";\n\t\t\t$string_video.= \"<param name='flashvars' value='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"<embed width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"type='application/x-shockwave-flash' \";\n\t\t\t$string_video.= \"pluginspage='http://www.macromedia.com/go/getflashplayer' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden' \";\n\n\t\t\t$string_video.= \"src='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf' \";\n\t\t\t$string_video.= \"quality='high' \";\n\t\t\t$string_video.= \"allowscriptaccess='always' \";\n\t\t\t$string_video.= \"wmode='transparent' \";\n\t\t\t$string_video.= \"allowfullscreen='true' \";\n\t\t\t$string_video.= \"flashvars='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"</object>\";\n\t\t}\n\t\treturn $string_video.$string_youtube;\n\n\t}", "function show_video_active($arr_cate_id,$menu_class,$cate_lang,$width,$height,$skin_media='default.zip'){\n\n\t\t$str_select=\"*\";\n\t\t$arr_where=array($this->_table.'.video_public'=>1,$this->_table.'.video_active'=>1,'category_sub.menu_class'=>$menu_class,'category_sub.cate_lang'=>$cate_lang,'category_sub.cate_public'=>1);\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->join('category_sub',$this->_table.'.cate_id=category_sub.cate_id');\n\t\t$this->db->where($arr_where);\n\t\t$this->db->where_in($this->_table.'.cate_id',$arr_cate_id);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$arr_video=$query->row_array();\n\n\t\t$string_video='';\n\n\t\tif(is_array($arr_video) && !empty($arr_video)){\n\n\t\t\tif(preg_match(\"/youtube.com/\",element('video_file',$arr_video,''))){\n\n\t\t\t\t$string_youtube=\"<iframe width='\".$width.\"' height='\".$height.\"' src='\".element('video_file',$arr_video,'').\"' frameborder='0' allowfullscreen></iframe>\";\n\t\t\t\treturn $string_youtube;\n\t\t\t}\n\n\t\t\t$string_flashvars=\"netstreambasepath=\".base_url();\n\t\t\t$string_flashvars.= \"&amp;playlist.position=none\";\n\t\t\t$string_flashvars.= \"&amp;playlist.size=0\";\n\t\t\t$string_flashvars.= \"&amp;skin=\".base_url().DIR_PUBLIC.\"mediaplayer/skin/\".$skin_media;\n\t\t\t$string_flashvars.= \"&amp;config=\".base_url().DIR_PUBLIC.\"mediaplayer/config/config.xml\";\n\t\t\t$string_flashvars.= \"&amp;title=\".element('video_name',$arr_video,'');\n\t\t\t$string_flashvars.= \"&amp;file=\".base_src_video(element('video_file',$arr_video,''));\n\t\t\tif(element('video_img',$arr_video,'') != \"\")\n\t\t\t\t$string_flashvars.= \"&amp;image=\".base_src_img(element('video_img',$arr_video,''));\n\n\t\t\t$string_video=\"<object width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' \";\n\t\t\t$string_video.= \"codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden'>\";\n\n\t\t\t$string_video.= \"<param name='movie' value='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf'>\";\n\t\t\t$string_video.= \"<param name='quality' value='high'>\";\n\t\t\t$string_video.= \"<param name='allowscriptaccess' value='always'>\";\n\t\t\t$string_video.= \"<param name='wmode' value='transparent'>\";\n\t\t\t$string_video.= \"<param name='allowfullscreen' value='true'>\";\n\t\t\t$string_video.= \"<param name='flashvars' value='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"<embed width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"type='application/x-shockwave-flash' \";\n\t\t\t$string_video.= \"pluginspage='http://www.macromedia.com/go/getflashplayer' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden' \";\n\n\t\t\t$string_video.= \"src='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf' \";\n\t\t\t$string_video.= \"quality='high' \";\n\t\t\t$string_video.= \"allowscriptaccess='always' \";\n\t\t\t$string_video.= \"wmode='transparent' \";\n\t\t\t$string_video.= \"allowfullscreen='true' \";\n\t\t\t$string_video.= \"flashvars='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"</object>\";\n\t\t}\n\t\treturn $string_video;\n\n\t}", "public function index()\n {\n //\n session()->put('activeMenu', 'manageVideo');\n\n $videos = DB::table('videos')\n ->join('categories', 'videos.categoryID', '=', 'categories.categoryID')\n ->select('videos.videoID', 'videos.videoName', 'videos.videoDescription', 'videos.categoryID', 'categories.categoryName', 'videos.created_at', 'videos.updated_at')\n ->paginate(10);\n\n return view('video.videos', compact('videos'));\n }", "public function widget( $args, $instance ) {\n$title = apply_filters( 'widget_title', $instance['title'] );\n$youtubeurl = apply_filters( 'widget_catno', $instance['catno'] );\n$viewmore = apply_filters( 'widget_spantext', $instance['viewmore'] );\n$sviewmore = apply_filters( 'widget_spantext', $instance['sviewmore'] );\n\n\t\t\t $video_url1=split('[&]',$youtubeurl);\n\t $url_array=explode(\"=\",$video_url1[0]);\n\t\t $path=$url_array[1];\n\n// before and after widget arguments are defined by themes\necho $args['before_widget'];\nif ( ! empty( $title ) )\necho $args['before_title'] . $title . $args['after_title'];\n\n$taxonomy = 'ygallery_category';\n//$taxonomy = 'category';\n$orderby = 'name';\n$show_count = 0; // 1 for yes, 0 for no\n$pad_counts = 0; // 1 for yes, 0 for no\n$hierarchical = 1; // 1 for yes, 0 for no\n$title = '';\n$empty = 0;\n\n$args = array(\n 'taxonomy' => $taxonomy,\n 'orderby' => $orderby,\n 'show_count' => $show_count,\n 'pad_counts' => $pad_counts,\n 'hierarchical' => $hierarchical,\n 'title_li' => $title,\n 'hide_empty' => $empty\n);\n\n\n $categories = get_categories($args); \n foreach ($categories as $category) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\techo '<li><a href=\"' .get_site_url() . '/video-categories/?category='.$category->slug.'\">' . $category->cat_name . '('.$category->category_count.')</a></li>';\n\t\t\t\t\n\t\t\t\t//echo $term->name.\",\"; \n\t\t\t}\n\t\techo '</ul>';\n\n\nif($viewmore&&$sviewmore)\n{\n?>\n<a href=\"http://chicagomalayaleeassociation.org/video-gallery/\" class=\"video_category_video\" >\n<?php \necho $viewmore; \n?>\n</a>\n<?php\n}\n// This is where you run the code and display the output\n//echo __( 'Hello, World!', 'yggallery_kalamela_widget_domain' );\necho $args['after_widget'];\n}", "public function addVideo()\n {\n $getAllVideoCategory = VideoCategory::all();\n return view('admin.addvideo')->with('videoCategory',$getAllVideoCategory);\n }", "function pavi_shortcode_video($atts = array()){\n \n return pavi_get_display_video($atts);\n}", "function pavi_the_display_video($args = array()){\n echo pavi_get_display_video($args);\n}", "public function getShow($video)\n\t{\n // redirect to the frontend\n\t}", "public function viewsVideo($video)\n {\n return $this->performRequest('GET',\"/videos1/{$video}\");\n }", "function show_one_video_front_end($video_id,$menu_class,$cate_lang,$width,$height,$skin_media='default.zip'){\n\n\t\t$str_select=\"*\";\n\t\t$arr_where=array($this->_table.'.video_public'=>1,$this->_table.'.video_id'=>$video_id,'category_sub.menu_class'=>$menu_class,'category_sub.cate_lang'=>$cate_lang,'category_sub.cate_public'=>1);\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->join('category_sub',$this->_table.'.cate_id=category_sub.cate_id');\n\t\t$this->db->where($arr_where);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$arr_video=$query->row_array();\n\n\t\t$string_video='';\n\n\t\tif(is_array($arr_video) && !empty($arr_video)){\n\n\t\t\tif(preg_match(\"/youtube.com/\",element('video_file',$arr_video,''))){\n\n\t\t\t\t$string_youtube=\"<iframe width='\".$width.\"' height='\".$height.\"' src='\".element('video_file',$arr_video,'').\"' frameborder='0' allowfullscreen></iframe>\";\n\t\t\t\treturn $string_youtube;\n\t\t\t}\n\n\t\t\t$string_flashvars=\"netstreambasepath=\".base_url();\n\t\t\t$string_flashvars.= \"&amp;playlist.position=none\";\n\t\t\t$string_flashvars.= \"&amp;playlist.size=0\";\n\t\t\t$string_flashvars.= \"&amp;skin=\".base_url().DIR_PUBLIC.\"mediaplayer/skin/\".$skin_media;\n\t\t\t$string_flashvars.= \"&amp;config=\".base_url().DIR_PUBLIC.\"mediaplayer/config/config.xml\";\n\t\t\t$string_flashvars.= \"&amp;title=\".element('video_name',$arr_video,'');\n\t\t\t$string_flashvars.= \"&amp;file=\".base_src_video(element('video_file',$arr_video,''));\n\t\t\tif(element('video_img',$arr_video,'') != \"\")\n\t\t\t\t$string_flashvars.= \"&amp;image=\".base_src_img(element('video_img',$arr_video,''));\n\n\t\t\t$string_video=\"<object width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' \";\n\t\t\t$string_video.= \"codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden'>\";\n\n\t\t\t$string_video.= \"<param name='movie' value='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf'>\";\n\t\t\t$string_video.= \"<param name='quality' value='high'>\";\n\t\t\t$string_video.= \"<param name='allowscriptaccess' value='always'>\";\n\t\t\t$string_video.= \"<param name='wmode' value='transparent'>\";\n\t\t\t$string_video.= \"<param name='allowfullscreen' value='true'>\";\n\t\t\t$string_video.= \"<param name='flashvars' value='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"<embed width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"type='application/x-shockwave-flash' \";\n\t\t\t$string_video.= \"pluginspage='http://www.macromedia.com/go/getflashplayer' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden' \";\n\n\t\t\t$string_video.= \"src='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf' \";\n\t\t\t$string_video.= \"quality='high' \";\n\t\t\t$string_video.= \"allowscriptaccess='always' \";\n\t\t\t$string_video.= \"wmode='transparent' \";\n\t\t\t$string_video.= \"allowfullscreen='true' \";\n\t\t\t$string_video.= \"flashvars='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"</object>\";\n\t\t}\n\t\treturn $string_video;\n\n\t}", "public function listAction()\n {\n $module = $this->params('module');\n\n // Get config\n $config = Pi::service('registry')->config->read($module);\n\n // Set info\n $categories = [];\n $where = ['status' => 1];\n $order = ['display_order DESC', 'title ASC', 'id DESC'];\n $select = $this->getModel('category')->select()->where($where)->order($order);\n $rowSet = $this->getModel('category')->selectWith($select);\n\n // Make list\n foreach ($rowSet as $row) {\n $categories[$row->id] = Pi::api('category', 'video')->canonizeCategory($row);\n }\n\n // Set category tree\n $categoryTree = [];\n if (!empty($categories)) {\n $categoryTree = Pi::api('category', 'video')->makeTreeOrder($categories);\n }\n\n // Set header and title\n $title = __('Category list');\n\n // Set seo_keywords\n $filter = new Filter\\HeadKeywords;\n $filter->setOptions(\n [\n 'force_replace_space' => true,\n ]\n );\n $seoKeywords = $filter($title);\n\n // Save statistics\n if (Pi::service('module')->isActive('statistics')) {\n Pi::api('log', 'statistics')->save('video', 'categoryList');\n }\n\n // Set view\n $this->view()->headTitle($title);\n $this->view()->headDescription($title, 'set');\n $this->view()->headKeywords($seoKeywords, 'set');\n $this->view()->setTemplate('category-list');\n $this->view()->assign('categories', $categories);\n $this->view()->assign('categoryTree', $categoryTree);\n $this->view()->assign('config', $config);\n }", "public function show(Video $video)\n {\n //\n }", "public function show(Video $video)\n {\n //\n }", "public function show(Video $video)\n {\n //\n }", "public function show(Video $video)\n {\n //\n }", "public function indexAction() {\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n if (!Engine_Api::_()->core()->hasSubject()) {\r\n return $this->setNoRender();\r\n }\r\n\t\t$setting = Engine_Api::_()->getApi('settings', 'core');\r\n\t\tif (!$setting->getSetting('video_enable_chanel', 1)) {\r\n return $this->setNoRender();\r\n }\r\n\t\t$this->view->tab =\t$this->_getParam('tab','inside');\r\n\t\t$this->view->photo =\t$this->_getParam('photo','pPhoto');\r\n\t\t$this->view->option =\t$this->_getParam('option',array('report','follow','like','share','delete','edit','favourite','stats','rating','verified'));\r\n\t\t\r\n // Get subject and check auth\r\n $this->view->subject = $subject = Engine_Api::_()->core()->getSubject('sesvideo_chanel');\r\n\t\t$this->view->video_count = $subject->countVideos();\r\n\t\t$this->view->photo_count = $subject->count();\r\n\t\t$this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\r\n\t\t$this->view->can_edit = 0;\r\n\t\t$this->view->can_delete = 0;\r\n\t\tif($viewer->getIdentity() != 0){\r\n\t\t\t$this->view->can_edit = $canEdit = $subject->authorization()->isAllowed($viewer, 'edit');\r\n\t\t\t$this->view->can_delete = $canDelete = $subject->authorization()->isAllowed($viewer, 'delete');\r\n\t\t}\r\n\t\t$this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\r\n\t\t$this->view->viewer_id = $viewer->getIdentity();\r\n\t\t // rating code\r\n $this->view->allowShowRating = $allowShowRating = Engine_Api::_()->getApi('settings', 'core')->getSetting('video.ratechanel.show', 1);\r\n $this->view->allowRating = $allowRating = Engine_Api::_()->getApi('settings', 'core')->getSetting('video.chanel.rating', 1);\r\n $this->view->getAllowRating = $allowRating;\r\n if ($allowRating == 0) {\r\n if ($allowShowRating == 0)\r\n $showRating = false;\r\n else\r\n $showRating = true;\r\n } else\r\n $showRating = true;\r\n $this->view->showRating = $showRating;\r\n\t\t\r\n if ($showRating) {\r\n $this->view->canRate = $canRate = Engine_Api::_()->authorization()->isAllowed('sesvideo_chanel', $viewer, 'rating_chanel');\r\n $this->view->allowRateAgain = $allowRateAgain = Engine_Api::_()->getApi('settings', 'core')->getSetting('video.ratechanel.again', 1);\r\n $this->view->allowRateOwn = $allowRateOwn = Engine_Api::_()->getApi('settings', 'core')->getSetting('video.ratechanel.own', 1);\r\n if ($canRate == 0 || $allowRating == 0)\r\n $allowRating = false;\r\n else\r\n $allowRating = true;\r\n if ($allowRateOwn == 0 && $mine)\r\n $allowMine = false;\r\n else\r\n $allowMine = true;\r\n $this->view->allowMine = $allowMine;\r\n $this->view->allowRating = $allowRating;\r\n $this->view->rating_type = $rating_type = 'sesvideo_chanel';\r\n $this->view->rating_count = $rating_count = Engine_Api::_()->getDbTable('ratings', 'sesvideo')->ratingCount($subject->getIdentity(), $rating_type);\r\n $this->view->rated = $rated = Engine_Api::_()->getDbTable('ratings', 'sesvideo')->checkRated($subject->getIdentity(), $viewer->getIdentity(), $rating_type);\r\n $rating_sum = Engine_Api::_()->getDbTable('ratings', 'sesvideo')->getSumRating($subject->getIdentity(), $rating_type);\r\n if ($rating_count != 0) {\r\n $this->view->total_rating_average = $rating_sum / $rating_count;\r\n } else {\r\n $this->view->total_rating_average = 0;\r\n }\r\n if (!$allowRateAgain && $rated) {\r\n $rated = false;\r\n } else {\r\n $rated = true;\r\n }\r\n $this->view->ratedAgain = $rated;\r\n }\r\n }", "public function actionIndex()\n {\n $data = array();\n $where = \"\";\n $have_video = isset($_GET['have_video']) ? intval($_GET['have_video']) : 0;\n if($have_video == 1) {\n $where = \" AND have_video = 1 \";\n }\n $query_count = \"SELECT COUNT(id) FROM \" . $this->_table . \" WHERE 1 \" . $where;\n\n $item_count = $this->db->createCommand($query_count)->queryScalar();\n\n $pages = new CPagination($item_count);\n $perPage = 10;\n $pages->setPageSize($perPage);\n\n $page = isset($_GET['page']) ? intval($_GET['page']) : 0;\n if ($page <= 0) {\n $page = 1;\n }\n\n $offset = ($page - 1) * $perPage;\n\n $query = \"SELECT id, cate_id, short_text, title, thumbnail, created, alias FROM \" . $this->_table . \" WHERE 1 \" . $where . \" \"\n . \" ORDER BY id DESC \"\n . \"LIMIT \" . $offset . \",\" . $perPage;\n $data['listItem'] = $this->db->createCommand($query)->queryAll();\n\n\n $data['category'] = $this->getCategory();\n\n $this->render('index', array(\n 'data' => $data,\n 'item_count' => $item_count,\n 'page_size' => $perPage,\n 'pages' => $pages,\n ));\n }", "public function video($lang, $permalink) {\n $videos = Media::where('type', 0)->where('permalink', $permalink)->first();\n\n if ($videos) {\n $videos->month = Carbon::parse($videos->created_at)->format('M');\n $videos->day = Carbon::parse($videos->created_at)->day;\n\n $other_videos = videos::where('id', '!=', $videos->id)->inRandomOrder()->limit(10)->get();\n foreach ($other_videos as $n) {\n $n->ar_title = clean_limit($n->ar_title, 10);\n }\n }\n\n return $videos ? view('web.videos.video', compact('videos', 'other_videos')) : view('web.errors.notfound');\n }", "public function showTVShowCategories(){\n $querry=$this->con->prepare(\"SELECT * from categories\");\n $querry->execute();\n\n\n $html=\"<div class='previewCategories'>\n <h1>TV Shows</h1>\";\n\n //Keep on Appending the HTML OF EACH CATEGORY\n while($row=$querry->fetch(PDO::FETCH_ASSOC)){ //This loop working needs investigation\n $html.=$this->getCategoyHtml($row,null,true,false);\n }\n\n //Return the whole html to print\n return $html.\"</div>\";\n }", "function mars_video_meta() {}", "public function getViewedCategory();", "function VideoLink($vdetails,$type=NULL)\r\n{\r\n return video_link($vdetails,$type);\r\n}", "public function create()\n {\n $categories = Category::all()->pluck('name','id');\n \n return view('admin.video.create', compact('categories'));\n }", "function showvideosmodel() {\n\t\tglobal $option, $mainframe, $db;\n\t\t$rs_showupload = '';\n\t\t$strVideoCount = 0;\n\t\t## To store and retrieve filter variables that are stored with the session\n\t\t$filter_order = $mainframe->getUserStateFromRequest($option . 'filter_order_adminvideos', 'filter_order', 'ordering', 'cmd');\n\t\t$filter_order_Dir = $mainframe->getUserStateFromRequest($option . 'filter_order_Dir_adminvideos', 'filter_order_Dir', 'asc', 'word');\n\t\t$search = $mainframe->getUserStateFromRequest($option . 'search', 'search', '', 'string');\n $search1 = $search;\n\t\t$state_filter = $mainframe->getUserStateFromRequest($option . 'filter_state', 'filter_state', '', 'int');\n\t\t$featured_filter = $mainframe->getUserStateFromRequest($option . 'filter_featured', 'filter_featured', '', 'string');\n\t\t$category_filter = $mainframe->getUserStateFromRequest($option . 'filter_category', 'filter_category', '', '');\n\t\t## page navigation\n\t\t## Default List Limit\n\t\t$limit = $mainframe->getUserStateFromRequest($option . '.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');\n\t\t$limitstart = $mainframe->getUserStateFromRequest($option . '.limitstart', 'limitstart', 0, 'int');\n\n\t\t## set user = admin for admin videos\n\t\t$strAdmin = (JRequest::getVar('user', '', 'get')) ? JRequest::getVar('user', '', 'get') : '';\n\t\t## get logged user\n\t\t$user = JFactory::getUser();\n\t\t$userid = $user->get('id');\n\t\t## get user groups from joomla version above 1.6.0\n\t\tif(version_compare(JVERSION,'1.6.0','ge'))\n\t\t{\n\t\t\t## query items are returned as an associative array\n\t\t\t$query = $db->getQuery(true);\n\t\t\t$query->select('g.id AS group_id')\n\t\t\t\t ->from('#__usergroups AS g')\n\t\t\t\t ->leftJoin('#__user_usergroup_map AS map ON map.group_id = g.id')\n\t\t\t\t ->where('map.user_id = ' . (int) $userid);\n\t\t\t$db->setQuery($query);\n\t\t\t$arrUserGroup = $db->loadObject();\n\n\t\t\t/**\n\t\t\t * User group\n\t\t\t * 6 - Manager\n\t\t\t * 7 - Administrator\n\t\t\t * 8 - Super Users\n\t\t\t */\n\n\t\t\t## for videos added by admin\n\t\t\tif($strAdmin == 'admin') {\n\t\t\t\tif ($arrUserGroup->group_id == '8')\n\t\t\t\t$where = \"WHERE a.usergroupid IN (6,7,8)\";\n\t\t\t\telse\n\t\t\t\t$where = \"WHERE a.usergroupid='$arrUserGroup->group_id' AND a.memberid = $userid\";\n\t\t\t\t## for videos added by member\n\t\t\t} else {\n\t\t\t\t$where = \"WHERE a.usergroupid NOT IN (6,7,8) AND a.memberid != '$userid'\";\n\t\t\t}\n\t\t}\n\t\t## get user groups from joomla version below 1.6.0\n\t\telse\n\t\t{\n\t\t\t$query = 'SELECT gid from #__users\n WHERE id = ' . (int) $userid;\n\t\t\t$db->setQuery($query);\n\t\t\t$arrUserGroup = $db->loadObject();\n\t\t\t## for videos added by admin\n\t\t\tif($strAdmin == 'admin')\n\t\t\t{\n\t\t\t\tif ($arrUserGroup->gid == 25)\n\t\t\t\t{\n\t\t\t\t\t$where = \"WHERE c.gid='25'\";\n\t\t\t\t}\n\t\t\t\telse if($arrUserGroup->gid == 24)\n\t\t\t\t{\n\t\t\t\t\t$where = \"WHERE c.gid='24'\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t## for videos added by member\n\t\t\telse\n\t\t\t{\n\t\t\t\t$where = \"WHERE c.gid NOT IN (24,25)\";\n\t\t\t}\n\t\t}\n\t\t$query = \"SELECT `id`,`member_id`,`category`,`seo_category`,`parent_id`,`ordering`,`published`\n \t\t FROM #__hdflv_category where published=1\";\n\t\t$db->setQuery($query);\n\t\t$rs_showplaylistname = $db->loadObjectList();\n\n\t\t/**\n\t\t * select videos details\n\t\t * for filter by order,title,category,viewed,video link,thumb link,order,featured,id\n\t\t * initially filter by order\n\t\t */\n\t\tif ($filter_order)\n\t\t{\n\t\t\t## for select videos details\n\t\t\t$strMainQuery = \"SELECT distinct(d.videoid) as cvid,a.`id`, a.`memberid`, a.`published`, a.`title`, a.`seotitle`,\n\t\t\t\t\t\t\t a.`featured`, a.`type`, a.`rate`, a.`ratecount`, a.`times_viewed`, a.`videos`, a.`filepath`,\n\t\t\t\t\t\t\t a.`videourl`, a.`thumburl`, a.`previewurl`, a.`hdurl`, a.`home`, a.`playlistid`, a.`duration`,\n\t\t\t\t\t\t\t a.`ordering`, a.`streamerpath`, a.`streameroption`, a.`postrollads`, a.`prerollads`, a.`midrollads`, a.`imaads`, a.`embedcode`,\n\t\t\t\t\t\t\t a.`description`, a.`targeturl`, a.`download`, a.`prerollid`, a.`postrollid`, a.`created_date`,\n\t\t\t\t\t\t\t a.`addedon`, a.`usergroupid`, a.`tags`, a.`useraccess`,b.category,c.username\n\t\t \t\t\t FROM #__hdflv_upload a\n\t\t \t INNER JOIN `#__users` c\";\n\n\t\t\t## for select user group id\n\t\t\tif(version_compare(JVERSION,'1.6.0','ge'))\n\t\t\t{\n\t\t\t\t$strMainQuery = \"$strMainQuery ON c.id = a.memberid\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$strMainQuery = \"$strMainQuery ON c.id = a.memberid\";\n\t\t\t}\n\n\t\t\t## for select video category and comments\n\t\t\t$strMainQuery = \"$strMainQuery\n\t\t\t\t\t\t\t LEFT JOIN #__hdflv_category b ON a.playlistid=b.id\n \t\t LEFT JOIN #__hdflv_comments d ON d.videoid=a.id\n \t\t $where\";\n\n\t\t}\n\t\t## assign filter variables\n\t\t$lists['order_Dir'] = $filter_order_Dir;\n\t\t$lists['order'] = $filter_order;\n $search = $this->phpSlashes($search);\n\t\t## filtering based on search keyword\n\t\tif ($search)\n\t\t{\n\t\t\t$strMainQuery .= \" AND a.title LIKE '%$search%'\";\n\t\t\t$lists['search'] = $search1;\n\t\t}\n\t\t## filtering based on status\n\t\tif($state_filter) {\n\t\t\tif($state_filter == 1) {\n\t\t\t\t$state_filterval = 1;\n\t\t\t}elseif ($state_filter == 2) {\n\t\t\t\t$state_filterval = 0;\n\t\t\t}else {\n\t\t\t\t$state_filterval = -2;\n\t\t\t}\n\t\t\t$strMainQuery .= \" AND a.published = $state_filterval\";\n\t\t\t$lists['state_filter'] = $state_filter;\n\t\t} else {\n\t\t\t$strMainQuery .= \" AND a.published != -2\";\n\t\t}\n\t\t## filtering based on featured status\n\t\tif($featured_filter) {\n\t\t\t$featured_filterval = ($featured_filter == '1')?'1':'0';\n\t\t\t$strMainQuery .= \" AND a.featured = $featured_filterval\";\n\t\t\t$lists['featured_filter'] = $featured_filter;\n\t\t}\n\t\tif($category_filter) {\n\t\t\t$strMainQuery .= \" AND a.playlistid = $category_filter\";\n\t\t\t$lists['category_filter'] = $category_filter;\n\t\t}\n\t\t\t$strMainQuery .= \" ORDER BY $filter_order $filter_order_Dir\";\n\n\t\t\t$db->setQuery($strMainQuery);\n\t\t\t$arrVideoList = $db->loadObjectList();\n\t\t\t$strTotalVideos = count($arrVideoList);\n\n\t\t\t## set pagination\n\n\t\t\t$pageNav = new JPagination($strTotalVideos, $limitstart, $limit);\n\n\t\t\t$strMainQuery .= \" LIMIT $pageNav->limitstart,$pageNav->limit\";\n\t\t\t$db->setQuery($strMainQuery);\n\t\t\t$arrVideoList = $db->loadObjectList();\n\n\t\t/**\n\t\t * get the most recent database error code\n\t\t * display the last database error message in a standard format\n\t\t *\n\t\t */\n\t\tif ($db->getErrorNum())\n\t\t{\n\t\t\tJError::raiseWarning($db->getErrorNum(), $db->stderr());\n\t\t}\n\n\t\treturn array('pageNav' => $pageNav, 'limitstart' => $limitstart,'lists' => $lists, 'rs_showupload' => $arrVideoList, 'rs_showplaylistname' => $rs_showplaylistname);\n\t}", "public function home_video(){\n\tif ($this->session->userdata('logged_in')){\n\t\t$data['title'] = 'Home Video';\n\t\t$data['homevideoList'] = $this->common_model->get_all('fr_home_video', '');\n\t\t$this->set_layout('home_video/home_video_list',$data);\n\t}else{\n\t\t$this->load->view('site/login');\n\t}\n}", "public function browse($type = null, $param = null,$isRedirect = true) {\n if($isRedirect) {\n $page = (!empty($this->request->named['page'])) ? $this->request->named['page'] : 1;\n }\n else {\n $page = $this->request->query('page') ? $this->request->query('page') : 1;\n }\n $uid = $this->Auth->user('id');\n $role_id = $this->_getUserRoleId();\n\n if (!empty($this->request->named['category_id'])) {\n $type = 'category';\n $param = $this->request->named['category_id'];\n }\n $this->set('title_for_layout', __( 'Videos'));\n $url = (!empty($param) ) ? $type . '/' . $param : $type;\n //$data = '';\n $sFriendsList = '';\n switch ($type) {\n case 'home':\n case 'my':\n case 'friends':\n $this->_checkPermission();\n $param = $uid;\n break;\n\n case 'search':\n $param = urldecode($param);\n\n if (!Configure::read('core.guest_search') && empty($uid))\n $this->_checkPermission();\n\n break;\n\n case 'group':\n // check permission if group is private\n $this->loadModel('Group.Group');\n $group = $this->Group->findById($param);\n\n $this->loadModel('Group.GroupUser');\n $is_member = $this->GroupUser->isMember($uid, $param);\n\n if ($group['Group']['type'] == PRIVACY_PRIVATE) {\n $cuser = $this->_getUser();\n\n if (!$cuser['Role']['is_admin'] && !$is_member)\n {\n if($isRedirect) {\n $this->autoRender = false;\n echo 'Only group members can view videos';\n return;\n }\n else {\n $this->throwErrorCodeException('not_group_member');\n return $error = array(\n 'code' => 400,\n 'message' => __('Only group members can view videos'),\n );\n }\n }\n }\n\n $this->set('is_member', $is_member);\n $this->set('ajax_view', true);\n $this->set('group_id', $param);\n $this->set('groupname', $group['Group']['name']);\n\n //$data['is_member'] = $is_member;\n //$data['ajax_view'] = true;\n //$data['groupname'] = $group['Group']['name'];\n break;\n default:\n $this->loadModel('Friend');\n $friends_list = $this->Friend->getFriendsList($uid);\n $aFriendListId = array_keys($friends_list);\n $sFriendsList = implode(',', $aFriendListId);\n if ($type != 'category'){\n $param = $uid;\n }\n }\n $more_result = 0;\n $videos = $this->Video->getVideos($type, $param, $page, RESULTS_LIMIT, $sFriendsList, $role_id);\n $more_videos = $this->Video->getVideos($type, $param, $page + 1, RESULTS_LIMIT, $sFriendsList, $role_id);\n\n if(!empty($more_videos)){\n $more_result = 1;\n }\n\n $this->loadModel('Group.GroupUser');\n foreach ($videos as $key => $video){\n $admins = $this->GroupUser->getUsersList($video['Video']['group_id'], GROUP_USER_ADMIN);\n $videos[$key]['Video']['admins'] = $admins;\n } \n\n $this->set('videos', $videos);\n $this->set('more_url', '/videos/browse/' . h($url) . '/page:' . ( $page + 1 ));\n $this->set('more_result', $more_result);\n\n // MOOSOCIAL-2214\n if ($type == 'group'){\n $this->set('type', 'Group_Group');\n }\n \n if($isRedirect && $this->theme != \"mooApp\") {\n if ($page == 1 && $type == 'home'){\n $this->render('/Elements/ajax/home_video');\n }\n elseif ($page == 1 && $type == 'group'){\n $this->render('/Elements/ajax/group_video');\n }\n else {\n if ($this->request->is('ajax')){\n $this->render('/Elements/lists/videos_list');\n }\n else{\n $this->render('/Elements/lists/videos_list_m');\n }\n }\n }\n else { \n if($type == 'category') $this->set('categoryId', $param);\n $this->set('type', $type);\n }\n }", "public function index()\n {\n \treturn view('panel.video.index');\n }", "public function show(Video $video)\n {\n //\n $files = DB::table('files')->select('fileID', 'fileName', 'file', 'videoID', 'created_at', 'updated_at')->where('videoID', '=', $video->videoID)->paginate();\n\n $categoryData = DB::table('categories')->select('categoryID', 'categoryName')->where('categoryID', '=', $video->categoryID)->paginate();\n\n $sameCategoryData = DB::table('videos')->select('videoID', 'videoName', 'videoDescription', 'image', 'created_at')\n ->where([['categoryID', '=', $video->categoryID], ['videoID', '!=', $video->videoID]])\n ->inRandomOrder()\n ->paginate(4);\n\n $profileID = session()->get('profileID');\n\n $myRequest = new \\Illuminate\\Http\\Request();\n $myRequest->setMethod('POST');\n $myRequest->request->add([\n 'profileID' => $profileID,\n 'videoID' => $video->videoID\n ]);\n\n app('App\\Http\\Controllers\\HistoryController')->store($myRequest);\n\n return view('video.videoView', compact('video', 'categoryData', 'sameCategoryData', 'files'));\n }", "public function edit($id)\n {\n $video = Video::find($id);\n // dd($video->categories[0]->name);\n $categories = Category::where('status',1)->orderBy('name')->get();\n $tags = Tag::where('status',1)->get();\n return view('adminCMS.videos.editVideo',compact('video','categories','tags'));\n }", "function catagoryStatistics($catId, $clientKey){\n\t\n\t$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, \"https://www.googleapis.com/youtube/v3/videoCategories?part=snippet&id=\".$catId.\"&key=\".$clientKey.\"\");\ncurl_setopt($ch, CURLOPT_HEADER, 0);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n$output = curl_exec($ch);\necho curl_error($ch);\ncurl_close($ch);\n \n$searchResponse = json_decode($output,true);\n\t\n\tforeach ($searchResponse['items'] as $searchResult) {\n\t//$videoId = $searchResult['id'];\n\t$catChannelId=$searchResult['snippet']['channelId'];\n\t$title=$searchResult['snippet']['title'];\n\treturn array ('catTitle'=>$title, 'catChannelId'=>$catChannelId);\n\t\n\t}\n\n}", "public function index()\n {\n return view('mediamanagement::Frontend.Video.index')\n ->withVideos($this->video->getActive())\n ->withSeo($this->seo->findByField('page', 'video'));\n }", "function viewAction() {\r\n\r\n $photo_id = $this->_getParam('photo_id', false);\r\n if (!$photo_id)\r\n return $this->_forward('requireauth', 'error', 'core');\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $this->view->photo = $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n $this->view->chanel = $chanel = $photo->getChanel();\r\n Engine_Api::_()->core()->setSubject($photo);\r\n if (!$viewer || !$viewer->getIdentity() || !$chanel->isOwner($viewer)) {\r\n $photo->view_count = new Zend_Db_Expr('view_count + 1');\r\n $photo->save();\r\n }\r\n if (!$this->_helper->requireAuth()->setAuthParams('sesvideo_chanelphoto', null, 'view')->isValid())\r\n return;\r\n $checkchanel = Engine_Api::_()->getItem('sesvideo_chanel', $this->_getParam('chanel_id'));\r\n if (!($checkchanel instanceof Core_Model_Item_Abstract) || !$checkchanel->getIdentity() || $checkchanel->chanel_id != $photo->chanel_id) {\r\n $this->_forward('requiresubject', 'error', 'core');\r\n return;\r\n }\r\n // Render\r\n $this->_helper->content->setEnabled();\r\n }", "function tpl_show($video)\n{\n global $smarty, $config;\n\n // imageurl\n $video['imgurl'] = getThumbnail($video['imgurl'], $video['title']);\n\n // make soft linebreaks:\n $video['filename'] = preg_replace('/(_|\\.|-)/', '$1<wbr />', $video['filename']);\n\n // split comma-separated countries, prevent empty array\n $video['country'] = preg_split('/,\\s*/', $video['country'], -1, PREG_SPLIT_NO_EMPTY);\n\n // split comma-separated multiple languages, prevent empty array\n $video['language'] = preg_split('/,\\s*/', $video['language'], -1, PREG_SPLIT_NO_EMPTY);\n\n // humanreadable filesize:\n $video['filesize'] = round($video['filesize']/(1024*1024), 2);\n\n // break plot and comment\n $video['plot'] = nl2br($video['plot']);\n $video['comment'] = nl2br($video['comment']);\n\n\t// cast\n $smarty->assign('cast_toggle', $config['showcasttoggle']);\n $show_cast = true;\n if ($config['showcasttoggle'])\n {\n $show_cast = (isset($_GET['show_cast']) && $_GET['show_cast'] == '1');\n }\n $smarty->assign('show_cast', $show_cast);\n $video['cast'] = [];\n if ($show_cast)\n {\n \t$video['cast'] = prepare_cast($video['actors']);\n }\n\n // prepare the custom fields\n customfields($video, 'out');\n\n // hide owner if not using multi-user\n if (!$config['multiuser']) unset($video['owner']);\n\n // get drilldown url for image\n if ($video['imdbID'])\n {\n require_once './engines/engines.php';\n $smarty->assign('link', engineGetContentUrl($video['imdbID'], engineGetEngine($video['imdbID'])));\n }\n\n // add episodes information\n if (array_key_exists('episodes', $video) && is_array($video['episodes']))\n {\n // allow multiple columns\n $smarty->assign('listcolumns', session_get('listcolumns'));\n }\n\n $smarty->assign('castcolumns', $config['castcolumns']);\n $smarty->assign('video', $video);\n\n // get genre ids and names\n $smarty->assign('genres', getItemGenres($video['id'], true));\n\n // make engines available\n $smarty->assign('engines', $config['engine']);\n\n // allow XML export\n foreach (array('xls','pdf','xml') as $export)\n {\n if ($config[$export]) $smarty->assign($export, 'show.php?id='.$video['id'].'&amp;');\n }\n // new-style way of exporting\n // $smarty->assign('exports', listExports('show.php?id='.$video['id'].'&amp;'));\n}", "function get_type_videos()\n{\n return 'atu_videos';\n}", "public function show(VideoType $video_type)\n {\n //\n }", "public function edit($id)\n {\n $video = Video::find($id);\n $category = Category::all()->pluck('name','id');\n \n return view('admin.video.edit', compact('video','category'));\n }", "public function category(VideoCategory $videoCategory)\n {\n $page = Input::get('page', 1);\n\n $cat = VideoCategory::where('slug', '=', $videoCategory)->first();\n\n $parent_cat = VideoCategory::where('parent_id', '=', $cat->id)->first();\n\n if (!empty($parent_cat->id)) {\n $parent_cat2 = VideoCategory::where('parent_id', '=', $parent_cat->id)->first();\n if (!empty($parent_cat2->id)) {\n $videos = Video::select($this->getVideoFieldsForFrontend())\n ->where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orWhere('video_category_id', '=', $parent_cat->id)\n ->orWhere('video_category_id', '=', $parent_cat2->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n } else {\n $videos = Video::where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orWhere('video_category_id', '=', $parent_cat->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n }\n } else {\n $videos = Video::where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n }\n\n $data = [\n 'videos' => $videos,\n 'current_page' => $page,\n 'category' => $cat,\n 'page_title' => 'Videos - ' . $cat->name,\n 'page_description' => 'Page ' . $page,\n 'pagination_url' => '/videos/category/' . $videoCategory,\n 'menu' => Menu::orderBy('order', 'ASC')->get(),\n 'video_categories' => VideoCategory::all(),\n 'theme_settings' => config('settings.theme'),\n ];\n\n return view('Theme::video-list', $data);\n }", "public function show(UploadVideo $uploadVideo)\n {\n //\n }", "public function category()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_index');\n $view->kategorie = $_GET['kategorie'];\n $view->title = 'Kategorie';\n $view->heading = 'Kategorie: '. $_GET['kategorie'];\n $view->vereine = $vereinRepository->getByCategory($view->kategorie);\n $view->display();\n }", "public function viewVideoAction()\n\t{\n\t\t$userSession = new Container('fo_user');\n\t\t$pageSession = new Container('fo_page');\n\t\t$this->layout('frontend');\n\t\t$request \t\t= $this->getRequest();\n\t\t$message\t\t= '';\n\t\t$errorMessage\t= '';\n\t\t\n\t\t$request\t= $this->getRequest();\n\t\t$id\t\t\t= $this->params()->fromRoute('id', 0);\n\t\t$originalID\t= base64_decode($id);\n\t\t$videoArray\t= $this->getVideoDetails($originalID);\n\t\t\n\t\t//\tTrack Video Views\n\t\tif(!isset($pageSession->pageSession['last_video']) || (isset($pageSession->pageSession['last_video']) && $pageSession->pageSession['last_video'] != $originalID)) {\n\t\t\t$this->trackVideoViews($originalID);\n\t\t\t$pageSession->pageSession\t= array('last_video' => $originalID);\n\t\t\t\n\t\t\t//\tAssign the recently viewed video in session\n\t\t\t$mediaArray\t\t\t\t\t\t= $userSession->mediaSession;\n\t\t\t$videosArray\t\t\t\t\t= $mediaArray['videos'];\n\t\t\t$videosArray[strtotime('now')]\t= $originalID;\n\t\t\t$mediaArray['videos']\t\t\t= $videosArray;\n\t\t\t$userSession->mediaSession\t\t= $mediaArray;\n\t\t}\n\t\t//\tMedia Tags\n\t\t$mediaIdArray[]\t= (string)$videoArray['_id'];\n\t\t$mediaTags\t\t= $this->getMediaTags($mediaIdArray, 1);\n\t\t\n\t\t//echo '<pre>===>'; print_r($mediaTags); echo '</pre>';\n\t\t//\tRecommended Videos\n\t\t$videoSession \t\t= new Container('fo_videos_recommended');\n\t\t$recommendedArray\t= array('title'\t\t=> $videoArray['media_title'],\n\t\t\t\t\t\t\t\t\t'category'\t=> $videoArray['media_category'],\n\t\t\t\t\t\t\t\t\t'tags'\t\t=> $mediaTags,\n\t\t\t\t\t\t\t\t\t'id'\t\t=> new \\MongoId($videoArray['_id']));\n\t\t$videoSession->videoSession\t= $recommendedArray;\n\t\t\n\t\t$tempUserSession= $userSession->mediaSession;\n\t\t$extFriendsArray= array();\n\t\t\n\t\tif(isset($tempUserSession['friends']) && is_array($tempUserSession['friends']) && count($tempUserSession['friends']) > 0 && count($mediaIdArray) > 0) {\n\t\t\t$extFriendsArray\t= $this->getExtendedFriends($tempUserSession['friends'], $mediaIdArray);\n\t\t}\n\t\t\n\t\t$likes\t\t= $this->getVideoLikes((string)$videoArray['_id']);\n\t\t$like\t= 0;\n\t\t$dislike= 0;\n\t\tif(is_array($likes) && count($likes) > 0) {\n\t\t\tforeach($likes as $lkey => $lvalue) {\n\t\t\t\tif($lvalue['rating'] == 'like') {\n\t\t\t\t\t$like++;\n\t\t\t\t} else if($lvalue['rating'] == 'dislike') {\n\t\t\t\t\t$dislike++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn new ViewModel(array(\n\t\t\t'userObject'\t=> $userSession->userSession,\n\t\t\t'message'\t\t=> $message,\n\t\t\t'errorMessage'\t=> $errorMessage,\n\t\t\t'extended'\t\t=> $extFriendsArray,\n\t\t\t'videoArray'\t=> $videoArray,\n\t\t\t'like'\t\t\t=> $like,\n\t\t\t'dislike'\t\t=> $dislike,\n\t\t\t'action'\t\t=> $this->params('action'),\n\t\t\t'controller'\t=> $this->params('controller'),\n\t\t));\n }", "public function actionView($title) {\n\n\n $videoId = explode('-', $title);\n $videoModel = new VideosComments();\n\n $model = new VideosComments();\n $model->user_id = Yii::$app->user->id;\n $video = $this->findModel($videoId[1]);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->render('view', [\n 'model' => $video,\n 'videosComments' => $videoModel,\n 'videosCommentsList' => VideosComments::getVideosComments($videoId[1]),\n 'popularVideos' => Videos::getPopularVideos(),\n //'author' => Profile::findOne(['user_id' => $video['psychologist_id']]),\n ]);\n }\n\n if ($videoId[1]) {\n $videoModel->video_id = $videoId[1];\n return $this->render('view', [\n 'model' => $video,\n 'videosComments' => $videoModel,\n 'videosCommentsList' => VideosComments::getVideosComments($videoId[1]),\n 'popularVideos' => Videos::getPopularVideos(),\n //'author' => Profile::findOne(['user_id' => $video['psychologist_id']]),\n ]);\n }\n\n }", "public function get_videocategory()\n\t{\n\t\t$category = array();\n\n\t\t$sql = \"SELECT * FROM \" . $this->table_prefix . \"_video_category ORDER BY weight ASC\";\n\t\t$result = $this->db_cache( $sql, 'id' );\n\n\t\t$category[0] = array(\n\t\t\t'id' => 0,\n\t\t\t'title' => $this->lang('unknow'),\n\t\t\t'keywords' => '',\n\t\t\t'description' => ''\n\t\t);\n\n\t\tif( ! empty( $result ) )\n\t\t{\n\t\t\tforeach( $result as $row )\n\t\t\t{\n\t\t\t\t$category[$row['id']] = array(\n\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t'title' => $row['title'],\n\t\t\t\t\t'keywords' => $row['keywords'],\n\t\t\t\t\t'description' => $row['description']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $category;\n\t}", "public function viewVideo_action() {\r\n Auth::checkAuthentication();\r\n $userID = Session::get('user_id');\r\n $userRole = Session::get('user_role');\r\n $lessonID = Request::post('lessonID');\r\n \r\n if(isset($userID) && isset($userRole) && isset($lessonID)) {\r\n if (LessonModel::canViewLesson($userID, $userRole, $lessonID)) {\r\n LessonModel::recordViewedVideo($userID, $lessonID);\r\n \r\n $response_array['canViewAssessment'] = LessonModel::hasViewedVideoAndGame($userID, $lessonID);\r\n echo json_encode($response_array);\r\n } else {\r\n Redirect::to('lesson/index');\r\n }\r\n } else {\r\n Redirect::to('error/index');\r\n }\r\n }", "public function mostrarVideoVistaController()\n {\n //llamando al modelo\n $respuesta = @GestorVideosModel::mostrarVideoVistaModel(\"videos\");\n\n foreach ($respuesta as $dato) {\n echo '<li id=\"' . $dato['id'] . '\" ruta=\"' . $dato['ruta'] . '\" class=\"bloqueVideo\">\n <span class=\"fa fa-times eliminarVideo\"></span>\n <video controls class=\"handleVideo\">\n <source src=\"' . substr($dato['ruta'], 6) . '\" type=\"video/mp4\">\n </video>\n </li>';\n }\n\n }", "public function actionThird()\n {\n $id = $_GET['id'];\n\n $title = VideoLibrary::model()->findByPK($id)->title;\n $description = VideoLibrary::model()->findByPK($id)->description;\n $url = VideoLibrary::model()->findByPK($id)->url;\n $this->render('watchVideo', array('url'=>$url,'title'=>$title,'description'=>$description) );\n }", "public function getVideos()\n {\n echo \"11\";\n }", "public function index(){\n $data['videos'] = $this->repository->getModel()->all();\n return view('admin_content.videos.index',$data);\n }", "public function getVideoCategorySlugAttribute()\n {\n $categoryString = '';\n $categories = $this->categories()->first();\n if (!empty($categories) && $categories->webseriesDetail()) {\n $categoryString = $categories->webseriesDetail['slug'];\n }\n return $categoryString;\n }", "public function getVideoCategoryNameAttribute()\n {\n $categoryString = '';\n $categories = $this->categories()->first();\n if (!empty($categories)) {\n $categoryString = $categories->title;\n }\n return $categoryString;\n }", "public function showMovieCategories(){\n $querry=$this->con->prepare(\"SELECT * from categories\");\n $querry->execute();\n\n\n $html=\"<div class='previewCategories'>\n <h1>Movies</h1>\";\n\n //Keep on Appending the HTML OF EACH CATEGORY\n while($row=$querry->fetch(PDO::FETCH_ASSOC)){ //This loop working needs investigation\n $html.=$this->getCategoyHtml($row,null,false,true);\n }\n\n //Return the whole html to print\n return $html.\"</div>\";\n }", "function show_video_rating($params)\n{\n global $cbvid;\n return $cbvid->show_video_rating($params);\n}", "function videoCategory($connection, $videoId)\n{\n $queryCategoryVideo = \"SELECT category_video\nFROM video_category\nWHERE video_category.id_category IN (\nSELECT id_category\nFROM video_con_category\nWHERE video_con_category.id_video = '$videoId'\nAND video_con_category.id_category = video_category.id_category)\";\n $resultCategoryVideo = mysqli_query($connection, $queryCategoryVideo);\n $categoryVideo = '';\n while ($rowCategory = mysqli_fetch_array($resultCategoryVideo)) {\n $categoryVideoName = $rowCategory['category_video'];\n $categoryVideo .= $categoryVideoName.',';\n }\n $categoryVideo = substr($categoryVideo, 0, -1);\n\n return $categoryVideo;\n}", "public function index()\n { \n $media_cat = category::all();\n \n return view('home')->with('media_cat', $media_cat);\n }", "public function list_video($menu_class,$cate_lang,$limit_x=NULL,$limit_y=NULL){\n\n\t\tif(($limit_x !== NULL) && ($limit_y !== NULL))\n\t\t\t$this->db->limit($limit_y,$limit_x);\n\n\t\t$str_select='*';\n\t\t$arr_where=array('category_sub.menu_class'=>$menu_class,'category_sub.cate_lang'=>$cate_lang);\n\t\t$str_order=$this->_table.'.video_order asc';\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->join('category_sub',$this->_table.'.cate_id=category_sub.cate_id');\n\t\t$this->db->where($arr_where);\n\t\t$this->db->order_by($str_order);\n\n\t\t$query=$this->db->get($this->_table);\n\t\treturn $query->result_array();\n\n\t}", "public function getLink(){\n\t\t$parentCat = VideoCategory::get()->byID($this->VideoCategoryID);\n\t\t$parentPage = Page::get()->byID($parentCat->VideoPageID);\n\t\treturn $parentPage->Link().\"?video=\".$this->ID;\n\t}", "public function index()\n {\n $format = Carbon::now()->subMonth();\n $videos = $this->video->where('user_id', Auth::user()->id);\n $username = Auth::user()->username;\n $categories = Category::all();\n $latest = $this->video->whereDateFormat('created_at', '>=', $format);\n\n return view('pages.library', compact('videos', 'latest', 'username'))->with('categories', $categories);\n }", "public function actionVideoByItem($item='')\n {\n\n $video = $this->getModule()->getVideo($item);\n\n\n if($video){\n// header('Content-Type: image/jpg');\n echo $video->getContent();\n// echo $image->getContent($size);\n }else{\n throw new \\yii\\web\\HttpException(404, 'There is no video');\n }\n\n }", "public function index()\n {\n $videos = Resource::where('type_id', 1)->with('category')->orderBy('created_at', 'desc');\n $name = Input::get('name');\n\n //搜索\n if ($name) {\n $videos = $videos->where('title', 'like', '%' . $name . '%');\n }\n //生成唯一键\n /*$key = md5($videos->toSql());\n\n if(!Cache::get($key)) {\n //查出来\n $videos = $videos->paginate(10);\n //缓存起来\n Cache::put($key,$videos,5);\n } else {\n $videos = Cache::get($key);\n }*/\n $videos = $videos->paginate(10);\n //Cache::put('123','123456',3);\n //$a = Cache::get('123');\n //echo $a;\n\t\treturn view('admin.video.index')->with(compact('videos','name'));\n\t}", "function type_url_form_video()\n {\n }", "public function view_videos($args)\n {\n $this->registry->template->Title = \"HiiFan News Portal :: Admin Home Page : View Videos\";\n $videoListArray = $this->registry->model->run(\"getAllVideoList\", $args);\n $this->registry->template->PresentPage = $args['start_page'];\n $this->registry->template->VideoListArray = $videoListArray;\n $this->registry->template->show(\"view_videos\");\n }", "function video_link($vdetails,$type=NULL)\r\n{\r\n global $myquery;\r\n #checking what kind of input we have\r\n if(is_array($vdetails))\r\n {\r\n if(empty($vdetails['title']))\r\n {\r\n #check for videoid\r\n if(empty($vdetails['videoid']) && empty($vdetails['vid']) && empty($vdetails['videokey']))\r\n {\r\n return BASEURL;\r\n }else{\r\n if(!empty($vdetails['videoid']))\r\n $vid = $vdetails['videoid'];\r\n elseif(!empty($vdetails['vid']))\r\n $vid = $vdetails['vid'];\r\n elseif(!empty($vdetails['videokey']))\r\n $vid = $vdetails['videokey'];\r\n else\r\n return BASEURL;\r\n }\r\n }\r\n }else{\r\n if(is_numeric($vdetails))\r\n $vid = $vdetails;\r\n else\r\n return BASEURL;\r\n }\r\n #checking if we have vid , so fetch the details\r\n if(!empty($vid))\r\n $vdetails = get_video_details($vid);\r\n\r\n //calling for custom video link functions\r\n $functions = cb_get_functions('video_link');\r\n if($functions)\r\n {\r\n foreach($functions as $func)\r\n {\r\n $array = array('vdetails'=>$vdetails,'type'=>$type);\r\n if(function_exists($func['func']))\r\n {\r\n $returned = $func['func']($array);\r\n if($returned)\r\n {\r\n $link = $returned;\r\n return $link;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n $plist = \"\";\r\n if(SEO == 'yes'){\r\n\r\n if($vdetails['playlist_id'])\r\n $plist = '?&play_list='.$vdetails['playlist_id'];\r\n\r\n $vdetails['title'] = strtolower($vdetails['title']);\r\n\r\n switch(config('seo_vido_url'))\r\n {\r\n default:\r\n $link = BASEURL.'/video/'.$vdetails['videokey'].'/'.SEO(clean(str_replace(' ','-',$vdetails['title']))).$plist;\r\n break;\r\n\r\n case 1:\r\n {\r\n $link = BASEURL.'/'.SEO(clean(str_replace(' ','-',$vdetails['title']))).'_v'.$vdetails['videoid'].$plist;\r\n }\r\n break;\r\n\r\n case 2:\r\n {\r\n $link = BASEURL.'/video/'.$vdetails['videoid'].'/'.SEO(clean(str_replace(' ','-',$vdetails['title']))).$plist;\r\n }\r\n break;\r\n\r\n case 3:\r\n {\r\n $link = BASEURL.'/video/'.$vdetails['videoid'].'_'.SEO(clean(str_replace(' ','-',$vdetails['title']))).$plist;\r\n }\r\n break;\r\n }\r\n\r\n\r\n }else{\r\n if($vdetails['playlist_id'])\r\n $plist = '&play_list='.$vdetails['playlist_id'];\r\n $link = BASEURL.'/watch_video.php?v='.$vdetails['videokey'].$plist;\r\n }\r\n if(!$type || $type=='link')\r\n return $link;\r\n elseif($type=='download')\r\n return BASEURL.'/download.php?v='.$vdetails['videokey'];\r\n}", "function get_video_category()\n {\n\t\t$select = array('id', 'vchCategoryName');\n\t\t\n\t $this->db->select($select)->from('video_category')->where('enumStatus', 'A');\n\t $this->db->order_by('id', 'desc');\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query->result_array();\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n }", "public function edit($id)\n\t{\n\t\t$video = Resource::find($id);\n\t\t//id=1表示是视频的大类\n\t\t$categories = Category::find(1);\n\t\treturn view('admin.video.edit')->with(compact('video','categories'));\n\t}", "public function createVideo();", "public function show($id)\n {\n return view('video::show');\n }", "public function create()\n {\n //\n\n $categories = DB::table('categories')->Select('categoryID', 'categoryName')->paginate();\n\n return view('video.addVideo', compact('categories'));\n }", "function getparentVideo($catid)\n{\n\t//echo $catid;\n\t$record=$cn->selectdb(\"SELECT * FROM tbl_video_category where cat_id=\".$catid.\"\");\n\t//echo \"select cat_id,cat_name,cat_parent_id from tbl_category where cat_id=\".$catid.\"\";\n\tif(dbNumRows($record)>0)\n\t{\n\t\t$sitemap=\"\";\n\t\twhile($row2 = dbFetchAssoc($record)) \n\t\t{\n\t\t\textract($row2);\n\t\t\t//$sitemap = $sitemap.$cat_name.\">>\";\n\t\t\t//$sitemap = $cat_name.\">>\".$sitemap;\n\t\t\t$sitemap = \"<a href='maingallery.php?id=\".$cat_id.\"' style='text-decoration:none;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;color:#310101'>\".$cat_name.\"</a>\".\"&nbsp;&nbsp;&raquo;&nbsp;&nbsp;\".$sitemap;\n\t\t\tif($cat_parent_id!=0)\n\t\t\t{\n\t\t\t\tgetparentVideo($cat_parent_id);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t}\n\t\t\techo $sitemap;\n\t\t}\n\t}\n}", "public function externalAction() {\n\n //GET SUBJECT\n $this->view->video = $video = Engine_Api::_()->core()->getSubject('sitereview_video');\n\n //CHECK THAT EMBEDDING IS ALLOWED OR NOT\n if (!Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereview_video.embeds', 1)) {\n $this->view->error = 1;\n return;\n } else if (isset($video->allow_embed) && !$video->allow_embed) {\n $this->view->error = 2;\n return;\n }\n\n //GET EMBED CODE\n $this->view->videoEmbedded = \"\";\n if ($video->status == 1) {\n $video->view_count++;\n $video->save();\n $this->view->videoEmbedded = $video->getRichContent(true);\n }\n\n //TRACK VIEWS FROM EXTERNAL SOURCES\n Engine_Api::_()->getDbtable('statistics', 'core')\n ->increment('video.embedviews');\n\n //GET FILE LOCATION\n if ($video->type == 3 && $video->status == 1) {\n if (!empty($video->file_id)) {\n $storage_file = Engine_Api::_()->getItem('storage_file', $video->file_id);\n if ($storage_file) {\n $this->view->video_location = $storage_file->map();\n }\n }\n }\n\n //GET RATING DATA\n $this->view->rating_count = Engine_Api::_()->getDbTable('videoratings', 'sitereview')->ratingCount($video->getIdentity());\n }", "function showCategory()\r\n {\r\n }", "public function create()\n\t{\n\t\t$compact = [];\n\n\t\t$categories = Category::with('child')->find(1);\n\t\t$compact[] = 'categories';\n\n\t\treturn view('admin.video.create')->with(compact($compact));\n\t}", "function yoast_add_og_video() {\n if ( get_post_format() == 'video' ) {\n $post = get_post();\n preg_match('/\\[embed(.*)](.*)\\[\\/embed]/', $post->post_content, $video);\n $videoParts = explode('/',$video[2]);\n echo '<meta property=\"og:video\" content=\"' . $video[2] . '\" />', \"\\n\";\n echo '<meta property=\"og:video:secure_url\" content=\"' . str_replace('http://','https://' , $video[2]) . '\" />', \"\\n\";\n echo '<meta property=\"og:video:height\" content=\"1080\" />', \"\\n\";\n echo '<meta property=\"og:video:width\" content=\"1920\" />', \"\\n\";\n //echo '<meta property=\"og:image\" content=\"https://img.youtube.com/vi/'.$videoParts[3].'/maxresdefault.jpg\" />', \"\\n\";\n }\n}", "public function index()\n {\n //\n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = usermoodle::where('id', $user_id)->first();\n\n $videoTipos = VideoType::all();\n return view('admin.videotype.index', compact('videoTipos', 'usuario'));\n }", "public function indexAction() {\n\t if($this->settings['channel']) {\n\t $videos = $this->videoRepository->getUserUploads($this->settings['channel']); \n } else {\n $this->videoRepository->setQuery($this->settings);\n $queryUrl = $this->videoRepository->getQueryUrl(); \n\t\t $videos = $this->videoRepository->getVideos($query); \n\t\t $this->view->assign('query', $queryUrl);\n } \n\t\t$this->view->assign('videos', $videos);\n\t\tif($this->settings['singlePageOnListPage']) {\n\t\t $comments = $this->videoRepository->getComments($videos[0][vid]);\n\t\t $this->view->assign('comments', $comments);\n $this->response->addAdditionalHeaderData('\n <style>\n .tx-youtubeapi-video-list {\n \t\t\tfloat:left;\t\n \t\t\twidth:50%;\n \t\t\tpadding:0.5em;\n \t\t}\n \t\t\n \t\t.tx-youtubeapi-video-single {\n \t\t\tpadding:0.5em;\n \t\t}\n \t\t\n \t\t.tx-pagebrowse-pi1 {\n clear: both;\n }\n </style>');\n }\n \n\t\t$this->view->assign('settings', $this->settings);\n\t}", "public function actionVideo_tutorials()\t\n\t\t\n\t {\t\n\t \n $this->pageTitle='Video Tutorials - Business Supermarket';\n\t\t\t \n $this->render('video_tutorials',array('model' =>$model));\n\t\t\t \n\t }", "public function addVideocategory()\n {\n return view('admin.addvideocategory');\n }", "public function index()\n {\n $videos=auth()->user()->videos->sortByDesc('created_at');\n $title='last uploaded videos';\n\n return view('videos.my-videos',compact('videos','title'));\n }", "function video() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['id'];\n if ($id > 0) {\n $query = \"select * from videos where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $query = \"update videos set views = views + 1 where id =$id;\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n $this->response(json_encode($result), 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }", "public function index()\n \t{\n \t\t$videos=Video::orderBy('listing_order','desc')\n ->orderBy('updated_at','desc')->get();\n\n \t\treturn view('admin.video.manage',compact('videos'));\n \t}", "public function view_video($video)\n{\n\tif(Auth::check()){\n\t\tif(Auth::user()->type==\"Artist\"){\n\t\t\t$deliver_videos = DB::table('requested_videos')->select('*')\n\t\t\t->where('requested_videos.uploadedby','=',Auth::user()->profile_id)\n\t\t\t->where('requested_videos.id','=',$video)\n\t\t\t->paginate(15);\n\t\t\t$artist = Profile::find(Auth::user()->profile_id);\n\t\t\t$video_data['video'] = $deliver_videos;\n\t\t\t$video_data['artist'] = $artist;\n //dd($video_data);\n //return view('frontend.my_video',$video_data);\n\t\t\treturn view('frontend.artistDashboard.view_video',$video_data); \n\t\t}else{\n\t\t\treturn redirect('/login');\n\t\t}\n\t}else{\n\t\treturn redirect('/login'); \n\t} \n\t//return view(\"frontend.artistDashboard.view_video\");\n\n}", "public function index()\n {\n if(Auth::user()->speciality !== 'admin')\n {\n $videos = Video::whereSpeciality(Auth::user()->speciality)->get();\n }\n else\n {\n $videos = Video::all();\n }\n return view('home', compact('videos'));\n }", "function getNazrulVideo() {\n $sql = \"SELECT Album01,ID, LiveLink FROM ferozatable where Header='Music' and SubCategory='Solo Album' and LiveLink !=''\";\n $query = $this->db->query($sql);\n return $query->result();\n }", "public function create()\n {\n $categories = Category::where('status',1)->orderBy('name')->get();\n //dd($categories->toArray());\n return view('adminCMS.videos.addVideo',compact('categories'));\n }", "public function index()\n {\n $videos = Video::orderBy('id','DESC')->get();\n \n return view('admin.video.index',compact('videos'));\n }", "public function index()\n {\n $video = Video::all();\n return view('admin.videos.index', compact('video'));\n }", "public function show($category)\n {\n }", "public function actionIndex()\n {\n// $videos = Track::findAll(['type' => 'video']);\n return $this->render('index',['audio' => '1','video' => '1']);\n }", "public function getCategoryVideoswithBlock($username, $category)\n {\n// if(!strcmp($category,'All')){\n// return $this->createwithBlock($username);\n// }\n $blockUsers = $this->getBlockUsername($username);\n if (empty($blockUsers)) {\n return $this->categoryFilter($category, $username);\n }\n $qMarks = str_repeat('?,', count($blockUsers) - 1) . '?';\n $category = \"'\" . $category . \"'\";\n $query = $this->conn->prepare(\"SELECT videos.* From videos inner join category on videos.category = category.id where category.name=$category and videos.uploaded_by NOT IN ($qMarks)\");\n $query->execute($blockUsers);\n $dbresult = $query->fetchAll(PDO::FETCH_ASSOC);\n $dbresult = $this->checkPrivacy($dbresult, $username);\n $categoryFilterquerywithBlock = '';\n foreach ($dbresult as $value) {\n $filePath = $value[\"file_path\"];\n $title = $value[\"title\"];\n $uploaded_by = $value[\"uploaded_by\"];\n $views = $value[\"views\"];\n $upload_date = date('Y-m-d', strtotime($value[\"upload_date\"]));\n// $upload_date = date('Y-m-d H:i:s',$value[\"upload_date\"]);\n $videoid = $value[\"id\"];\n $thumbnailpath = $this->getthumbnail($videoid);\n $thumbnailpath = $thumbnailpath[\"file_path\"];\n $duration = $value['video_duration'];\n $videolink = \"<a href='watch.php?vid=$videoid'><img src='$thumbnailpath' alt='$title' height='200' width='300'></a>\";\n $categoryFilterquerywithBlock .= \"<div>$videolink<br> \n <span id='videoTitle'>$title</span><br> <div class='wrapper'><div class='left'>$uploaded_by<br>$views views</div> <div class ='right'><span style='float:right'>$duration</span><br><span style='float:right'>$upload_date</span> </div></div>\n </div> &emsp;&emsp;&emsp;\";\n }\n return $categoryFilterquerywithBlock;\n }" ]
[ "0.71129334", "0.7088098", "0.68356526", "0.67956144", "0.6774687", "0.67714834", "0.6703376", "0.66435254", "0.66068417", "0.6592017", "0.65885174", "0.65164816", "0.6491253", "0.649111", "0.64447176", "0.6427883", "0.6427751", "0.638876", "0.6347911", "0.631395", "0.6300028", "0.6299589", "0.6285462", "0.62830603", "0.62763196", "0.62763196", "0.62763196", "0.62763196", "0.6262997", "0.6239748", "0.6225081", "0.6207511", "0.61916834", "0.6189905", "0.6185983", "0.6156242", "0.61530024", "0.61491936", "0.6141516", "0.61411273", "0.6133722", "0.61214185", "0.61151475", "0.6108333", "0.6096691", "0.607842", "0.6068002", "0.6065699", "0.6064545", "0.6052383", "0.6045427", "0.6033861", "0.60216445", "0.60208845", "0.598757", "0.5972158", "0.5966316", "0.59626573", "0.59602576", "0.5955564", "0.5952025", "0.5950738", "0.59455043", "0.59367824", "0.59317297", "0.5931689", "0.5930436", "0.59301764", "0.59049445", "0.589967", "0.58939654", "0.5893002", "0.58669025", "0.58659166", "0.5864552", "0.58631873", "0.5841584", "0.5841522", "0.583817", "0.5835147", "0.58327013", "0.5832062", "0.58319414", "0.58282995", "0.5820768", "0.5815074", "0.58112043", "0.580963", "0.5804742", "0.5790921", "0.5787206", "0.57797885", "0.5770244", "0.57695806", "0.5769213", "0.57646716", "0.5760062", "0.5750815", "0.57444763", "0.5739688" ]
0.5880714
72
/Edit video category Function for view Form
public function editVideoCategory($id) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $workout = VideoCategory::find($id); return view('admin.editvideocategory')->with('workout',$workout); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addEdit(){\n\t\tif (isset($this->session->userdata['logged_in'])){\n\t\t\t$video_id = $this->uri->segment(4);// get id form url\n\t\t\tif($video_id==''){\n\t\t\t\t$data['title'] = \"Add Video\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$data['title'] = \"Edit Video\";\n\t\t\t}\n\t\t\t$data['content'] = 'admin/addeditvideo';\n\t\t\t$data['getVideo'] = $this->VideoModel->getVideoById($video_id); //retrive all category By Id\n\t\t\t//print_r($data['getVideo']); die;\n\t\t\t$this->load->view('admin/layout/adminmaster',$data);\n\t\t}else{\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "public function edit($id)\n {\n $video = Video::find($id);\n $category = Category::all()->pluck('name','id');\n \n return view('admin.video.edit', compact('video','category'));\n }", "public function edit($id)\n {\n $video = Video::find($id);\n // dd($video->categories[0]->name);\n $categories = Category::where('status',1)->orderBy('name')->get();\n $tags = Tag::where('status',1)->get();\n return view('adminCMS.videos.editVideo',compact('video','categories','tags'));\n }", "public function edit($id)\n\t{\n\t\t$video = Resource::find($id);\n\t\t//id=1表示是视频的大类\n\t\t$categories = Category::find(1);\n\t\treturn view('admin.video.edit')->with(compact('video','categories'));\n\t}", "public function editAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid()) {\n return;\n }\n\n //GET LISTING ID\n $listing_id = $this->_getParam('listing_id', 0);\n\n $listingtype_id = $this->_listingType->listingtype_id;\n\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n\n //GET VIDEO OBJECT\n $sitereview_video = Engine_Api::_()->getItem('sitereview_video', $this->_getParam('video_id'));\n\n //GET TAB ID\n $this->view->tab_selected_id = $this->_getParam('content_id');\n\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n $this->view->can_edit = $canEdit = $sitereview->authorization()->isAllowed($viewer, \"edit_listtype_$sitereview->listingtype_id\");\n\n //SUPERADMIN, VIDEO OWNER AND LISTING OWNER CAN EDIT VIDEO\n if ($viewer_id != $sitereview_video->owner_id && $canEdit != 1) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n //GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitereview_main');\n\n //FORM GENERATION\n $this->view->form = $form = new Sitereview_Form_Editvideo();\n\n //PREPARE TAGS\n $sitereviewTags = $sitereview_video->tags()->getTagMaps();\n $tagString = '';\n foreach ($sitereviewTags as $tagmap) {\n if ($tagString !== '') {\n $tagString .= ', ';\n }\n $tagString .= $tagmap->getTag()->getTitle();\n }\n $this->view->tagNamePrepared = $tagString;\n $form->tags->setValue($tagString);\n\n //IF NOT POST OR FORM NOT VALID THAN RETURN\n if (!$this->getRequest()->isPost()) {\n $form->populate($sitereview_video->toArray());\n return;\n }\n\n //IF NOT POST OR FORM NOT VALID THAN RETURN\n if (!$form->isValid($this->getRequest()->getPost())) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid data');\n return;\n }\n\n //GET FORM VALUES\n $values = $form->getValues();\n\n //PROCESS\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n try {\n $sitereview_video->setFromArray($values);\n\n // Add tags\n $tags = preg_split('/[,]+/', $values['tags']);\n $sitereview_video->tags()->setTagMaps($viewer, $tags);\n $sitereview_video->save();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview_video->getSlug(), 'video_id' => $sitereview_video->getIdentity(), 'user_id' => $sitereview_video->owner_id, 'content_id' => $this->view->tab_selected_id), \"sitereview_video_view_listtype_$listingtype_id\", true);\n }", "public function edit(Video $video)\n { \n\n $categories = Category::pluck('name', 'id');\n\n return view('admin.videos.edit', compact('video', 'categories'));\n }", "public function editVideo($id)\n {\n\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = Video::find($id);\n $categories = VideoCategory::all();\n //dd($categories);\n return view('admin.editvideo')->with('workout',$workout)->with('videoCategories',$categories);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function updateVideoCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $videoCategory = VideoCategory::find($id);\n $videoCategory->video_category_name = $request->name;\n $videoCategory->save();\n Session::flash('success','Video Category Updated succcessfully.');\n return redirect()->back()->with('workout',$videoCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function edit(Video $video)\n {\n //\n }", "public function edit(Video $video)\n {\n //\n }", "public function addVideo()\n {\n $getAllVideoCategory = VideoCategory::all();\n return view('admin.addvideo')->with('videoCategory',$getAllVideoCategory);\n }", "public function edit(ProductVideo $productVideo)\n {\n //\n }", "public function edit($id)\n {\n $video = $this->video->find($id);\n $categories = Category::all();\n\n return view('pages.editvideo')->with('video', $video)->with('categories', $categories);\n }", "public function videoCategory() {\n $this->loadModel('VideoCategories');\n $data = $this->VideoCategories->find('all');\n $this->paginate = [ ];\n $videoCategories = $this->paginate($data);\n\n $this->set(compact('videoCategories'));\n \n }", "public function edit($id)\n {\n $title = 'Video Management';\n\n $video = Video::where('id_video', $id)->first();\n\n $category = Categories::all();\n\n return view('video::edit')->withVideo($video)->withCategory($category)->withTitle($title);\n }", "public function editAction() {\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n //GET SITEREVIEW SUBJECT\n $this->view->sitereview = $sitereview = Engine_Api::_()->core()->getSubject();\n\n $this->view->listingtype_id = $listingtype_id = $this->_listingType->listingtype_id;\n\n $this->view->slideShowEnanle = $this->slideShowEnable($listingtype_id);\n\n $this->view->listing_singular_uc = ucfirst($this->_listingType->title_singular);\n $this->view->listing_singular_lc = strtolower($this->_listingType->title_singular);\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, $viewer, \"edit_listtype_$listingtype_id\")->isValid()) {\n return;\n }\n\n $this->view->content_id = Engine_Api::_()->sitereview()->getTabId($listingtype_id, 'sitereview.video-sitereview');\n\n //SELECTED TAB\n $this->view->TabActive = \"video\";\n\n if (!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_videoedit_edit_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n }\n\n //GET VIDEOS\n $this->view->type_video = $type_video = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereview.show.video');\n\n if ($type_video && isset($sitereview->main_video['corevideo_id'])) {\n $this->view->main_video_id = $sitereview->main_video['corevideo_id'];\n } elseif (isset($sitereview->main_video['reviewvideo_id'])) {\n $this->view->main_video_id = $sitereview->main_video['reviewvideo_id'];\n }\n\n $this->view->videos = $videos = array();\n $this->view->integratedWithVideo = false;\n $sitevideoEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitevideo');\n if ($sitevideoEnabled && (Engine_Api::_()->getDbtable('modules', 'sitevideo')->getIntegratedModules(array('enabled' => 1, 'item_type' => \"sitereview_listing_$sitereview->listingtype_id\", 'item_module' => 'sitereview')))) {\n $params = array();\n $params['parent_type'] = $sitereview->getType() . '_' . $sitereview->listingtype_id;\n $params['parent_id'] = $sitereview->listing_id;\n $this->view->videos = $videos = Engine_Api::_()->getDbTable('videos', 'sitevideo')->getVideoPaginator($params);\n $this->view->integratedWithVideo = true;\n } else {\n if (Engine_Api::_()->sitereview()->enableVideoPlugin() && !empty($type_video)) {\n $this->view->videos = $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 1);\n } elseif (empty($type_video)) {\n $this->view->videos = $videos = Engine_Api::_()->getItemTable('sitereview_clasfvideo', 'sitereview')->getListingVideos($sitereview->listing_id, 0, 0);\n }\n }\n\n $allowed_upload_video = Engine_Api::_()->sitereview()->allowVideo($sitereview, $viewer, count($videos), $uploadVideo = 1);\n $this->view->upload_video = 1;\n if (Engine_Api::_()->sitereview()->hasPackageEnable()) {\n $this->view->upload_video = $allowed_upload_video;\n } else {\n if (empty($allowed_upload_video)) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n }\n\n $this->view->count = count($videos);\n\n //MAKE FORM\n $this->view->form = $form = new Sitereview_Form_Video_Editvideo();\n\n foreach ($videos as $video) {\n\n $subform = new Sitereview_Form_Video_Edit(array('elementsBelongTo' => $video->getGuid()));\n\n if ($video->status != 1) {\n if ($video->status == 0 || $video->status == 2):\n $msg = $this->view->translate(\"Your video is currently being processed - you will be notified when it is ready to be viewed.\");\n elseif ($video->status == 3):\n $msg = $this->view->translate(\"Video conversion failed. Please try again.\");\n elseif ($video->status == 4):\n $msg = $this->view->translate(\"Video conversion failed. Video format is not supported by FFMPEG. Please try again.\");\n elseif ($video->status == 5):\n $msg = $this->view->translate(\"Video conversion failed. Audio files are not supported. Please try again.\");\n elseif ($video->status == 7):\n $msg = $this->view->translate(\"Video conversion failed. You may be over the site upload limit. Try a smaller file, or delete some files to free up space.\");\n endif;\n\n $subform->addElement('dummy', 'mssg' . $video->video_id, array(\n 'description' => $msg,\n 'decorators' => array(\n 'ViewHelper',\n array('HtmlTag', array('tag' => 'div', 'class' => 'tip')),\n array('Description', array('tag' => 'span', 'placement' => 'APPEND')),\n array('Description', array('placement' => 'APPEND')),\n ),\n ));\n $t = 'mssg' . $video->video_id;\n $subform->$t->getDecorator(\"Description\")->setOption(\"placement\", \"append\");\n }\n $subform->populate($video->toArray());\n $form->addSubForm($subform, $video->getGuid());\n }\n\n //CHECK METHOD\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //GET FORM VALUES\n $values = $form->getValues();\n\n if (isset($_POST['corevideo_cover']) && !empty($_POST['corevideo_cover'])) {\n if (isset($sitereview->main_video) && !empty($sitereview->main_video)) {\n $sitereview->main_video = array_merge((array) $sitereview->main_video, array('corevideo_id' => $_POST['corevideo_cover']));\n } else {\n $sitereview->main_video = array('corevideo_id' => $_POST['corevideo_cover']);\n }\n } elseif (isset($_POST['reviewvideo_cover']) && $_POST['reviewvideo_cover']) {\n if (isset($sitereview->main_video) && !empty($sitereview->main_video)) {\n $sitereview->main_video = array_merge((array) $sitereview->main_video, array('reviewvideo_id' => $_POST['reviewvideo_cover']));\n } else {\n $sitereview->main_video = array('reviewvideo_id' => $_POST['reviewvideo_cover']);\n }\n }\n\n $sitereview->save();\n\n //VIDEO SUBFORM PROCESS IN EDITING\n foreach ($videos as $video) {\n $subform = $form->getSubForm($video->getGuid());\n\n $values = $subform->getValues();\n $values = $values[$video->getGuid()];\n if (isset($values['delete']) && $values['delete'] == '1') {\n Engine_Api::_()->getDbtable('videos', 'sitereview')->delete(array('video_id = ?' => $video->video_id, 'listing_id = ?' => $sitereview->listing_id));\n Engine_Api::_()->getDbtable('actions', 'activity')->delete(array('type = ?' => 'video_sitereview_listtype_' . $listingtype_id, 'object_id = ?' => $sitereview->listing_id));\n } else {\n $video->setFromArray($values);\n $video->save();\n }\n }\n\n return $this->_helper->redirector->gotoRoute(array('action' => 'edit', 'listing_id' => $sitereview->listing_id), \"sitereview_videospecific_listtype_$listingtype_id\", true);\n }", "public function edit(Video $video)\n {\n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = UserMoodle::where('id', $user_id)->first();\n $users = UserMoodle::all();\n $competitors = Competitor::where('video_id', $video->id)->get();\n $competitor_types = CompetitorType::where('status', 1)->get();\n $video_types = VideoType::where('status', 1)->get();\n\n return view('admin.videos.edit', compact('video', 'usuario', 'users', 'video_types', 'competitor_types', 'competitors'));\n }", "public function edit(Video $video)\n {\n //\n $categories = DB::table('categories')->Select('categoryID', 'categoryName')->paginate();\n\n $getFilesData = DB::table('files')->select('fileID', 'fileName', 'file', 'created_at')->where('videoID', '=', $video->videoID)->paginate();\n\n return view('video.editVideo', compact('video', 'categories', 'getFilesData'));\n }", "public function edit()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/edit\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n\n } catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception->getMessage());\n }\n\n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "public function edit_category($category_id){\n $category_info=DB::table('tbl_category')\n ->where('category_id',$category_id)\n ->first();\n $edit_category=view('admin.pages.edit_category') \n ->with('category_info',$category_info); \n return view('admin.admin_master')->with('admin_content',$edit_category);\n }", "public function editAction() {\n $this->_helper->layout->setLayout('admin-simple');\n\n if (!($category_id = $this->_getParam('category_id'))) {\n die('No identifier specified');\n }\n\n //FETCH PARAMETERS ACCORDING TO THIS CATEGORY\n $reviewCategories = Engine_Api::_()->getDbtable('reviewcats', 'sitestorereview')->reviewParams($category_id);\n\n //GENERATE A FORM\n $form = $this->view->form = new Sitestorereview_Form_Admin_Ratingparameter_Edit();\n $form->setAction($this->getFrontController()->getRouter()->assemble(array()));\n\n $form->setField($reviewCategories->toArray());\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n\n foreach ($values as $key => $value) {\n $reviewcat_id = explode('reviewcat_name_', $key);\n $reviewcat = Engine_Api::_()->getItem('sitestorereview_reviewcat', $reviewcat_id[1]);\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\n try {\n //EDIT CATEGORY NAMES\n $reviewcat->reviewcat_name = $value;\n $reviewcat->save();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => 10,\n 'parentRefresh' => 10,\n 'messages' => array('')\n ));\n }\n\n $this->renderScript('admin-ratingparameter/edit.tpl');\n }", "public function editPost()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"edit_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryName = $this->input->post(\"name\");\n\n $categoryModel = new CategoriesModel();\n\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n if ($categoryModel->editCategory($categoryName, $categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category edited successfully!\",\"success\");\n } else {\n $this->view->redirect(\"/categories/manage\",\"You did not change anything ?\");\n }\n\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function edit() {\n// user must be logged in\n if (User::is_logged_in()) {\n// preventing double submitting\n $token = md5(time());\n $_SESSION[$token] = true;\n\n $user_id = $_SESSION['user_id'];\n $is_admin = isset($_SESSION['is_admin']) && $_SESSION['is_admin'];\n $post_id = $_GET['post_id'];\n $post = Post::find($post_id);\n\n $description = $post['description'];\n $categoryId = $post['category'];\n $imageFile = $post['imageFile'];\n// user can edit only his post or he must be an admin\n if ($user_id == $post['authorId'] || $is_admin) {\n // get all categories for the select box in form\n $categories = Category::all();\n// show post edit form\n require_once('views/posts/edit.php');\n }\n }\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "function edit()\n {\n $id = $this->uri->rsegment('3');\n $video = $this->video_model->get_info($id);\n if(!$video)\n {\n $this->session->set_flashdata('message', 'Không tồn tại video này');\n redirect(admin_url('video'));\n }\n $this->data['video'] = $video;\n \n $this->load->library('form_validation');\n $this->load->helper('form');\n \n //neu ma co du lieu post len thi kiem tra\n if($this->input->post())\n {\n $this->form_validation->set_rules('name', 'Tên video', 'required');\n $this->form_validation->set_rules('link', 'Link video', 'required');\n \n if($this->form_validation->run())\n {\n \n //lay ten file anh minh hoa duoc update len\n $this->load->library('upload_library');\n $upload_path = './upload/video';\n $upload_data = $this->upload_library->upload($upload_path, 'image'); \n $images = '';\n if(isset($upload_data['file_name']))\n {\n $images = $upload_data['file_name'];\n }\n \n //luu du lieu can them\n $data = array(\n 'name' => $this->input->post('name'),\n 'images' => $images,\n 'link' => $this->input->post('link'),\n ); \n if($images != '')\n {\n $data['images'] = $images;\n }\n \n //them moi vao csdl\n if($this->video_model->update($video->id, $data))\n {\n $this->session->set_flashdata('message', 'Cập nhật thành công');\n }else{\n $this->session->set_flashdata('message', 'Không cập nhật được');\n }\n redirect(admin_url('video'));\n }\n }\n \n \n //load view\n $this->data['temp'] = 'admin/video/edit';\n $this->load->view('admin/main', $this->data);\n }", "public function getEdit($video)\n\t{\n // Title\n $title = Lang::get('admin/videos/title.video_update');\n\n // Show the page\n return View::make('admin/videos/create_edit', compact('video', 'title'));\n\t}", "public function editVideo(Request $request)\n {\n\n $editVideo = UploadVideo::where(\"id\", $request->id)->first();\n $editVideo->content_title = ucfirst($request->title);\n if ($request->active) {\n $editVideo->active_status = 1;\n } else {\n $editVideo->active_status = 0;\n }\n\n $editVideo->save();\n }", "function EditarCategoria($params=null){\n $id_categoria= $params[':ID'];\n $this->modelo->GetCategoria($id_categoria);\n $this->vista->mostrarCategoriaEdit($id_categoria); \n }", "function editAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\t\n\t\t$redirectUrl = $this->getRedirectUrl();\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t$error \t\t= array();\n\t\t\t$success \t= array();\n\t\t\t$contents \t= '';\n\t\t\t$formData \t= array();\n\t\t\t //Truyen du lieu hien co vao form\n\t\t\t$formData['fbulkid'] = array();\n\t\t\t$formData['fid'] = $myProductCat->id;\n\t\t\t$formData['fname'] = $myProductCat->name;\n\t\t\t$formData['forder'] = $myProductCat->order;\n\t\t\t$formData['fparentid'] = $myProductCat->parentid;\n\t\t\t$formData['fenable'] = $myProductCat->enable;\n\t\t\t$formData['fseourl'] = $myProductCat->seoUrl;\n\t\t\t$formData['fseotitle'] = $myProductCat->seoTitle;\n\t\t\t$formData['fseokeyword'] = $myProductCat->seoKeyword;\n\t\t\t$formData['fseodescription'] = $myProductCat->seoDescription;\n\t\t\t\n\t\t\tif(!empty($_POST['fsubmit']))//truong hop da nhan nut submit\n\t\t\t{\n if($_SESSION['productcategoryEditToken']==$_POST['ftoken'])//kiem tra token\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->editActionValidator($formData, $error))//kiem tra du lieu co hop le hay khong\n {\n //Cac thong tin khong ngon ngu:\n $myProductCat->order = (int)$formData['forder'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n if(strlen($formData['fseourl']) > 0)\n $myProductCat->seoUrl = Helper::codau2khongdau($formData['fseourl'], true);\n else\n $myProductCat->seoUrl = Helper::codau2khongdau(strip_tags($formData['fname']), true);\n //Cac thong tin lien quan ngon ngu: \n $myProductCat->name = $formData['fname']; \n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n \n if($myProductCat->updateData())//cap nhat database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succUpdate']);\n $this->registry->me->writelog('ProductCategoryedit', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n }\n else\n {\n $error[] = $this->registry->lang['controller']['errUpdate']; \n }\n }\n }\n $_SESSION['productcategoryEditToken'] = Helper::getSecurityToken();//Tao token moi\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t\t\t$this->registry->smarty->assign(array(\t'formData' \t=> $formData,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'subcategories' => $myProductCat->getSub(true),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'parentCategories' => Core_ProductCategory::getFullCategories(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectUrl'=> $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'success'\t=> $success,\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\t));\n\t\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'edit.tpl');\n\t\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategorylist',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_edit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t\t$this->registry->smarty->assign(array('redirect' => $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectMsg' => $redirectMsg,\n\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t}\n\t}", "public function edit($video_type)\n {\n //\n $tipoVideo = VideoType::findOrFail($video_type);\n \n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = usermoodle::where('id', $user_id)->first();\n\n return view('admin.videotype.edit', compact('tipoVideo', 'usuario'));\n }", "public function create()\n {\n $categories = Category::all()->pluck('name','id');\n \n return view('admin.video.create', compact('categories'));\n }", "public function edit(Video $video)\n {\n $bussines=Bussine::lists('slug','id');\n return view('backend.videos.edit')->with('video',$video)->with('bussines',$bussines);\n }", "public function indexAction()\n {\n $module = $this->params('module');\n $slug = $this->params('slug');\n\n // Get config\n $config = Pi::service('registry')->config->read($module);\n\n // Get category information from model\n $category = $this->getModel('category')->find($slug, 'slug');\n $category = Pi::api('category', 'video')->canonizeCategory($category);\n\n // Check category\n if (!$category || $category['status'] != 1) {\n $this->getResponse()->setStatusCode(404);\n $this->terminate(__('The category not found.'), '', 'error-404');\n $this->view()->setLayout('layout-simple');\n return;\n }\n // Update Hits\n $this->getModel('category')->increment('hits', ['id' => $category['id']]);\n // category list\n $categoriesJson = Pi::api('category', 'video')->categoryListJson();\n // Check display type\n switch ($category['display_type']) {\n case 'video':\n $template = 'video-angular';\n break;\n\n case 'subcategory':\n // Get info\n $list = [];\n $where = ['status' => 1, 'parent' => $category['id']];\n $order = ['display_order ASC', 'time_create DESC', 'title ASC'];\n $select = $this->getModel('category')->select()->where($where)->order($order);\n $rowSet = $this->getModel('category')->selectWith($select);\n // Make list\n foreach ($rowSet as $row) {\n $list[$row->id] = Pi::api('category', 'video')->canonizeCategory($row);\n }\n // Set view\n $this->view()->assign('list', $list);\n // Set template\n $template = 'category-single';\n break;\n }\n\n // Save statistics\n if (Pi::service('module')->isActive('statistics')) {\n Pi::api('log', 'statistics')->save('video', 'category', $category['id']);\n }\n\n // Set view\n $this->view()->headTitle($category['seo_title']);\n $this->view()->headDescription($category['seo_description'], 'set');\n $this->view()->headKeywords($category['seo_keywords'], 'set');\n $this->view()->setTemplate($template);\n $this->view()->assign('config', $config);\n $this->view()->assign('category', $category);\n $this->view()->assign('categoriesJson', $categoriesJson);\n $this->view()->assign('pageType', 'category');\n }", "public function edit(Postcategory $postcategory)\n {\n //\n }", "public function edit_category($category) {\n $this->category();\n $categories_sql_string = \"SELECT * FROM category WHERE id = \" . $category . \" limit 1\";\n $connection = new Database(\"sbrettsc_db\");\n $menu_array = $connection->get_array_from_query($categories_sql_string);\n $data = array(\"menu_array\" => array_shift($menu_array));\n\n $this->loadView(\"editors/category_editor\", $data);\n }", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "public function edit(Category $category) {\n //not implemented\n }", "public function addVideocategory()\n {\n return view('admin.addvideocategory');\n }", "public function postEdit($video)\n\t{\n\n // Declare the rules for the form validation\n $rules = array(\n 'user' => 'required|min:5',\n 'link' => 'required|min:10',\n 'description' => 'required|min:10'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Update the video video data\n $video->user = Input::get('user');\n $video->link = Input::get('link');\n $video->description = Input::get('description');\n // Was the video video updated?\n if($video->save())\n {\n // Redirect to the new video video page\n return Redirect::to('admin/videos/' . $video->id . '/edit')->with('success', Lang::get('admin/videos/messages.update.success'));\n }\n\n // Redirect to the videos video management page\n return Redirect::to('admin/videos/' . $video->id . '/edit')->with('error', Lang::get('admin/videos/messages.update.error'));\n }\n\n // Form validation failed\n return Redirect::to('admin/videos/' . $video->id . '/edit')->withInput()->withErrors($validator);\n\t}", "public function edit($id)\n {\n $video = Video::find($id);\n $pk = CoursePackage::all();\n return view('admin.video.edit')->with('v' , $video)->with('pk' , $pk);\n }", "public function edit($id = 0)\n\t{\t\n\t\t// Get the channel\n\t\t$channel = $this->video_channel_m->get($id);\n\t\t\n\t\t// ID specified?\n\t\t$channel or redirect('admin/video/channels/index');\n\t\t\n\t\t// Validate the results\n\t\tif ($this->form_validation->run())\n\t\t{\n\t\t\t$input = array(\n\t\t\t\t'title' => $this->input->post('title'),\n\t\t\t\t'description' => $this->input->post('description'),\n\t\t\t\t'parent_id' => $this->input->post('parent_id'),\n\t\t\t);\n\t\t\t\n\t\t\tif ( ! empty($_FILES['thumbnail']['name']))\n\t\t\t{\n\t\t\t\tif ( ! self::_upload())\n\t\t\t\t{\n\t\t\t\t\t$this->template->messages = array('error' => $this->upload->display_errors());\n\t\t\t\t\tgoto display;\n\t\t\t\t}\n\n\t\t\t\tif ( ! self::_resize())\n\t\t\t\t{\n\t\t\t\t\t$this->template->messages = array('error' => $this->image_lib->display_errors());\n\t\t\t\t\tgoto display;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$thumbnail = $this->upload->data();\n\t\t\t\t$input['thumbnail'] = $thumbnail['file_name'];\n\t\t\t}\n\t\t\t\n\t\t\t$this->video_channel_m->update($id, $input)\n\t\t\t\t? $this->session->set_flashdata('success', sprintf( lang('video_channel:edit_success'), $this->input->post('title')) )\n\t\t\t\t: $this->session->set_flashdata(array('error'=> lang('video_channel:edit_error')));\n\t\t\t\n\t\t\tredirect('admin/videos/channels');\n\t\t}\n\t\t\n\t\tdisplay:\n\t\t\n\t\t// Loop through each rule\n\t\tforeach ($this->validation_rules as $rule)\n\t\t{\n\t\t\tif ($this->input->post($rule['field']) !== FALSE)\n\t\t\t{\n\t\t\t\t$channel->{$rule['field']} = $this->input->post($rule['field']);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$channels = array(lang('select.none')) + $this->video_channel_m->order_by('title')->where('parent_id', 0)->dropdown('id', 'title');\n\n\t\t$this->template->title($this->module_details['name'], sprintf(lang('video_channel:edit_title'), $channel->title))\n\t\t\t->set('channel', $channel)\n\t\t\t->set('channels', $channels)\n\t\t\t->build('admin/channels/form', $this->data);\n\t}", "public function edit(Category $Category)\n {\n //\n }", "public function actionCategoryEdit()\n {\n $this->_assertCanManageCategories();\n $category_id = $this->_input->filterSingle('faq_id', XenForo_Input::UINT);\n $viewParams = array('faqcategory' => $this->_getCategoryModel()->getById($category_id));\n return $this->responseView('Iversia_FAQ_ViewPublic_Category', 'iversia_faq_edit_category', $viewParams);\n }", "function get_category_to_edit($id)\n {\n }", "public function edit(Request $request, $video_id)\n {\n $categories = VideoRecordsCategory::getAllList();\n $videoRecord = VideoRecords::where('id', $video_id)->get();\n foreach ($videoRecord as $videoRecord);\n $photos = VideoRecordImages::where('video_record_id', $video_id)->get();\n return $this->view('video_records.create_edit', compact('categories'))\n ->with('photoable', $videoRecord)\n ->with('folder_date', $videoRecord->created_at->format('dmY'))\n ->with('photos', $photos)\n ->with('item', $videoRecord);\n }", "public function editAction(Tx_Youtubeapi_Domain_Model_Video $video) {\n\t\t$this->view->assign('video', $video);\n\t}", "function catedit()\r\n\t{\r\n\t\t$data['cat'] = $this->categeory_model->cat($this->uri->segment(4));\r\n\t\t$this->load->view('admin/edit',$data);\r\n\t}", "public function addVideo(){\n if (isset($_POST[\"add_video\"])) {\n $movie = $this->model('Movie');\n $system = $this->model('System');\n\n $video_name = $_POST[\"video_title\"];\n $video_url = $_POST[\"video_url\"];\n $video_category = $_POST[\"selected_category\"];\n $video_description = $_POST[\"video_description\"];\n $video_sef_url = $system->seflink($video_name);\n\n $movie->addVideo($video_name,$video_url,$video_category,$video_description,$video_sef_url);\n }\n // where to go after comment has been added\n header('location: ' . URL . 'yonetim/videos');\n }", "public function edit(CourseCategory $courseCategory)\n {\n //\n }", "public function edit($id){\n $categorie=Blog_categories::find($id);\n return view ('blog_categories.edit',['categorie'=>$categorie]);\n}", "public function edit_video($video){\n\tif(Auth::check()){\n\t\tif(Auth::user()->type==\"Artist\"){\n\t\t\t$deliver_videos = DB::table('requested_videos')->select('*')\n\t\t\t->where('requested_videos.uploadedby','=',Auth::user()->profile_id)\n\t\t\t->where('requested_videos.id','=',$video)\n\t\t\t->paginate(15);\n\t\t\t$artist = Profile::find(Auth::user()->profile_id);\n\t\t\t$video_data['video'] = $deliver_videos;\n\t\t\t$video_data['artist'] = $artist;\n //return view('frontend.my_video',$video_data);\n\t\t\treturn view('frontend.artistDashboard.edit_video',$video_data); \n\t\t}else{\n\t\t\treturn redirect('/login');\n\t\t}\n\t}else{\n\t\treturn redirect('/login'); \n\t} \n\n}", "public function formModify() {\n $categories=$this->model->listCategories();\n $this->view->display(\"view/form/ProductFormModify.php\", NULL, $categories); \n }", "public function edit_category($id)\n\t{\n\t\t$query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n $data['category']=$query; \n\t\t$data['title']=\"Dahboard || Great Wine Global\";\n $this->load->view('superpanel/header',$data);\n $this->load->view('superpanel/edit_categorie');\n $this->load->view('superpanel/footer');\n\t}", "public function edit($id)\n { \n //This Function Call CategoryHelpers.php Directory . \n $category = fetchCategoryTree(0,'','');\n $cat = Category::find($id);\n return view('admin.category.edit', compact('cat', 'category'));\n }", "public function edit($id)\n {\n //\n $channels = Channel::pluck('title','id');\n $video = Video::with(['slider'])\n ->where('id',$id)\n ->first();\n // dd($video);\n $val = [];\n $val[] = $video->related_videos_1;\n $val[] = $video->related_videos_2;\n $val[] = $video->related_videos_3;\n $valj = json_encode($val);\n // dd($video);\n $videos = Video::where('channel_id', $video->channel_id)->where('id','<>',$video->id)->pluck('title','id');\n if($video->type==1){\n return view('Push::videos.edit', compact(['channels','video', 'videos','valj']));\n }elseif($video->type==2){\n return view('Push::videos.editpdf', compact(['channels','video', 'videos','valj']));\n }else{\n return view('Push::videos.editslider', compact(['channels','video', 'videos','valj']));\n } \n }", "public function edit(BlogCategory $blogCategory)\n {\n //\n }", "public function actionVideo()\n {\n\n $arrParams = Yii::$app->request->queryParams;\n $arrParams['ArticleSearch']['category_id'] = Article::CAT_VIDEO;\n $searchModel = new ArticleSearch();\n $dataProvider = $searchModel->search($arrParams);\n $dataProvider->sort = [\n 'defaultOrder'=>['published_at'=>SORT_DESC]\n ];\n\n return $this->render('index_video', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider\n ]);\n }", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "function modifyCategory()\n{\n global $connection;\n if (isset($_POST['modifyBtn'])) {\n $categoria_id = $_POST['categoria_id'];\n\n $categoria_nome = str_replace([\"'\", '’', '“', '”'], [\"\\'\", \"\\'\", \"\\'\", \"\\'\"], $_POST['categoria_nome']);\n\n $query_update = \"UPDATE video_category SET category_video='$categoria_nome' WHERE id_category='$categoria_id'\";\n $result_update = mysqli_query($connection, $query_update);\n if ($result_update) {\n return header('Location: video_categorie.php?modify=true');\n } else {\n return header('Location: video_categorie.php?modify=false');\n }\n }\n}", "public function edit(Kategoriartikelblog $kategoriartikelblog)\n {\n //\n }", "public function edit_postAction() {\r\n\t\t$info = $this->getPost(array('id', 'sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$ret = Game_Service_Category::updateCategory($info, intval($info['id']));\r\n\t\tif (!$ret) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功.'); \t\t\r\n\t}", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "public function edit($id)\n\t{\n\t\tBreadcrumbs::addCrumb('Manage Teams and Videos', 'teacher');\n\t\tBreadcrumbs::addCrumb('Edit Video', $id);\n\t\tView::share('title', 'Edit Video');\n\t\t$video = Video::with('students')->find($id);\n\n\t\t// Get the most recent competition year with video divisisons\n\t $comp_year = CompYear::orderBy('year', 'desc')\n\t ->with([ 'vid_divisions' => function($q) {\n\t\t\t\t\t\t\t\t\t\treturn $q->orderby('display_order');\n\t\t\t\t\t\t\t\t\t}])\n\t\t\t\t\t\t\t->first();\n\n $division_list = [ 0 => \"- Select Division -\" ] + $comp_year->vid_divisions->lists('name', 'id');\n\n\t\t// Student Setup\n\t\t$ethnicity_list = [ 0 => \"- Select Ethnicity -\" ] + Ethnicity::all()->lists('name','id');\n\t\tif(!Session::has('students')) {\n\t\t\t// On first load we populate the form from the DB\n\t\t\t$students = $video->students;\n\t\t} else {\n\t\t\t// On subsequent loads or errors, use the sessions variable\n\t\t\t$students = [];\n\t\t}\n\t\t$index = -1;\n\n\n\t\tif (is_null($video))\n\t\t{\n\t\t\treturn Redirect::route('teacher.index');\n\t\t}\n\n\t\t$divisions = Division::longname_array();\n\n\t\treturn View::make('teacher.videos.edit', compact('video','students', 'division_list', 'ethnicity_list', 'index'))\n\t\t\t\t ->with('divisions', $divisions);\n\t}", "public function Editar(){\n $ca = new Categoria();\n \n if(isset($_REQUEST['id'])){\n $ca = $this->model->Obtener($_REQUEST['id']);\n }\n \n require_once 'view/header.php';\n require_once 'view/categoria/editar.php';\n require_once 'view/footer.php';\n }", "public function edit(Video $video)\n {\n $data = $video->createOrUpdate();\n\n return view( 'videos.video.edit' )\n ->withVideo( $video->edit() )\n ->withSeries( $data['series'] )\n ->withCategories( $data['categories'] );\n }", "function processForm()\r\n\t{\r\n\t\t$originalViewId = $this->viewId;\r\n\t\tparent::processForm();\r\n\t\t\r\n\t\t$this->mc->database->query(\"UPDATE \" . $this->mc->config['database_pref'] . \"views SET view_action = view_name WHERE view_id = ?\", array(array($this->viewId, \"i\")));\r\n\t\t\r\n\t\t//if(isset($_REQUEST['view_videoselection']) && $_REQUEST['view_videoselection'] != -1)\r\n\t\t\t// TODO: currently just statically inserted\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'The Superbowl XLVI 2012.mp4', 'Superbowl XLVI Trailer', '4:16', 'superbowl_logo.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Ahmad Bradshaw Touchdown.mp4', 'Ahmad Bradshaw Touchdown', '0:24', 'superbowl_shot.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Jerome Simpson Touchdown Flip.mp4', 'Jerome Simpson Touchdown Flip', '0:26', 'nfl_logo_rasen.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Tom Brady Final Throw.mp4', 'Tom Brady Final Throw', '1:33', 'nfl_logl_original.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\t\t$this->mc->database->query(\"INSERT INTO \" . $this->mc->config['database_pref'] . \"concept_mediacenter (view_id, video_name, video_text, video_length, video_thumbnail, revision) VALUES(?, 'Best SuperBowl Moments.mp4', 'Best SuperBowl Moments', '3:19', 'superbowl_moments.jpg', ?)\", array(array($this->viewId, \"i\"), array($this->mc->config['current_revision'], \"i\")));\r\n\t\r\n\t\t// update concept type id for this view\r\n\t\t$conceptQuery = $this->mc->database->query(\"SELECT concept_id FROM \" . $this->mc->config['database_pref'] . \"concepts WHERE concept_key = 'mediacenter'\");\r\n\t\t$this->mc->database->query(\"UPDATE \" . $this->mc->config['database_pref'] . \"views SET view_c_type = ? WHERE view_id = ?\", array(array($conceptQuery->rows[0]->concept_id, \"i\"), array($this->viewId, \"i\")));\r\n\t\t\r\n\t\t$this->cleanUpDirectory();\r\n\t\t$this->createXmlFile();\r\n\t\t\r\n\t\t// re-create main xml file and refresh filelist\r\n\t\t$this->mc->filecreator->createGeneralFiles();\r\n\t\t$configSet = true;\r\n\t\tinclude_once('modules/filemanager.module.php');\r\n\t\t$fileManagerObj = new apdModuleFilemanager($this->mc);\r\n\t\t$fileManagerObj->refreshFilelist();\r\n\t\t\r\n\t\theader(\"Location: index.php?m=mediacenter&view_id=\" . $this->viewId);\r\n\t}", "public function category(VideoCategory $videoCategory)\n {\n $page = Input::get('page', 1);\n\n $cat = VideoCategory::where('slug', '=', $videoCategory)->first();\n\n $parent_cat = VideoCategory::where('parent_id', '=', $cat->id)->first();\n\n if (!empty($parent_cat->id)) {\n $parent_cat2 = VideoCategory::where('parent_id', '=', $parent_cat->id)->first();\n if (!empty($parent_cat2->id)) {\n $videos = Video::select($this->getVideoFieldsForFrontend())\n ->where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orWhere('video_category_id', '=', $parent_cat->id)\n ->orWhere('video_category_id', '=', $parent_cat2->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n } else {\n $videos = Video::where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orWhere('video_category_id', '=', $parent_cat->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n }\n } else {\n $videos = Video::where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n }\n\n $data = [\n 'videos' => $videos,\n 'current_page' => $page,\n 'category' => $cat,\n 'page_title' => 'Videos - ' . $cat->name,\n 'page_description' => 'Page ' . $page,\n 'pagination_url' => '/videos/category/' . $videoCategory,\n 'menu' => Menu::orderBy('order', 'ASC')->get(),\n 'video_categories' => VideoCategory::all(),\n 'theme_settings' => config('settings.theme'),\n ];\n\n return view('Theme::video-list', $data);\n }", "public function edit($id = null)\n {\n // Get the CV matching ID\n $cvs = $this->Cvs->get($id, ['contain' => ['Categories', 'CategoriesCompetences']]);\n\n // If CV id = Auth ID or account_type is admin / super admin\n if ($this->Auth->user('id') === $cvs->user_id or $this->Auth->user('account_type') >= 2) {\n // If request is patch / post or put\n if ($this->request->is(['patch', 'post', 'put'])) {\n $cv = $this->Cvs->patchEntity($cvs, $this->request->data);\n $ext = substr(strtolower(strrchr($this->request->data['video']['name'], '.')), 1);\n $arr_ext = array(\"mp3\", \"mp4\", \"wma\");\n // set a random new video name\n $setNewFileName = time() . \"_\" . rand(000000, 999999);\n\n // if ext uploaded is in allowed arr_ext\n if (in_array($ext, $arr_ext)) {\n // place video in videos map\n move_uploaded_file(($this->request->data['video']['tmp_name']), WWW_ROOT . '/videos/' . $setNewFileName . '.' . $ext);\n // set the new filename in public $video\n $this->video = $setNewFileName . '.' . $ext;\n }\n // set video path to the path in $video\n\n\n // if able to save, save the entity in database\n if ($this->Cvs->save($cv)) {\n $this->Flash->set('De CV is succesvol opgeslagen!', ['key' => 'cv-success', 'params' => ['class' => 'alert alert-success']]);\n\n return $this->redirect(['action' => 'index']);\n }\n else {\n $this->Flash->set('Er ging iets mis! Controleer of alle velden correct ingevuld zijn.', ['key' => 'cv-error', 'params' => ['class' => 'alert alert-danger']]);\n }\n }\n }\n else {\n return $this->redirect(['controller' => 'Cvs', 'action' => 'index']);\n }\n\n // if user is company, redirect\n if ($this->Auth->user('account_type') === 1) {\n return $this->redirect(['controller' => 'Dashboard', 'action' => 'index']);\n }\n\n // get all the categories and set them in $categories\n $categories = $this->Cvs->Categories->find('list', ['keyField' => 'id', 'valueField' => 'category']);\n\n // set all object\n $this->set(compact('cvs', 'categories'));\n }", "public function edit()\r\n {\r\n if (!isset($_SESSION['auth']) || empty($this->params['id'])) {\r\n header('Location: ' . BASE_URI);\r\n exit;\r\n }\r\n // get genre and publisher list\r\n $genreModel = new GenreModel();\r\n $genreList = $genreModel->read();\r\n $publisherModel = new PublisherModel();\r\n $publisherList = $publisherModel->read();\r\n\r\n // CASE user submit change\r\n if (isset($this->params['title'])) {\r\n $this->model->id = $this->params['id'];\r\n unset($this->model->params['id']);\r\n\r\n $this->model->params = $this->filterArrayEmpty($this->model->params);\r\n /**\r\n * Verif here\r\n */\r\n $this->model->save();\r\n header('Location: ' . BASE_URI . DIRECTORY_SEPARATOR . 'movie?id=' . $this->params['id']);\r\n exit;\r\n }\r\n\r\n // CASE edit movie page\r\n $this->model->id['col'] = 'id_movie';\r\n $this->model->id['val'] = $_GET['id'];\r\n // get genre and publisher real name\r\n $data = $this->model->read();\r\n\r\n $this->render('edit', [\r\n 'movie' => !empty($data) ? $data[0] : 'No data',\r\n 'genreList' => $genreList,\r\n 'publisherList' => $publisherList\r\n ]);\r\n }", "public function edit($id = NULL){\n\t\tif ($id) {\n\t\t\t$this->data['category'] = $this->category_m->get($id);\n\t\t\tcount($this->data['category']) || $this->data['errors'][] = 'category could not be found';\n\t\t}\n\t\telse {\n\t\t\t$this->data ['category'] = $this->category_m->get_new();\n\t\t}\n\t\t\n\t\t// Set up the form\n\t\t$rules = $this->category_m->rules;\n\t\t$this->form_validation->set_rules($rules);\n\t\t\n\t\t// Process the form\n\t\tif ($this->form_validation->run() == TRUE) {\n\t\t\t$data = $this->category_m->array_from_post(array(\n\t\t\t\t'title', \n\t\t\t\t'description', \n\t\t\t\t'items_style'\n\t\t\t\t\n\t\t\t));\n\t\t\t$this->category_m->save($data, $id);\n\t\t\tredirect('admin/category');\n\t\t}\n\t\t\n\t\t$this->data['subview'] ='admin/category/edit';\n\t $this->load->view('admin/_layout_main', $this->data);\n }", "public function editNewsPost($cat_id)\n {\n\n $postData = DB::table('news_posts')\n ->join('news_categories', 'news_posts.news_category_id', '=', 'news_categories.id')\n ->select('news_posts.*', 'news_categories.name as catName', 'news_categories.id as catID')\n /*->get();*/\n ->where('news_posts.id',$cat_id)\n ->first();\n\n\n\n\n $editPost=view('admin.news_post_edit')\n ->with('postData',$postData);\n\n return view('admin.master')\n ->with('main_content',$editPost);\n\n return Redirect::to('/news');\n }", "public function create()\n {\n return view('adminVideo.category.create');\n }", "public function edit(Category $Category)\n {\n echo \"i am in edit\";exit();\n //\n }", "function editAction($categoryId)\n {\n $category = $this->category->findByPk($categoryId);\n $this->set(\"category\", $category);\n $this->set(\"categoryJson\", JsonView::php2js($category));\n $this->set(\"categoryExtraFields\", $this->extraField->getCategoryFields($categoryId));\n $this->set(\"categoriesSelect\", $this->category->createOptionsList());\n }", "public function edit($id){\n\n //\n\n $categories = Category::pluck('name', 'id')->all();\n $category = Category::find($id);\n\n $sub_categories = Category::where(['parent_id' => $id])->orderBy('id', 'desc')->get();\n\n\n return view(\"admin.category.edit\", compact( 'categories','category','sub_categories'));\n\n }", "public function editPost($id) {\n\n $category = ApplicationCategory::find($id)->first();\n\n if ( ! $category) {\n // Category not found\n\n return redirect()->back();\n }\n // Validate\n\n $validation = Validator::make($this->request->all(), [\n 'parent_id' => 'exists:app_categories,id',\n 'title' => 'required|min:1|max:255',\n 'description' => 'required|min:1|max:1023',\n 'image_small' => 'image|mimes:jpeg,jpg,png',\n 'image_large' => 'image|mimes:jpeg,jpg,png',\n 'is_active' => 'numeric',\n 'is_visible' => 'numeric',\n ]);\n $niceNames = array(\n 'name' => '`Application name`'\n );\n $validation->setAttributeNames($niceNames);\n\n if ($validation->fails()) {\n return redirect()->back()\n ->withInput($this->request->all())\n ->withErrors($validation->errors());\n }\n\n $category->parent_id = $this->request->get('parent_id') ? $this->request->get('parent_id') : null;\n $category->name = $this->request->get('name');\n $category->title = $this->request->get('title');\n $category->description = $this->request->get('description');\n if ($image = $this->request->file('image_small')) {\n $category->uploadImageSmall($image);\n }\n if ($image = $this->request->file('image_large')) {\n $category->uploadImageLarge($image);\n }\n $category->is_active = $this->request->get('is_active') == 1;\n $category->is_visible = $this->request->get('is_visible') == 1;\n\n $category->save();\n\n return redirect()->back();\n }", "public function editCategory($cat_id)\n {\n // get category by cat_id..\n $category = DB::table('categories')->where('id',$cat_id)->first();\n return view('admin.category.edit_category',compact('category'));\n }" ]
[ "0.74266785", "0.7275998", "0.726344", "0.68650925", "0.6863897", "0.6794455", "0.6754705", "0.6735835", "0.67225397", "0.67225397", "0.6645616", "0.66434765", "0.6589407", "0.65821415", "0.6552618", "0.6528862", "0.64521164", "0.6444938", "0.6425412", "0.64169085", "0.63936806", "0.6358071", "0.6355891", "0.63320124", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.6316502", "0.63104206", "0.6309189", "0.63046366", "0.6291342", "0.62776655", "0.6276063", "0.6260355", "0.624997", "0.6238244", "0.6225054", "0.62226075", "0.6220072", "0.6216206", "0.62125313", "0.6208241", "0.61922204", "0.6180612", "0.61791176", "0.61753684", "0.6171248", "0.6167762", "0.6167211", "0.6165418", "0.61642003", "0.61640567", "0.61636996", "0.61582637", "0.6143632", "0.6138543", "0.61349356", "0.6128142", "0.6123053", "0.61179346", "0.6105488", "0.6081049", "0.60741264", "0.607093", "0.6068146", "0.6062558", "0.6052618", "0.6048097", "0.6046088", "0.60433674", "0.6042966", "0.6036076", "0.6027784", "0.6027034", "0.6026355", "0.60259444", "0.6021262", "0.6014411", "0.6010563", "0.6005819", "0.6005415", "0.6004389" ]
0.7021443
3
/Edit video category Function for update
public function updateVideoCategory(Request $request) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $this->validate($request,array( 'name' => 'required', )); $id = $request->id; $videoCategory = VideoCategory::find($id); $videoCategory->video_category_name = $request->name; $videoCategory->save(); Session::flash('success','Video Category Updated succcessfully.'); return redirect()->back()->with('workout',$videoCategory); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modifyCategory()\n{\n global $connection;\n if (isset($_POST['modifyBtn'])) {\n $categoria_id = $_POST['categoria_id'];\n\n $categoria_nome = str_replace([\"'\", '’', '“', '”'], [\"\\'\", \"\\'\", \"\\'\", \"\\'\"], $_POST['categoria_nome']);\n\n $query_update = \"UPDATE video_category SET category_video='$categoria_nome' WHERE id_category='$categoria_id'\";\n $result_update = mysqli_query($connection, $query_update);\n if ($result_update) {\n return header('Location: video_categorie.php?modify=true');\n } else {\n return header('Location: video_categorie.php?modify=false');\n }\n }\n}", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "public function addEdit(){\n\t\tif (isset($this->session->userdata['logged_in'])){\n\t\t\t$video_id = $this->uri->segment(4);// get id form url\n\t\t\tif($video_id==''){\n\t\t\t\t$data['title'] = \"Add Video\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$data['title'] = \"Edit Video\";\n\t\t\t}\n\t\t\t$data['content'] = 'admin/addeditvideo';\n\t\t\t$data['getVideo'] = $this->VideoModel->getVideoById($video_id); //retrive all category By Id\n\t\t\t//print_r($data['getVideo']); die;\n\t\t\t$this->load->view('admin/layout/adminmaster',$data);\n\t\t}else{\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "public function update_category(){\n $query = \"UPDATE {$this->table} SET cat_title = :cat_title WHERE {$this->table}.cat_id = :cat_id\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_title',$this->cat_title);\n $stmt->bindParam(':cat_id',$this->cat_id);\n $stmt->execute();\n return $stmt;\n }", "public function edit($id)\n {\n $video = Video::find($id);\n // dd($video->categories[0]->name);\n $categories = Category::where('status',1)->orderBy('name')->get();\n $tags = Tag::where('status',1)->get();\n return view('adminCMS.videos.editVideo',compact('video','categories','tags'));\n }", "public function testUpdateCategoryUsingPUT()\n {\n }", "private function updateVideo()\n {\n try\n {\n $request = $_POST;\n\n global $cbvid;\n\n //check if video id provided\n if( !isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video Id not provided\");\n\n if( !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n //check if title provided\n if( !isset($request['title']) || $request['title']==\"\")\n throw_error_msg(\"title not provided\");\n else\n $title = mysql_clean($request['title']);\n\n //check if description provided\n if( !isset($request['description']) || $request['description']==\"\")\n throw_error_msg(\"description not provided.\");\n else\n $description = mysql_clean($request['description']);\n\n //check if tags provided\n if(!isset($request['tags']) || $request['tags']==\"\")\n throw_error_msg(\"tags not provided.\");\n else\n $tags = mysql_clean($request['tags']);\n\n //check if tags provided\n if(!isset($request['category']) || $request['category']==\"\")\n {\n throw_error_msg(\"category not provided.\");\n }\n else\n {\n $request['category'] = explode(',',$request['category']); \n $_POST['category'] = $request['category'];\n }\n \n if (isset($request['video_users-user']) || isset($request['video_users-group'])) \n {\n $video_user_ = mysql_clean($request['video_users-user']);\n $video_group_ = mysql_clean($request['video_users-group']);\n\n $request['video_users'] = get_video_users($video_user_,$video_group_,false);\n }\n \n $result = $cbvid->update_video($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $vdetails = $cbvid->get_video_details($request['videoid']);\n $formatted_video = format_videos(array($vdetails));\n\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $formatted_video[0]);\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function editCategory()\r\n{\r\n $query_string = \"UPDATE categories \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"categoryname = :categoryname, \";\r\n $query_string .= \"categorydescription = :categorydescription \";\r\n $query_string .= \"WHERE categoryid = :categoryid\";\r\n\r\n return $query_string;\r\n}", "public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }", "public function edit($id)\n {\n $video = Video::find($id);\n $category = Category::all()->pluck('name','id');\n \n return view('admin.video.edit', compact('video','category'));\n }", "public function categories_update($param = null)\r\n {\r\n if (isset($_POST[\"cat_id\"]) && !empty($_POST[\"cat_id\"])) {\r\n $action = $_POST[\"cat_id\"];\r\n $newValue = $_POST[\"cat_descr\"];\r\n $update = Category::find($action)->update(['cat_descr' => $newValue]);\r\n echo $update;\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }", "function fm_update_category($name, $catid = NULL, $groupid = 0) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($catid != NULL) {\r\n\t\t$update->id = $catid;\r\n\t\t$update->name = $name;\r\n\t\t$update->timemodified = time();\r\n\t\tif (!update_record('fmanager_categories', $update)) {\r\n\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\t$new->name = $name;\r\n\t\tif ($groupid == 0){\r\n\t\t\t$new->owner = $USER->id;\r\n\t\t\t$new->ownertype = OWNERISUSER;\r\n\t\t} else {\r\n\t\t\t$new->owner = $groupid;\r\n\t\t\t$new->ownertype = OWNERISGROUP;\r\n\t\t}\r\n\t\t$new->timemodified = time();\r\n\t\tif (!insert_record('fmanager_categories', $new)) {\r\n\t\t\terror(get_string(\"errnoinsert\",'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public function editVideoCategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = VideoCategory::find($id);\n return view('admin.editvideocategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function edit_postAction() {\r\n\t\t$info = $this->getPost(array('id', 'sort', 'title', 'img', 'status', 'hits'));\r\n\t\t$info = $this->_cookData($info);\r\n\t\t$ret = Game_Service_Category::updateCategory($info, intval($info['id']));\r\n\t\tif (!$ret) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功.'); \t\t\r\n\t}", "function EditarCategoria($params=null){\n $id_categoria= $params[':ID'];\n $this->modelo->GetCategoria($id_categoria);\n $this->vista->mostrarCategoriaEdit($id_categoria); \n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "function wp_update_category($catarr)\n {\n }", "public function edit(Video $video)\n {\n //\n }", "public function edit(Video $video)\n {\n //\n }", "public function testUpdateItemSubCategory()\n {\n }", "public function update(Request $request, VideoCategory $videoCategory)\n {\n $data = $request->validate([\n 'name' => 'required',\n ]);\n\n $videoCategory->update($data);\n\n return back()->with('success', 'تم التعديل بنجاح');\n }", "public function edit(ProductVideo $productVideo)\n {\n //\n }", "public function update_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n //category id\n $id = $this->input->post('category_id', true);\n if ($this->gallery_category_model->update_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_updated\"));\n redirect('admin_category/gallery_categories');\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }", "public function updateCategory(){\n\t\t \n\t\t$file_id = $this->category_model->updateCategory($_POST['id'],$_POST['name']);\n\t\t echo $file_id;\n\t\t\t\t\n }", "public function update(Request $request, $id)\n {\n $data['page_title'] = 'Content';\n $data['categories'] = Category::all()->sortBy('name');\n $data['languages'] = Settings::LANGUAGES;\n $data['genres'] = Settings::GENRES;\n\n $validationData = $request->validate(\n [\n 'category' => ['required'],\n 'name' => ['required', 'string', 'max:255'],\n //'videofile' => 'sometimes|nullable|mimes:mpeg,ogg,mp4,webm,3gp,mov,flv,avi,wmv,ts|max:' . config('constants.MAX_VIDEO_UPLOAD_SIZE'),\n 'file' => 'sometimes|nullable|mimes:png,PNG,jpg,JPG,jpeg,JPEG|max:' . config('constants.MAX_FILE_UPLOAD_SIZE'),\n 'language' => ['required', 'string'],\n 'genres' => ['required', 'string'],\n 'artist' => ['required', 'string'],\n 'castandcrew' => ['required', 'string'],\n 'description' => ['required', 'string'],\n\n ]\n );\n if ($request->hasfile('file')) {\n $image = $request->file('file');\n $image_name = time() . '_' . $image->getClientOriginalName();\n //$image_path = $request->file('file')->storeAs('uploads', $image_name);\n $image_path = 'banner_images/' . $image_name;\n Storage::disk('s3')->put($image_path, file_get_contents($image));\n }\n\n //print($duration);\n $tags = ($request->tags) ? explode(',', $request->tags) : '';\n $display_tags = ($request->display_tags) ? explode(',', $request->display_tags) : '';\n\n $save_data = [\n 'category_id' => $request->category,\n 'name' => $request->name,\n 'language' => $request->language,\n 'genres' => $request->genres,\n //'content_link' => ($video_path) ?? '',\n //'format' => ($video_extension) ?? '',\n 'tags' => json_encode($tags),\n 'display_tags' => json_encode($display_tags),\n //'client_id' => $this->client(),\n 'artist' => $request->artist,\n 'castandcrew' => $request->castandcrew,\n 'description' => $request->description,\n 'updated_by' => Auth::id(),\n ];\n if (isset($image_path))\n $save_data = array_merge($save_data, ['banner_image' => $image_path]);\n //dd($save_data);\n $content = Content::whereId($id)->update($save_data);\n if ($content) {\n return redirect('client/contents/view/' . $id)->with('success', \"Content Update Successfully.\");\n } else {\n return redirect('client/contents/view/' . $id)->with('failure', \"Oops! Content Not Updated.\");\n }\n }", "public function update(Request $request ,Category $update){\n $update -> category_name_en = $request -> blog_category_name_en;\n $update -> category_name_lng = $request -> blog_category_name_lng;\n $update -> category_name_en_slug = strtolower(str_replace(' ' , '-' , $request -> blog_category_name_en));\n $update -> category_name_lng_slug = str_replace(' ' , '-' , $request -> blog_category_name_lng);\n $update -> update();\n return true;\n }", "function editCategory($category, $id) {\n $data = [\n 'name' => $_POST['name'],\n 'description' => $_POST['description']\n ];\n\n $stmt = $category->update($id, $data);\n header('location: confirm.php?action=Category&type=update&query='.$stmt);\n}", "public function editVideo($id)\n {\n\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = Video::find($id);\n $categories = VideoCategory::all();\n //dd($categories);\n return view('admin.editvideo')->with('workout',$workout)->with('videoCategories',$categories);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function editPost()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"edit_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryName = $this->input->post(\"name\");\n\n $categoryModel = new CategoriesModel();\n\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n if ($categoryModel->editCategory($categoryName, $categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category edited successfully!\",\"success\");\n } else {\n $this->view->redirect(\"/categories/manage\",\"You did not change anything ?\");\n }\n\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "public function update(Request $request, Video $video)\n { \n\n $request->validate([\n 'name' => \"required|unique:videos,name,$video->id\"\n ]);\n\n $url_video = $request->url_video;\n\n $url_video_array = explode(\"/\", $url_video);\n \n if(Str::contains($url_video, 'youtube')) {\n $url_video_id = $url_video_array[4];\n $url_thumbail = 'https://img.youtube.com/vi/'.$url_video_id.'/0.jpg';\n } \n\n if(Str::contains($url_video, 'vimeo')) {\n $url_video_id = $url_video_array[4];\n $hash = unserialize(file_get_contents(\"https://vimeo.com/api/v2/video/\".$url_video_id.\".php\"));\n $url_thumbail_preview = $hash[0]['thumbnail_large'];\n $url_thumbail = substr_replace( $url_thumbail_preview, \"480x360\", -3);\n } \n\n $video->update([\n 'name' => $request->name, \n 'date_public' => $request->date_public, \n 'status' => $request->status,\n 'category_id' => $request->category_id,\n 'url_video' => $url_video,\n 'url_thumbail' => $url_thumbail\n ]);\n\n return redirect()->route('admin.videos.edit', $video)->with('info', 'El video se actualizó con éxito');\n }", "function modifyCategory()\n{\n global $connection;\n global $updateCategorySuccess, $updateCategoryError;\n $updateCategorySuccess = $updateCategoryError = '';\n\n if (isset($_POST['btn_save_category'])) {\n $category_id = $_POST['txt_userid'];\n\n $updateColumncategory = '';\n\n $category_name = htmlentities($_POST['category_name']);\n if (!empty($category_name)) {\n $updateColumncategory .= \"category = '$category_name',\";\n }\n\n $updateColumncategory = rtrim($updateColumncategory, ',');\n\n $query_update = \"UPDATE product_category SET $updateColumncategory WHERE id_category = '$category_id'\";\n $result_update = mysqli_query($connection, $query_update);\n\n if ($result_update) {\n $updateCategorySuccess = '<script language=\"javascript\">\n swal(\"Sukses!\", \"Kategoria u modifikua me sukses!\", \"success\")\n </script>';\n } else {\n $updateCategoryError = '<script language=\"javascript\">\n swal(\"Gabim!\", \"Ka ndodhur një gabim gjatë modifikimit të kategorisë! Provoni përsëri!\", \"error\")\n </script>';\n }\n }\n}", "function get_category_to_edit($id)\n {\n }", "public function update(Request $request, $id)\n {\n\n try{\n\n $video = Video::find($id);\n\n $video->title = $request->input('title');\n $video->subtitle = $request->input('subtitle');\n $video->description = $request->input('description');\n $category = Category::find($request->input('category'));\n $tags = json_decode($request->input('tags'),true);\n $video->tags()->detach(); //we need time to attach again this is why this line is here and not inmeduatly bedore attach tags\n $video->categories()->detach();\n if($request->hasFile('thumbnail')){\n $thumbnailFile = $request->file('thumbnail');\n $thumbnailName = 'thumbnail_'.str_slug($request->input('title')).\".\".$thumbnailFile->getClientOriginalExtension();\n $thumbnailFile->move(public_path(\"uploads/videos/\"),$thumbnailName);\n $video->thumbnail = asset(\"uploads/videos/$thumbnailName\");\n }\n if($request->hasFile('video')){\n $videoFile = $request->file('video');\n $videoName = 'video_'.str_slug($request->input('title')).\".\".$videoFile->getClientOriginalExtension();\n $videoFile->move(public_path(\"uploads/videos/\"),$videoName);\n $video->video = asset(\"uploads/videos/$videoName\");\n\n }\n $video->categories()->attach($category->id);\n foreach ($tags as $key => $value) {\n $tagName = $tags[$key]['name'];\n //$tags = Tag::where('name','LIKE',\"%$name%\")->first();\n $tag = Tag::firstOrCreate(['name'=>$tagName]);\n\n $video->tags()->attach($tag->id);\n }\n $video->save();\n\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was updated successfully !!\");\n return redirect()->back();\n\n } catch(\\Exception $e){\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not update the video\");\n Log::warning(\"Can not update Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "function edit_category($tbl_name){\n\t\t//print_r($_POST); die;\n\t\tunset($_POST['submitLog']);\n\t\t$this->db->where('id', $_POST['id']);\n\t\tunset($_POST['id']);\n\t\t$this->db->update($tbl_name,$_POST);\n\t\t// print_r($this->db->last_query());\n\t // die();\n\t}", "public function edit(Postcategory $postcategory)\n {\n //\n }", "public function edit_category($category) {\n $this->category();\n $categories_sql_string = \"SELECT * FROM category WHERE id = \" . $category . \" limit 1\";\n $connection = new Database(\"sbrettsc_db\");\n $menu_array = $connection->get_array_from_query($categories_sql_string);\n $data = array(\"menu_array\" => array_shift($menu_array));\n\n $this->loadView(\"editors/category_editor\", $data);\n }", "public function editVideo(Request $request)\n {\n\n $editVideo = UploadVideo::where(\"id\", $request->id)->first();\n $editVideo->content_title = ucfirst($request->title);\n if ($request->active) {\n $editVideo->active_status = 1;\n } else {\n $editVideo->active_status = 0;\n }\n\n $editVideo->save();\n }", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "public function update(Request $request)\n {\n $dataArr = $request->all();\n \n $this->validate($request,[ \n 'cate_id' => 'required', \n 'title' => 'required', \n 'slug' => 'required',\n ],\n [ \n 'cate_id.required' => 'Please choose category', \n 'title.required' => 'Please input title',\n 'slug.required' => 'Please input slug' \n ]); \n \n $dataArr['alias'] = Helper::stripUnicode($dataArr['title']);\n \n $dataArr['type'] = 1;\n $dataArr['updated_user'] = Auth::user()->id;\n $dataArr['is_hot'] = isset($dataArr['is_hot']) ? 1 : 0;\n $dataArr['is_gg'] = isset($dataArr['is_gg']) ? 1 : 0;\n if($dataArr['is_gg'] == 1){\n $dataArr['encode_link'] = Helper::encodeLink($dataArr['video_url']); \n } \n $model = Articles::find($dataArr['id']);\n\n $model->update($dataArr);\n \n $this->storeMeta( $dataArr['id'], $dataArr['meta_id'], $dataArr);\n TagObjects::where(['object_id' => $dataArr['id'], 'type' => 1])->delete();\n // xu ly tags\n if( !empty( $dataArr['tags'] ) ){\n \n foreach ($dataArr['tags'] as $tag_id) {\n $modelTagObject = new TagObjects; \n $modelTagObject->object_id = $dataArr['id'];\n $modelTagObject->tag_id = $tag_id;\n $modelTagObject->type = 1;\n $modelTagObject->save();\n }\n }\n Session::flash('message', 'Success.'); \n\n return redirect()->route('articles.edit', $dataArr['id']);\n }", "public function update()\n {\n $model = $this->model()::findOrFail(request('_id'));\n $data = array_merge(request()->all(), ['slug' => request('name')]);\n $category = $model->update($data);\n return redirect()->route('admin.'.$this->table().'.index');\n }", "public function update(Request $request)\n {\n $id = $request->id;\n $thumbnail = 'http://img.youtube.com/vi/' . $request->thumbnail . '/mqdefault.jpg';\n\n $datas = [\n 'video_title' => $request->title,\n 'user_id' => Auth::user()->id,\n 'id_category' => $request->category,\n 'video_url' => $request->urlnew,\n 'content' => $request->area,\n 'key' => $request->thumbnail,\n 'thumbnail' => $thumbnail,\n ];\n \n $updatevideo = Video::where('id_video',$id)->update($datas);\n\n return redirect()->route('video.index')->withErrors(['success' => 'Success update Video']);\n }", "public function videoCategory() {\n $this->loadModel('VideoCategories');\n $data = $this->VideoCategories->find('all');\n $this->paginate = [ ];\n $videoCategories = $this->paginate($data);\n\n $this->set(compact('videoCategories'));\n \n }", "public function edit(Category $category) {\n //not implemented\n }", "function updateCategory($id) {\n\t$request = Slim::getInstance()->request();\n\t$body = $request->getBody();\n\t$category = json_decode($body);\n\t$sql = \"UPDATE category SET name=:name, description=:description WHERE id=:id\";\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->prepare($sql); \n\t\t$stmt->bindParam(\"name\", $category->name);\n\t\t$stmt->bindParam(\"description\", $category->description);\n\t\t$stmt->bindParam(\"id\", $id);\n\t\t$stmt->execute();\n\t\t$db = null;\n\t\techo json_encode($category);\n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}", "public function update(Request $request, $slug){\n if(!checkRole(getUserGrade(2)))\n {\n prepareBlockUserMessage();\n return back();\n }\n $record = LmsCategory::getRecordWithSlug($slug);\n\n $rules = [\n 'category' \t => 'bail|required|max:60' ,\n ];\n /**\n * Check if the title of the record is changed, \n * if changed update the slug value based on the new title\n */\n $name = $request->category;\n if($name != $record->category)\n $record->slug = $record->makeSlug($name,TRUE);\n\n //Validate the overall request\n $this->validate($request, $rules);\n $record->category \t\t\t= $name;\n $record->description\t\t= $request->description;\n $record->record_updated_by \t= Auth::user()->id;\n $record->save();\n $file_name = 'catimage';\n if ($request->hasFile($file_name)){\n\n $rules = array( $file_name => 'mimes:jpeg,jpg,png,gif|max:10000' );\n $this->validate($request, $rules);\n\n $record->image = $this->processUpload($request, $record,$file_name);\n $record->save();\n }\n\n flash('success','record_updated_successfully', 'success');\n return redirect(URL_LMS_CATEGORIES);\n }", "function edit()\n {\n $id = $this->uri->rsegment('3');\n $video = $this->video_model->get_info($id);\n if(!$video)\n {\n $this->session->set_flashdata('message', 'Không tồn tại video này');\n redirect(admin_url('video'));\n }\n $this->data['video'] = $video;\n \n $this->load->library('form_validation');\n $this->load->helper('form');\n \n //neu ma co du lieu post len thi kiem tra\n if($this->input->post())\n {\n $this->form_validation->set_rules('name', 'Tên video', 'required');\n $this->form_validation->set_rules('link', 'Link video', 'required');\n \n if($this->form_validation->run())\n {\n \n //lay ten file anh minh hoa duoc update len\n $this->load->library('upload_library');\n $upload_path = './upload/video';\n $upload_data = $this->upload_library->upload($upload_path, 'image'); \n $images = '';\n if(isset($upload_data['file_name']))\n {\n $images = $upload_data['file_name'];\n }\n \n //luu du lieu can them\n $data = array(\n 'name' => $this->input->post('name'),\n 'images' => $images,\n 'link' => $this->input->post('link'),\n ); \n if($images != '')\n {\n $data['images'] = $images;\n }\n \n //them moi vao csdl\n if($this->video_model->update($video->id, $data))\n {\n $this->session->set_flashdata('message', 'Cập nhật thành công');\n }else{\n $this->session->set_flashdata('message', 'Không cập nhật được');\n }\n redirect(admin_url('video'));\n }\n }\n \n \n //load view\n $this->data['temp'] = 'admin/video/edit';\n $this->load->view('admin/main', $this->data);\n }", "public function update(CategoryValidate $request,Category $category)\n {\n //check if file is upload\n if($request->hasFile('image')){\n $image_name = time().'.'.$request->image->getClientOriginalExtension();\n $request->image->move(('admin/category/'), $image_name);\n }else{\n $image_name = $category->image;\n }\n\n $category->parent_id=$request->parent_id;\n\n $category->category_name=$request->category_name;\n\n $category->category_type=$request->category_type;\n\n $category->slug=Str::slug($request->category_name);\n\n $category->image=$image_name;\n\n $category->created_by=auth()->user()->id;\n\n $category->status=$request->status; \n\n $category->save();\n\n return redirect()->route('categories.index')\n ->with('success','Category update successfully.'); \n }", "public function actionUpdate()\n {\n $categoryOptions = DataHelper::getCategoryOptions();\n $statusMap = CmsCategory::getCategoryStatus();\n $model = $this->findModel($_GET['id']);\n if (Yii::$app->request->isPost) {\n $model->image_main_file = UploadedFile::getInstance($model, 'image_main_file');\n if (($file = $model->uploadImageMain())!=false) {\n UtilHelper::DeleteImg($model->image_main);\n $model->image_main = $file['src'];\n }\n $model->image_node_file = UploadedFile::getInstance($model, 'image_node_file');\n if (($file = $model->uploadImageNode())!=false) {\n UtilHelper::DeleteImg($model->image_node);\n $model->image_node = $file['src'];\n }\n $model->banner_file = UploadedFile::getInstance($model, 'banner_file');\n if (($file = $model->uploadBanner())!=false) {\n UtilHelper::DeleteImg($model->banner);\n $model->banner = $file['src'];\n }\n \n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n DataHelper::deleteCache();\n return $this->redirect(['index']);\n }\n }\n return $this->render('update', [\n 'model' => $model,\n 'categoryOptions' => $categoryOptions,\n 'statusMap' => $statusMap,\n ]);\n }", "public function edit($id)\n\t{\n\t\t$video = Resource::find($id);\n\t\t//id=1表示是视频的大类\n\t\t$categories = Category::find(1);\n\t\treturn view('admin.video.edit')->with(compact('video','categories'));\n\t}", "function editAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\t\n\t\t$redirectUrl = $this->getRedirectUrl();\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t$error \t\t= array();\n\t\t\t$success \t= array();\n\t\t\t$contents \t= '';\n\t\t\t$formData \t= array();\n\t\t\t //Truyen du lieu hien co vao form\n\t\t\t$formData['fbulkid'] = array();\n\t\t\t$formData['fid'] = $myProductCat->id;\n\t\t\t$formData['fname'] = $myProductCat->name;\n\t\t\t$formData['forder'] = $myProductCat->order;\n\t\t\t$formData['fparentid'] = $myProductCat->parentid;\n\t\t\t$formData['fenable'] = $myProductCat->enable;\n\t\t\t$formData['fseourl'] = $myProductCat->seoUrl;\n\t\t\t$formData['fseotitle'] = $myProductCat->seoTitle;\n\t\t\t$formData['fseokeyword'] = $myProductCat->seoKeyword;\n\t\t\t$formData['fseodescription'] = $myProductCat->seoDescription;\n\t\t\t\n\t\t\tif(!empty($_POST['fsubmit']))//truong hop da nhan nut submit\n\t\t\t{\n if($_SESSION['productcategoryEditToken']==$_POST['ftoken'])//kiem tra token\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->editActionValidator($formData, $error))//kiem tra du lieu co hop le hay khong\n {\n //Cac thong tin khong ngon ngu:\n $myProductCat->order = (int)$formData['forder'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n if(strlen($formData['fseourl']) > 0)\n $myProductCat->seoUrl = Helper::codau2khongdau($formData['fseourl'], true);\n else\n $myProductCat->seoUrl = Helper::codau2khongdau(strip_tags($formData['fname']), true);\n //Cac thong tin lien quan ngon ngu: \n $myProductCat->name = $formData['fname']; \n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n \n if($myProductCat->updateData())//cap nhat database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succUpdate']);\n $this->registry->me->writelog('ProductCategoryedit', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n }\n else\n {\n $error[] = $this->registry->lang['controller']['errUpdate']; \n }\n }\n }\n $_SESSION['productcategoryEditToken'] = Helper::getSecurityToken();//Tao token moi\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t\t\t$this->registry->smarty->assign(array(\t'formData' \t=> $formData,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'subcategories' => $myProductCat->getSub(true),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'parentCategories' => Core_ProductCategory::getFullCategories(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectUrl'=> $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'success'\t=> $success,\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\t));\n\t\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'edit.tpl');\n\t\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategorylist',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_edit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t\t$this->registry->smarty->assign(array('redirect' => $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectMsg' => $redirectMsg,\n\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t}\n\t}", "public function update(Request $request, $id)\n\n {\n\n $cat = Youtubelink::find($id);\n\n $cat->link = $request->link;\n\n $cat->save();\n\n\n\n\n Session::flash('success',\"Category Successfully Updated\");\n\n\n\n return redirect()->route('youtubes.index');\n\n }", "function update_category_detail($siteData,$category_id)\n\t{\n\t\t$this->db->where('id', $category_id);\n\t\t$this->db->update('category', $siteData); \n\t\t\n\t}", "public function update($id)\n {\n // DB::table('video_uploaded')\n // ->where ('id')\n // ->update(['video_type'=>$request['video_type'],'video_url'=>$request['video_url'], 'price'=>$request['price'], 'video'=>$request['video']\n // ]); \n // return view('reg/video_list');\n }", "public function updated(Category $category)\n {\n //\n }", "public function update(Request $request, $id)\n {\n //\n\n $this->validate($request,[\n 'name_en' => 'required|max:255',\n 'name_ar' => 'required|max:255',\n 'description_en' => 'required',\n 'description_ar' => 'required',\n 'slug_en' => 'required|max:255',\n 'slug_ar' => 'required|max:255',\n 'meta_title_en'=> 'required|max:255',\n 'meta_title_ar'=> 'required|max:255',\n// 'image_cover'=> 'required|image',\n 'status' => 'required'\n ]);\n\n $category =Category::find($id);\n if ($request->hasFile('image_cover')) {\n\n $dir = public_path().'/uploads/category/';\n $file = $request->file('image_cover');\n $fileName = str_random(6).'.'.$file->getClientOriginalExtension();\n $file->move($dir , $fileName);\n $category->image_url = $fileName;\n\n }\n $category->status = $request->status ;\n\n $category->save();\n\n $languages = Language::where('status','=','1')->get();\n foreach ($languages as $language){\n foreach($category->categoryDescription as $description){\n\n if($description->lang_id == $language->id){\n $description->name = $request->input('name_'.$language->label) ;\n $description->description = $request->input('description_'.$language->label);\n $description->slug = $request->input('slug_'.$language->label);\n $description->meta_title = $request->input('meta_title_'.$language->label);\n $description->meta_description = $request->input('meta_description_'.$language->label);\n $description->save();\n }\n }\n }\n\n session()->flash('message' , 'Category has been updated successfully');\n return redirect()->route('categories.index');\n }", "function update_category($category_id)\n {\n $this->db->update('tbl_category',$this, array('category_id'=>$category_id));\n }", "public function editAction() {\n $this->_helper->layout->setLayout('admin-simple');\n\n if (!($category_id = $this->_getParam('category_id'))) {\n die('No identifier specified');\n }\n\n //FETCH PARAMETERS ACCORDING TO THIS CATEGORY\n $reviewCategories = Engine_Api::_()->getDbtable('reviewcats', 'sitestorereview')->reviewParams($category_id);\n\n //GENERATE A FORM\n $form = $this->view->form = new Sitestorereview_Form_Admin_Ratingparameter_Edit();\n $form->setAction($this->getFrontController()->getRouter()->assemble(array()));\n\n $form->setField($reviewCategories->toArray());\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n\n foreach ($values as $key => $value) {\n $reviewcat_id = explode('reviewcat_name_', $key);\n $reviewcat = Engine_Api::_()->getItem('sitestorereview_reviewcat', $reviewcat_id[1]);\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\n try {\n //EDIT CATEGORY NAMES\n $reviewcat->reviewcat_name = $value;\n $reviewcat->save();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => 10,\n 'parentRefresh' => 10,\n 'messages' => array('')\n ));\n }\n\n $this->renderScript('admin-ratingparameter/edit.tpl');\n }", "public function update(){\n $facebook = $_POST['facebook'];\n $linkedin = $_POST['linkedin'];\n $twitter = $_POST['twitter'];\n $youtube = $_POST['youtube'];\n $id = $_POST['hiddenid'];\n\t\t $sql= $this->link->query(\"UPDATE category SET facebook='$facebook',linkedin='$linkedin',twitter='$twitter ',youtube='$youtube' WHERE id=$id\");\n if($sql){\n\t\t echo \"<script>alert('Link Update')</script>\";\n\t\t echo \"<script>window.location.href = './social.php'</script>\";\n exit;\n\t }\n\t}", "protected function updateCategory($req){\n if(!empty($req['parent_id'])){\n $parent_id = $req['parent_id'];\n }else{\n $parent_id=\"0\";\n }\n if(isset($req['cat_image']) && !isset($req['banner_image'])){\n $cat_image_path=public_path('category_images/Normal');\n $sort = $req['sort'];\n $cat_file_name=$this->fileUploading($cat_image_path,$req['cat_image']);\n $category=array('name'=>$req['name'],\n 'description'=>$req['desc'],\n 'parent_id'=>$parent_id,\n 'thumb_image'=>$cat_file_name,\n 'sort_order' => $sort,\n 'updated_at'=>date('Y-m-d H:i:s'));\n \n }\n else if(isset($req['banner_image']) && !isset($req['cat_image'])){\n $cat_banner_image=public_path('category_images/Banner');\n $banner_file_name=$this->fileUploading($cat_banner_image,$req['banner_image']);\n $sort = $req['sort'];\n $category=array('name'=>$req['name'],\n 'description'=>$req['desc'],\n 'parent_id'=>$parent_id,\n 'banner_image'=> $banner_file_name,\n 'sort_order' => $sort,\n 'updated_at'=>date('Y-m-d H:i:s'));\n }\n else if(isset($req['banner_image']) && isset($req['cat_image'])){\n $cat_image_path=public_path('category_images/Normal');\n $cat_file_name=$this->fileUploading($cat_image_path,$req['cat_image']);\n $sort = $req['sort'];\n $cat_banner_image=public_path('category_images/Banner');\n $banner_file_name=$this->fileUploading($cat_banner_image,$req['banner_image']);\n $category=array('name'=>$req['name'],\n 'description'=>$req['desc'],\n 'parent_id'=>$parent_id,\n 'thumb_image'=>$cat_file_name,\n 'banner_image'=> $banner_file_name,\n 'sort_order' => $sort,\n 'updated_at'=>date('Y-m-d H:i:s'));\n }else{\n $category=array('name'=>$req['name'],\n 'description'=>$req['desc'],\n 'parent_id'=>$parent_id,\n 'sort_order' => $req['sort'],\n 'updated_at'=>date('Y-m-d H:i:s'));\n }\n \n \n if($parent_id != \"0\"){\n $attribute_subcat_id = \"\";\n if($parent_id == 147){\n $attribute_subcat_id = 25;\n }elseif ($parent_id == 143) {\n $attribute_subcat_id = 26;\n }elseif ($parent_id == 78) {\n $attribute_subcat_id = 28;\n }\n $attr_arr=array(\n 'attribute_id'=>$attribute_subcat_id,\n 'option_value'=> $req['name'],\n );\n\n $isAttrExist = DB::table('attribute_options')->where('option_value', $req['name'])->first();\n if(!$isAttrExist){\n $cosplay_yes_insert=DB::table('attribute_options')->insert($attr_arr);\n }\n } \n \n $cond = array('category_id'=>$req['category_id']);\n Site_model::update_data('category',$category,$cond);\n \n if(isset($req['costume_list']) && $parent_id!=\"0\"){\n Site_model::delete_single('costume_to_category',$cond);\n foreach(array_unique($req['costume_list']) as $key=>$value){\n DB::table('costume_to_category')\n ->where('costume_id', $value)\n ->where('category_id', '!=', $req['category_id'])\n ->delete();\n $category_coustume=array('costume_id'=>$value,\n 'category_id'=>$req['category_id'],\n 'sort_no'=>$key,\n );\n Site_model::insert_get_id('costume_to_category',$category_coustume);\n }\n }\n $this->urlRewrites($req['category_id'],\"update\",$req['old_category'],$req['name'],$req['elements_change']);\n return true;\n }", "public function updateCategory($parameters,$id)\n {\n \t $this->db->update('product_category', $parameters, array('product_id' => $id));\n return true;\n }", "public function update($id)\n\t{\n\t\t$category = Category::find($id);\n\n\t\t$img = $this->save_file(Input::file('thumbnail'), 60, 25, 'categories');\n\t\tif($img == ''){\n\t\t\t$img = $category->thumbnail;\n\t\t}\n\t\t//滚动图像\n\t\t$slides = array();\n\t\tif(Input::hasFile('slides')){\n\t\t\tforeach(Input::file('slides') as $file){\n\t\t\t\t$slides[] = $this->save_file($file, 50, 14, 'categories');\n\t\t\t}\n\t\t}\n\t\t$slide = serialize($slides);\n\t\tif(empty($slides)){\n\t\t\t$slide = $category->slides;\n\t\t}\n\n\t\t$credentials = Input::except('thumbnail', 'slides');\n\t\t$credentials['thumbnail'] = $img;\n\t\t$credentials['slides'] = $slide;\n\n if( $category->update($credentials) )\n {\n return Redirect::route('admin.categories.index')\n ->with('success', Lang::get('cpanel::common.update_success'));\n }\n\n return Redirect::back()\n ->withInput()\n ->withErrors($category->errors());\n\t}", "public function category_update(){ \n\n\n if (!has_role($this->session->userdata('user_id'), 'CATEGORY_UPDATE')) {\n redirect(base_url('page_not_found'));\n }\n\n $data['parent'] = $this->input->post('parent');\n $data['last_modified'] = date(\"Y-m-d H:i:s\");\n $data['name'] = $this->input->post('name');\n \n if(!$this->category_model->is_parent_category($data['parent'])){\n\n $this->session->set_flashdata('category_save_failed', \"Failed to update sub category!!\");\n }else{\n\n \n $category_id = $this->input->post('cat_id');\n\n\n\n\n if($this->category_model->update_category($category_id, $data)){\n\n $this->logger\n ->user($this->session->userdata('user_id')) //Set UserID, who created this Action\n ->user_details($this->user_model->getUserInfoByIpAddress())\n ->type('category_update') //Entry type like, Post, Page, Entry\n ->id($category_id) //Entry ID\n ->token('UPDATE') //Token identify Action\n ->comment($this->session->userdata('name'). ' update a category.')\n ->log(); //Add Database Entry\n\n $this->session->set_flashdata('category_save_success', \"Category information Updated Successfully!!\");\n } else {\n $this->session->set_flashdata('category_save_failed', \"Category update fialied!!\");\n }\n }\n redirect(base_url('categories'));\n }", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}", "public function postEdit($video)\n\t{\n\n // Declare the rules for the form validation\n $rules = array(\n 'user' => 'required|min:5',\n 'link' => 'required|min:10',\n 'description' => 'required|min:10'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Update the video video data\n $video->user = Input::get('user');\n $video->link = Input::get('link');\n $video->description = Input::get('description');\n // Was the video video updated?\n if($video->save())\n {\n // Redirect to the new video video page\n return Redirect::to('admin/videos/' . $video->id . '/edit')->with('success', Lang::get('admin/videos/messages.update.success'));\n }\n\n // Redirect to the videos video management page\n return Redirect::to('admin/videos/' . $video->id . '/edit')->with('error', Lang::get('admin/videos/messages.update.error'));\n }\n\n // Form validation failed\n return Redirect::to('admin/videos/' . $video->id . '/edit')->withInput()->withErrors($validator);\n\t}", "public function edit(Category $Category)\n {\n //\n }", "public function actionUpdate($id)\n { $this->layout='inner';\n $model = $this->findModel($id);\n $vendor = ArrayHelper::map(User::find()->where(['usertype'=>'Vendor'])->all(), 'id', 'username');\n $cat_list = ArrayHelper::map(ProductCategory::find()->where(['parent_id'=>'0'])->all(), 'id', 'cat_name');\n $cat= ProductCat::find()->Where(['product_id'=>$id])->one();\n $query=$this->fetchChildCategories($cat['category_id']);\n $str=rtrim($this->sam, \"|\");\n $str_data=explode(\"|\",$str);\n if($str_data>0){ \n // $str_data[]=$cat['category_id'];\n } \n // print_r($str_data); die;\n if ($model->load(Yii::$app->request->post())) {\n //$last_cat=end($_POST['Product']['category_id']); \n if($model->save()){\n //$sql=\"update product_cat set category_id = '\".$last_cat .\"' WHERE product_id='\".$model->id.\"'\";\n //Yii::$app->db->createCommand($sql)->execute();\n /*$product_cat= new ProductCat();\n $product_cat->product_id=$model->id;\n $product_cat->category_id=$last_cat;\n $product_cat->save();*/\n //Yii::$app->getSession()->setFlash('success','successful updated');\n return $this->redirect(['add-search-terms','id'=>$id]);\n }\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'cat'=>$str_data,\n 'vendor'=>$vendor,\n 'cat_list'=>$cat_list,\n\n ]);\n }\n }", "public function edit(BlogCategory $blogCategory)\n {\n //\n }", "function editMainCategory()\n\t{ \n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from products_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$sqlid=\"SELECT category_id,category_parent_id FROM category_table where category_id in(select category_id from products_table where category_id='\".$obj->records[0]['category_id'].\"')\";\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$sql1 = \"SELECT category_id,category_name FROM category_table where category_parent_id=0\";\n\t\t\n\t\t\t$query1 = new Bin_Query();\n\t\t\n\t\t\t$query1->executeQuery($sql1);\n\t\t\n\n\t\t\treturn Display_DManageProducts::displayCategory($query1->records,$query->records[0]['category_id']);\n\t\t\t\n\t\t// \t\t\treturn $category;\n\t }\n\t}", "public function edit(Video $video)\n { \n\n $categories = Category::pluck('name', 'id');\n\n return view('admin.videos.edit', compact('video', 'categories'));\n }", "public function edit_category($id)\n\t{\n\t\t$query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n $data['category']=$query; \n\t\t$data['title']=\"Dahboard || Great Wine Global\";\n $this->load->view('superpanel/header',$data);\n $this->load->view('superpanel/edit_categorie');\n $this->load->view('superpanel/footer');\n\t}", "public function update_category($id)\n\t{\n\t\t$config = array(\n 'upload_path' => \"uploads/category/\",\n 'upload_url' => base_url() . \"uploads/category/\",\n 'allowed_types' => \"gif|jpg|png|jpeg\"\n );\n\n $this->load->library('upload', $config);\n $category_name=ucwords(strtolower($this->input->post('category_name')));\n if($this->upload->do_upload('userfile')) {\n\n $data['userfile'] = $this->upload->data();\n $filename = $data['userfile']['file_name'];\n\t\t \n $datalist = array( \n 'category_img' => base_url().'uploads/category/'.$filename, \n 'meta_keyword' => $this->input->post('meta_keyword'),\n 'meta_description' => $this->input->post('meta_description'),\n 'category_name'=> $this->input->post('category_name'),\n\t\t\t\t'category_description'=> $this->input->post('category_description'), \n 'category_slug' => $this->input->post('category_slug'),\n 'status'=>$this->input->post('status'), \n );\n }else{\n $datalist = array( \n 'meta_keyword' => $this->input->post('meta_keyword'),\n 'meta_description' => $this->input->post('meta_description'),\n 'category_name'=> $this->input->post('category_name'),\n\t\t\t\t'category_description'=> $this->input->post('category_description'), \n 'category_slug' => $this->input->post('category_slug'),\n 'status'=>$this->input->post('status'),\n );\n } \n\n $query= $this->General_model->show_data_id('categories',$id,'category_Id','update',$datalist);\n $this->session->set_flashdata('success', 'Product category Updated successfully.');\n redirect('superpanel/categorie');\n\t}", "public function update_category ($data) {\n\t\t$slug = \\Illuminate\\Support\\Str::slug($data->category, '-');\n\t\t$category = Category::find($data->category_id);\n\t\t$category->category = $data->category;\n\t\t$category->slug = $slug;\n\t\t$category->description = $data->description;\n\n\t\t$category->save();\n\t\treturn true;\n\t}", "public function edit($id = 0)\n\t{\t\n\t\t// Get the channel\n\t\t$channel = $this->video_channel_m->get($id);\n\t\t\n\t\t// ID specified?\n\t\t$channel or redirect('admin/video/channels/index');\n\t\t\n\t\t// Validate the results\n\t\tif ($this->form_validation->run())\n\t\t{\n\t\t\t$input = array(\n\t\t\t\t'title' => $this->input->post('title'),\n\t\t\t\t'description' => $this->input->post('description'),\n\t\t\t\t'parent_id' => $this->input->post('parent_id'),\n\t\t\t);\n\t\t\t\n\t\t\tif ( ! empty($_FILES['thumbnail']['name']))\n\t\t\t{\n\t\t\t\tif ( ! self::_upload())\n\t\t\t\t{\n\t\t\t\t\t$this->template->messages = array('error' => $this->upload->display_errors());\n\t\t\t\t\tgoto display;\n\t\t\t\t}\n\n\t\t\t\tif ( ! self::_resize())\n\t\t\t\t{\n\t\t\t\t\t$this->template->messages = array('error' => $this->image_lib->display_errors());\n\t\t\t\t\tgoto display;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$thumbnail = $this->upload->data();\n\t\t\t\t$input['thumbnail'] = $thumbnail['file_name'];\n\t\t\t}\n\t\t\t\n\t\t\t$this->video_channel_m->update($id, $input)\n\t\t\t\t? $this->session->set_flashdata('success', sprintf( lang('video_channel:edit_success'), $this->input->post('title')) )\n\t\t\t\t: $this->session->set_flashdata(array('error'=> lang('video_channel:edit_error')));\n\t\t\t\n\t\t\tredirect('admin/videos/channels');\n\t\t}\n\t\t\n\t\tdisplay:\n\t\t\n\t\t// Loop through each rule\n\t\tforeach ($this->validation_rules as $rule)\n\t\t{\n\t\t\tif ($this->input->post($rule['field']) !== FALSE)\n\t\t\t{\n\t\t\t\t$channel->{$rule['field']} = $this->input->post($rule['field']);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$channels = array(lang('select.none')) + $this->video_channel_m->order_by('title')->where('parent_id', 0)->dropdown('id', 'title');\n\n\t\t$this->template->title($this->module_details['name'], sprintf(lang('video_channel:edit_title'), $channel->title))\n\t\t\t->set('channel', $channel)\n\t\t\t->set('channels', $channels)\n\t\t\t->build('admin/channels/form', $this->data);\n\t}", "public function edit(CourseCategory $courseCategory)\n {\n //\n }", "function multi_entry_category_update()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ($this->input->get_post('entry_ids') === FALSE OR $this->input->get_post('type') === FALSE)\n\t\t{\n\t\t\treturn $this->dsp->no_access_message($this->lang->line('unauthorized_to_edit'));\n\t\t}\n\n\t\tif ($this->input->get_post('category') === FALSE OR ! is_array($_POST['category']) OR count($_POST['category']) == 0)\n\t\t{\n\t\t\treturn $this->output->show_user_error('submission', $this->lang->line('no_categories_selected'));\n\t\t}\n\n\t\t/** ---------------------------------\n\t\t/**\t Fetch categories\n\t\t/** ---------------------------------*/\n\n\t\t// We do this first so we can destroy the category index from\n\t\t// the $_POST array since we use a separate table to store categories in\n\t\t\n\t\t$this->api->instantiate('channel_categories');\n\n\t\tforeach ($_POST['category'] as $cat_id)\n\t\t{\n\t\t\t$this->api_channel_categories->cat_parents[] = $cat_id;\n\t\t}\n\n\t\tif ($this->api_channel_categories->assign_cat_parent == TRUE)\n\t\t{\n\t\t\t$this->api_channel_categories->fetch_category_parents($_POST['category']);\n\t\t}\n\n\t\t$this->api_channel_categories->cat_parents = array_unique($this->api_channel_categories->cat_parents);\n\n\t\tsort($this->api_channel_categories->cat_parents);\n\n\t\tunset($_POST['category']);\n\n\t\t$ids = array();\n\n\t\tforeach (explode('|', $_POST['entry_ids']) as $entry_id)\n\t\t{\n\t\t\t$ids[] = $this->db->escape_str($entry_id);\n\t\t}\n\n\t\tunset($_POST['entry_ids']);\n\n\t\t$entries_string = implode(\"','\", $ids);\n\n\t\t/** -----------------------------\n\t\t/**\t Get Category Group IDs\n\t\t/** -----------------------------*/\n\t\t$query = $this->db->query(\"SELECT DISTINCT exp_channels.cat_group FROM exp_channels, exp_channel_titles\n\t\t\t\t\t\t\t WHERE exp_channel_titles.channel_id = exp_channels.channel_id\n\t\t\t\t\t\t\t AND exp_channel_titles.entry_id IN ('\".$entries_string.\"')\");\n\n\t\t$valid = 'n';\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$valid = 'y';\n\t\t\t$last = explode('|', $query->row('cat_group') );\n\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$valid_cats = array_intersect($last, explode('|', $row['cat_group']));\n\n\t\t\t\tif (count($valid_cats) == 0)\n\t\t\t\t{\n\t\t\t\t\t$valid = 'n';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($valid == 'n')\n\t\t{\n\t\t\treturn $this->dsp->show_user_error($this->lang->line('no_category_group_match'));\n\t\t}\n\n\t\t/** -----------------------------\n\t\t/**\t Remove Valid Cats, Then Add...\n\t\t/** -----------------------------*/\n\n\t\t$valid_cat_ids = array();\n\t\t$query = $this->db->query(\"SELECT cat_id FROM exp_categories\n\t\t\t\t\t\t\t WHERE group_id IN ('\".implode(\"','\", $valid_cats).\"')\n\t\t\t\t\t\t\t AND cat_id IN ('\".implode(\"','\", $this->api_channel_categories->cat_parents).\"')\");\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\tforeach($query->result_array() as $row)\n\t\t\t{\n\t\t\t\t$this->db->query(\"DELETE FROM exp_category_posts WHERE cat_id = \".$row['cat_id'].\" AND entry_id IN ('\".$entries_string.\"')\");\n\t\t\t\t$valid_cat_ids[] = $row['cat_id'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->input->get_post('type') == 'add')\n\t\t{\n\t\t\t$insert_cats = array_intersect($this->api_channel_categories->cat_parents, $valid_cat_ids);\n\t\t\t// How brutish...\n\t\t\tforeach($ids as $id)\n\t\t\t{\n\t\t\t\tforeach($insert_cats as $val)\n\t\t\t\t{\n\t\t\t\t\t$this->db->query($this->db->insert_string('exp_category_posts', array('entry_id' => $id, 'cat_id' => $val)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t/** ---------------------------------\n\t\t/**\t Clear caches if needed\n\t\t/** ---------------------------------*/\n\n\t\tif ($this->config->item('new_posts_clear_caches') == 'y')\n\t\t{\n\t\t\t$this->functions->clear_caching('all');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->functions->clear_caching('sql');\n\t\t}\n\t\t\n\t\t$this->session->set_flashdata('message_success', $this->lang->line('multi_entries_updated'));\n\t\t$this->functions->redirect(BASE.AMP.'C=content_edit');\n\t}", "function update_category_detail($siteData, $category_id) {\n $this->db->where('id', $category_id);\n $this->db->update('category', $siteData);\n }" ]
[ "0.70255893", "0.68039304", "0.67580926", "0.67113507", "0.67026937", "0.6621358", "0.65880543", "0.6528769", "0.6527254", "0.6502974", "0.6494821", "0.64577454", "0.6449746", "0.6443463", "0.64407146", "0.64304763", "0.6426913", "0.63906366", "0.63733435", "0.63481635", "0.63481635", "0.63345647", "0.63203114", "0.6311294", "0.6307293", "0.6283688", "0.62724113", "0.6236646", "0.6193586", "0.6192923", "0.6168221", "0.6160371", "0.61546195", "0.6153729", "0.612934", "0.61283535", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61269826", "0.61259866", "0.6123249", "0.60976255", "0.60945845", "0.6093175", "0.6083225", "0.60766476", "0.6066647", "0.60622525", "0.60558325", "0.60440016", "0.6040163", "0.6038051", "0.6033371", "0.603217", "0.6025314", "0.59864825", "0.59827524", "0.597595", "0.5975741", "0.5973134", "0.59704715", "0.5970146", "0.596766", "0.5954923", "0.5947535", "0.5944779", "0.59410393", "0.593783", "0.5929354", "0.59258574", "0.59219867", "0.5919664", "0.59167546", "0.59160024", "0.5902735", "0.5901649", "0.5899081", "0.5896066", "0.58950824", "0.5891532", "0.589152", "0.58867913" ]
0.7049841
0
/Edit video category Function for delete video category
public function deleteVideoCategory(Request $request) { $id = $request->workoutid; $getWorkout = VideoCategory::find($id); if($getWorkout->delete()){ return redirect()->back()->with('danger','Video Category Deleted successfully'); } else{ return redirect()->back()->with('danger','Sorry! Video Category is not deleted'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cat_delete_link()\n{\n return Parrot::getInstance()->getUrl(\"admin/category/\" . discussion::encode_title(cat_title()) . \"/delete\");\n}", "public function delete(){\n\n\t\t$sql = new Sql();\n\n\t\t$sql->query(\"DELETE FROM tb_categories WHERE idcategory=:idcategory\",array(\n\t\t\t\":idcategory\"=>$this->getidcategory()\n\t\t));\n\n\t\tCategory::updateFile();\n\t}", "public function remove_category() {\n\t\t$this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(Request::get(\"cat\"));\n\t\t$this->model->categories->unlink($category);\n if(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\t\n\t}", "public function deletecategory(){\n\t\n\t\t$id = $this->request->getParameter(\"actionid\");\n\t\t$modelCategory = new CaCategory();\n\t\t$modelCategory->delete($id);\n\t\n\t\t// generate view\n\t\t$this->redirect(\"catalogadmin/categories\");\n\t}", "function product_category_delete(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\tmysql_q(\"DELETE FROM product_category WHERE id='\".add_slash($_r['id']).\"'\");\n\n\t\tredirect(\"product_category.htm\", \"\");\n\t}", "public function deletePost(){\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"delete_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n if ($categoryModel->deleteCategory($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category deleted successfully!\",\"success\");\n }\n } catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "function DeleteCategory()\n{\n if (isset($_POST['deletebtn'])) {\n global $connection;\n\n $connesione = $_POST['deleteImp'];\n\n $delete_query = \"DELETE FROM video_category WHERE id_category='$connesione'\";\n $delete_result = mysqli_query($connection, $delete_query);\n\n if ($delete_result) {\n return header('Location: video_categorie.php?delete=true');\n } else {\n return header('Location: video_categorie.php?delete=false');\n }\n }\n}", "public function delete_category($id)\n { \n\t $query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n @unlink(str_replace(base_url(),'',$query[0]->category_img));\n \n $query=$this->General_model->show_data_id('categories',$id,'category_Id','delete','');\n $this->session->set_flashdata('success','Product Category Deleted successfully'); \n redirect('superpanel/categorie');\n\t\n\t }", "public function delete()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n try{\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/delete\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n\n }", "public function delete_gallery_category_post()\n {\n prevent_author();\n\n $id = $this->input->post('category_id', true);\n\n //check if category has posts\n if ($this->gallery_image_model->get_category_image_count($id) > 0) {\n $this->session->set_flashdata('error', trans(\"msg_delete_images\"));\n redirect($this->agent->referrer());\n }\n\n if ($this->gallery_category_model->delete_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_deleted\"));\n redirect($this->agent->referrer());\n } else {\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }", "public function delete_category() {\n $category_id = $_GET['category_id'];\n\n $data['delete_category'] = $this->Category_crud->get_category_by_id($category_id);\n $this->load->view('restaurant/category/delete_category_model', $data);\n\n if (isset($_POST['delete_category_yes'])) {\n $this->Category_crud->delete_category_sub_category_item($category_id);\n redirect(rest_path('Category'));\n }\n\n if (isset($_POST['delete_category_no'])) {\n $this->Category_crud->delete_category($category_id);\n redirect(rest_path('Category'));\n }\n }", "public static function deleteCategoryController(){\n\n\n \t \t if (isset($_POST[\"editCategoryId\"])) {\n\n\n \t \t \t\t\t// NOTA: Se pasa un valor entero como array ya que el modelo de productos recibe de varios métodos\n \t \t\t\t\t\t$dataController = array(\"idcategory\"=>$_POST[\"editCategoryId\"]);\n\n \t \t\t\t\t\t// Esta variable se envía al modelos para proceder a eliminar la categoria\n \t \t\t\t\t\t$dataIdCategoryController = $_POST[\"editCategoryId\"];\n\n \t \t\t\t\t\t// VER PRODUCTOS ASOCIADOS A LA CATEGORIA\n\t\t\t\t\t\t// $answerProducts = productsModel::ViewProductById($dataController, \"productos\");\n\n\t\t\t\t\t\t// foreach ($answerProducts as $row => $item) {\n\n\t\t\t\t\t\t// $dataProductController = array(\"id\"=>$item[\"id\"], \"idcategory\"=>0, \"enable\"=> 1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// $answerDeleteProducts = productsModel::disableProductByIdCategory($dataProductController, \"productos\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$answerDeleteCategory = categorieModel::deleteCategoryModel($dataIdCategoryController, \"categorias\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t \t\tif ($answerDeleteCategory == 1) {\n\n\t \t\t\t\t\techo '<script >swal({\n\n\t\t\t\t\t\t\t\ttitle: \"¡OK!\",\n\t\t\t\t\t\t\t\ttext: \"¡Categoría eliminada correctamente!\",\n\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\tfunction(isConfirm){\n\n\t\t\t\t\t\t\t\t\tif (isConfirm) {\n\n\n\t\t\t\t\t\t\t\t\t\twindow.location = \"categories\";\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t</script>';\n\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\techo \"error\";\n\n\t \t\n\t\t\t\t\t\t\t\t }\n\t\t\t\t \t\t}\n\t\t\t\t}", "public function deleteAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Game_Service_Category::getCategory($id);\r\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\r\n\t\t$result = Game_Service_Category::deleteCategory($id);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "public function delete_category(){\n $query = \"DELETE FROM {$this->table} WHERE {$this->table}.cat_id = (:cat_id)\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_id', $this->cat_id);\n $stmt->execute();\n return $stmt;\n \n }", "public function deleteAction() {\n\n //CHECK USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET VIEWER INFO\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n $listingtype_id = $this->_listingType->listingtype_id;\n $this->view->listingType = $this->_listingType;\n\n //GET TAB ID\n $this->view->tab_selected_id = $tab_selected_id = $this->_getParam('content_id');\n $this->view->format_form = $this->_getParam('format', null);\n\n //GET VIDEO OBJECT\n $this->view->sitereview_video = $sitereview_video = Engine_Api::_()->getItem('sitereview_video', $this->getRequest()->getParam('video_id'));\n\n //GET VIDEO TITLE\n $this->view->title = $sitereview_video->title;\n\n //GET LISTING ID\n $listing_id = $sitereview_video->listing_id;\n\n //GET NAVIGATION \n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitereview_main');\n\n //GET SITEREVIEW SUBJECT\n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n $can_edit = $sitereview->authorization()->isAllowed($viewer, 'edit_listtype_' . $sitereview->listingtype_id);\n\n if (!$sitereview_video) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_(\"Video doesn't exists or not authorized to delete\");\n return;\n }\n\n //VIDEO OWNER AND LISTING OWNER CAN DELETE VIDEO\n if ($viewer_id != $sitereview_video->owner_id && $can_edit != 1) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n if (!$this->getRequest()->isPost()) {\n $this->view->status = false;\n $this->view->error = Zend_Registry::get('Zend_Translate')->_('Invalid request method');\n return;\n }\n\n $db = $sitereview_video->getTable()->getAdapter();\n $db->beginTransaction();\n\n try {\n\n Engine_Api::_()->getDbtable('videoratings', 'sitereview')->delete(array('videorating_id =?' => $this->getRequest()->getParam('video_id')));\n\n $sitereview_video->delete();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n\n\n\n\n $this->view->status = true;\n if ($this->view->format_form == 'smoothbox') {\n $this->_forwardCustom('success', 'utility', 'core', array(\n 'smoothboxClose' => true,\n 'parentRefresh' => '500',\n 'parentRefreshTime' => '500',\n 'format' => 'smoothbox',\n 'messages' => Zend_Registry::get('Zend_Translate')->_('You have successfully deleted this video.')\n ));\n } else {\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n if ($can_edit) {\n return $this->_gotoRouteCustom(array('action' => 'edit', 'listing_id' => $sitereview->listing_id), \"sitereview_videospecific_listtype_$listingtype_id\", true);\n } else {\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview->getSlug(), 'tab' => $tab_selected_id), \"sitereview_entry_view_listtype_$listingtype_id\", true);\n }\n } else {\n return $this->_gotoRouteCustom(array('listing_id' => $sitereview->listing_id, 'slug' => $sitereview->getSlug(), 'tab' => $tab_selected_id), \"sitereview_entry_view_listtype_$listingtype_id\", true);\n }\n }\n }", "function categoryRemove(){\n\tif(startSession() && isset($_SESSION['UserID']))\n\t{\n\t\t$CatID\t\t\t \t= strip_tags($_GET['id']);\t#int - primaryKey\n\n\t\t$db = pdo(); # pdo() creates and returns a PDO object\n\n\t\t$sql = \"DELETE FROM ma_Categories WHERE CatID = :CatID\";\n\n\t\t$stmt = $db->prepare($sql);\n\t\t//INTEGER EXAMPLE $stmt->bindValue(1, $id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':CatID', $CatID, PDO::PARAM_INT);\n\n\t\ttry {$stmt->execute();} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\t\t#feedback success or failure of update\n\n\t\tif ($stmt->rowCount() > 0)\n\t\t{//success! provide feedback, chance to change another!\n\t\t\tfeedback(\"Category Removed Successfully\",\"success\");\n\t\t}else{//Problem! Provide feedback!\n\t\t\tfeedback(\"Category Not Trashed!\",\"warning\");\n\t\t}\n\t\tmyRedirect(THIS_PAGE);\n\t}\n\t#script for expanding textarea\n}", "public function delcategory() {\n extract($_GET);\n //print_r($_GET);die();\n // call to model function to del category from db\n $result = $this->dash_model->delcategory($mat_cat_id);\n\n echo json_encode($result);\n }", "private function deleteVideo()\n {\n try \n {\n global $cbvid;\n \n $request = $_REQUEST;\n #pex($request,true);\n if(!isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg(\"video id not provided\");\n\n if( isset($request['videoid']) && !is_numeric($request['videoid']) )\n throw_error_msg(\"invalid video id\");\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n $cbvid->delete_video( (int)$request['videoid'] );\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"video deleted successfully\", \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n } \n }", "public function delete($video_id);", "public function delete_assets_category() {\n\t\t\n\t\tif($this->input->post('type')=='delete_record') {\n\t\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t$id = $this->uri->segment(4);\n\t\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t$result = $this->Assets_model->delete_assets_category_record($id);\n\t\t\tif(isset($id)) {\n\t\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_deleted');\n\t\t\t} else {\n\t\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t\t}\n\t\t\t$this->output($Return);\n\t\t}\n\t}", "public function updateVideoCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $videoCategory = VideoCategory::find($id);\n $videoCategory->video_category_name = $request->name;\n $videoCategory->save();\n Session::flash('success','Video Category Updated succcessfully.');\n return redirect()->back()->with('workout',$videoCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function deleteCategoryMeta($cat_id) {\n\t\t$course_meta = new CourseMeta($cat_id);\n\t\t$course_meta->delete();\n\t}", "protected function _delete()\r\n\t{\r\n\t\tEngine_Api::_() -> getDbTable('favorites', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from favorite table\r\n\t\tEngine_Api::_() -> getDbTable('favorites', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from rating table\r\n\t\tEngine_Api::_() -> getDbTable('ratings', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// remove video from watchlater table\r\n\t\tEngine_Api::_() -> getDbTable('watchlaters', 'ynvideo') -> delete(array('video_id = ?' => $this -> getIdentity(), ));\r\n\r\n\t\t// update video count in signature table\r\n\t\t$signatureTbl = Engine_Api::_() -> getDbTable('signatures', 'ynvideo');\r\n\t\t$signature = $signatureTbl -> fetchRow($signatureTbl -> select() -> where('user_id = ?', $this -> owner_id));\r\n\t\tif ($signature)\r\n\t\t{\r\n\t\t\t$signature -> video_count = new Zend_Db_Expr('video_count - 1');\r\n\t\t}\r\n\t\t$signature -> save();\r\n\r\n\t\t// remove video from playlists\r\n\t\t$playlistAssocTbl = Engine_Api::_() -> getDbTable('playlistassoc', 'ynvideo');\r\n\t\t$playlistAssocs = $playlistAssocTbl -> fetchAll($playlistAssocTbl -> select() -> where('video_id = ?', $this -> getIdentity()));\r\n\t\tforeach ($playlistAssocs as $playlistAssoc)\r\n\t\t{\r\n\t\t\t$playlistAssoc -> delete();\r\n\t\t}\r\n\r\n\t\tparent::_delete();\r\n\t}", "public function delete(): void\n {\n $query_lang = 'DELETE FROM '. rex::getTablePrefix() .'d2u_linkbox_categories '\n .'WHERE category_id = '. $this->category_id;\n $result_lang = rex_sql::factory();\n $result_lang->setQuery($query_lang);\n }", "function delete_category($category_id)\n {\n $this->db->update('tbl_category',$this,array('category_id'=>$category_id));\n //echo $this->db->last_query();\n }", "function del()\n {\n $id = $this->uri->rsegment(3);\n $this->_del($id);\n \n $this->session->set_flashdata('message', 'Xóa thành công');\n redirect(admin_url('video'));\n }", "public function videoCategory() {\n $this->loadModel('VideoCategories');\n $data = $this->VideoCategories->find('all');\n $this->paginate = [ ];\n $videoCategories = $this->paginate($data);\n\n $this->set(compact('videoCategories'));\n \n }", "public function operateCategory(){\n\t\t$title = $_POST['name'];\n\t\t\n\t\t$operation = $_POST['operation'];\n\t\t$id = $_POST['edit_id'];\n\t\t$shared = !empty($_POST['shared']) ? $_POST['shared'] : 0;\n\t\t$description = isset($_POST['description']) ? $_POST['description'] : '';\n\t\t$parent_id = isset($_POST['parent_id']) ? $_POST['parent_id'] : 0;\n\t\t$published = isset($_POST['published']) ? $_POST['published'] : 0;\n\t\t$save = $_POST['submit'];\n\t\t//echo '<pre>'; print_r($_POST); die;\n\t\t//echo $title.\" \".$operation.\" \".$id.\" \".\" \".$shared.\" \".$save;\n\t\tif(isset($save))\n\t\t{\n\t\t\tif( $operation == 'add' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id,'description' => $description,'published' => $published);\n\t\t\t\t$data = $this->query_model->getCategory(\"downloads\");\n\t\t\t\tif($this->query_model->addCategory($args)){\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\t\tredirect($this->index());\n\t\t\t\t\t}\n\t\t\t}\n\t\t\telseif( $operation == 'edit' )\n\t\t\t{\n\t\t\t\t$args = array(\"cat_name\" => $title, \"cat_type\" => \"videos\", \"permission\" => $shared,'parent_id'=>$parent_id ,'description' => $description,'published' => $published);\n\t\t\t\t$this->db->where(\"cat_id\",$id);\n\t\t\t\tif($this->query_model->editCategory($args)){\n\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\techo \"<script language='javascript'>alert('Unable to add category');</script>\";\n\t\t\t\t\tredirect($this->index());\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t}", "private function removeVideoFromGroup()\n {\n try\n {\n $request = $_REQUEST;\n\n if(!isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg('provide group id');\n else if(!is_numeric($request['group_id'])) \n throw_error_msg('invalid group id'); \n else\n $gid = (int)$request['group_id'];\n\n if(!isset($request['videoid']) || $request['videoid']==\"\" )\n throw_error_msg('provide video id');\n else if(!is_numeric($request['videoid'])) \n throw_error_msg('invalid video id'); \n else\n $vid = (int)$request['videoid'];\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n global $cbgroup; \n $id = $cbgroup->remove_group_video($vid,$gid,true);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg())\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'video removed from group', \"data\" => array());\n $this->response($this->json($data));\n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "function deleteVideo()\n{\n global $connection;\n if (isset($_POST['btn_delete'])) {\n $idVideo = $_POST['btn_delete'];\n $data = videoCurrentFileTitle($idVideo, $connection);\n $videoTitle = $data['videoTitle'];\n $podcast_location = '../../../upload_podcast/';\n $video_location = '../../../upload_video/';\n $trailerTitle = $data['trailerTitle'];\n $trailer_location = '../../../trail_video/';\n $thumbnailTitle = $data['thumbnailTitle'];\n $thumbnail_location = '../../../thumbnail_video/';\n $superCategorie = $data['superCategorie'];\n \n if ($superCategorie == 1 || $superCategorie == 3) {\n $videoPath = $video_location.$videoTitle;\n } else {\n $videoPath = $podcast_location.$videoTitle;\n }\n \n $trailerPath = $trailer_location.$trailerTitle;\n $thumbnailPath = $thumbnail_location.$thumbnailTitle;\n \n \n global $deleteVideoResponse;\n $deleteVideoResponse = \"\";\n if (empty($idVideo)) {\n $deleteVideoResponse = '<script language=\"javascript\">swal(\"Errore!\", \"È necessario selezionare un video!\", \"error\").then(function() {\n location.reload();\n })</script>';\n } else {\n $query = \"DELETE FROM videos\n WHERE id_video = '$idVideo'\";\n $result = mysqli_query($connection, $query);\n if ($result) {\n unlink($videoPath);\n unlink($trailerPath);\n unlink($thumbnailPath);\n $deleteVideoResponse = '<script language=\"javascript\">swal(\"Successo!\", \"Il video è stato eliminato!\", \"success\".then(function() {\n location.reload();\n }))</script>';\n } else {\n $deleteVideoResponse = '<script language=\"javascript\">swal(\"Errore!\", \"Il video non è stato eliminato!\", \"error\").then(function() {\n location.reload();\n })</script>';\n }\n }\n }\n}", "public function destroy($id)\n {\n $category = ProductCategory::find($id);\n if ($category->source!='DL') {\n if ($category->parent_id==0) {\n $findeCategory = ProductCategory::where('parent_id', '=',$category->id)->get();\n if ($findeCategory){\n foreach ($findeCategory as $findeCategoryIdItem) {\n $findeCategoryIdItem->parent_id = 0;\n $findeCategoryIdItem->save();\n }\n }\n }\n $findeCategoryId = ProductCategory::where('name', '=', 'Разное')->first();\n $findeProductCategoryId = ProductList::where('productCategoryId', '=',$category->id)->get();\n if ($findeProductCategoryId){\n foreach ($findeProductCategoryId as $findeProductCategoryId) {\n $findeProductCategoryId->productCategoryId = $findeCategoryId->id;\n $findeProductCategoryId->save();\n }\n }\n $category->delete();\n }\n return redirect()->route('admin.product-categories.index')->with('delete','Категория успешно удалена');\n }", "function delete( $catID=-1 )\r\n {\r\n\r\n if ( $catID == -1 )\r\n $catID = $this->ID;\r\n\r\n $category = new eZImageCategory( $catID );\r\n\r\n $categoryList = $category->getByParent( $category );\r\n\r\n foreach ( $categoryList as $category )\r\n {\r\n $category->delete();\r\n }\r\n\r\n foreach ( $this->images() as $image )\r\n {\r\n $image->delete();\r\n }\r\n\r\n $categoryID = $category->id();\r\n\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->begin( );\r\n\r\n $res1 = $db->query( \"DELETE FROM eZImageCatalogue_Category WHERE ID='$categoryID'\" );\r\n $res2 = $db->query( \"DELETE FROM eZImageCatalogue_CategoryPermission WHERE ObjectID='$this->ID'\" );\r\n\r\n if ( ( $res1 == false ) || ( $res2 == false ) )\r\n $db->rollback( );\r\n else\r\n $db->commit();\r\n\r\n }", "function modifyCategory()\n{\n global $connection;\n if (isset($_POST['modifyBtn'])) {\n $categoria_id = $_POST['categoria_id'];\n\n $categoria_nome = str_replace([\"'\", '’', '“', '”'], [\"\\'\", \"\\'\", \"\\'\", \"\\'\"], $_POST['categoria_nome']);\n\n $query_update = \"UPDATE video_category SET category_video='$categoria_nome' WHERE id_category='$categoria_id'\";\n $result_update = mysqli_query($connection, $query_update);\n if ($result_update) {\n return header('Location: video_categorie.php?modify=true');\n } else {\n return header('Location: video_categorie.php?modify=false');\n }\n }\n}", "public function deleteCategoryLangaugeAction(){\n $ebookers_obj = new Ep_Ebookers_Managelist();\n //to call a function to delete themes//\n $ebookers_obj->deleteCategoryLangauge($this->_request->getParams());\n //unset($_REQUEST);\n exit;\n }", "public function modelDelete($category_id){\r\n\t\t\t$conn = Connection::getInstance();\r\n\t\t\t// chuan bi truy van \r\n\t\t\t$query = $conn->prepare(\"delete from tbl_category where category_id=:category_id\");\r\n\t\t\t//thuc thi truy van \r\n\t\t\t$query->execute(array(\"category_id\"=>$category_id));\r\n\t\t\t\r\n\t\t}", "public function delete_category($category_id){\n \n DB::table('tbl_category')\n ->where('category_id',$category_id)\n ->delete();\n return Redirect::to('/manage-category');\n }", "public function deleteCategories($category_id){\n if(DB::table('tbl_post')->where('category_id',$category_id)->first()){\n $name = DB::table('tbl_categories')->where('id',$category_id)->first();\n Session::put('massege','Không thể xóa danh mục \"'.$name->name.'\".');\n }\n else{\n DB::table('tbl_categories')->where('id',$category_id)->delete();\n Session::put('massege','Xoá danh mục thành công.');\n }\n return Redirect::to('categories');\n \n }", "function delete_category($cat_id)\n { \n $sql = \"DELETE FROM prod_categories WHERE `cat_id` = \\\"$cat_id\\\" LIMIT 1\";\n \n //echo $sql ;\n \n\t//submit query\n \n include 'connect.php';\n \n $result = mysqli_query($link, $sql); //returns object\n \n \n \n if (!$result) \n {\n\t\t\t\t\n $err = mysqli_error($link);\n //echo $err ;\n //echo 'error g et_user';\n\t\t\t\t\t\t\t\t\n }\n else\n { \n echo 'Kategoria u fshi nga sistemi!!!' ;\n }\n\n // close connection \n \n }", "function testDeletingCategory()\n {\n \n $this->tester->seeRecord('common\\models\\Category', ['description' => 'abc']);\n\n $category = Category::find()->where(['description' => 'abc'])->One();\n $category->delete();\n\n $this->tester->dontseeRecord('common\\models\\Category', ['description' => 'abc']);;\n }", "function delete(){\n if(isset($_GET['id'])){\n eliminar_categoria($_GET['id']); \n }\n }", "public function addEdit(){\n\t\tif (isset($this->session->userdata['logged_in'])){\n\t\t\t$video_id = $this->uri->segment(4);// get id form url\n\t\t\tif($video_id==''){\n\t\t\t\t$data['title'] = \"Add Video\";\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$data['title'] = \"Edit Video\";\n\t\t\t}\n\t\t\t$data['content'] = 'admin/addeditvideo';\n\t\t\t$data['getVideo'] = $this->VideoModel->getVideoById($video_id); //retrive all category By Id\n\t\t\t//print_r($data['getVideo']); die;\n\t\t\t$this->load->view('admin/layout/adminmaster',$data);\n\t\t}else{\n\t\t\tredirect('admin/login');\n\t\t}\n\t}", "function delete_category($action, $id)\r\n{\r\n\tglobal $dropbox_cnf;\r\n\tglobal $_user, $is_courseAdmin, $is_courseTutor;\r\n\r\n\t// an additional check that might not be necessary\r\n\tif ($action=='deletereceivedcategory')\r\n\t{\r\n\t\t$sentreceived='received';\r\n\t\t$entries_table=$dropbox_cnf['tbl_post'];\r\n\t\t$id_field='file_id';\r\n\t}\r\n\telseif ($action=='deletesentcategory')\r\n\t{\r\n\t\t$sentreceived='sent';\r\n\t\t$entries_table=$dropbox_cnf['tbl_file'];\r\n\t\t$id_field='id';\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// step 1: delete the category\r\n\t$sql=\"DELETE FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"' AND $sentreceived='1'\";\r\n\t$result=api_sql_query($sql);\r\n\r\n\t// step 2: delete all the documents in this category\r\n\t$sql=\"SELECT * FROM \".$entries_table.\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t$result=api_sql_query($sql);\r\n\r\n\twhile ($row=mysql_fetch_array($result))\r\n\t{\r\n\t\t$dropboxfile=new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor);\r\n\t\tif ($action=='deletereceivedcategory')\r\n\t\t{\r\n\t\t\t$dropboxfile->deleteReceivedWork($row[$id_field]);\r\n\t\t}\r\n\t\tif ($action=='deletesentcategory')\r\n\t\t{\r\n\t\t\t$dropboxfile->deleteSentWork($row[$id_field]);\r\n\t\t}\r\n\t}\r\n}", "public function destroy($id)\n {\n $category= Category::find($id);\n\n if(Storage::disk(\"public\")->exists(\"category/\".$category->image)){\n Storage::disk(\"public\")->delete(\"category/\".$category->image);\n }\n\n if(Storage::disk(\"public\")->exists(\"category/slider/\".$category->image)){\n Storage::disk(\"public\")->delete(\"category/slider/\".$category->image);\n }\n\n $category->delete();\n\n\n\n Toastr::success(\"Category Delete successfully\",'success');\n return redirect()->route('admin.category.index');\n }", "public function deleteClean() {\n\n $id = $this->request->get('category_id');\n\n // check category valid\n $category = ApplicationCategory::find($id)->first();\n\n $next_id = $this->request->get('next_category_id');\n\n\n $category_next = ApplicationCategory::find($next_id)->first();\n\n // check if exists.\n\n DB::table('apps')\n ->where('category_id', $id)\n ->update(['category_id' => $next_id]);\n\n $category->delete();\n\n return redirect('/develop/categories');\n\n\n }", "public function categories_delete($param = null)\r\n {\r\n if (isset($_POST[\"cat_id\"]) && !empty($_POST[\"cat_id\"])) {\r\n $action = $_POST[\"cat_id\"];\r\n $delete = Category::find($action)->delete();\r\n $total = Category::count();\r\n echo json_encode([\"total\" => $total, \"isDeleted\" => $delete]);\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }", "public function delete() {\n $sql = sprintf(\"DELETE FROM category WHERE id=%d\", $this->id);\n self::$connection->execute($sql);\n }", "public function destroy($category)\n {\n\n $item = BountyCategory::where('id', $category)->delete();\n\n \n \n\n session()->flash('success',\"deleted successfully\");\n return redirect()->back();\n }", "function delete_category($category_id) {\n global $db;\n $query = \n ' DELETE FROM categories \n WHERE cat_categoryID = :category_id';\n $statement = $db->prepare($query);\n $statement->bindValue(':category_id', $category_id);\n $statement->execute();\n $statement->closeCursor();\n}", "public function edit($id)\n {\n $video = Video::find($id);\n // dd($video->categories[0]->name);\n $categories = Category::where('status',1)->orderBy('name')->get();\n $tags = Tag::where('status',1)->get();\n return view('adminCMS.videos.editVideo',compact('video','categories','tags'));\n }", "public function deleteAction()\n {\n // enforce permissions.\n $this->acl->check('categories', 'manage');\n\n // require post request method.\n $request = $this->getRequest();\n if (!$request->isPost()) {\n throw new P4Cms_AccessDeniedException(\n \"Cannot delete category. Request method must be http post.\"\n );\n }\n\n $id = $request->getParam('id', $request->getParam('category'));\n $category = Category_Model_Category::fetch($id);\n $category->delete();\n\n $this->view->category = $category;\n }", "public function destroy($kw_category_id = 0, $id)\n {\n\n }", "function deleteAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');//lay id cua record can xoa\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t//tien hanh xoa\n\t\t\tif($myProductCat->delete())\n\t\t\t{\n\t\t\t\t$redirectMsg = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succDelete']);\n\t\t\t\t\n\t\t\t\t$this->registry->me->writelog('ProductCategorydelete', $myProductCat->id, array('name' => $myProductCat->name[$langCode])); \t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$redirectMsg = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['errDelete']);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t}\n\t\t\n\t\t$this->registry->smarty->assign(array('redirect' => $this->getRedirectUrl(),\n\t\t\t\t\t\t\t\t\t\t\t\t'redirectMsg' => $redirectMsg,\n\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t\t\n\t}", "function cs_pb_video($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$video_element_size = '25';\n\t\t$video_url = '';\n\t\t$video_width = '';\n\t\t$video_height = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$video_element_size = $cs_node->video_element_size;\n\t\t\t$video_url = $cs_node->video_url;\n\t\t\t$video_width = $cs_node->video_width;\n\t\t\t$video_height = $cs_node->video_height;\n\t\t\t\t$counter = $post->ID.$count_node;\n}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $video_element_size?>\" item=\"video\" data=\"<?php echo element_size_data_array_index($video_element_size)?>\" >\n \t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"video_element_size[]\" class=\"item\" value=\"<?php echo $video_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> &nbsp; \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> &nbsp; \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> &nbsp; \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n \t<div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Video Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\">&nbsp;</a>\n </div>\n <div class=\"opt-conts\">\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Video URL</label></li>\n <li class=\"to-field\">\n \t<input type=\"text\" name=\"video_url[]\" class=\"txtfield\" value=\"<?php echo $video_url?>\" />\n <p>Enter Video URL (Youtube, Vimeo or any other supported by wordpress)</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Width</label></li>\n <li class=\"to-field\"><input type=\"text\" name=\"video_width[]\" class=\"txtfield\" value=\"<?php echo $video_width?>\" /></li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Height</label></li>\n <li class=\"to-field\"><input type=\"text\" name=\"video_height[]\" class=\"txtfield\" value=\"<?php echo $video_height?>\" /></li>\n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"video\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}", "public function remove_category($id) {\r\n\t\t\treturn parent::delete($id);\r\n\t\t}", "public function deleted(Category $category)\n {\n //\n }", "public function deleteAction() {\n $this->_helper->layout->setLayout('admin-simple');\n\n if (!($category_id = $this->_getParam('category_id'))) {\n die('No identifier specified');\n }\n\n //GENERATE FORM\n $form = $this->view->form = new Sitestorereview_Form_Admin_Ratingparameter_Delete();\n $form->setAction($this->getFrontController()->getRouter()->assemble(array()));\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n\n foreach ($values as $key => $value) {\n if ($value == 1) {\n $reviewcat_id = explode('reviewcat_name_', $key);\n $reviewcat = Engine_Api::_()->getItem('sitestorereview_reviewcat', $reviewcat_id[1]);\n\n Engine_Api::_()->sitestorereview()->deleteReviewCategory($reviewcat_id[1]);\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\n try {\n //DELETE THE REVIEW PARAMETERS\n $reviewcat->delete();\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n }\n\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => 10,\n 'parentRefresh' => 10,\n 'messages' => array('')\n ));\n }\n $this->renderScript('admin-ratingparameter/delete.tpl');\n }", "function shophead_deleted($category_id = \"\")\n {\n $id = base64_decode($category_id);\n $categroy_data = $this->ProductCategory->find('first', array('conditions' => array('ProductCategory.id' => $id)));\n \n App::import('Model', 'ProductSubCategory');\n $this -> ProductSubCategory = new ProductSubCategory();\n $subcategories=$this->ProductSubCategory->find(\"list\",array('conditions'=>array(\"ProductSubCategory.product_category_id\"=>$id)));\n \n if(count($subcategories)==0){\n if (!empty($categroy_data)) {\n $new_business_data = $categroy_data['ProductCategory']['id'];\n if ($this->ProductCategory->delete($new_business_data)) {\n $this->Session->write('flash', array(DELETE_RECORD, 'success'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n } else {\n $this->Session->write('flash', array(FAILURE_MSG, 'failure'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n } else {\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }else{\n $this->Session->write('flash', array(CAT_CHILD_EXIST, 'failure'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }", "function deleting_categories (){\r\n if(isset($_GET['delete'])){\r\n $delete_cat_id_get = $_GET['delete'];\r\n $delete_cat_id_get = escape($delete_cat_id_get) ;\r\n $sql = \"DELETE FROM categories WHERE cat_id ='$delete_cat_id_get' \";\r\n $result = execute($sql);\r\n confirm($sql); \r\n redirect('categories.php');\r\n }\r\n \r\n}", "public function editVideoCategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = VideoCategory::find($id);\n return view('admin.editvideocategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function delete_MaterialCategory($id)\n {\n $this->db->where('id',$id);\n return $this->db->update('prj_mtrl_category',array('delete_status'=>'1'));\n }", "public function remove_post()\n {\n $input = $this->input->post();\n $data=$this->Category_model->deleteData($input);\n $this->response(['Item deleted successfully.'], REST_Controller::HTTP_OK);\n }", "public function delete_categoria($cat_id) {\n $conectar=parent::conexion();\n parent::set_names();\n $sql=\"UPDATE tm_categoria SET est=0 where cat_id=?\";\n $sql=$conectar->prepare($sql);\n // envia parametro\n $sql->bindValue(1,$cat_id);\n $sql->execute();\n // IMPORTANTE AGREGARLE EL PDO::FETCH_ASSOC PARA QUE HAGA BIEN LA CONSULTA\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n \n }", "public function destroy($id)\r\n\r\n {\r\n $category = Category::find($id);\r\n\r\n\r\n if ($category->image) {\r\n unlink(public_path() . DIRECTORY_SEPARATOR . 'assets\\admin\\img' . DIRECTORY_SEPARATOR . $category->image);\r\n $category->delete();\r\n }\r\n\r\n\r\n return redirect()->route('admin.category.index');\r\n }", "public function deleteCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n /*删除分类下的子分类*/\n $key = $_REQUEST['id'];\n $condition['id'] = $key;\n $form = M(\"categoryinfo\");\n $data = $form->where($condition)->delete(); \n $data_all = $form->select();\n for ($i = 0;$i< count($data_all);$i++)\n {\n if ($data_all[$i]['father'] == $key) \n {\n $condition['id'] = $data_all[$i]['id'];\n $form->where($condition)->delete();\n }\n } \n /*删除分类下的菜品*/\n $food = M('foodinfo');\n $data_food = $food->select();\n for ($i = 0;$i< count($data_food);$i++)\n {\n if ($data_food[$i]['father'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n if ($data_food[$i]['category'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n } \n\t\t$this->redirect('/index.php/Admin/dish');\n //$this->display();\n }", "public function delete_category()\r\n\t\t{\r\n\t\t\t$this->errno = DB_OK;\r\n\t\t\t\r\n\t\t\tif ( $this->cat_id == -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tSuch category hasn't been created\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"START TRANSACTION;\");\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tTransaction is needed despite the one query as delete is on cascade\r\n\t\t\t\r\n\t\t\tif ( ! ( $result = $this->con->query ( \"DELETE FROM category WHERE cat_id=$this->cat_id\" ) ) )\r\n\t\t\t{\t\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to connect\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( $this->con->affected_rows == 0 )\r\n\t\t\t{\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = CATEGORY_DONT_EXIST;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthis query should affect 1 row\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"COMMIT;\");\r\n\t\t\t\r\n\t\t}", "public function deleteCategory($cat_id)\n {\n DB::table('categories')->where('id',$cat_id)->delete();\n // Display a toaster Deleted message..\n $notification = array(\n 'message' => 'Category Deleted successfully.',\n 'alert-type' => 'success'\n );\n return Redirect()->back()->with($notification);\n }", "function action_delete($params) {\n $form_error =false;\n $category= model_category::load_by_id($params[0]);\n $id =$params[0];\n if(isset($_POST['form']['action'])) {\n //Check if the current category contains products.\n if($category::get_products_by_id($id)) {\n //If the category contains products,an error message appears.\n $form_error =TRUE;\n }\n else {\n if( model_category::deleteC($id)){\n header('Location: ' . APP_URL . 'category/list');\n die;\n }\n }\n }\n @include_once APP_PATH . 'view/category_delete.tpl.php';\n }", "function ciniki_directory_categoryDelete(&$ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'category_id'=>array('required'=>'yes', 'default'=>'', 'blank'=>'yes', 'name'=>'Category'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'directory', 'private', 'checkAccess');\n $ac = ciniki_directory_checkAccess($ciniki, $args['tnid'], 'ciniki.directory.categoryDelete');\n if( $ac['stat'] != 'ok' ) {\n return $ac;\n }\n\n //\n // Get the category uuid\n //\n $strsql = \"SELECT uuid FROM ciniki_directory_categories \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \" \n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['category']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.directory.12', 'msg'=>'The category does not exist'));\n }\n $uuid = $rc['category']['uuid'];\n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Get the list of entries to remove from this category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_directory_category_entries \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND category_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'entry');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $entries = $rc['rows'];\n foreach($entries as $entry) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category_entry', \n $entry['id'], $entry['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n //\n // Delete the object\n //\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category', $args['category_id'], $uuid, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'directory');\n\n return array('stat'=>'ok');\n}", "public function delete_category() {\r\n $id = $this->uri->segment(3);\r\n $delete = $this->faq_model->delete_menu($id);\r\n\r\n if ($delete) {\r\n $this->session->set_flashdata('succ_msg', 'Menu Deleted Successfully');\r\n } else {\r\n $this->session->set_flashdata('error_msg', 'Unable to Delete Successfully');\r\n }\r\n redirect(base_url() . 'faq/category_list');\r\n }", "public function delete()\n {\n if(($this->session->userdata('logged_in') != true) && ($this->session->userdata('logged_in_as') != 'admin'))\n {\n redirect('siteadmin', 'refresh');\n }\n \n $category_deletion_type = $this->input->post('category_deletion_type');\n \n /* starts to delete multiple categories */\n if ($category_deletion_type == 'multiple') \n {\n $category_id = $this->input->post('category_id');\n $c \t = 0;\n for( $i = 0; $i < count($category_id); $i++ )\n {\n $id = $category_id[$i];\n\n $check_category = $this->common_model->query_single_row_by_single_source('boutique_products', 'category_id', $id);\n if (count($check_category) == 0)\n {\n if( $this->common_model->delete_data('id', $id, 'boutique_categories') )\n $c++;\n }\n }\n if( $c == 0 )\n $this->session->set_flashdata('error_message', 'Could not delete any category!!');\n \n elseif( $c == 1 )\n $this->session->set_flashdata('success_message', 'A category was deleted successfully');\n \n elseif( $c > 1 )\n $this->session->set_flashdata('success_message', 'Multiple categories were deleted successfully');\n }\n /* ends to delete multiple category */\n \n /* starts to delete single category */\n else {\n $id = $this->input->post('single_category_id');\n $check_category = $this->common_model->query_single_row_by_single_source('boutique_products', 'category_id', $id);\n if (count($check_category) == 0)\n {\n if( $this->common_model->delete_data('id', $id, 'boutique_categories') )\n $this->session->set_flashdata('success_message', 'A category was deleted successfully');\n else\n $this->session->set_flashdata('error_message', 'Could not delete!! The category is in used');\n }\n else\n $this->session->set_flashdata('error_message', 'Could not delete the category!!');\n }\n /* ends to delete single category */ \n \n redirect(base_url().'category', 'refresh');\n }", "function delete_post()\n {\n $this->Admin_model->procedure = 'POST_DELETE';\n\n echo $this->p_post_id_delete;\n\n\n $rs = $this->Admin_model->delete($this->p_post_id_delete);\n\n //redirect('admin/Posts/display_cat');\n }", "public function update(Request $request, $id)\n {\n\n try{\n\n $video = Video::find($id);\n\n $video->title = $request->input('title');\n $video->subtitle = $request->input('subtitle');\n $video->description = $request->input('description');\n $category = Category::find($request->input('category'));\n $tags = json_decode($request->input('tags'),true);\n $video->tags()->detach(); //we need time to attach again this is why this line is here and not inmeduatly bedore attach tags\n $video->categories()->detach();\n if($request->hasFile('thumbnail')){\n $thumbnailFile = $request->file('thumbnail');\n $thumbnailName = 'thumbnail_'.str_slug($request->input('title')).\".\".$thumbnailFile->getClientOriginalExtension();\n $thumbnailFile->move(public_path(\"uploads/videos/\"),$thumbnailName);\n $video->thumbnail = asset(\"uploads/videos/$thumbnailName\");\n }\n if($request->hasFile('video')){\n $videoFile = $request->file('video');\n $videoName = 'video_'.str_slug($request->input('title')).\".\".$videoFile->getClientOriginalExtension();\n $videoFile->move(public_path(\"uploads/videos/\"),$videoName);\n $video->video = asset(\"uploads/videos/$videoName\");\n\n }\n $video->categories()->attach($category->id);\n foreach ($tags as $key => $value) {\n $tagName = $tags[$key]['name'];\n //$tags = Tag::where('name','LIKE',\"%$name%\")->first();\n $tag = Tag::firstOrCreate(['name'=>$tagName]);\n\n $video->tags()->attach($tag->id);\n }\n $video->save();\n\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was updated successfully !!\");\n return redirect()->back();\n\n } catch(\\Exception $e){\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not update the video\");\n Log::warning(\"Can not update Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n\n }", "public static function delete_category($id){\n try {\n DB::update(DB_TABLE_CATEGORY)\n ->set(array(\n DB_COLUMN_CATEGORY_DELETE_FLAG => 1,\n DB_COLUMN_CATEGORY_UPDATE_DATETIME => Utility::current_datetime(),\n ))\n ->where(DB_COLUMN_CATEGORY_ID, $id)\n ->execute();\n } catch (Exception $exc) {\n echo $exc->getTraceAsString();\n }\n }", "function videoCategory($categoryId, $catName, $clientKey){\n\t?>\n<div id=\"div-<?php echo $catName; ?>\" class=\"border-bg\" style=\"padding-bottom: 0px !important;\">\n<div class=\"page-header\">\n<h4>\n<span class=\"icons thirty2 <?php echo \"icon\".$catName; ?>\"></span>&nbsp;&nbsp;<?php echo $catName; ?>\n<ul class=\"nav nav-pills pull-right hide-videos\">\n<li class=\"dropdown pull-right\">\n<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\"><i class=\"fa fa-ellipsis-v color-a\"></i></a>\n<ul class=\"dropdown-menu\" role=\"menu\"><li><a class=\"pointer\" onclick=\"hideVideos('div-islam')\">Hide these videos</a></li></ul>\n</li>\n</ul> </h4>\n</div> \n<ul id=\"islam\" class=\"media\">\n <?php\n\t\n\t\n\t$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, \"https://www.googleapis.com/youtube/v3/videos?part=snippet,statistics,contentDetails&chart=mostPopular&regionCode=PK&videoCategoryId=\".$categoryId.\"&maxResults=6&key=\".$clientKey.\"\");\ncurl_setopt($ch, CURLOPT_HEADER, 0);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n$output = curl_exec($ch);\necho curl_error($ch);\ncurl_close($ch);\n \n$searchResponse = json_decode($output,true);\n// print_r($searchResponse);\n\tforeach ($searchResponse['items'] as $searchResult) {\n\t$videoId = $searchResult['id'];\n\t$videoTitle =$searchResult['snippet']['title'];\n\t$thumb= $searchResult['snippet']['thumbnails']['high']['url'];\n\t$duration=$searchResult['contentDetails']['duration'];\n\t$publishedAt=$searchResult['snippet']['publishedAt'];\n\t$viewCount=$searchResult['statistics']['viewCount'];\n\t?>\n\n <li class=\"homethumb hov\">\n <div class=\"mediathumb\">\n <a title=\"<?php echo $videoTitle ?>\" href=\"video/<?php echo $videoId; ?>\">\n <img src=\"<?php echo $thumb ?>\" alt=\"<?php echo $videoTitle; ?>\">\n <span class=\"duration\"><?php fix_duration($duration); ?></span>\n </a> \n </div> \n <h4><a title=\"<?php echo $videoTitle; ?>\" href=\"video/<?php echo $videoId; ?>\" class=\"medialink\"><?php echo shortString($videoTitle, 33); ?></a></h4>\n <div class=\"viewsanduser\">Posted <?php publushDateFix($publishedAt); ?><br>Views: <?php echo number_format($viewCount); ?></div> \n </li> \n\t\n\t\t<?php\n\t\t\n\t\t}\n?>\n\n</ul>\n<div id=\"unhide\" align=\"center\" style=\"display:none\"><a class=\"unhide\" onclick=\"unhide('div-islam')\">Click here to Unhide this section</a></div>\n</div>\n<?php\n}", "function EditarCategoria($params=null){\n $id_categoria= $params[':ID'];\n $this->modelo->GetCategoria($id_categoria);\n $this->vista->mostrarCategoriaEdit($id_categoria); \n }", "public function update_gallery_category_post()\n {\n prevent_author();\n\n //validate inputs\n $this->form_validation->set_rules('name', trans(\"category_name\"), 'required|xss_clean|max_length[200]');\n\n if ($this->form_validation->run() === false) {\n $this->session->set_flashdata('errors', validation_errors());\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n redirect($this->agent->referrer());\n } else {\n //category id\n $id = $this->input->post('category_id', true);\n if ($this->gallery_category_model->update_category($id)) {\n $this->session->set_flashdata('success', trans(\"category\") . \" \" . trans(\"msg_suc_updated\"));\n redirect('admin_category/gallery_categories');\n } else {\n $this->session->set_flashdata('form_data', $this->gallery_category_model->input_values());\n $this->session->set_flashdata('error', trans(\"msg_error\"));\n redirect($this->agent->referrer());\n }\n }\n }", "public function store(AddVideoRequest $request)\n {\n try{\n $videoFile = $request->file('video');\n $thumbnailFile = $request->file('thumbnail');\n $videoName = 'video_'.str_slug($request->input('title')).\".\".$videoFile->getClientOriginalExtension();\n $thumbnailName = 'thumbnail_'.str_slug($request->input('title')).\".\".$thumbnailFile->getClientOriginalExtension();\n $category = Category::find($request->input('category'));\n $tags = json_decode($request->input('tags'),true);\n\n if ($videoFile->move(public_path(\"uploads/videos/\"),$videoName) && $thumbnailFile->move(public_path(\"uploads/videos/\"),$thumbnailName)){\n $video = new Video();\n $video->title = ucfirst($request->input('title'));\n $video->subtitle = ucfirst($request->input('subtitle'));\n $video->description = ucfirst($request->input('description'));\n $video->duration = \"1:00\";\n $video->thumbnail = asset(\"uploads/videos/$thumbnailName\");\n $video->video = asset(\"uploads/videos/$videoName\");\n $video->user_id = Auth::id();\n $video->save();\n $video->categories()->attach($category->id);\n\n foreach ($tags as $key => $value) {\n $tagName = $tags[$key]['name'];\n //$tags = Tag::where('name','LIKE',\"%$name%\")->first();\n $tag = Tag::firstOrCreate(['name'=>$tagName]);\n $video->tags()->attach($tag->id);\n }\n $request->session()->flash('status', true);\n $request->session()->flash('mess', \"Video : '$video->title' was added successfully !!\");\n }\n return redirect()->back();\n } catch(\\Exception $e){\n $request->session()->flash('status', false);\n $request->session()->flash('mess', \"Sorry we could not store the video\");\n\n if($video){\n $video->categories()->detach();\n $video->delete();\n }\n\n Log::warning(\"Can not upload Video {$e->getFile()}, {$e->getLine()}, {$e->getMessage()}\");\n return redirect()->back();\n }\n\n }", "public function destroy()\n\t{\n\t\t$ids = \\Input::get('id');\n\t\tforeach ($ids as $id) {\n\t\t\t$category = Category::find($id);\n\t\t\tif (!$category)\n\t\t\t\tcontinue;\n// foreach ($category->pages as $page) {\n// if ($page->is_home) {\n// \\Session::flash('manager_error_message', \\Lang::get('manager.messages.menu_containing_home_page_cant_be_removed'));\n// return \\Redirect::back();\n// }\n// }\n\t\t\t$category->removeImage('image');\n\t\t\t$category->removeImage('image_desc');\n\t\t\tCategory::destroy($id);\n\t\t}\n\t\t\\Session::flash('manager_success_message', \\Lang::get('manager.messages.entities_deleted'));\n\t\treturn \\Redirect::back();\n\t}", "function remove_category($category_id) {\n\t\t$category_image_query = olc_db_query(\"SELECT categories_image FROM \".TABLE_CATEGORIES.\" WHERE categories_id = '\".olc_db_input($category_id).\"'\");\n\t\t$category_image = olc_db_fetch_array($category_image_query);\n\n\t\t$duplicate_image_query = olc_db_query(\"SELECT count(*) AS total FROM \".TABLE_CATEGORIES.\" WHERE categories_image = '\".olc_db_input($category_image['categories_image']).\"'\");\n\t\t$duplicate_image = olc_db_fetch_array($duplicate_image_query);\n\n\t\tif ($duplicate_image['total'] < 2) {\n\t\t\tif (file_exists(DIR_FS_CATALOG_IMAGES.'categories/'.$category_image['categories_image'])) {\n\t\t\t\t@ unlink(DIR_FS_CATALOG_IMAGES.'categories/'.$category_image['categories_image']);\n\t\t\t}\n\t\t}\n\n\t\tolc_db_query(\"DELETE FROM \".TABLE_CATEGORIES.\" WHERE categories_id = '\".olc_db_input($category_id).\"'\");\n\t\tolc_db_query(\"DELETE FROM \".TABLE_CATEGORIES_DESCRIPTION.\" WHERE categories_id = '\".olc_db_input($category_id).\"'\");\n\t\tolc_db_query(\"DELETE FROM \".TABLE_PRODUCTS_TO_CATEGORIES.\" WHERE categories_id = '\".olc_db_input($category_id).\"'\");\n\n\t\tif (USE_CACHE == TRUE_STRING_S) {\n\t\t\tolc_reset_cache_block('categories');\n\t\t\tolc_reset_cache_block('also_purchased');\n\t\t}\n\n\t}", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "public function delete($id_category){\n $category = \\App\\Models\\Category::find($id_category); // find the id and save it to variable category\n $category->delete();\n return redirect('/category')->with('success', 'Delete data success');\n }", "public function destroy($categoria)\n {\n Categoria::select('id','nombre','descripcion')\n ->where('id',$categoria)\n ->update([\n 'status_delete' => 1\n ]);\n return redirect()->to('Categoria-ver');\n }", "public function excluirVideoPorId($idVideo){\r\n \r\n $sql = mysql_query(\"DELETE FROM video_galeria WHERE id_video='$idVideo'\") or die(mysql_error());\r\n \r\n if($sql == true){\r\n\t\r\n\treturn true; \r\n\t\r\n }else{\r\n\t\r\n\treturn false; \r\n }\r\n\t\r\n}", "public function delete_academic_article_category()\n {\n // check status for delete\n $creator = json_decode($this->input->post('creator'));\n if($creator==null || $creator==''){\n echo 'fail';\n exit;\n }\n $creatorID = $this->Check__model->chk_token($creator);\n $statusUser = $this->Check__model->chk_status($creatorID);\n if( $statusUser != 'admin' ){\n echo 'fail';\n exit ;\n }\n //delete\n $academic_article_categoryID = json_decode($this->input->post('academic_article_categoryID'));\n $academic_article_category['aac_id'] = $academic_article_categoryID;\n $AAC_status = $this->academic_article_model->delete_academic_article_category($academic_article_category);\n if($AAC_status == true){\n echo $academic_article_categoryID ;\n } \n\n }", "public function postDelete($video)\n {\n // Declare the rules for the form validation\n $rules = array(\n 'id' => 'required|integer'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n $id = $video->id;\n $video->delete();\n\n // Was the video video deleted?\n $video = Video::find($id);\n if(empty($video))\n {\n // Redirect to the video videos management page\n return Redirect::to('admin/videos')->with('success', Lang::get('admin/videos/messages.delete.success'));\n }\n }\n // There was a problem deleting the video video\n return Redirect::to('admin/videos')->with('error', Lang::get('admin/videos/messages.delete.error'));\n }", "public function delCate($id, $img) {\n\n \t$delFilePath=\"uploads/categories/\".$img;\n\n \t$k=DB::table('mainCategories')->where('idMainCategory', $id)->delete();\n\n\t if($k!==\"\") {\n\n\t \t$l=DB::table('subCategories')->where('idSubMainCategory', $id)->delete();\n\n \t\t\n \t\t\t//-- To Delete Added Image From Folder\n\t\t //unlink(public_path($delFilePath));\n\n\t\t Session::put('cateDelMsz', 'Category Deleted Successfully.');\n\t\t \treturn Redirect::to('admin/category');\n\t\n \n\t }\n\t else {\n\n\t Session::put('cateDelMsz', 'Category Not Deleted.');\n\t \treturn Redirect::to('admin/category');\n\t }\n\n }", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function addVideocategory()\n {\n return view('admin.addvideocategory');\n }", "public function supcat($id)\n{\n $this->categories->delCat($id);\n redirect('administration/categorie');\n}", "function delete_advertisment( $category_id )\n\t{\n\n\t\t\t$full_image = $this -> get_category_image_icon( $category_id );\n\t\t\tif( $full_image != \"\" && file_exists( $full_image ) && $full_image != $category_image_icon )\n\t\t\t{\n\t\t\t\tunlink( $full_image );\n\t\t\t}\n\t\t\t\n\t\t\n\t\t$q = \"DELETE FROM title_dev_categories WHERE category_id = \".$category_id;\n\t\t$r = $this -> db -> deleteRecord( $q );\n\t\tif( $r )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function postCategoryMultiDelete(){\n\t\t$cat_ids = explode(',', Input::get('cat_ids'));\n\t\tif(count($cat_ids)){\n\t\t\ttry{\n\t\t\t\tforeach($cat_ids as $key => $value){\n\t\t\t\t\tif(!is_numeric($value))\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t\t$category = ShiftCategory::find($value);\n\t\t\t\t\t$this->shift->deleteCategory($category);\n\t\t\t\t}\n\t\t\t\treturn Redirect::back()->with('success', 'Selected category deleted successfully');\n\t\t\t}catch(\\Exception $e){\n\t\t\t\treturn Redirect::back()->with('error', $e->getMessage());\n\t\t\t}\n\t\t}else\n\t\t\treturn Redirect::back()->with('error', 'One or more category required to be selected before delete');\n\t}", "function deleteCategory($id) {\n\t$sql = \"DELETE FROM category WHERE id=:id\";\n\ttry {\n\t\t$db = getConnection();\n\t\t$stmt = $db->prepare($sql); \n\t\t$stmt->bindParam(\"id\", $id);\n\t\t$stmt->execute();\n\t\t$db = null;\n\t} catch(PDOException $e) {\n\t\techo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n\t}\n}", "public function delete_category_product($id){\n \n $this->AuthLogin(); \n DB::table('category_product')->where('category_id',$id)->delete();\n Session::put('message','Xoa danh muc san pham thanh cong');\n return Redirect::to('all-category-product');\n }", "public function delete(Request $request,$id){\n\t\t$cat = new category();\n\t\t$cat->where(\"pk_category_news_id\",\"=\",$id)->delete();\n\t}", "public function category(VideoCategory $videoCategory)\n {\n $page = Input::get('page', 1);\n\n $cat = VideoCategory::where('slug', '=', $videoCategory)->first();\n\n $parent_cat = VideoCategory::where('parent_id', '=', $cat->id)->first();\n\n if (!empty($parent_cat->id)) {\n $parent_cat2 = VideoCategory::where('parent_id', '=', $parent_cat->id)->first();\n if (!empty($parent_cat2->id)) {\n $videos = Video::select($this->getVideoFieldsForFrontend())\n ->where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orWhere('video_category_id', '=', $parent_cat->id)\n ->orWhere('video_category_id', '=', $parent_cat2->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n } else {\n $videos = Video::where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orWhere('video_category_id', '=', $parent_cat->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n }\n } else {\n $videos = Video::where('state', 'licensed')\n ->where('video_category_id', '=', $cat->id)\n ->orderBy('licensed_at', 'DESC')\n ->simplePaginate(9);\n }\n\n $data = [\n 'videos' => $videos,\n 'current_page' => $page,\n 'category' => $cat,\n 'page_title' => 'Videos - ' . $cat->name,\n 'page_description' => 'Page ' . $page,\n 'pagination_url' => '/videos/category/' . $videoCategory,\n 'menu' => Menu::orderBy('order', 'ASC')->get(),\n 'video_categories' => VideoCategory::all(),\n 'theme_settings' => config('settings.theme'),\n ];\n\n return view('Theme::video-list', $data);\n }", "public function UpdatePost_Category(Request $request){\n $postId = Post::query()->find($request->postID);\n $postId->categories()->detach($request->OldcategoryId);\n $postId->categories()->attach($request->categoryId); \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 }", "public function destroy(VideoCategory $videoCategory)\n {\n try {\n $videoCategory->delete();\n } catch (\\Throwable $th) {\n return back()->with('error', 'لا يمكن حذف قسم يحتوي على فيديوهات .. برجاء حذف او نقل الفيديوهات من هذا القسم اولا');\n }\n\n return back()->with('success', 'تم الحذف بنجاح');\n }", "function delete_categories($id){\n\t\t\tprint_r($this->input->post());\n\t\t}", "public function destroy($id)\n {\n $category = postCategory::find($id);\n if(File::exists('backend/img/postcategory/'.$category->image)){\n File::delete('backend/img/postcategory/'.$category->image);\n }\n $category->delete();\n return redirect ('/postcategory');\n }" ]
[ "0.6836293", "0.6664944", "0.663955", "0.66256726", "0.65463334", "0.643667", "0.64297694", "0.6421151", "0.64116925", "0.6404533", "0.63948876", "0.6360626", "0.63225144", "0.6319296", "0.62775624", "0.62721723", "0.62640065", "0.62535095", "0.6248276", "0.6229323", "0.61948544", "0.61898494", "0.6183621", "0.61766255", "0.615945", "0.61227447", "0.6121201", "0.6118562", "0.6090637", "0.6071174", "0.6069836", "0.60693073", "0.60625046", "0.6061117", "0.6056536", "0.6055096", "0.6037861", "0.6017133", "0.60078347", "0.59831494", "0.59800315", "0.5966163", "0.5943878", "0.59353423", "0.5929824", "0.5926265", "0.5924528", "0.5906628", "0.5899624", "0.5899202", "0.5893134", "0.58868086", "0.5886366", "0.5880381", "0.58787525", "0.5873255", "0.5869376", "0.5867826", "0.5867657", "0.58647436", "0.5862002", "0.5858274", "0.58571833", "0.5851283", "0.5812467", "0.58092916", "0.58003455", "0.5799786", "0.5789461", "0.57847446", "0.5763844", "0.57569015", "0.575677", "0.5747566", "0.5746658", "0.57450014", "0.5740402", "0.573912", "0.57286847", "0.57270616", "0.57239735", "0.5714586", "0.570877", "0.57080406", "0.5707734", "0.5698151", "0.5697256", "0.56969607", "0.56966156", "0.56905615", "0.56885165", "0.56878215", "0.5685926", "0.56846136", "0.56834966", "0.5682911", "0.56811756", "0.56717485", "0.56676465", "0.5666048" ]
0.67401767
1
/Edit Nutration Category for view form
public function editNutrationCategory($id) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $workout = NutrationCategory::find($id); return view('admin.editnutrationcategory')->with('workout',$workout); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Category $Category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function updateNutrationCategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n 'tips' => 'required',\n ));\n $id = $request->id;\n $nutrationCategory = NutrationCategory::find($id);\n $nutrationCategory->nutration_category_name = $request->name;\n $nutrationCategory->tips = $request->tips;\n $nutrationCategory->save();\n Session::flash('success','Nutration Category Updated succcessfully.');\n return redirect()->back()->with('workout',$nutrationCategory);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function addNutrationCategory()\n {\n return view('admin.addnutratoncategory');\n }", "public function edit(Category $category) {\n //not implemented\n }", "public function edit()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/edit\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n\n } catch (\\Exception $exception){\n $this->view->redirect(\"/categories/manage\",$exception->getMessage());\n }\n\n }", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "public function actionCategoryEdit()\n {\n $this->_assertCanManageCategories();\n $category_id = $this->_input->filterSingle('faq_id', XenForo_Input::UINT);\n $viewParams = array('faqcategory' => $this->_getCategoryModel()->getById($category_id));\n return $this->responseView('Iversia_FAQ_ViewPublic_Category', 'iversia_faq_edit_category', $viewParams);\n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "public function edit(Kategori $kategori)\n {\n //\n }", "public function edit_category($category) {\n $this->category();\n $categories_sql_string = \"SELECT * FROM category WHERE id = \" . $category . \" limit 1\";\n $connection = new Database(\"sbrettsc_db\");\n $menu_array = $connection->get_array_from_query($categories_sql_string);\n $data = array(\"menu_array\" => array_shift($menu_array));\n\n $this->loadView(\"editors/category_editor\", $data);\n }", "public function edit(category $category)\n {\n return \"category\";\n //\n }", "public function editPost()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"edit_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryName = $this->input->post(\"name\");\n\n $categoryModel = new CategoriesModel();\n\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n if ($categoryModel->editCategory($categoryName, $categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category edited successfully!\",\"success\");\n } else {\n $this->view->redirect(\"/categories/manage\",\"You did not change anything ?\");\n }\n\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "function editAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\t\n\t\t$redirectUrl = $this->getRedirectUrl();\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t$error \t\t= array();\n\t\t\t$success \t= array();\n\t\t\t$contents \t= '';\n\t\t\t$formData \t= array();\n\t\t\t //Truyen du lieu hien co vao form\n\t\t\t$formData['fbulkid'] = array();\n\t\t\t$formData['fid'] = $myProductCat->id;\n\t\t\t$formData['fname'] = $myProductCat->name;\n\t\t\t$formData['forder'] = $myProductCat->order;\n\t\t\t$formData['fparentid'] = $myProductCat->parentid;\n\t\t\t$formData['fenable'] = $myProductCat->enable;\n\t\t\t$formData['fseourl'] = $myProductCat->seoUrl;\n\t\t\t$formData['fseotitle'] = $myProductCat->seoTitle;\n\t\t\t$formData['fseokeyword'] = $myProductCat->seoKeyword;\n\t\t\t$formData['fseodescription'] = $myProductCat->seoDescription;\n\t\t\t\n\t\t\tif(!empty($_POST['fsubmit']))//truong hop da nhan nut submit\n\t\t\t{\n if($_SESSION['productcategoryEditToken']==$_POST['ftoken'])//kiem tra token\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->editActionValidator($formData, $error))//kiem tra du lieu co hop le hay khong\n {\n //Cac thong tin khong ngon ngu:\n $myProductCat->order = (int)$formData['forder'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n if(strlen($formData['fseourl']) > 0)\n $myProductCat->seoUrl = Helper::codau2khongdau($formData['fseourl'], true);\n else\n $myProductCat->seoUrl = Helper::codau2khongdau(strip_tags($formData['fname']), true);\n //Cac thong tin lien quan ngon ngu: \n $myProductCat->name = $formData['fname']; \n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n \n if($myProductCat->updateData())//cap nhat database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succUpdate']);\n $this->registry->me->writelog('ProductCategoryedit', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n }\n else\n {\n $error[] = $this->registry->lang['controller']['errUpdate']; \n }\n }\n }\n $_SESSION['productcategoryEditToken'] = Helper::getSecurityToken();//Tao token moi\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t\t\t$this->registry->smarty->assign(array(\t'formData' \t=> $formData,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'subcategories' => $myProductCat->getSub(true),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'parentCategories' => Core_ProductCategory::getFullCategories(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectUrl'=> $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'success'\t=> $success,\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\t));\n\t\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'edit.tpl');\n\t\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategorylist',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_edit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t\t$this->registry->smarty->assign(array('redirect' => $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectMsg' => $redirectMsg,\n\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t}\n\t}", "public function edit_category($category_id){\n $category_info=DB::table('tbl_category')\n ->where('category_id',$category_id)\n ->first();\n $edit_category=view('admin.pages.edit_category') \n ->with('category_info',$category_info); \n return view('admin.admin_master')->with('admin_content',$edit_category);\n }", "function editAction($categoryId)\n {\n $category = $this->category->findByPk($categoryId);\n $this->set(\"category\", $category);\n $this->set(\"categoryJson\", JsonView::php2js($category));\n $this->set(\"categoryExtraFields\", $this->extraField->getCategoryFields($categoryId));\n $this->set(\"categoriesSelect\", $this->category->createOptionsList());\n }", "public function edit(ProductCategory $productCategory)\n {\n //\n }", "public function editAction() {\n $id = (int) $this->params()->fromRoute('id', 0);\n\n if (!$id) {\n return $this->redirect()->toRoute('category', array('action' => 'add'));\n }\n $page = (int) $this->params()->fromRoute('page', 0);\n\n $session = new Container('User');\n $form = new CategoryForm('CategoryForm');\n $category = $this->getCategoryTable()->getCategory($id);\n $form->get('id')->setValue($id);\n $form->bind($category);\n\n $request = $this->getRequest();\n if ($request->isPost()) {\n $category = new Category();\n $data = $request->getPost();\n $category->exchangeArray($data);\n $form->setInputFilter($category->getInputFilter());\n $form->setData($data);\n\n if ($form->isValid()) {\n $validatorName = new \\Zend\\Validator\\Db\\NoRecordExists(\n array(\n 'table' => 'category',\n 'field' => 'title',\n 'adapter' => $this->getAdapter(),\n 'exclude' => array(\n 'field' => 'id',\n 'value' => $id,\n )\n )\n );\n if ($validatorName->isValid(trim($category->title))) {\n $no_duplicate_data = 1;\n } else {\n $flashMessage = $this->flashMessenger()->getErrorMessages();\n if (empty($flashMessage)) {\n $this->flashMessenger()->setNamespace('error')->addMessage('Category Name already Exists.');\n }\n $no_duplicate_data = 0;\n }\n\n if ($no_duplicate_data == 1) {\n $data->updated_date = time();\n $data->updated_by = $session->offsetGet('userId');\n\n $categoryId = $this->getCategoryTable()->saveCategory($category);\n// $this->getServiceLocator()->get('Zend\\Log')->info('Level created successfully by user ' . $session->offsetGet('userId'));\n $this->flashMessenger()->setNamespace('success')->addMessage('Category updated successfully');\n\n return $this->redirect()->toRoute('category');\n }\n }\n }\n return array('form' => $form, 'id' => $id, 'page' => $page);\n }", "public function edit(Category $Category)\n {\n echo \"i am in edit\";exit();\n //\n }", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "function catedit()\r\n\t{\r\n\t\t$data['cat'] = $this->categeory_model->cat($this->uri->segment(4));\r\n\t\t$this->load->view('admin/edit',$data);\r\n\t}", "public function edit(Categoria $categoria)\n {\n //\n }", "public function edit(Categoria $categoria)\n {\n //\n }", "public function edit(Categoria $categoria)\n {\n //\n }", "public function edit(TripCategory $tripCategory)\n {\n //\n }", "public function editCategory($id){\n\t\t $categoryById = Category::find($id);\n\t\treturn view('admin.category.editCategory', ['categoryById'=>$categoryById]);\n\t}", "public function edit_category($id)\n\t{\n\t\t$query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n $data['category']=$query; \n\t\t$data['title']=\"Dahboard || Great Wine Global\";\n $this->load->view('superpanel/header',$data);\n $this->load->view('superpanel/edit_categorie');\n $this->load->view('superpanel/footer');\n\t}", "public function edit(DrugCategory $drugCategory)\n {\n $title_eng = \"\";\n $title_rus = \"\";\n $title_kaz = \"\";\n $drugCatLanguages = DrugCategoryLanguage::all()->where('drug_category_id',$drugCategory->id);\n if($drugCatLanguages->where('language',1)->first() != null){\n $title_eng = $drugCatLanguages->where('language',1)->first()->title;\n }\n\n if($drugCatLanguages->where('language',2)->first() != null){\n $title_rus = $drugCatLanguages->where('language',2)->first()->title;\n }\n\n if($drugCatLanguages->where('language',3)->first() != null){\n $title_kaz = $drugCatLanguages->where('language',3)->first()->title;\n }\n return view('admin.DrugCategory.edit', compact(['drugCategory','title_eng','title_rus','title_kaz']));\n }", "public function edit($id)\n { \n //This Function Call CategoryHelpers.php Directory . \n $category = fetchCategoryTree(0,'','');\n $cat = Category::find($id);\n return view('admin.category.edit', compact('cat', 'category'));\n }", "public function editSpecialist($cat_id)\n {\n\n $specialistData = DB::table('specialists')\n ->join('departments', 'specialists.department_id', '=', 'departments.id')\n ->select('specialists.*', 'departments.name as deptName', 'departments.id as catID')\n /*->get();*/\n ->where('specialists.id',$cat_id)\n ->first();\n\n $editSpecialist=view('admin.specialist_edit')\n ->with('specialistData',$specialistData);\n\n return view('admin.master')\n ->with('main_content',$editSpecialist);\n\n return Redirect::to('/specialists');\n }", "public function edit($id)\n {\n\n $category= BountyCategory::findOrFail($id);\n\n return view('admin.bounty.edit-category')->with('categories',$category);\n }", "public function formModify() {\n $categories=$this->model->listCategories();\n $this->view->display(\"view/form/ProductFormModify.php\", NULL, $categories); \n }", "public function edit(Category $category): View\n {\n// $category-;\n return view('admin.categories.edit', compact('category'));\n }", "public function edit_kategori(){\r\n $kategori['id_kategori'] = $this->uri->segment(4);\r\n $data = array(\r\n 'form_nama' => 'Edit Data Kategori Menu',\r\n 'komponen' => 'action',\r\n 't_kategori' => $this->Model_kategori->tampil_kategori($kategori),\r\n );\r\n $this->load->view('ini_user/header', $data, FALSE);\r\n $this->load->view('ini_user/menu');\r\n $this->load->view('ini_user/edit_kategori');\r\n $this->load->view('ini_user/footer');\r\n }", "public function editnutration($id)\n {\n $dietPlan = false;\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $nutration = Nutration::find($id);\n $categories = NutrationCategory::all();\n if(($nutration->nutration_categorys_id) && ($nutration->is_seven == 1)){\n $nutration = SevenDayPlan::where('nutration_id',$id)->first(); \n $dietPlan = true;\n return view('admin.editsevenddays')->with('nutration',$nutration)->with('NutrationCategory',$categories)->with('dietplan',$dietPlan)->with('id',$id);\n }\n /*$isFoodplan = $workout->nutration_categorys_id;\n if($isFoodplan){\n $workout = SevenDayPlan::where('nutration_id',$id)->first();\n }*/\n return view('admin.editnutration')->with('nutration',$nutration)->with('NutrationCategory',$categories)->with('dietplan',$dietPlan)->with('id',$id);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "public function Editar(){\n $ca = new Categoria();\n \n if(isset($_REQUEST['id'])){\n $ca = $this->model->Obtener($_REQUEST['id']);\n }\n \n require_once 'view/header.php';\n require_once 'view/categoria/editar.php';\n require_once 'view/footer.php';\n }", "function edit($esta_categoria)\n {\n if($this->acceso(436)){\n // check if the categoria exists before trying to edit it\n $categoria = str_replace(\"%20\", \" \", $esta_categoria);\n $data['categoria'] = $this->Categoria_model->get_categoria($categoria);\n\n if(isset($data['categoria']['categoria']))\n {\n $this->load->library('form_validation');\n $this->form_validation->set_rules('categoria','Nombre','trim|required', array('required' => 'Este Campo no debe ser vacio'));\n $this->form_validation->set_rules('codigo_cat','Código','trim|required', array('required' => 'Este Campo no debe ser vacio'));\n if($this->form_validation->run()) \n {\n $params = array(\n 'categoria' => $this->input->post('categoria'),\n 'codigo_cat' => $this->input->post('codigo_cat'),\n );\n $this->Categoria_model->update_categoria($categoria,$params); \n redirect('categoria/index');\n }\n else\n {\n $data['_view'] = 'categoria/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The categoria you are trying to edit does not exist.');\n }\n }", "public function editCategory($cat_id)\n {\n // get category by cat_id..\n $category = DB::table('categories')->where('id',$cat_id)->first();\n return view('admin.category.edit_category',compact('category'));\n }", "public function edit($id){\n $data = Category::find($id);\n return view('admin.editcategory' , ['data'=>$data]);\n \n }", "public function edit($category)\n { $categories=Category::all();\n $category = Category::find($category);\n return view('admin.category.edit',compact('category','categories'));\n }", "public function edit(AwardCategory $awardCategory)\n {\n //\n }", "public function editAction()\n {\n $form = $this->getServiceLocator()->get('civcontent_category_form');\n \n // Grab copy of the existing entity\n $id = $this->params()->fromRoute('categoryid');\n $category = $this->getContentService()->getCategoryById($id);\n if (!$category)\n {\n $this->getResponse()->setStatusCode(404);\n return;\n }\n $form->bind($category);\n \n // Check if the request is a POST.\n $request = $this->getRequest();\n if ($request->isPost())\n {\n $data = (array) $request->getPost();\n $form->setData($data);\n if ($form->isValid())\n {\n // Persist changes.\n $this->getContentService()->persistCategory($category);\n \n // Redirect to content categories\n return $this->redirect()->toRoute('content/category', array(\n 'action' => 'index'\n ));\n }\n }\n \n // If a GET request, or invalid data then render/re-render the form\n return new ViewModel(array(\n 'form' => $form,\n 'id' => $id\n ));\n }", "public function edit($id_category){\n $category = \\App\\Models\\Category::find($id_category); // find the id and save it to variable category\n return view('category/edit', ['category' => $category]);\n }", "function edit_category_data($category_id)\n\t{\n\t\t$this->data['title'] \t= 'Edit Portfolio Category Data';\n\t\t$this->data['category']\t= $this->portfolio_model->get_category_by_id($category_id);\n\t\t$this->data['css'] \t\t= 'body/admin/css/form_style_default';\n\t\t$this->data['js'] \t\t= 'body/admin/js/form_style_default';\n\t\t$this->data['content'] \t= 'content/admin/portfolio/edit_category';\n\t\t$this->load->view('body/admin/style_1', $this->data);\n\t}", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "public function edit(Postcategory $postcategory)\n {\n //\n }", "public function edit($id){\n $categorie=Blog_categories::find($id);\n return view ('blog_categories.edit',['categorie'=>$categorie]);\n}", "public function editAction() {\n $this->_helper->layout->setLayout('admin-simple');\n\n if (!($category_id = $this->_getParam('category_id'))) {\n die('No identifier specified');\n }\n\n //FETCH PARAMETERS ACCORDING TO THIS CATEGORY\n $reviewCategories = Engine_Api::_()->getDbtable('reviewcats', 'sitestorereview')->reviewParams($category_id);\n\n //GENERATE A FORM\n $form = $this->view->form = new Sitestorereview_Form_Admin_Ratingparameter_Edit();\n $form->setAction($this->getFrontController()->getRouter()->assemble(array()));\n\n $form->setField($reviewCategories->toArray());\n\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n $values = $form->getValues();\n\n foreach ($values as $key => $value) {\n $reviewcat_id = explode('reviewcat_name_', $key);\n $reviewcat = Engine_Api::_()->getItem('sitestorereview_reviewcat', $reviewcat_id[1]);\n\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n\n try {\n //EDIT CATEGORY NAMES\n $reviewcat->reviewcat_name = $value;\n $reviewcat->save();\n\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n $this->_forward('success', 'utility', 'core', array(\n 'smoothboxClose' => 10,\n 'parentRefresh' => 10,\n 'messages' => array('')\n ));\n }\n\n $this->renderScript('admin-ratingparameter/edit.tpl');\n }", "function shophead_edit($category_id = \"\")\n {\n $this->layout = 'admin_layout';\n $id = base64_decode($category_id);\n // pr($id);\n $this->loadModel('ProductCategory');\n $data = $this->ProductCategory->find('first', array('conditions' => array('ProductCategory.id' => $id)));\n if (!empty($data)) {\n if (!empty($this->request->data)) {\n $this->request->data = Sanitize::clean($this->request->data, array('encode' => false));\n $this->ProductCategory->set($this->request->data);\n if ($this->request->data['ProductCategory']['name'] == $data['ProductCategory']['name']) {\n unset($this->request->data['ProductCategory']['name']);\n }\n if ($this->ProductCategory->validates()) {\n if ($this->ProductCategory->save($this->request->data)) {\n $this->Session->write('flash', array(EDIT_RECORD, 'success'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n } else {\n $this->Session->write('flash', array(FAILURE_MSG, 'failure'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }\n }\n $this->request->data = $data;\n } else {\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }", "public function edit(Category $category)\n {\n //\n return view('setup.category.edit', compact('category'));\n }", "public function edit($id = NULL){\n\t\tif ($id) {\n\t\t\t$this->data['category'] = $this->category_m->get($id);\n\t\t\tcount($this->data['category']) || $this->data['errors'][] = 'category could not be found';\n\t\t}\n\t\telse {\n\t\t\t$this->data ['category'] = $this->category_m->get_new();\n\t\t}\n\t\t\n\t\t// Set up the form\n\t\t$rules = $this->category_m->rules;\n\t\t$this->form_validation->set_rules($rules);\n\t\t\n\t\t// Process the form\n\t\tif ($this->form_validation->run() == TRUE) {\n\t\t\t$data = $this->category_m->array_from_post(array(\n\t\t\t\t'title', \n\t\t\t\t'description', \n\t\t\t\t'items_style'\n\t\t\t\t\n\t\t\t));\n\t\t\t$this->category_m->save($data, $id);\n\t\t\tredirect('admin/category');\n\t\t}\n\t\t\n\t\t$this->data['subview'] ='admin/category/edit';\n\t $this->load->view('admin/_layout_main', $this->data);\n }", "public function edit($id)\n\t{\n\t\t$category = Category::find($id);\t\n\t\t\n\t\treturn View::make('category.category.form')->with('category', $category);\t\t\t\t\t\t\t\t\t\t\n\t}", "function edit($categoria_id)\n {\n if($this->acceso(3)){\n // check if the categoria exists before trying to edit it\n $data['categoria'] = $this->Categoria_model->get_categoria($categoria_id);\n\n if(isset($data['categoria']['categoria_id']))\n {\n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n 'categoria_nombre' => $this->input->post('categoria_nombre'),\n );\n\n $this->Categoria_model->update_categoria($categoria_id,$params); \n redirect('categoria/index');\n }\n else\n {\n $data['_view'] = 'categoria/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The categoria you are trying to edit does not exist.');\n }\n }", "public function edit($id){\n\n // Define the category\n $category = Category::withTrashed()->where('id', $id)->first();\n // Check if any category is found:\n if(!$category){\n // Display an error:\n FlashSession::addAlert('error', 'Er geen categorie gevonden met dit ID');\n // Return to the overview:\n return redirect('/admin/category');\n }\n // Return to the view with category data:\n return view('admin.category.edit', compact('category'));\n }", "static public function ControllerEditarCategoria(){\n //evaluamos igual si viene una categoria\n if(isset($_POST[\"editarCategoria\"])){\n //validaciones\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarCategoria\"])){\n //tabla y arreglos\n\t\t\t\t$tabla = \"categorias\";\n\n\t\t\t\t$datos = array(\"categoria\"=>$_POST[\"editarCategoria\"],\n\t\t\t\t\t\t\t \"id\"=>$_POST[\"idCategoria\"]);\n //lo enviamos al modelo\n\t\t\t\t$respuesta = ModeloCategorias::ModeloEditarCategoria($tabla, $datos);\n //si edita que envie una respuesta\n\t\t\t\tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"La categoría ha sido cambiada correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"categorias\";\n\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</script>';\n\n\t\t\t\t}\n\n\n\t\t\t}else{\n // en caso contrarios\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡La categoría no puede ir vacía o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"categorias\";\n\n\t\t\t\t\t\t\t}\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 }", "public function edit($id)\n {\n $cat= MenuCategories::find($id);\n return view(\"dashboard.pages.supervisor.category.edit\", [ 'cat'=>$cat]);\n \n }", "public function edit($id)\n {\n $data = $this->Category->findData($id);\n $catalogue = Catelog::get();\n\t\tif($data->in_home==\"on\"){\n\t\t\t$is_Selected=\"checked\";\n\t\t}else{\n\t\t\t$is_Selected=\"\";\n\t\t}\n $html = '<div class=\"form-group error\"></div>\n <label for=\"categories_name\">Name</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"text\" id=\"editcategories_name\" name=\"categories_name\" value=\"'.$data->categories_name.'\" class=\"form-control\" placeholder=\"Enter your category name\">\n </div>\n </div>\n <label for=\"catelogue_id\">Catalogue</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <select class=\"form-control\" id=\"editcatelogue_id\" name=\"catelogue_id\">\n <option value=\"\">-- Please select --</option>';\n foreach($catalogue as $key)\n {\n $status=\"\";\n if($data->catelogue_id==$key->id){\n $status=\"selected\";\n }\n $html .= '<option value=\"'.$key->id.'\" '.$status.'>'.$key->catelogue_name.'</option> ';\n }\n $html .= ' </select>\n </div>\n </div>\n <label for=\"image\">Images</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"file\" name=\"image_1\" id=\"image_1\" placeholder=\"Choose image\" > \n </div>\n </div>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <img src=\"'.asset('storage/category/'.$data->image).'\" name=\"old_img\" width=\"50px\" height=\"50px\"> \n </div>\n </div>\n <label for=\"description\">Description</label>\n <div class=\"form-group\">\n <div class=\"form-line\">\n <input type=\"text\" id=\"editDescription\" name=\"Description\" value=\"'.$data->description.'\" class=\"form-control\" placeholder=\"Enter your description\">\n </div>\n </div>\n\t\t\t\t <label for=\"description\">Show In Home</label>\n <div class=\"form-group\">\n\t\t\t\t\t\t<input type=\"checkbox\" id=\"in_home\" name=\"in_home\" class=\"form-control\" '.$is_Selected.'>\n\t\t\t\t\t</div>\n <br>\n ';\n return response()->json(['html'=>$html]);\n }", "public function editCategory($editCategory) {\n if (isset($editCategory)) {\n\n $data = array(\n 'name' => $editCategory['name'],\n 'support_emails' => $editCategory['support_emails'],\n 'quantity_enabled' => $editCategory['quantity_enabled']\n );\n \n if (isset($editCategory['supplier_user'])) {\n $data['supplier_user'] = $editCategory['supplier_user'];\n }\n \n if (isset($editCategory['custom_fields'])) {\n $data['custom_fields'] = $editCategory['custom_fields'];\n } else {\n $data['custom_fields'] = NULL;\n }\n $this->db->where('id', $editCategory['category_id']);\n $this->db->update('categories', $data);\n return TRUE;\n } else {\n return False;\n }\n }", "public function edit($id) {\n $category = Category::whereNull('category_id')->findOrFail($id);\n return view('admin.category.category_edit_form', compact('category'));\n }", "public function categoryForm(){\n $table = \"categories\";\n $cresults = $this->getAllrecords($table);\n foreach($cresults as $category){\n echo('<option value=\"'.$category[\"cat_id\"].'\">'.$category[\"cat_name\"].'</option>');\n }\n\n\n }", "public function editAction($cat_id)\n\t{\n\t\t$this->oView->box_title = \"Edit Category\";\n\t\t$configure_languages = $this->oConfigureModule['configure_languages'];\n\t\t$this->oView->configure_languages = $configure_languages;\t\t\t\t\n\t\t$this->oView->link_url = site_url('dashboard/category/edit/'.$cat_id);\n\t\t$this->oView->cat_id = $cat_id;\n\t\t\n\t\t$objCat = new Category();\n\t\t\n\t\tif ($this->oInput->isPost())\n\t\t{\n\t\t\t$parent_code = $this->oInput->post('parent_code');\n\t\t\t$parent_id = 0;\n\t\t\t\n\t\t\tif (trim(strtolower($parent_code)) != \"root\") \n\t\t\t{\n\t\t\t\t$row = $objCat->getRow(\"code = ?\",array($parent_code));\n\t\t\t\t$parent_id = $row[\"id\"]; \n\t\t\t}\n\t\t\t\n\t\t\t$data['parent_id'] = $parent_id;\n\t\t\t$data['code'] = $this->oInput->post('code');\n\t\t\t$data['active'] = $this->oInput->post('active');\n\t\t\t$data['sort_order'] = $this->oInput->post('sort_order');\n\t\t\t\n\t\t\tforeach ($configure_languages['languages'] as $code => $row)\n\t\t\t{\n\t\t\t\t$data[\"name_{$code}\"] = $this->oInput->post(\"name_{$code}\");\n\t\t\t\t$data[\"description_{$code}\"] = $this->oInput->post(\"description_{$code}\");\n\t\t\t\t$data[\"icon_{$code}\"] = $this->oInput->post(\"icon_{$code}\");\n\t\t\t\t$data[\"image_{$code}\"] = $this->oInput->post(\"image_{$code}\");\n\t\t\t}\n\n\t\t\t$objCat->update($cat_id,$data);\n\t\t\n\t\t}\n\n\t\t$rowCat = $objCat->get($cat_id);\n\t\t\n\t\t$rowParentCat = $objCat->get($rowCat['parent_id']);\n\t\t$rowCat['parent_code'] = $rowParentCat['code'];\n\t\tif ($rowParentCat['code'] == 0) \n\t\t\t$rowCat['parent_code'] = \"ROOT\";\n\t\t\n\t\t$this->oView->rowCat = $rowCat;\t\t\n\t\t\n\t\t$this->renderView('dashboard/category/_form');\n\t}", "public function edit(Request $request,$id= null)\n {\n if ($request->isMethod('post')) {\n $data = $request->all();\n Category::where(['id'=>$id])->update(['name'=>$data['name'],'slug'=>str_slug($request->name)]);\n return redirect()->route('all_categories')->with('flash_message_success','Category Updated Successfully');\n }\n $category = Category::find($id);\n $levels = Category::where(['parent_id'=>0])->get();\n return view('admin.category.edit_category',compact('category','levels'));\n }", "public function edit($id){\n\n //\n\n $categories = Category::pluck('name', 'id')->all();\n $category = Category::find($id);\n\n $sub_categories = Category::where(['parent_id' => $id])->orderBy('id', 'desc')->get();\n\n\n return view(\"admin.category.edit\", compact( 'categories','category','sub_categories'));\n\n }", "public function edit(Category $category)\n {\n $user_check = \\Auth::user();\n if (in_array($user_check->level, [0, 1])) {\n $form = \\FormBuilder::create(CategoryForm::class, [\n 'url' => route('category.update', ['subject' => $category->id]),\n 'method' => 'PUT',\n 'model' => $category\n ]);\n return view('category.edit', compact('form'));\n } else {\n session()->flash('message', 'Desculpe! Essa área é restrita a administração.');\n return view('includes.message');\n }\n }", "public function editCategory($id){\n $cate_data = Category::find($id);\n $all_cates = Category::all();\n $selected_cate = Category::find($cate_data->parent_id);\n\n return view('dashboard.edit-categories-products',[\n 'cate_data' => $cate_data,\n 'all_cates' => $all_cates,\n 'selected_cate' => $selected_cate\n ]);\n }", "public function edit($category)\n {\n return view('admin.spot_categories.edit')->with('category', $category);\n }", "public\n\tfunction edit( $id ) {\n\t\t$parent = Category::all();\n\t\t$subcat = Subcategory::all();\n\t\t$cat = Grandcategory::find( $id );\n\t\treturn view( \"admin.grandcategory.edit\", compact( \"cat\", 'parent', 'subcat' ) );\n\t}", "public function edit() {\n\t\t$id = $this->input->get('id');\n\t\t$data = $this->kategori_m->get_by(array('id' => $id));\n\t\t$kode_induk = $data->kode_induk_kategori;\n\t\tif (!is_null($kode_induk)) {\n\t\t\t$id_induk = $this->kategori_m->get_by(array('kode_kategori' => $kode_induk))->id;\n\t\t\t$data->id_induk = $id_induk;\n\t\t} else {\n\t\t\t$data->id_induk = \"\";\n\t\t}\n\t\t$this->printOptionOnCombobox($data, $id);\n\t\techo json_encode($data);\n\t}", "public function edit(Category $edit){\n return $edit;\n }", "public function edit($id) {\n //\n if (!Entrust::can('category-update')) {\n return redirect('');\n }\n $this->data['sub_title'] = 'Edit Category';\n $this->data['category'] = Category::find($id);\n $this->data['parent'] = Category::where('id', '!=', $id)->where('parent', '=', 0)->lists('name', 'id');\n return view('backend.category.edit', $this->data);\n }", "public function edit($id)\n {\n $categories = Categorie::where('id',$id)->first();\n return view('admin/edit_category')->with('cts',$categories);\n }", "public function edit($id) {\n $category = Category::findOrFail($id);\n return view('category.form', compact('category'));\n }", "public function edit($id)\n {\n $categoriesHelper = new categoriesHelper();\n $data = Category::where('id', '<>', $id)->mothers()->orderBy('type')->get()->toArray();\n $data = $categoriesHelper->separateTypesCategories($data);\n $panel = [\n 'left' => ['width' => '2'],\n 'center' => ['width' => '10'],\n ];\n $storeCategories = ['' => trans('categories.no_father')];\n $groupCategories = ['' => trans('categories.no_father')];\n foreach ($data['group'] as $row) {\n $groupCategories[$row['id']] = $row['name'];\n }\n foreach ($data['store'] as $row) {\n $storeCategories[$row['id']] = $row['name'];\n }\n\n return view('categories.update', ['categories' => $data, 'category' => Category::find($id), 'panel' => $panel, 'groupCategories' => $groupCategories, 'storeCategories' => $storeCategories]);\n }", "public function Edit($id)\n\t{\n\t\t$form = new GroupForm();\n\n\t\t$categoria = Categoria::find($id);///->first() first pega o primeiro a ser encontrado pela consulta\n\t\t\n\t\t$url = URL::full();\n\t\t$data = Input::all();\n\t\t\n\n\t\tif ($form->isPosted())\n\t\t{\n\t\t\t$this->beforeFilter('csf', array('on' => 'post'));\n\n\t\t\tif ($form->isValidForAdd(Categoria::$rules))\n\t\t\t{\n\t\t\t\t$categoria->descricao = Input::get(\"descricao\");\n\t\t\t\t$categoria->tipo = Input::get(\"tipo\");\n\t\t\t\t$categoria->save();\n\n\t\t\t\treturn Redirect::route(\"categ_list\");\n\t\t\t}\n\n\t\t\treturn Redirect::to($url)->with(compact('categoria'))->withErrors($form->getErrors());\n\t\t\t\n\t\t\t\n\t\t}\n\n\t\t/* \n\t\t\t* Tratamento da requisição GET para exibir a pagina de edição\n\t\t\t*\n\t\t*/\n\t\tif(!$categoria) {\n\t\t\treturn Redirect::route('categ_edit');\n\t\t}\n\t\t//metodo with envia para view os objetos com o compact\t\t\t\n\t\treturn View::make('admin.categorias.edit')->with(compact('categoria'));\n\t\t\n\t}", "public function edit($id)\n {\n // dd($category);\n $parents=Category::where('parent_id','=','0')->get();\n $category=Category::find($id);\n\n return view('admin.category_edit',compact('parents','category'));\n }", "public function edit(booksCategory $booksCategory)\n {\n //\n }", "public function edit(booksCategory $booksCategory)\n {\n //\n }", "public function edit(Category $category)\n {\n $estados = Estado::all();\n return view('Admin.category.edit', compact('category', 'estados'));\n\n }", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}" ]
[ "0.70665777", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.70652986", "0.7064272", "0.7058258", "0.7027451", "0.6993431", "0.6987719", "0.6948315", "0.6881495", "0.6867869", "0.6866318", "0.6862784", "0.67795503", "0.6776954", "0.6770778", "0.6752352", "0.6750525", "0.6749864", "0.67397904", "0.673453", "0.67341024", "0.673114", "0.673012", "0.673012", "0.673012", "0.671293", "0.66866934", "0.668053", "0.666724", "0.66258556", "0.66136384", "0.6612306", "0.660614", "0.6604735", "0.6604348", "0.6596192", "0.6584885", "0.65807825", "0.6577723", "0.6572249", "0.6570907", "0.65410966", "0.6533952", "0.6525754", "0.6524654", "0.6507598", "0.6490349", "0.6489652", "0.64888877", "0.648846", "0.6485212", "0.64705235", "0.6457255", "0.64419496", "0.64416885", "0.644073", "0.6431503", "0.64153767", "0.64096797", "0.64076173", "0.64049476", "0.6389233", "0.63792014", "0.6367788", "0.6362238", "0.6360204", "0.63586146", "0.6355088", "0.6351449", "0.6349077", "0.63486516", "0.6340681", "0.63346565", "0.6319064", "0.63189626", "0.63159925", "0.6313565", "0.6313565", "0.631036", "0.63017255" ]
0.7055109
24
/Edit Nutration Category Function for update
public function updateNutrationCategory(Request $request) { if((Auth::check()) && (Auth::user()->is_admin == 1)){ $this->validate($request,array( 'name' => 'required', 'tips' => 'required', )); $id = $request->id; $nutrationCategory = NutrationCategory::find($id); $nutrationCategory->nutration_category_name = $request->name; $nutrationCategory->tips = $request->tips; $nutrationCategory->save(); Session::flash('success','Nutration Category Updated succcessfully.'); return redirect()->back()->with('workout',$nutrationCategory); } else{ Session::flash('danger','You are not authorize to view this page'); return redirect()->back(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdateItemSubCategory()\n {\n }", "public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }", "public function updateCate()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$category = $_POST['upcategory'];\n\t\t\t$category_id = $_POST['upcategory_id'];\n\t\t\t$sql = \" update lib_book_species set category = '{$category}' where category in \n\t\t\t\t\t(select category from lib_category where category_id = {$category_id});\n\t\t\t\t\tupdate lib_category set category='\" . $category . \"' where category_id='\" . $category_id . \"';\n\t\t\t\t\t\";\n\t\t\t$cate = D('Category');\n\t\t\t$return = $cate->execute($sql);\n\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'Modify successfully!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}", "public function testUpdateCategoryUsingPUT()\n {\n }", "function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }", "public function update_assets_category() {\n\t\n\t\tif($this->input->post('edit_type')=='assets_category') {\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t\n\t\t$id = $this->uri->segment(4);\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('name')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_cat_name_field');\n\t\t}\n\t\t\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\t\n\t\t// set data\n\t\t$data = array(\n\t\t'category_name' => $this->input->post('name')\n\t\t);\n\t\t\n\t\t$result = $this->Assets_model->update_assets_category_record($data,$id);\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}", "function edit(category $category)\n {\n $query = \"UPDATE categories SET name = '$category->name', \n tag = '$category->tag', description = '$category->description', slug = '$category->slug', active = '$category->active' WHERE categories_id = $category->category_id\";\n $result = $this->db->update($query);\n }", "public function update_cat_att()\n\t\t{\n\t\t\t$id=$this->input->post('cat_id');\n\t\t\t$cat_name=$this->input->post('cat_edit_name');\n\t\t\t$update=$this->db->where(\"f_att_id\",$id)->update('food_attribute',array(\"f_att_name\"=>$cat_name));\n\t\t\tif($update)\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t}", "public function editCategory()\r\n{\r\n $query_string = \"UPDATE categories \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"categoryname = :categoryname, \";\r\n $query_string .= \"categorydescription = :categorydescription \";\r\n $query_string .= \"WHERE categoryid = :categoryid\";\r\n\r\n return $query_string;\r\n}", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = true;\n\t\t\tif(count($error)==0){\n\t\t\t\t$set = array();\n\t\t\t\t$set[] = \"title = '\".add_slash($data['title']).\"'\";\n\t\t\t\t$set[] = \"language_id = '1'\";\n\t\t\t\t$set[] = \"category_id = '0'\";\n\t\t\t\t\n\t\t\t\t$set = implode(', ', $set);\n\t\t\t\tif($data['id']){\n\t\t\t\t\tmysql_q(\"UPDATE product_category SET $set WHERE id = '\".add_slash($data['id']).\"'\");\n\t\t\t\t} else {\n\t\t\t\t\t$data['id'] = mysql_q(\"INSERT INTO product_category SET $set\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($data['save']){\n\t\t\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t\t\t} else{\n\t\t\t\t\tredirect(\"product_category-edit-\".$data['id'].\".htm\", \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else if($data['cancel']) {\n\t\t\tredirect(\"product_category.htm\", \"\");\n\t\t}\n\n\t\t$fields = \"\n\t\t[hidden name='id']\n\t\t[input name='title' label='Category Title' error='Please Enter Category Title']\n\t\t[sac class='']\n\t\t\";\n\t\t\n\t\tif(!$data['save'] && $data['id']){\n\t\t\t$data = mysql_q(\"SELECT * FROM product_category WHERE id='\".add_slash($data['id']).\"'\", \"single\");\n\t\t}\n\n\t\t$tpl->assign(\"data\", $data);\n\t\t\n\t\t$form = new form();\n\t\t$form->add($fields);\n\t\t$tpl->assign(\"form1\", $form->build());\n\t\t\n\t\t$main['content'] = $tpl->fetch(\"admin_product_category_edit.tpl\");\n\t\tdisplay($main);\n\t}", "function wp_update_category($catarr)\n {\n }", "function update_category($category_id)\n {\n $this->db->update('tbl_category',$this, array('category_id'=>$category_id));\n }", "private function update($cat){\r\n\t\tif(!$this->acceptUpdates) return;//do not allow health coach to change answers\r\n\t\tif(!isset($this->categories[$cat])) throw new Exception(\"Invalid category\");\r\n\r\n\t\t$sql=\"UPDATE `u_mod_ifocus` SET \";\r\n\t\t$comma=false;\r\n\t\tforeach($this->data[$cat] as $key=>$value){\r\n\t\t\tif($comma) $sql.=\" , \";\r\n\t\t\t$sql.=\"`\".$key.\"`='\".$this->dbOb->escape_string($value).\"'\";\r\n\t\t\t$comma=true;\r\n\t\t}\r\n\t\tif(!$comma) return; //cant update a section we have no data for\r\n\t\tif(!$this->id) return; //can't update a record we haven't loaded\r\n\r\n\t\t$sql .= \", last_completed = '\" . $cat . \"'\";\r\n\r\n\t\tif($cat==\"biometric_data\"){\r\n\t\t\tif(!$this->isCompleted()) $sql.=\", date_completed=NOW() \";\r\n\t\t\t//upon completion reward points for Health Assessment Questions\r\n\t\t\t$im=new IncentivePointsModel();\r\n\t\t\tif($this->data[\"preventative_health\"][\"q12\"]==1){\r\n\t\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"FluShot\");\r\n\t\t\t}\r\n\t\t\t$im->addIncentivePointMA(\"IFocusModel\",\"Complete\");\r\n\t\t}\r\n\r\n\t\t$sql .= \" ,date_updated=NOW() WHERE id = '\" . $this->data['id'] . \"'\";\r\n\t\t$this->dbOb->update($sql);\r\n\t}", "function modifyCategory()\n{\n global $connection;\n global $updateCategorySuccess, $updateCategoryError;\n $updateCategorySuccess = $updateCategoryError = '';\n\n if (isset($_POST['btn_save_category'])) {\n $category_id = $_POST['txt_userid'];\n\n $updateColumncategory = '';\n\n $category_name = htmlentities($_POST['category_name']);\n if (!empty($category_name)) {\n $updateColumncategory .= \"category = '$category_name',\";\n }\n\n $updateColumncategory = rtrim($updateColumncategory, ',');\n\n $query_update = \"UPDATE product_category SET $updateColumncategory WHERE id_category = '$category_id'\";\n $result_update = mysqli_query($connection, $query_update);\n\n if ($result_update) {\n $updateCategorySuccess = '<script language=\"javascript\">\n swal(\"Sukses!\", \"Kategoria u modifikua me sukses!\", \"success\")\n </script>';\n } else {\n $updateCategoryError = '<script language=\"javascript\">\n swal(\"Gabim!\", \"Ka ndodhur një gabim gjatë modifikimit të kategorisë! Provoni përsëri!\", \"error\")\n </script>';\n }\n }\n}", "function edit_category() {\r\n\r\n\tif(isset($_POST['editcategory'])){\r\n\r\n\t\t$cat_id\t\t\t\t= clean_input($_GET['cat_id']);\r\n\t\t$cat_name \t\t\t= clean_input($_POST['cat_name']);\r\n\t\t$cat_desc_short \t= clean_input($_POST['cat_desc_short']);\r\n\t\t$cat_desc_long \t\t= clean_input($_POST['cat_desc_long']);\r\n\t\t$cat_parent_id \t\t= clean_input($_POST['cat_parent_id']);\r\n\t\t$cat_url \t\t\t= clean_input($_POST['cat_url']);\r\n\t\t$cat_date \t\t\t= clean_input($_POST['cat_date']);\r\n\t\t$cat_mod \t\t\t= clean_input($_POST['cat_mod']);\r\n\t\t$page_template \t\t= clean_input($_POST['page_template']);\r\n\t\t$cat_mod_by \t\t= clean_input($_SESSION['userid']);\r\n\t\t$cat_meta_title \t\t\t= clean_input($_POST['cat_meta_title']);\r\n\t\t$cat_meta_keywords \t\t\t= clean_input($_POST['cat_meta_keywords']);\r\n\t\t$cat_meta_description \t\t= clean_input($_POST['cat_meta_description']);\r\n\t\t$insert_keywords\t \t\t= clean_input($_POST['insert_keywords']);\t\t\t\r\n\r\n\t\t$xyquery = \"UPDATE categories SET \";\r\n\t\t$xyquery .= \"cat_name = '$cat_name',\";\r\n\t\t$xyquery .= \"cat_desc_short = '$cat_desc_short'\";\r\n\t\t$xyquery .= \",cat_desc_long = '$cat_desc_long'\";\r\n\t\t$xyquery .= \",cat_parent_id = '$cat_parent_id'\";\r\n\t\t$xyquery .= \",cat_url = '$cat_url'\";\r\n\t\t$xyquery .= \",cat_mod = '$cat_mod'\";\r\n\t\t$xyquery .= \",cat_mod_by = '$cat_mod_by'\";\r\n\t\t$xyquery .= \",page_template = '$page_template'\";\r\n\t\t$xyquery .= \",cat_meta_title = '$cat_meta_title'\";\r\n\t\t$xyquery .= \",cat_meta_keywords = '$cat_meta_keywords'\";\r\n\t\t$xyquery .= \",cat_meta_description = '$cat_meta_description'\";\r\n\t\t$xyquery .= \",insert_keywords = '$insert_keywords'\";\t\t\t\t\r\n\t\t$xyquery .= \"WHERE cat_id = '$cat_id'\";\r\n\r\n\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\r\n\t\t//echo \"<center><h4>The category \".$cat_name.\" been edited!</h4></center>\";\r\n?>\r\n<script>\r\n$(document).ready(function() {\r\n\t$(\"<p>NOTICE:</p><p>The category <?= $cat_name;?> has been modified.</p>\").appendTo(\"#xyalert\");\r\n\t$(\"#xyalert\").fadeIn(200).delay(1500).fadeOut(200);\r\n});\r\n</script>\r\n<?\r\n\t\treturn $xyresult;\r\n\t}\r\n}", "public function modifyCategory(){\n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n\n\t\t$id = $_REQUEST['id'];\t\t\n\t\t$name = $_REQUEST['name'];\n\t $remark = $_REQUEST['remark'];\n $father = $_REQUEST['father'];\n\t\t$form = M('categoryinfo');\n \t//$key = 2;\n \t$condition['id'] = $id;\n \t$data = $form->where($condition)->find();\n \t//var_dump($data); \n $data['id'] = $id;\n \t$data['name'] = $name;\n\t\t$data['remark'] = $remark;\n $data['father'] = $father;\n \t//echo $data;\n\t\t$result = $form->save($data);\n\t\t$this->redirect('/index.php/Admin/dish');\n\t\t\t\t\t\t//\telse {$this->error('修改失败');}\n\t\t}", "public function update(Request $request ,Category $update){\n $update -> category_name_en = $request -> blog_category_name_en;\n $update -> category_name_lng = $request -> blog_category_name_lng;\n $update -> category_name_en_slug = strtolower(str_replace(' ' , '-' , $request -> blog_category_name_en));\n $update -> category_name_lng_slug = str_replace(' ' , '-' , $request -> blog_category_name_lng);\n $update -> update();\n return true;\n }", "public function editCategory($editCategory) {\n if (isset($editCategory)) {\n\n $data = array(\n 'name' => $editCategory['name'],\n 'support_emails' => $editCategory['support_emails'],\n 'quantity_enabled' => $editCategory['quantity_enabled']\n );\n \n if (isset($editCategory['supplier_user'])) {\n $data['supplier_user'] = $editCategory['supplier_user'];\n }\n \n if (isset($editCategory['custom_fields'])) {\n $data['custom_fields'] = $editCategory['custom_fields'];\n } else {\n $data['custom_fields'] = NULL;\n }\n $this->db->where('id', $editCategory['category_id']);\n $this->db->update('categories', $data);\n return TRUE;\n } else {\n return False;\n }\n }", "public function category_update(){ \n\n\n if (!has_role($this->session->userdata('user_id'), 'CATEGORY_UPDATE')) {\n redirect(base_url('page_not_found'));\n }\n\n $data['parent'] = $this->input->post('parent');\n $data['last_modified'] = date(\"Y-m-d H:i:s\");\n $data['name'] = $this->input->post('name');\n \n if(!$this->category_model->is_parent_category($data['parent'])){\n\n $this->session->set_flashdata('category_save_failed', \"Failed to update sub category!!\");\n }else{\n\n \n $category_id = $this->input->post('cat_id');\n\n\n\n\n if($this->category_model->update_category($category_id, $data)){\n\n $this->logger\n ->user($this->session->userdata('user_id')) //Set UserID, who created this Action\n ->user_details($this->user_model->getUserInfoByIpAddress())\n ->type('category_update') //Entry type like, Post, Page, Entry\n ->id($category_id) //Entry ID\n ->token('UPDATE') //Token identify Action\n ->comment($this->session->userdata('name'). ' update a category.')\n ->log(); //Add Database Entry\n\n $this->session->set_flashdata('category_save_success', \"Category information Updated Successfully!!\");\n } else {\n $this->session->set_flashdata('category_save_failed', \"Category update fialied!!\");\n }\n }\n redirect(base_url('categories'));\n }", "public function edit_category() {\n $data['pageName'] = $this->pageName . ' : Edit Category';\n $get = $this->uri->uri_to_assoc();\n \n //If no id found\n if(!isset($get['id'])){\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">No content found</span>');\n redirect('admin/static_pages/home', \"location\");\n exit();\n }\n \n $category_id = $get['id'];\n $where_clause = array('category_id' => $category_id);\n $categoryRS = $this->User_model->get_category($where_clause);\n\n\n if (!$categoryRS) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Content not available. Please try again later.</span>');\n redirect('admin/category/home', \"location\");\n exit();\n }\n \n $category = $categoryRS[0];\n $data['category'] = $category;\n \n //After posting save data\n if(isset($_POST['category_id']) && !empty($_POST['category_id'])) {\n \n $pst_category_id = addslashes($_POST['category_id']);\n $isCategoryAdded = $this->User_model->update_category($pst_category_id);\n \n if(!$isCategoryAdded) {\n $this->session->set_flashdata('info_message', '<span class=\"error-alert\">Unable to update the record</span>');\n }\n else{\n $this->session->set_flashdata('info_message', 'Record updated successfull!');\n redirect('admin/category/home', \"location\");\n }\n }\n $this->load->view('admin/category/edit_view', $data); \n }", "public function update_category(){\n $query = \"UPDATE {$this->table} SET cat_title = :cat_title WHERE {$this->table}.cat_id = :cat_id\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_title',$this->cat_title);\n $stmt->bindParam(':cat_id',$this->cat_id);\n $stmt->execute();\n return $stmt;\n }", "function saveCat()\n {\n //update stuff\n }", "public function categories_update($param = null)\r\n {\r\n if (isset($_POST[\"cat_id\"]) && !empty($_POST[\"cat_id\"])) {\r\n $action = $_POST[\"cat_id\"];\r\n $newValue = $_POST[\"cat_descr\"];\r\n $update = Category::find($action)->update(['cat_descr' => $newValue]);\r\n echo $update;\r\n\r\n } else {\r\n echo json_encode([\"error\" => \"ERROR\"]);\r\n }\r\n }", "public function update()\n\t{\n\t\t$input = \\Input::all();\n\n\t\t$category = Category::findOrFail($input.id);\n\n\t\tif($category){\n\t\t\t$category->name = $input.name;\n\t\t\t$result = $category->save();\n\t\t}\n\n\t\tif($result){\n\t\t\treturn \"true\";\n\t\t}\n\t\treturn \"false\";\n\t}", "function category_edit($id)\n\t{\n\t\tglobal $db;\n\t\t$ccnoprice = $_POST['ccnoprice'];\n\t\t$sSQL = \"UPDATE \".PREFIX.\"categories SET ccnoprice='\".$ccnoprice.\"', ccTemplate='\".mysql_real_escape_string($_POST['ccTemplate']).\"' WHERE id=\".$id;\n\t\t$db->query($sSQL);\n\t}", "public function edit_category($category) {\n $this->category();\n $categories_sql_string = \"SELECT * FROM category WHERE id = \" . $category . \" limit 1\";\n $connection = new Database(\"sbrettsc_db\");\n $menu_array = $connection->get_array_from_query($categories_sql_string);\n $data = array(\"menu_array\" => array_shift($menu_array));\n\n $this->loadView(\"editors/category_editor\", $data);\n }", "function editChoiceCategory($data,$id){\n\t\t$this->db->where('choice_category_id',$id);\n\t\t$query = $this->db->update(\"tbl_choice_category\",$data);\n\t\treturn $this->db->affected_rows();\n\t}", "function fm_update_category($name, $catid = NULL, $groupid = 0) {\r\n\tglobal $USER;\r\n\t\r\n\tif ($catid != NULL) {\r\n\t\t$update->id = $catid;\r\n\t\t$update->name = $name;\r\n\t\t$update->timemodified = time();\r\n\t\tif (!update_record('fmanager_categories', $update)) {\r\n\t\t\terror(get_string(\"errnoupdate\",'block_file_manager'));\r\n\t\t}\r\n\t} else {\r\n\t\t$new->name = $name;\r\n\t\tif ($groupid == 0){\r\n\t\t\t$new->owner = $USER->id;\r\n\t\t\t$new->ownertype = OWNERISUSER;\r\n\t\t} else {\r\n\t\t\t$new->owner = $groupid;\r\n\t\t\t$new->ownertype = OWNERISGROUP;\r\n\t\t}\r\n\t\t$new->timemodified = time();\r\n\t\tif (!insert_record('fmanager_categories', $new)) {\r\n\t\t\terror(get_string(\"errnoinsert\",'block_file_manager'));\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "public function updateForm()\n{\n\n $listeCatgories = $this->model->getCategories();\n $new = $this->model->getNew();\n $this->view->updateForm($new,$listeCatgories);\n}", "public function update(Tax $category): void\n {\n }", "function update_category_detail($siteData,$category_id)\n\t{\n\t\t$this->db->where('id', $category_id);\n\t\t$this->db->update('category', $siteData); \n\t\t\n\t}", "public function updated(Category $category)\n {\n //\n }", "public function update(){\n $service_category = new OsServiceCategoryModel($this->params['service_category']['id']);\n $service_category->set_data($this->params['service_category']);\n if($service_category->save()){\n $response_html = __('Service Category Updated. ID: ', 'latepoint') . $service_category->id;\n $status = LATEPOINT_STATUS_SUCCESS;\n }else{\n $response_html = $service_category->get_error_messages();\n $status = LATEPOINT_STATUS_ERROR;\n }\n if($this->get_return_format() == 'json'){\n $this->send_json(array('status' => $status, 'message' => $response_html));\n }\n }", "public function update()\n {\n $model = $this->model()::findOrFail(request('_id'));\n $data = array_merge(request()->all(), ['slug' => request('name')]);\n $category = $model->update($data);\n return redirect()->route('admin.'.$this->table().'.index');\n }", "function edit_category($tbl_name){\n\t\t//print_r($_POST); die;\n\t\tunset($_POST['submitLog']);\n\t\t$this->db->where('id', $_POST['id']);\n\t\tunset($_POST['id']);\n\t\t$this->db->update($tbl_name,$_POST);\n\t\t// print_r($this->db->last_query());\n\t // die();\n\t}", "function editCategory($category, $id) {\n $data = [\n 'name' => $_POST['name'],\n 'description' => $_POST['description']\n ];\n\n $stmt = $category->update($id, $data);\n header('location: confirm.php?action=Category&type=update&query='.$stmt);\n}", "public function updateCategory(){\n\t\t \n\t\t$file_id = $this->category_model->updateCategory($_POST['id'],$_POST['name']);\n\t\t echo $file_id;\n\t\t\t\t\n }", "function update_utility_bill_category($utility_bill_category_id = '')\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['timestamp']\t\t\t\t=\ttime();\n\t\t$data['updated_by']\t\t\t\t=\t$this->session->userdata('user_id');\n\n\t\t$this->db->where('utility_bill_category_id', $utility_bill_category_id);\n\t\t$this->db->update('utility_bill_category', $data);\n\n\t\t$this->session->set_flashdata('success', 'Utility bill category has been updated successfully.');\n\n\t\tredirect(base_url() . 'utility_bill_categories', 'refresh');\n\t}", "public function edit(Category $category) {\n //not implemented\n }", "public function update_category(Request $request){\n $data = array();\n $category_id=$request->category_id;\n $data['category_name']=$request->category_name;\n $data['category_description']=$request->category_description;\n\n//$data['publication_status']=$request->publication_status;\n DB::table('tbl_category')\n ->where('category_id',$category_id)\n ->update($data);\n\n Session::put('message','Category update Successfully!!');\n return Redirect::to('/edit-category/'.$category_id);\n }", "function update_category_detail($siteData, $category_id) {\n $this->db->where('id', $category_id);\n $this->db->update('category', $siteData);\n }", "function editMainCategory()\n\t{ \n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql='select * from products_table where product_id='.$id;\n\t\t\t\n\t\t\t$obj=new Bin_Query();\n\t\t\t\n\t\t\t$obj->executeQuery($sql);\n\t\t\t\n\t\t\t$sqlid=\"SELECT category_id,category_parent_id FROM category_table where category_id in(select category_id from products_table where category_id='\".$obj->records[0]['category_id'].\"')\";\n\t\t\t\n\t\t\t$query=new Bin_Query();\n\t\t\t\n\t\t\t$query->executeQuery($sqlid);\n\t\t\t\n\t\t\t$sql1 = \"SELECT category_id,category_name FROM category_table where category_parent_id=0\";\n\t\t\n\t\t\t$query1 = new Bin_Query();\n\t\t\n\t\t\t$query1->executeQuery($sql1);\n\t\t\n\n\t\t\treturn Display_DManageProducts::displayCategory($query1->records,$query->records[0]['category_id']);\n\t\t\t\n\t\t// \t\t\treturn $category;\n\t }\n\t}", "public function update($id)\n\t{\n\t\t$description = Input::get('description');\n\t\t$acronym = substr($description,0,1);\n\t\t$category = Category::find($id);\n\t\t$category->description = $description; \n\t\t$category->acronym = $acronym; \n\t\t$category->save(); \n\t\treturn Response::json($category);\n/*\t\treturn Response::json(array('success'=>\"La categoria fue actualizada exitosamente\"));*/\n\t}", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function edit(Category $category)\n {\n //\n }", "public function update(CategoryEditRequest $request, Categ $categ)\n {\n //dd($categ);\n //dd($request);\n\n if($request->isMethod('post')){\n $categ->fill($request->all());\n $isOk=$categ->save();\n //$isOk=false;\n if($isOk){\n return redirect()->route('adminCateg')->with('success','запись обновлена');}\n else{\n return redirect()->route('adminCateg')->with('error','запись не обновлена');}\n }\n return view('news.admin.categ.update', ['categ'=>$categ]);\n }", "public function update(Request $request, Category $category)\n {\n $category->exp_group_name = $request->exp_group_name;\n $category->exp_group_desc = $request->exp_group_desc;\n\n if ( $request->exp_group_status == '1' or $request->exp_group_status == '0')\n {\n \n $category->exp_group_status = $request->exp_group_status;\n }\n\n\n \n\n\n\n \n $category->save();\n return redirect()->route('admin.categories.index');\n }", "public function actionUpdate($id)\n { $this->layout='inner';\n $model = $this->findModel($id);\n $vendor = ArrayHelper::map(User::find()->where(['usertype'=>'Vendor'])->all(), 'id', 'username');\n $cat_list = ArrayHelper::map(ProductCategory::find()->where(['parent_id'=>'0'])->all(), 'id', 'cat_name');\n $cat= ProductCat::find()->Where(['product_id'=>$id])->one();\n $query=$this->fetchChildCategories($cat['category_id']);\n $str=rtrim($this->sam, \"|\");\n $str_data=explode(\"|\",$str);\n if($str_data>0){ \n // $str_data[]=$cat['category_id'];\n } \n // print_r($str_data); die;\n if ($model->load(Yii::$app->request->post())) {\n //$last_cat=end($_POST['Product']['category_id']); \n if($model->save()){\n //$sql=\"update product_cat set category_id = '\".$last_cat .\"' WHERE product_id='\".$model->id.\"'\";\n //Yii::$app->db->createCommand($sql)->execute();\n /*$product_cat= new ProductCat();\n $product_cat->product_id=$model->id;\n $product_cat->category_id=$last_cat;\n $product_cat->save();*/\n //Yii::$app->getSession()->setFlash('success','successful updated');\n return $this->redirect(['add-search-terms','id'=>$id]);\n }\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'cat'=>$str_data,\n 'vendor'=>$vendor,\n 'cat_list'=>$cat_list,\n\n ]);\n }\n }", "public function update()\n {\n $category = CategoryService::load(\\Request::input('id'))->update(\\Request::all());\n \\Msg::success($category->name . ' has been <strong>updated</strong>');\n return redir('account/categories');\n }", "public function editPost()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"edit_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryName = $this->input->post(\"name\");\n\n $categoryModel = new CategoriesModel();\n\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n if ($categoryModel->editCategory($categoryName, $categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category edited successfully!\",\"success\");\n } else {\n $this->view->redirect(\"/categories/manage\",\"You did not change anything ?\");\n }\n\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update(Request $request, Category $category)\n {\n //\n }", "public function update_category() {\n $category_id = $_GET['category_id'];\n $data['category_branch_location'] = $this->get_branch_location();\n $data['update_category'] = $this->Category_crud->get_category_by_id($category_id);\n $this->load->view('restaurant/category/update_category', $data);\n\n\n if (isset($_POST['save_update_category'])) {\n $imagename = $_FILES['category_image_upload']['name'];\n if (!empty($imagename)) {\n\n $config['upload_path'] = \"assets/lib/images/category/\";\n $config['allowed_types'] = 'gif|jpg|png|jpeg';\n\n $this->load->library('upload', $config);\n $this->upload->initialize($config);\n\n if (!$this->upload->do_upload('category_image_upload')) {\n $error = array('error' => $this->upload->display_errors());\n } else {\n $success = array('image_metadata' => $this->upload->data());\n }\n\n $update_category = array(\n 'ar_name' => $_POST['category_ar_name'],\n 'en_name' => $_POST['category_en_name'],\n 'discount' => $_POST['category_discount'],\n 'image' => $imagename\n );\n $this->Category_crud->update_category_information($category_id, $update_category);\n redirect(rest_path('Category'));\n } else {\n $update_category = array(\n 'ar_name' => $_POST['category_ar_name'],\n 'en_name' => $_POST['category_en_name'],\n 'discount' => $_POST['category_discount'],\n 'image' => $_POST['category_image']\n );\n $this->Category_crud->update_category_information($category_id, $update_category);\n redirect(rest_path('Category'));\n }\n }\n }", "public function update($product_category_id)\n\t{\n\t\t$master['status'] = True;\n $data = array();\n $master = array();\n $original_category_name=$this->db->from('tbl_product_category')->where('category_id',$product_category_id)->get()->result();\n $is_unique='';\n if($this->input->post('category')!=$original_category_name[0]->category)\n {\n \t$is_unique = '|is_unique[tbl_product_category.category]';\n }\n\n $this->form_validation->set_rules('category', 'Category', 'trim|required|max_length[64]'.$is_unique);\n $this->form_validation->set_rules('remarks', 'Remarks', 'trim|max_length[254]');\n $this->form_validation->set_error_delimiters('<p class=\"text-danger\">', '</p>');\n\t\tif ($this->form_validation->run() == True) \n\t\t{\n\t\t\t$this->product_category->update($product_category_id);\n\t\t\t$master['status'] = True;\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$master['status'] = false;\n foreach ($_POST as $key => $value) \n {\n if (form_error($key) != '') \n {\n $data['error_string'] = $key;\n $data['input_error'] = form_error($key);\n array_push($master, $data);\n }\n }\n\t\t}\n\t\techo(json_encode($master));\n\t}", "function update_categoria($idcategoria,$params)\n {\n $this->db->where('idcategoria',$idcategoria);\n return $this->db->update('categoria',$params);\n }", "public function edit(Category $Category)\n {\n //\n }", "function pnAddressBook_admin_updatecategories() {\r\n\r\n\t$output = new pnHTML();\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\tlist($id,$del,$name,$newname) = pnVarCleanFromInput('id','del','name','newname');\r\n\tif(is_array($del)) {\r\n $dels = implode(',',$del);\r\n }\r\n\r\n\t$modID = $modName = array();\r\n\r\n\tif(isset($id)) {\r\n\t\tforeach($id as $k=>$i) {\r\n \t$found = false;\r\n \tif(count($del)) {\r\n \tforeach($del as $d) {\r\n \tif($i == $d) {\r\n \t$found = true;\r\n \tbreak;\r\n \t}\r\n \t}\r\n \t}\r\n \tif(!$found) {\r\n \tarray_push($modID,$i);\r\n \tarray_push($modName,$name[$k]);\r\n }\r\n \t}\r\n\t}\r\n\r\n\t$pntable = pnDBGetTables();\r\n\t$cat_table = $pntable[pnaddressbook_categories];\r\n\t$cat_column = $pntable['pnaddressbook_categories_column'];\r\n\r\n\t$updates = array();\r\n foreach($modID as $k=>$id) {\r\n array_push($updates,\"UPDATE $cat_table\r\n SET $cat_column[name]='\".pnVarPrepForStore($modName[$k]).\"'\r\n WHERE $cat_column[nr]=$id\");\r\n\t}\r\n\r\n\t$error = '';\r\n\r\n\tif(pnModAPIFunc(__PNADDRESSBOOK__,'admin','updateCategories',array('updates'=>$updates))) {\r\n \tif (empty($error)) { $error .= 'UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\telse { $error .= ' - UPDATE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t}\r\n\r\n\t$delete = \"DELETE FROM $cat_table WHERE $cat_column[nr] IN ($dels)\";\r\n\tif(isset($dels)) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','deleteCategories',array('delete'=>$delete))) {\r\n if (empty($error)) { $error .= 'DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - DELETE '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n }\r\n }\r\n\r\n\tif( (isset($newname)) && ($newname != '') ) {\r\n if(pnModAPIFunc(__PNADDRESSBOOK__,'admin','addCategories',array('name'=>$newname))) {\r\n if (empty($error)) { $error .= 'INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t\telse { $error .= ' - INSERT '.pnVarPrepHTMLDisplay(_pnAB_SUCCESS); }\r\n\t\t}\r\n }\r\n\r\n\t$args=array('msg'=>$error);\r\n\r\n\tpnRedirect(pnModURL(__PNADDRESSBOOK__, 'admin', 'categories',$args));\r\n\treturn true;\r\n}", "public function editNutrationCategory($id)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n $workout = NutrationCategory::find($id);\n return view('admin.editnutrationcategory')->with('workout',$workout);\n }\n\n else{\n Session::flash('danger','You are not authorize to view this page');\n return redirect()->back();\n }\n }", "function classiera_update_my_category_fields($term_id) {\r\n\tif(isset($_POST['taxonomy'])){\t\r\n\t if($_POST['taxonomy'] == 'category'):\r\n\t\t$tag_extra_fields = get_option(MY_CATEGORY_FIELDS);\r\n\t\t$tag_extra_fields[$term_id]['your_image_url'] = strip_tags($_POST['your_image_url']);\r\n\t\t$tag_extra_fields[$term_id]['category_image'] = $_POST['category_image'];\r\n\t\t$tag_extra_fields[$term_id]['category_icon_code'] = $_POST['category_icon_code'];\r\n\t\t$tag_extra_fields[$term_id]['category_icon_color'] = $_POST['category_icon_color'];\r\n\t\tupdate_option(MY_CATEGORY_FIELDS, $tag_extra_fields);\r\n\t endif;\r\n\t}\r\n}", "public function updateCategory(Request $request,$cat_id)\n {\n // validate input of category name..\n $request->validate([\n 'category_name' => 'required|max:255'\n ]);\n // update category by cat_id..\n $data = array();\n $data['category_name'] = $request->category_name;\n //$data['updated_at'] = Carbon::now();\n $update_category = DB::table('categories')->where('id',$cat_id)->update($data);\n if ($update_category)\n {\n // Display a toaster Updated message..\n $notification = array(\n 'message' => 'Category Updated successfully.',\n 'alert-type' => 'success'\n );\n return Redirect()->route('categories')->with($notification);\n }else {\n // Display a toaster No Updated message..\n $notification = array(\n 'message' => 'Nothing Data To Update.',\n 'alert-type' => 'warning'\n );\n return Redirect()->route('categories')->with($notification);\n }\n }", "public function update(Request $request, Category $Category)\n {\n //\n }", "function shophead_edit($category_id = \"\")\n {\n $this->layout = 'admin_layout';\n $id = base64_decode($category_id);\n // pr($id);\n $this->loadModel('ProductCategory');\n $data = $this->ProductCategory->find('first', array('conditions' => array('ProductCategory.id' => $id)));\n if (!empty($data)) {\n if (!empty($this->request->data)) {\n $this->request->data = Sanitize::clean($this->request->data, array('encode' => false));\n $this->ProductCategory->set($this->request->data);\n if ($this->request->data['ProductCategory']['name'] == $data['ProductCategory']['name']) {\n unset($this->request->data['ProductCategory']['name']);\n }\n if ($this->ProductCategory->validates()) {\n if ($this->ProductCategory->save($this->request->data)) {\n $this->Session->write('flash', array(EDIT_RECORD, 'success'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n } else {\n $this->Session->write('flash', array(FAILURE_MSG, 'failure'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }\n }\n $this->request->data = $data;\n } else {\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }", "public function update_category($id)\n\t{\n\t\t$config = array(\n 'upload_path' => \"uploads/category/\",\n 'upload_url' => base_url() . \"uploads/category/\",\n 'allowed_types' => \"gif|jpg|png|jpeg\"\n );\n\n $this->load->library('upload', $config);\n $category_name=ucwords(strtolower($this->input->post('category_name')));\n if($this->upload->do_upload('userfile')) {\n\n $data['userfile'] = $this->upload->data();\n $filename = $data['userfile']['file_name'];\n\t\t \n $datalist = array( \n 'category_img' => base_url().'uploads/category/'.$filename, \n 'meta_keyword' => $this->input->post('meta_keyword'),\n 'meta_description' => $this->input->post('meta_description'),\n 'category_name'=> $this->input->post('category_name'),\n\t\t\t\t'category_description'=> $this->input->post('category_description'), \n 'category_slug' => $this->input->post('category_slug'),\n 'status'=>$this->input->post('status'), \n );\n }else{\n $datalist = array( \n 'meta_keyword' => $this->input->post('meta_keyword'),\n 'meta_description' => $this->input->post('meta_description'),\n 'category_name'=> $this->input->post('category_name'),\n\t\t\t\t'category_description'=> $this->input->post('category_description'), \n 'category_slug' => $this->input->post('category_slug'),\n 'status'=>$this->input->post('status'),\n );\n } \n\n $query= $this->General_model->show_data_id('categories',$id,'category_Id','update',$datalist);\n $this->session->set_flashdata('success', 'Product category Updated successfully.');\n redirect('superpanel/categorie');\n\t}", "function get_category_to_edit($id)\n {\n }", "public function edit(Category $Category)\n {\n echo \"i am in edit\";exit();\n //\n }", "function editAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\t\n\t\t$redirectUrl = $this->getRedirectUrl();\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t$error \t\t= array();\n\t\t\t$success \t= array();\n\t\t\t$contents \t= '';\n\t\t\t$formData \t= array();\n\t\t\t //Truyen du lieu hien co vao form\n\t\t\t$formData['fbulkid'] = array();\n\t\t\t$formData['fid'] = $myProductCat->id;\n\t\t\t$formData['fname'] = $myProductCat->name;\n\t\t\t$formData['forder'] = $myProductCat->order;\n\t\t\t$formData['fparentid'] = $myProductCat->parentid;\n\t\t\t$formData['fenable'] = $myProductCat->enable;\n\t\t\t$formData['fseourl'] = $myProductCat->seoUrl;\n\t\t\t$formData['fseotitle'] = $myProductCat->seoTitle;\n\t\t\t$formData['fseokeyword'] = $myProductCat->seoKeyword;\n\t\t\t$formData['fseodescription'] = $myProductCat->seoDescription;\n\t\t\t\n\t\t\tif(!empty($_POST['fsubmit']))//truong hop da nhan nut submit\n\t\t\t{\n if($_SESSION['productcategoryEditToken']==$_POST['ftoken'])//kiem tra token\n {\n $formData = array_merge($formData, $_POST);\n \n if($this->editActionValidator($formData, $error))//kiem tra du lieu co hop le hay khong\n {\n //Cac thong tin khong ngon ngu:\n $myProductCat->order = (int)$formData['forder'];\n $myProductCat->parentid = (int)$formData['fparentid'];\n $myProductCat->enable = (int)$formData['fenable']==1?1:0;\n if(strlen($formData['fseourl']) > 0)\n $myProductCat->seoUrl = Helper::codau2khongdau($formData['fseourl'], true);\n else\n $myProductCat->seoUrl = Helper::codau2khongdau(strip_tags($formData['fname']), true);\n //Cac thong tin lien quan ngon ngu: \n $myProductCat->name = $formData['fname']; \n $myProductCat->seoTitle = $formData['fseotitle'];\n $myProductCat->seoKeyword = $formData['fseokeyword'];\n $myProductCat->seoDescription = $formData['fseodescription'];\n \n if($myProductCat->updateData())//cap nhat database\n {\n $success[] = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succUpdate']);\n $this->registry->me->writelog('ProductCategoryedit', $myProductCat->id, array('name' => $myProductCat->name[$langCode], 'order' => $myProductCat->order));\n }\n else\n {\n $error[] = $this->registry->lang['controller']['errUpdate']; \n }\n }\n }\n $_SESSION['productcategoryEditToken'] = Helper::getSecurityToken();//Tao token moi\n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t\t\t$this->registry->smarty->assign(array(\t'formData' \t=> $formData,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'subcategories' => $myProductCat->getSub(true),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'parentCategories' => Core_ProductCategory::getFullCategories(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectUrl'=> $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'error'\t\t=> $error,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'success'\t=> $success,\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\t));\n\t\t\t$contents .= $this->registry->smarty->fetch($this->registry->smartyControllerContainer.'edit.tpl');\n\t\t\t$this->registry->smarty->assign(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'menu'\t\t=> 'productcategorylist',\n\t\t\t\t\t\t\t\t\t\t\t\t\t'pageTitle'\t=> $this->registry->lang['controller']['pageTitle_edit'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t'contents' \t\t\t=> $contents));\n\t\t\t$this->registry->smarty->display($this->registry->smartyControllerGroupContainer . 'index.tpl');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t\t$this->registry->smarty->assign(array('redirect' => $redirectUrl,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'redirectMsg' => $redirectMsg,\n\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t}\n\t}", "public function update(CategoryRequest $request, $id)\n {\n $cate = Category::find($id);\n $cate->name = $request->txtCateName;\n $cate->alias = changeTitle($request->txtCateName);\n $cate->order = $request->txtOrder;\n $cate->parent_id = $request->sltParent;\n $cate->keywords = $request->txtKeywords;\n $cate->description = $request->txtDesc;\n $cate ->save();\n return redirect()->back()->with('edit','Chỉnh sửa sản phẩm thành công');\n }", "public function update(Request $request, Category $category)\n {\n $request->validate([\n 'name' => 'required | string | unique:categories,id',\n 'role' => 'required'\n ]);\n $input = $request->only(['name', 'role', 'mainid', 'subid', 'status', 'featured']);\n $category->update($input); \n\n Toastr::success('Category updated successfully :)','Success');\n return redirect()->route($this->route.'index');\n }", "public function UpdateFood($sku, $foodDesc, $category, $price){\r\n $conn = new ConnectionManager();\r\n $pdo = $conn->getConnection();\r\n \r\n \r\n // YOUR CODE GOES HERE\r\n\r\n\r\n\r\n return $isOk;\r\n }", "function setCategory($id, $category){\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//category value of a question in the database\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Accepts 2 parameters, the question ID value, and the new value (int)\r\n\t\t$query= \"UPDATE `tbl_question` SET `category` = '$category' WHERE `tbl_question`.`question_id` =$id LIMIT 1 ;\";\r\n\t\t$result = $this->mdb2->query($query) or die('An unknown error occurred while updating the data');\r\n\t\tif(MDB2::isError($result)){\r\n\t\t\treturn false;\r\n\t\t}else{\r\n\t\t\treturn true;\r\n\t\t}\t\r\n\t}", "public function updated(Category $category)\n {\n //\n }", "public function edit_category($id)\n\t{\n\t\t$query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n $data['category']=$query; \n\t\t$data['title']=\"Dahboard || Great Wine Global\";\n $this->load->view('superpanel/header',$data);\n $this->load->view('superpanel/edit_categorie');\n $this->load->view('superpanel/footer');\n\t}", "public function update_category ($data) {\n\t\t$slug = \\Illuminate\\Support\\Str::slug($data->category, '-');\n\t\t$category = Category::find($data->category_id);\n\t\t$category->category = $data->category;\n\t\t$category->slug = $slug;\n\t\t$category->description = $data->description;\n\n\t\t$category->save();\n\t\treturn true;\n\t}" ]
[ "0.71557504", "0.71024853", "0.70967233", "0.6873377", "0.6844343", "0.68225706", "0.6781376", "0.67681557", "0.6741728", "0.66843164", "0.66287494", "0.6611749", "0.6610787", "0.65974736", "0.65905493", "0.6587013", "0.65291274", "0.6514518", "0.6501304", "0.6478147", "0.64662594", "0.6392799", "0.63845795", "0.6375152", "0.6367889", "0.63598716", "0.63504887", "0.6346485", "0.63436383", "0.6340993", "0.6334696", "0.6320037", "0.6311734", "0.6302258", "0.6298048", "0.62872916", "0.628145", "0.62791324", "0.62780344", "0.62569255", "0.62539685", "0.62536025", "0.62524337", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6251341", "0.6224295", "0.62238127", "0.6218534", "0.6216396", "0.62132716", "0.6210872", "0.6210872", "0.6210872", "0.6210872", "0.6210872", "0.6210872", "0.6210872", "0.6210872", "0.6210872", "0.6210872", "0.61915725", "0.6186637", "0.6186032", "0.61734736", "0.61688566", "0.61660856", "0.6165533", "0.61634415", "0.6149121", "0.6136466", "0.61358804", "0.61315626", "0.6129491", "0.612391", "0.61191964", "0.6114427", "0.61067104", "0.6094284", "0.60938585", "0.6090113", "0.6083536" ]
0.7165534
0
/Delete Nutrition Category Function
public function deleteNutrationCategory(Request $request) { $id = $request->workoutid; $getWorkout = NutrationCategory::find($id); if($getWorkout->delete()){ return redirect()->back()->with('danger','Nutration Category Deleted successfully'); } else{ return redirect()->back()->with('danger','Sorry! Nutration Category is not deleted'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete_category() {\n $category_id = $_GET['category_id'];\n\n $data['delete_category'] = $this->Category_crud->get_category_by_id($category_id);\n $this->load->view('restaurant/category/delete_category_model', $data);\n\n if (isset($_POST['delete_category_yes'])) {\n $this->Category_crud->delete_category_sub_category_item($category_id);\n redirect(rest_path('Category'));\n }\n\n if (isset($_POST['delete_category_no'])) {\n $this->Category_crud->delete_category($category_id);\n redirect(rest_path('Category'));\n }\n }", "function product_category_delete(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u;\n\t\t\n\t\tmysql_q(\"DELETE FROM product_category WHERE id='\".add_slash($_r['id']).\"'\");\n\n\t\tredirect(\"product_category.htm\", \"\");\n\t}", "function ciniki_foodmarket_categoryDelete(&$ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'category_id'=>array('required'=>'yes', 'blank'=>'yes', 'name'=>'Category'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'foodmarket', 'private', 'checkAccess');\n $rc = ciniki_foodmarket_checkAccess($ciniki, $args['tnid'], 'ciniki.foodmarket.categoryDelete');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Get the current settings for the category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_foodmarket_categories \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.foodmarket', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['category']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.5', 'msg'=>'Category does not exist.'));\n }\n $category = $rc['category'];\n\n // \n // Check for any child categories\n //\n $strsql = \"SELECT COUNT(id) AS children \"\n . \"FROM ciniki_foodmarket_categories \"\n . \"WHERE ciniki_foodmarket_categories.parent_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbSingleCount');\n $rc = ciniki_core_dbSingleCount($ciniki, $strsql, 'ciniki.foodmarket', 'num');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( $rc['num'] > 0 ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.6', 'msg'=>'You still have ' . $rc['num'] . ' child categor' . ($rc['num']>1?'ies':'y') . '.'));\n }\n\n //\n // Check for items already in the category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_foodmarket_category_items \"\n . \"WHERE category_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.foodmarket', 'item');\n if( $rc['stat'] != 'ok' ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.foodmarket.149', 'msg'=>'Unable to load item', 'err'=>$rc['err']));\n }\n $items = isset($rc['rows']) ? $rc['rows'] : array();\n \n //\n // Start transaction\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDelete');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.foodmarket');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Remove any items from the category first\n //\n foreach($items as $item) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.foodmarket.categoryitem', $item['id'], $item['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.foodmarket');\n return $rc;\n }\n }\n\n //\n // Remove the category\n //\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.foodmarket.category', $args['category_id'], $category['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.foodmarket');\n return $rc;\n }\n\n //\n // Commit the transaction\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.foodmarket');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'foodmarket');\n\n return array('stat'=>'ok');\n}", "public function deleteCategory(){ \n $cookies = new CookieModel();\n $cookie_id = $cookies -> read();\n if (! $cookie_id) $this->redirect('/');\n /*删除分类下的子分类*/\n $key = $_REQUEST['id'];\n $condition['id'] = $key;\n $form = M(\"categoryinfo\");\n $data = $form->where($condition)->delete(); \n $data_all = $form->select();\n for ($i = 0;$i< count($data_all);$i++)\n {\n if ($data_all[$i]['father'] == $key) \n {\n $condition['id'] = $data_all[$i]['id'];\n $form->where($condition)->delete();\n }\n } \n /*删除分类下的菜品*/\n $food = M('foodinfo');\n $data_food = $food->select();\n for ($i = 0;$i< count($data_food);$i++)\n {\n if ($data_food[$i]['father'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n if ($data_food[$i]['category'] == $key) \n {\n $condition['id'] = $data_food[$i]['id'];\n $food->where($condition)->delete();\n }\n } \n\t\t$this->redirect('/index.php/Admin/dish');\n //$this->display();\n }", "function ciniki_directory_categoryDelete(&$ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'category_id'=>array('required'=>'yes', 'default'=>'', 'blank'=>'yes', 'name'=>'Category'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n //\n // Check access to tnid as owner\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'directory', 'private', 'checkAccess');\n $ac = ciniki_directory_checkAccess($ciniki, $args['tnid'], 'ciniki.directory.categoryDelete');\n if( $ac['stat'] != 'ok' ) {\n return $ac;\n }\n\n //\n // Get the category uuid\n //\n $strsql = \"SELECT uuid FROM ciniki_directory_categories \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \" \n . \"\";\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQuery');\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'category');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['category']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.directory.12', 'msg'=>'The category does not exist'));\n }\n $uuid = $rc['category']['uuid'];\n\n // \n // Turn off autocommit\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectDelete');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Get the list of entries to remove from this category\n //\n $strsql = \"SELECT id, uuid \"\n . \"FROM ciniki_directory_category_entries \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"AND category_id = '\" . ciniki_core_dbQuote($ciniki, $args['category_id']) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.directory', 'entry');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $entries = $rc['rows'];\n foreach($entries as $entry) {\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category_entry', \n $entry['id'], $entry['uuid'], 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n\n //\n // Delete the object\n //\n $rc = ciniki_core_objectDelete($ciniki, $args['tnid'], 'ciniki.directory.category', $args['category_id'], $uuid, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Commit the database changes\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.directory');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'directory');\n\n return array('stat'=>'ok');\n}", "public function delete_category()\r\n\t\t{\r\n\t\t\t$this->errno = DB_OK;\r\n\t\t\t\r\n\t\t\tif ( $this->cat_id == -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tSuch category hasn't been created\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"START TRANSACTION;\");\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tTransaction is needed despite the one query as delete is on cascade\r\n\t\t\t\r\n\t\t\tif ( ! ( $result = $this->con->query ( \"DELETE FROM category WHERE cat_id=$this->cat_id\" ) ) )\r\n\t\t\t{\t\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to connect\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( $this->con->affected_rows == 0 )\r\n\t\t\t{\t\t\r\n\t\t\t\t$this->con->query(\"ROLLBACK;\");\r\n\t\t\t\t$this->errno = CATEGORY_DONT_EXIST;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tthis query should affect 1 row\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t$this->con->query(\"COMMIT;\");\r\n\t\t\t\r\n\t\t}", "public function deleteAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Game_Service_Category::getCategory($id);\r\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\r\n\t\t$result = Game_Service_Category::deleteCategory($id);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "public function delete() {\n $sql = sprintf(\"DELETE FROM category WHERE id=%d\", $this->id);\n self::$connection->execute($sql);\n }", "public function deletecategory(){\n\t\n\t\t$id = $this->request->getParameter(\"actionid\");\n\t\t$modelCategory = new CaCategory();\n\t\t$modelCategory->delete($id);\n\t\n\t\t// generate view\n\t\t$this->redirect(\"catalogadmin/categories\");\n\t}", "function categoryRemove(){\n\tif(startSession() && isset($_SESSION['UserID']))\n\t{\n\t\t$CatID\t\t\t \t= strip_tags($_GET['id']);\t#int - primaryKey\n\n\t\t$db = pdo(); # pdo() creates and returns a PDO object\n\n\t\t$sql = \"DELETE FROM ma_Categories WHERE CatID = :CatID\";\n\n\t\t$stmt = $db->prepare($sql);\n\t\t//INTEGER EXAMPLE $stmt->bindValue(1, $id, PDO::PARAM_INT);\n\t\t$stmt->bindValue(':CatID', $CatID, PDO::PARAM_INT);\n\n\t\ttry {$stmt->execute();} catch(PDOException $ex) {trigger_error($ex->getMessage(), E_USER_ERROR);}\n\t\t#feedback success or failure of update\n\n\t\tif ($stmt->rowCount() > 0)\n\t\t{//success! provide feedback, chance to change another!\n\t\t\tfeedback(\"Category Removed Successfully\",\"success\");\n\t\t}else{//Problem! Provide feedback!\n\t\t\tfeedback(\"Category Not Trashed!\",\"warning\");\n\t\t}\n\t\tmyRedirect(THIS_PAGE);\n\t}\n\t#script for expanding textarea\n}", "public function delete_category($category_id){\n \n DB::table('tbl_category')\n ->where('category_id',$category_id)\n ->delete();\n return Redirect::to('/manage-category');\n }", "function delete_categoria($idcategoria)\n {\n return $this->db->delete('categoria',array('idcategoria'=>$idcategoria));\n }", "public function addNutrationCategory()\n {\n return view('admin.addnutratoncategory');\n }", "public function delete()\n {\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not logged in!\");\n }\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n\n try{\n $categoryName = $categoryModel->getCategoryNameById($categoryId);\n\n $this->view->render(\"admin/categories/delete\",[\n \"name\"=> $categoryName,\n \"id\"=> $categoryId\n ]\n );\n }catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n\n }", "public function delete($interview_category_id)\r\n {\r\n $this->checkIfDemo();\r\n $this->AdminInterviewCategoryModel->remove($interview_category_id);\r\n }", "public function EliminarCategorias()\n\t{\n\n\t\t$sql = \" select codcategoria from productos where codcategoria = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcategoria\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\n\t\t\t$sql = \" delete from categorias where codcategoria = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codcategoria);\n\t\t\t$codcategoria = base64_decode($_GET[\"codcategoria\"]);\n\t\t\t$stmt->execute();\n\n\t\t\theader(\"Location: categorias?mesage=1\");\n\t\t\texit;\n\n\t\t}else {\n\n\t\t\theader(\"Location: categorias?mesage=2\");\n\t\t\texit;\n\t\t}\n\n\t}", "public function remove_category() {\n\t\t$this->use_layout=false;\n\t\t$this->model = new $this->model_class(WaxUrl::get(\"id\"));\n\t\t$category = new CmsCategory(Request::get(\"cat\"));\n\t\t$this->model->categories->unlink($category);\n if(!$this->attached_categories = $this->model->categories) $this->attached_categories= array();\n\t\t$cat = new CmsCategory;\n\t\tif(!$this->all_categories = $cat->all() ) $this->all_categories=array();\t\t\n\t\t$this->cat_partial = $this->render_partial(\"list_categories\");\t\n\t}", "public function deletePost(){\n\n if (!$this->auth->isLogged()) {\n $this->view->redirect(\"/user/login\", \"You can not add new categories if you are not logged in!\");\n }\n\n if (!$this->auth->isInRole(\"admin\")) {\n $this->view->redirect(\"/user/login\", \"You can not manage categories if you are not Admin!\");\n }\n\n if ($this->input->post(\"delete_category\") === null){\n $this->view->redirect(\"/categories/manage\");\n }\n\n if (empty($this->input->get(0,\"int\"))){\n $this->view->redirect(\"/categories/manage\");\n }\n\n $categoryId = $this->input->get(0,\"int\");\n\n $categoryModel = new CategoriesModel();\n try{\n if (!$categoryModel->existCategoryId($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"This categories do not exist!\");\n }\n if ($categoryModel->deleteCategory($categoryId)){\n $this->view->redirect(\"/categories/manage\",\"Category deleted successfully!\",\"success\");\n }\n } catch (\\Exception $exception) {\n $this->view->redirect(\"/categories/manage\", $exception->getMessage());\n }\n }", "public function category_delete(Request $request)\n {\n $id = $request->id;\n\n $op = $request->op; // get operation number \n\n switch($op) {\n /** Event Categories */\n case 1:\n $model = new Category;\n $entity_id = 1;\n break;\n\n /** Sponsor Categories */\n case 2:\n $model = new SponsorCategory;\n $entity_id = 12;\n break;\n\n /** Offer Categories */\n case 3:\n $model = new OfferCategory;\n $entity_id = 7;\n break;\n\n /** Doctors Specialization Categories */\n case 4:\n $model = new DoctorsCategory;\n $entity_id = 11;\n break;\n\n default:\n return redirect()->back();\n break;\n }\n\n // delete from localization - Arabic version\n try {\n EntityLocalization::where('entity_id', $entity_id)->where('item_id', $id)->delete();\n } catch (\\Exception $ex) {\n return response()->json(['error', 'error deleting arabic']);\n }\n\n // delete from interests - English version\n try {\n $model::where('id', $id)->delete();\n } catch (\\Exception $ex) {\n return response()->json(['error', 'error deleting english']);\n }\n\n // return success response\n return response()->json(['success', 'success']);\n }", "function delete_category($cat_id)\n { \n $sql = \"DELETE FROM prod_categories WHERE `cat_id` = \\\"$cat_id\\\" LIMIT 1\";\n \n //echo $sql ;\n \n\t//submit query\n \n include 'connect.php';\n \n $result = mysqli_query($link, $sql); //returns object\n \n \n \n if (!$result) \n {\n\t\t\t\t\n $err = mysqli_error($link);\n //echo $err ;\n //echo 'error g et_user';\n\t\t\t\t\t\t\t\t\n }\n else\n { \n echo 'Kategoria u fshi nga sistemi!!!' ;\n }\n\n // close connection \n \n }", "public function delete(){\n\n\t\t$sql = new Sql();\n\n\t\t$sql->query(\"DELETE FROM tb_categories WHERE idcategory=:idcategory\",array(\n\t\t\t\":idcategory\"=>$this->getidcategory()\n\t\t));\n\n\t\tCategory::updateFile();\n\t}", "public static function deleteCategoryController(){\n\n\n \t \t if (isset($_POST[\"editCategoryId\"])) {\n\n\n \t \t \t\t\t// NOTA: Se pasa un valor entero como array ya que el modelo de productos recibe de varios métodos\n \t \t\t\t\t\t$dataController = array(\"idcategory\"=>$_POST[\"editCategoryId\"]);\n\n \t \t\t\t\t\t// Esta variable se envía al modelos para proceder a eliminar la categoria\n \t \t\t\t\t\t$dataIdCategoryController = $_POST[\"editCategoryId\"];\n\n \t \t\t\t\t\t// VER PRODUCTOS ASOCIADOS A LA CATEGORIA\n\t\t\t\t\t\t// $answerProducts = productsModel::ViewProductById($dataController, \"productos\");\n\n\t\t\t\t\t\t// foreach ($answerProducts as $row => $item) {\n\n\t\t\t\t\t\t// $dataProductController = array(\"id\"=>$item[\"id\"], \"idcategory\"=>0, \"enable\"=> 1);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// $answerDeleteProducts = productsModel::disableProductByIdCategory($dataProductController, \"productos\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$answerDeleteCategory = categorieModel::deleteCategoryModel($dataIdCategoryController, \"categorias\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t \t\tif ($answerDeleteCategory == 1) {\n\n\t \t\t\t\t\techo '<script >swal({\n\n\t\t\t\t\t\t\t\ttitle: \"¡OK!\",\n\t\t\t\t\t\t\t\ttext: \"¡Categoría eliminada correctamente!\",\n\t\t\t\t\t\t\t\ttype: \"success\",\n\t\t\t\t\t\t\t\tconfirmButtonText: \"Cerrar\",\n\t\t\t\t\t\t\t\tcloseOnConfirm: false\n\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\tfunction(isConfirm){\n\n\t\t\t\t\t\t\t\t\tif (isConfirm) {\n\n\n\t\t\t\t\t\t\t\t\t\twindow.location = \"categories\";\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t</script>';\n\n\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\techo \"error\";\n\n\t \t\n\t\t\t\t\t\t\t\t }\n\t\t\t\t \t\t}\n\t\t\t\t}", "public function action_delete()\n {\n if($this->category->has_subcategories())\n {\n // Response faile info\n $this->request->response = View::factory('error', array(\n 'message' => '该分类有子分类,无法删除', \n ));\n }\n else\n {\n if($this->category->delete())\n {\n // Delete successfully\n // Delete search results as well\n $this->request->redirect('category/tree');\n }\n else\n {\n // Failed\n $this->request->response = View::factory('error', array(\n 'message' => '删除失败', \n ));\n }\n }\n }", "function delete($category_id)\n {\n $query = \"DELETE FROM categories WHERE categories_id = '$category_id'\";\n $result = $this->db->delete($query);\n }", "public function delete_category($id)\n { \n\t $query=$this->General_model->show_data_id('categories',$id,'category_Id','get','');\n @unlink(str_replace(base_url(),'',$query[0]->category_img));\n \n $query=$this->General_model->show_data_id('categories',$id,'category_Id','delete','');\n $this->session->set_flashdata('success','Product Category Deleted successfully'); \n redirect('superpanel/categorie');\n\t\n\t }", "public function remove_category($id) {\r\n\t\t\treturn parent::delete($id);\r\n\t\t}", "public function delete_category($id) {\n $this->category();\n\n $connection = new Database(\"sbrettsc_db\");\n $connection->do_sql(\"DELETE FROM category WHERE id = \" . $id);\n $this->index();\n\n }", "public function delete_category() {\r\n $id = $this->uri->segment(3);\r\n $delete = $this->faq_model->delete_menu($id);\r\n\r\n if ($delete) {\r\n $this->session->set_flashdata('succ_msg', 'Menu Deleted Successfully');\r\n } else {\r\n $this->session->set_flashdata('error_msg', 'Unable to Delete Successfully');\r\n }\r\n redirect(base_url() . 'faq/category_list');\r\n }", "public function delete() {\n\t\t$sql = 'delete from cart_categories where categories_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\t$sql = 'delete from cart_categories_description where categories_id=\"' . e($this->getId()) . '\"';\n\t\tDatabase::singleton()->query($sql);\n\t\t\n\t\t$cats = $this->getSubCategories();\n\t\tforeach ($cats as $cat) {\n\t\t\t$cat->delete();\n\t\t}\n\t}", "function remove_utility_bill_category($utility_bill_category_id = '')\n\t{\n\t\t$this->db->where('utility_bill_category_id', $utility_bill_category_id);\n\t\t$this->db->delete('utility_bill_category');\n\n\t\t$this->session->set_flashdata('success', 'Utility bill category has been deleted successfully.');\n\n\t\tredirect(base_url() . 'utility_bill_categories', 'refresh');\n\t}", "function deleteProductCategory($connection, int $catId)\n{\n if(is_int($catId))\n {\n if(mysqli_num_rows(mysqli_query($connection, \"SELECT id FROM productCategories WHERE id = '$catId' LIMIT 1\")) == 1)\n {\n $run = mysqli_query($connection , \"DELETE from productCategories WHERE id = '$catId'\");\n if($run)\n {\n return array\n (\n \"result\" => true\n );\n }\n else\n {\n return array\n (\n \"result\" => false,\n \"error\" => mysqli_error($connection)\n );\n }\n\n }\n else\n {\n return array\n (\n \"result\" => false,\n \"error\" => \"Nu s-a gasit nici o categorie in baza id-ului specificat!\"\n );\n }\n }\n else\n {\n return array\n (\n \"result\" => false,\n \"error\" => \"Nici un ID de categorie specificat!\"\n );\n }\n}", "public function delcategory() {\n extract($_GET);\n //print_r($_GET);die();\n // call to model function to del category from db\n $result = $this->dash_model->delcategory($mat_cat_id);\n\n echo json_encode($result);\n }", "public function deleteCategoryLangaugeAction(){\n $ebookers_obj = new Ep_Ebookers_Managelist();\n //to call a function to delete themes//\n $ebookers_obj->deleteCategoryLangauge($this->_request->getParams());\n //unset($_REQUEST);\n exit;\n }", "public function deleteCategory($cat_id)\n {\n DB::table('categories')->where('id',$cat_id)->delete();\n // Display a toaster Deleted message..\n $notification = array(\n 'message' => 'Category Deleted successfully.',\n 'alert-type' => 'success'\n );\n return Redirect()->back()->with($notification);\n }", "public function deleteCategory()\r\n{\r\n $query_string = \"DELETE FROM categories \";\r\n $query_string .= \"WHERE categoryid= :categoryid\";\r\n\r\n return $query_string;\r\n}", "public function delete_assets_category() {\n\t\t\n\t\tif($this->input->post('type')=='delete_record') {\n\t\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t\t$id = $this->uri->segment(4);\n\t\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\t$result = $this->Assets_model->delete_assets_category_record($id);\n\t\t\tif(isset($id)) {\n\t\t\t\t$Return['result'] = $this->lang->line('xin_success_assets_category_deleted');\n\t\t\t} else {\n\t\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t\t}\n\t\t\t$this->output($Return);\n\t\t}\n\t}", "private function delCategory($idx) {\n \t$query = Category::find()->where('ID != 1 && PARENTID='.$idx)->all();\n \tforeach($query as $items) {\n \t\t$this->delCategory($items['ID']);\n \t}\n\n \t$Postmodel = Products::findAll(['CATEGORYID'=>$idx]);\n \tforeach($Postmodel as $items) {\n \t\t$items->CATEGORYID = 0;\n \t\t$items->save();\n \t}\n \t$this->findModel_category($idx)->delete();\n }", "public function delete_category(){\n $query = \"DELETE FROM {$this->table} WHERE {$this->table}.cat_id = (:cat_id)\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(':cat_id', $this->cat_id);\n $stmt->execute();\n return $stmt;\n \n }", "public function deleteClean() {\n\n $id = $this->request->get('category_id');\n\n // check category valid\n $category = ApplicationCategory::find($id)->first();\n\n $next_id = $this->request->get('next_category_id');\n\n\n $category_next = ApplicationCategory::find($next_id)->first();\n\n // check if exists.\n\n DB::table('apps')\n ->where('category_id', $id)\n ->update(['category_id' => $next_id]);\n\n $category->delete();\n\n return redirect('/develop/categories');\n\n\n }", "function delete_category($category_id)\n {\n $this->db->update('tbl_category',$this,array('category_id'=>$category_id));\n //echo $this->db->last_query();\n }", "function shophead_deleted($category_id = \"\")\n {\n $id = base64_decode($category_id);\n $categroy_data = $this->ProductCategory->find('first', array('conditions' => array('ProductCategory.id' => $id)));\n \n App::import('Model', 'ProductSubCategory');\n $this -> ProductSubCategory = new ProductSubCategory();\n $subcategories=$this->ProductSubCategory->find(\"list\",array('conditions'=>array(\"ProductSubCategory.product_category_id\"=>$id)));\n \n if(count($subcategories)==0){\n if (!empty($categroy_data)) {\n $new_business_data = $categroy_data['ProductCategory']['id'];\n if ($this->ProductCategory->delete($new_business_data)) {\n $this->Session->write('flash', array(DELETE_RECORD, 'success'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n } else {\n $this->Session->write('flash', array(FAILURE_MSG, 'failure'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n } else {\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }else{\n $this->Session->write('flash', array(CAT_CHILD_EXIST, 'failure'));\n $this->redirect(array('controller' => 'ProductCategories', 'action' => 'index'));\n }\n }", "function delete_kategori($id_kategori)\n {\n return $this->db->delete('kategori',array('id_kategori'=>$id_kategori));\n }", "public function test_delete_ScienceFiction_category_along_with_its_books(){\n $this->visit('/admin/categories')->press('delete')->press('Proceed')\n ->see('Data removed')->see('The Evolutionary Void')->see('The Dreaming Void')->see('Blood Music');\n\n\n }", "function categories_delete()\n{\n // Get database information\n $dbconn = xarDBGetConn();\n $xartable = xarDBGetTables();\n\n // Delete categories table\n $query = \"DROP TABLE \".$xartable['categories'];\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n // Delete links table\n $query = \"DROP TABLE \".$xartable['categories_linkage'];\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n // Delete categories ext privileges table\n $query = \"DROP TABLE \".$xartable['categories_ext_privileges'];\n $result= $dbconn->Execute($query);\n if (!$result) return;\n\n // Delete module variables\n// xarModDelVar('categories', 'bold');\n xarModDelVar('categories', 'catsperpage');\n\n // Remove module hooks\n if (!xarModUnregisterHook('item', 'new', 'GUI',\n 'categories', 'admin', 'newhook')) return;\n if (!xarModUnregisterHook('item', 'create', 'API',\n 'categories', 'admin', 'createhook')) return;\n if (!xarModUnregisterHook('item', 'modify', 'GUI',\n 'categories', 'admin', 'modifyhook')) return;\n if (!xarModUnregisterHook('item', 'update', 'API',\n 'categories', 'admin', 'updatehook'))return;\n if (!xarModUnregisterHook('item', 'delete', 'API',\n 'categories', 'admin', 'deletehook'))return;\n if (!xarModUnregisterHook('module', 'modifyconfig', 'GUI',\n 'categories', 'admin', 'modifyconfighook'))return;\n if (!xarModUnregisterHook('module', 'updateconfig', 'API',\n 'categories', 'admin', 'updateconfighook'))return;\n if (!xarModUnregisterHook('module', 'remove', 'API',\n 'categories', 'admin', 'removehook')) return;\n\n // UnRegister blocks\n if (!xarModAPIFunc('blocks', 'admin', 'unregister_block_type',\n array('modName' => 'categories',\n 'blockType'=> 'navigation'))) return;\n\n xarTplUnregisterTag('categories-navigation');\n xarTplUnregisterTag('categories-filter');\n xarTplUnregisterTag('categories-catinfo');\n /**\n * Remove instances and masks\n */\n\n // Remove Masks and Instances\n xarRemoveMasks('categories');\n xarRemoveInstances('categories');\n\n // Deletion successful\n return true;\n}", "public function actionDelete()\n\t{\n\t\t$categoryId = $this->_input->filterSingle('product_category_id', XenForo_Input::INT);\n\n\t\tif ($this->isConfirmedPost())\n\t\t{\n\t\t\t$writer = XenForo_DataWriter::create('Brivium_Store_DataWriter_Category');\n\t\t\t$writer->setExistingData($categoryId);\n\n\t\t\tif ($this->_input->filterSingle('move_child_categories', XenForo_Input::BINARY))\n\t\t\t{\n\t\t\t\t$parentCategoryId = $this->_input->filterSingle('parent_category_id', XenForo_Input::UINT);\n\n\t\t\t\tif ($parentCategoryId)\n\t\t\t\t{\n\t\t\t\t\t$parentCategory = $this->_getCategoryModel()->getCategoryById($parentCategoryId);\n\n\t\t\t\t\tif (!$parentCategory)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $this->responseError(new XenForo_Phrase('BRS_specified_destination_category_does_not_exist'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// no destination category id, so set it to 0 (root category)\n\t\t\t\t\t$parentCategoryId = 0;\n\t\t\t\t}\n\n\t\t\t\t$writer->setOption(Brivium_Store_DataWriter_Category::OPTION_CHILD_CATEGORY_DESTINATION_PARENT_ID, $parentCategoryId);\n\t\t\t}\n\n\t\t\t$writer->delete();\n\n\t\t\treturn $this->responseRedirect(\n\t\t\t\tXenForo_ControllerResponse_Redirect::SUCCESS,\n\t\t\t\tXenForo_Link::buildAdminLink('store')\n\t\t\t);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($categoryId)\n\t\t\t{\n\t\t\t\treturn $this->responseReroute('Brivium_Store_ControllerAdmin_Store', 'deleteConfirm');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $this->responseError(new XenForo_Phrase('requested_category_not_found'), 404);\n\t\t\t}\n\t\t}\n\t}", "function testDeletingCategory()\n {\n \n $this->tester->seeRecord('common\\models\\Category', ['description' => 'abc']);\n\n $category = Category::find()->where(['description' => 'abc'])->One();\n $category->delete();\n\n $this->tester->dontseeRecord('common\\models\\Category', ['description' => 'abc']);;\n }", "public function remove_post()\n {\n $input = $this->input->post();\n $data=$this->Category_model->deleteData($input);\n $this->response(['Item deleted successfully.'], REST_Controller::HTTP_OK);\n }", "public function testDeleteCategoryUsingDELETE()\n {\n }", "public function delete()\n {\n if(($this->session->userdata('logged_in') != true) && ($this->session->userdata('logged_in_as') != 'admin'))\n {\n redirect('siteadmin', 'refresh');\n }\n \n $category_deletion_type = $this->input->post('category_deletion_type');\n \n /* starts to delete multiple categories */\n if ($category_deletion_type == 'multiple') \n {\n $category_id = $this->input->post('category_id');\n $c \t = 0;\n for( $i = 0; $i < count($category_id); $i++ )\n {\n $id = $category_id[$i];\n\n $check_category = $this->common_model->query_single_row_by_single_source('boutique_products', 'category_id', $id);\n if (count($check_category) == 0)\n {\n if( $this->common_model->delete_data('id', $id, 'boutique_categories') )\n $c++;\n }\n }\n if( $c == 0 )\n $this->session->set_flashdata('error_message', 'Could not delete any category!!');\n \n elseif( $c == 1 )\n $this->session->set_flashdata('success_message', 'A category was deleted successfully');\n \n elseif( $c > 1 )\n $this->session->set_flashdata('success_message', 'Multiple categories were deleted successfully');\n }\n /* ends to delete multiple category */\n \n /* starts to delete single category */\n else {\n $id = $this->input->post('single_category_id');\n $check_category = $this->common_model->query_single_row_by_single_source('boutique_products', 'category_id', $id);\n if (count($check_category) == 0)\n {\n if( $this->common_model->delete_data('id', $id, 'boutique_categories') )\n $this->session->set_flashdata('success_message', 'A category was deleted successfully');\n else\n $this->session->set_flashdata('error_message', 'Could not delete!! The category is in used');\n }\n else\n $this->session->set_flashdata('error_message', 'Could not delete the category!!');\n }\n /* ends to delete single category */ \n \n redirect(base_url().'category', 'refresh');\n }", "public function deleteCategories($category_id){\n if(DB::table('tbl_post')->where('category_id',$category_id)->first()){\n $name = DB::table('tbl_categories')->where('id',$category_id)->first();\n Session::put('massege','Không thể xóa danh mục \"'.$name->name.'\".');\n }\n else{\n DB::table('tbl_categories')->where('id',$category_id)->delete();\n Session::put('massege','Xoá danh mục thành công.');\n }\n return Redirect::to('categories');\n \n }", "function delete_category($FormID) {\r\n $conn = db_connect();\r\n\r\n $query = \"delete from PortfolioCategories\r\n where PortCatID='\".$FormID.\"'\";\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "function delete_category($category_id) {\n global $db;\n $query = \n ' DELETE FROM categories \n WHERE cat_categoryID = :category_id';\n $statement = $db->prepare($query);\n $statement->bindValue(':category_id', $category_id);\n $statement->execute();\n $statement->closeCursor();\n}", "public function actionCategoryDelete()\n {\n $this->_assertCanManageCategories();\n\n $category_id = $this->_input->filterSingle('faq_id', XenForo_Input::UINT);\n\n // Delete category\n $dw = XenForo_DataWriter::create('Iversia_FAQ_DataWriter_Category');\n $dw->setExistingData($category_id);\n $dw->delete();\n\n // Delete associated questions\n $this->_getQuestionModel()->deleteOrphanQuestions($category_id);\n\n return $this->responseRedirect(\n XenForo_ControllerResponse_Redirect::SUCCESS,\n XenForo_Link::buildPublicLink('faq'),\n new XenForo_Phrase('iversia_faq_category_deleted')\n );\n }", "public function destroy($category)\n {\n\n $item = BountyCategory::where('id', $category)->delete();\n\n \n \n\n session()->flash('success',\"deleted successfully\");\n return redirect()->back();\n }", "public function modelDelete($category_id){\r\n\t\t\t$conn = Connection::getInstance();\r\n\t\t\t// chuan bi truy van \r\n\t\t\t$query = $conn->prepare(\"delete from tbl_category where category_id=:category_id\");\r\n\t\t\t//thuc thi truy van \r\n\t\t\t$query->execute(array(\"category_id\"=>$category_id));\r\n\t\t\t\r\n\t\t}", "public function delete_categoria($cat_id) {\n $conectar=parent::conexion();\n parent::set_names();\n $sql=\"UPDATE tm_categoria SET est=0 where cat_id=?\";\n $sql=$conectar->prepare($sql);\n // envia parametro\n $sql->bindValue(1,$cat_id);\n $sql->execute();\n // IMPORTANTE AGREGARLE EL PDO::FETCH_ASSOC PARA QUE HAGA BIEN LA CONSULTA\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n \n }", "public function RemoveCategory ($mobidulCode, $categoryId)\n {\n if ( ! $this->GetIsOwnerOfMobidul($mobidulCode) )\n return 'not-allowed';\n\n if ( ! empty($categoryId) )\n {\n $category = Category::where('id', $categoryId);\n\n if ( $category->count() == 0 )\n return 'not-existing';\n\n\n DB::beginTransaction();\n\n $navigationItem = NavigationItem::where('categoryId', $categoryId);\n $category2Station = Category2Station::where('categoryId', $categoryId);\n\n\n // delete NavigationItem\n if ( $navigationItem->count() > 0 )\n $navigationItem->delete();\n\n // delete Category2Station\n if ( $category2Station->count() > 0 )\n $category2Station->delete();\n\n // delete Category\n if ( $category->count() > 0 )\n $deletedCategory = $category->delete();\n\n\n DB::commit();\n\n return 'success';\n }\n else\n return 'empty';\n }", "public function supcat($id)\n{\n $this->categories->delCat($id);\n redirect('administration/categorie');\n}", "function deleteAction()\n\t{\n global $langCode;\n\t\t$id = (int)$this->registry->router->getArg('id');//lay id cua record can xoa\n\t\t$myProductCat = new Core_ProductCategory($id);\n\t\tif($myProductCat->id > 0)\n\t\t{\n\t\t\t//tien hanh xoa\n\t\t\tif($myProductCat->delete())\n\t\t\t{\n\t\t\t\t$redirectMsg = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['succDelete']);\n\t\t\t\t\n\t\t\t\t$this->registry->me->writelog('ProductCategorydelete', $myProductCat->id, array('name' => $myProductCat->name[$langCode])); \t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$redirectMsg = str_replace('###categoryname###', $myProductCat->name[$langCode], $this->registry->lang['controller']['errDelete']);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$redirectMsg = $this->registry->lang['controller']['errNotFound'];\n\t\t}\n\t\t\n\t\t$this->registry->smarty->assign(array('redirect' => $this->getRedirectUrl(),\n\t\t\t\t\t\t\t\t\t\t\t\t'redirectMsg' => $redirectMsg,\n\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t$this->registry->smarty->display('redirect.tpl');\n\t\t\t\n\t}", "public function deleted(Category $category)\n {\n //\n }", "public function Eliminar(){\n \n \n if (!$this->model->igualar($_REQUEST['id'])) {//si una categoria no esta asignada la puede eliminar\n \n $this->model->Eliminar($_REQUEST['id']);\n header('Location: ?c=Categoria'); \n }\n else{\n \n header('Location: ?c=Categoria&error'); //de lo contrario no se podra eliminar asta que se elimine el cliente que la tiene\n }\n\n\n\n \n \n \n\n\n\n\n \n \n \n }", "public function delete(Request $r)\n {\n DB::beginTransaction();\n try {\n foreach (Item::where('category_id', $r->id)->get() as $value) {\n $data = Item::find($value->id);\n $data->category_id = null;\n $data->update();\n }\n Category::find($r->id)->delete();\n DB::commit();\n $alert = ['success', 'Data kategori berhasil dihapus'];\n } catch (Exception $e) {\n DB::rollBack();\n $alert = ['danger', 'Data kategori gagal dihapus'];\n }\n return back()->with('alert', $alert);\n }", "function delete( $catID = -1 )\r\n {\r\n if ( $catID == -1 )\r\n $catID = $this->ID;\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $alternatives =& $this->alternatives();\r\n if ( is_array( $alternatives ) )\r\n {\r\n foreach ( $alternatives as $alternative )\r\n {\r\n $alternative->delete();\r\n }\r\n }\r\n\r\n $res[] = $db->query( \"DELETE FROM eZQuiz_Question WHERE ID='$this->ID'\" );\r\n eZDB::finish( $res, $db );\r\n\r\n }", "public function destroy(DrugCategory $drugCategory)\n {\n $drugLanguages = DrugCategoryLanguage::all()->where('drug_category_id',$drugCategory->id);\n foreach ($drugLanguages as $lang){\n $lang->delete();\n }\n $drugCategory->delete();\n return redirect()->route('drug_categories.index')->with('success','DrugCategory is deleted.');\n }", "public function delete_academic_article_category()\n {\n // check status for delete\n $creator = json_decode($this->input->post('creator'));\n if($creator==null || $creator==''){\n echo 'fail';\n exit;\n }\n $creatorID = $this->Check__model->chk_token($creator);\n $statusUser = $this->Check__model->chk_status($creatorID);\n if( $statusUser != 'admin' ){\n echo 'fail';\n exit ;\n }\n //delete\n $academic_article_categoryID = json_decode($this->input->post('academic_article_categoryID'));\n $academic_article_category['aac_id'] = $academic_article_categoryID;\n $AAC_status = $this->academic_article_model->delete_academic_article_category($academic_article_category);\n if($AAC_status == true){\n echo $academic_article_categoryID ;\n } \n\n }", "public function testSuccessDeleteCategory()\n {\n $service = $this->app->make(CategoryServiceInterface::class);\n\n $categoryA = 'categoryA' ;\n \n $service = $this->app->make(CategoryServiceInterface::class);\n $cateA = $service->save(null, $categoryA);\n\n $this->assertDatabaseHas('categories', [\n 'name' => $categoryA\n ]);\n \n $service->delete($cateA->id);\n $this->assertDatabaseMissing('categories', [\n 'name' => $categoryA\n ]);\n }", "function delete_kategori($id_kategori_point)\n {\n return $this->db->delete('kategori',array('id_kategori_point'=>$id_kategori_point));\n }", "public function deleteCategory(int $id): void\n {\n }", "public function delete_sub_sub_category()\n\t{\n\t\t$sub_sub_category_id = $this->input->post('sub_sub_category_id');\n\n\t\t$this->load->model('Admin_functions_model');\n\t\tif( $this->Admin_functions_model->delete_the_sub_sub_category($sub_sub_category_id) )\n\t\t{\n\t\t\t$this->session->set_flashdata('feedback', 'Sub Sub Category deleted successfully');\n\t\t\t$this->session->set_flashdata('feedback_class', 'alert-success');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->session->set_flashdata('feedback', 'Failed to delete, Please try again');\n\t\t\t$this->session->set_flashdata('feedback_class', 'alert-danger');\n\t\t}\n\n\t\treturn redirect('Admin_functions/class_room_training');\n\t}", "function delete( $catID = -1 )\r\n {\r\n if ( $catID == -1 )\r\n $catID = $this->ID;\r\n\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n// $answers =& $this->answers();\r\n\r\n if ( is_array ( $answers ) )\r\n {\r\n foreach ( $answers as $answer )\r\n {\r\n $answer->delete();\r\n }\r\n }\r\n\r\n $res[] = $db->query( \"DELETE FROM eZQuiz_Alternative WHERE ID='$catID'\" );\r\n eZDB::finish( $res, $db );\r\n }", "function eliminar_categoria($id){\n if(mostrar_categoria($id)[0]->listaProductos==NULL){\n if(delete_categoria($id)){\n header('Location: /GUI/admin.php?status=Admin&message=eliminó');\n }\n }else{\n header('Location: /GUI/admin.php?status=Admin&message=error prod');\n }\n }", "public function testCreateAndDeleteCategory()\n\t{\n $user = factory(User::class)->create();\n Passport::actingAs($user);\n\n $array_category = array(\n 'user_id' => $user->id,\n\t\t\t'name' => 'Temporal'\n\t\t);\n\n\t\t$category = factory(Category::class)->create($array_category);\n\t\t$this->assertDatabaseHas('categories', $array_category);\n\n\t\t$response = $this->delete('api/categories/' . $category->id);\n\t\t$response->assertStatus(201);\n\t\t$this->assertDatabaseMissing('categories', $array_category);\n\t}", "function Category_delete($id){\n $data= Category::findOrFail($id);\n $data -> delete();\n\n return back();\n }", "public function excluirCategoria($idcategoria){\n //$conexao = $c->conexao();\n\n $sql = \"DELETE FROM tbcategorias WHERE idcategoria = '$idcategoria' \";\n\n return $this->conexao->query($sql);\n\n\n }", "public function remove(Request $request){\n try{\n $category=Category::where('id',$request->id)->first();\n if($category){\n $category->delete();\n return Response::json(['success'=>'Category removed successfully !']);\n }else{\n return Response::json(['error'=>'Category not found!']);\n }\n }catch(\\Illuminate\\Database\\QueryException $exception){\n return Response::json(['error'=>'Category belongs to an article.So you cann\\'t delete this category!']);\n }\n }", "function remove_category($category_id) {\n\t\t$category_image_query = olc_db_query(\"SELECT categories_image FROM \".TABLE_CATEGORIES.\" WHERE categories_id = '\".olc_db_input($category_id).\"'\");\n\t\t$category_image = olc_db_fetch_array($category_image_query);\n\n\t\t$duplicate_image_query = olc_db_query(\"SELECT count(*) AS total FROM \".TABLE_CATEGORIES.\" WHERE categories_image = '\".olc_db_input($category_image['categories_image']).\"'\");\n\t\t$duplicate_image = olc_db_fetch_array($duplicate_image_query);\n\n\t\tif ($duplicate_image['total'] < 2) {\n\t\t\tif (file_exists(DIR_FS_CATALOG_IMAGES.'categories/'.$category_image['categories_image'])) {\n\t\t\t\t@ unlink(DIR_FS_CATALOG_IMAGES.'categories/'.$category_image['categories_image']);\n\t\t\t}\n\t\t}\n\n\t\tolc_db_query(\"DELETE FROM \".TABLE_CATEGORIES.\" WHERE categories_id = '\".olc_db_input($category_id).\"'\");\n\t\tolc_db_query(\"DELETE FROM \".TABLE_CATEGORIES_DESCRIPTION.\" WHERE categories_id = '\".olc_db_input($category_id).\"'\");\n\t\tolc_db_query(\"DELETE FROM \".TABLE_PRODUCTS_TO_CATEGORIES.\" WHERE categories_id = '\".olc_db_input($category_id).\"'\");\n\n\t\tif (USE_CACHE == TRUE_STRING_S) {\n\t\t\tolc_reset_cache_block('categories');\n\t\t\tolc_reset_cache_block('also_purchased');\n\t\t}\n\n\t}", "function deleteCategoryMeta($cat_id) {\n\t\t$course_meta = new CourseMeta($cat_id);\n\t\t$course_meta->delete();\n\t}", "function cat_delete_link()\n{\n return Parrot::getInstance()->getUrl(\"admin/category/\" . discussion::encode_title(cat_title()) . \"/delete\");\n}", "public function delete(){\n\t\t$ok=false;\t\t\n\t\tif (isset($_POST[\"idCategoria\"])) {\n\t\t\t$tabla = \"categorias\";\t\t\t\n\t\t\t$datos = $_POST[\"idCategoria\"];\t\t\t\n\t\t\t//borro la categoría\n\t\t\t$respuesta = ModeloCategorias::delete($tabla, $datos);\n\t\t\tif ($respuesta == \"OK\") {\n\t\t\t\t$ok=true;\t\n\t\t\t}else {\n\t\t\t\t$ok=false;\t\n\t\t\t}\n\t\t}\n\t\treturn json_encode($ok);\n\t}", "public function destroy(Category $category)\n {\n $user_check = \\Auth::user();\n if (in_array($user_check->level, [0, 1])) {\n\n $check_budget = BudgetCategories::where('category_id', $category->id)->count();\n $check_budget_product = BudgetProductAndServices::where('category_id', $category->id)->count();\n $check_product = ProductAndService::where('category_id', $category->id)->count();\n\n $check = $check_budget + $check_product + $check_product;\n\n if ($check > 0) {\n session()->flash('message', 'Essa categoria está associada a uma orçamento e/ou a um produto por isso não é possível excluir');\n return redirect()->route('category.index');\n } else {\n $category->delete();\n session()->flash('message', 'Categoria excluída com sucesso');\n return redirect()->route('category.index');\n }\n } else {\n session()->flash('message', 'Desculpe! Essa área é restrita a administração.');\n return view('includes.message');\n }\n\n }", "function delete_kategori_induk($id)\n {\n return $this->db->delete('kategori_induk',array('kode_kategori_induk'=>$id));\n }", "public function eliminarCategoria($nombrecategoria){\n \t$registro=mysqli_query($this->conexion(),\"select * from categorias where nombrecategoria='$_REQUEST[nombrecategoria]'\") or die(mysqli_error($this->conexion()));\n \tif ($reg=mysqli_fetch_array($registro)){\n \techo '<table border 1 >';\n \techo '<tr><th>Codigo Categoria</th><th>Nombre Categoria</th></tr>';\n \techo \"<td>\".$reg[0].\"<br>\";\n \techo \"<td>\".$reg[1].\"<br>\";\n \techo \"</table>\";\n \tmysqli_query($this->conexion(),\"delete from categorias where nombrecategoria='$nombrecategoria'\");\n\n \techo \"<br><br><br>Se elimino la categoria que se muestra en pantalla\";\n echo \"<form action='abcCategoria.php' method='post'>\n <input type='submit' value='Regresar'><br><br></form>\";\n\n \t}\n \telse{\n \techo 'No existe tal Categoria ingrese nuevamente el nombre';\n echo \"<form action='bajaCategoria.php' method='post'>\n <input type='submit' value='Regresar'><br><br></form>\";\n \t\t}\n \t}", "function delCategory($object) { \n /* you can itentify the item with $object->Item->ShopId */ \n}", "public function removeCategoryForFood($food_id, $category_name){\n\t\t// look for the category_name\n\t\t$query = $this->db->query('\n\t\t\tselect a.id\n\t\t\tfrom food_category_assoc a\n\t\t\tleft join food_category c\n\t\t\ton c.id = a.food_category_id\n\t\t\twhere\n\t\t\t\tupper(c.name) = upper(?)', array(trim($category_name)));\n\t\t$results = $query->result();\n\t\tif (count($results)>0){\n\t\t\t$assoc_id = $results[0]->id;\n\t\t\t\n\t\t\tif (!$this->db->query('delete from food_category_assoc where id=?', array($assoc_id))){\n\t\t\t\treturn $this->db->error;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public function delete(int $id)\n {\n // if (is_null($of_category)) {\n // return 'false';\n // }\n \n // if ($of_category->delete()) {\n // return 'success';\n // }\n\n // return 'error'; \n }", "public function deleteIndex($category, $id);", "public function deleteCategory($id) {\n\t\t$stmt = $mysqli->prepare(\"DELETE FROM categorie WHERE cat_id = ?\");\n\t\t$stmt->bind_param('i', $id);\n\t\t$stmt->execute();\n\t\t$stmt->close();\n\t}", "public function deleted(Category $category)\n {\n //\n }", "function delete_category($action, $id)\r\n{\r\n\tglobal $dropbox_cnf;\r\n\tglobal $_user, $is_courseAdmin, $is_courseTutor;\r\n\r\n\t// an additional check that might not be necessary\r\n\tif ($action=='deletereceivedcategory')\r\n\t{\r\n\t\t$sentreceived='received';\r\n\t\t$entries_table=$dropbox_cnf['tbl_post'];\r\n\t\t$id_field='file_id';\r\n\t}\r\n\telseif ($action=='deletesentcategory')\r\n\t{\r\n\t\t$sentreceived='sent';\r\n\t\t$entries_table=$dropbox_cnf['tbl_file'];\r\n\t\t$id_field='id';\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn get_lang('Error');\r\n\t}\r\n\r\n\t// step 1: delete the category\r\n\t$sql=\"DELETE FROM \".$dropbox_cnf['tbl_category'].\" WHERE cat_id='\".Database::escape_string($id).\"' AND $sentreceived='1'\";\r\n\t$result=api_sql_query($sql);\r\n\r\n\t// step 2: delete all the documents in this category\r\n\t$sql=\"SELECT * FROM \".$entries_table.\" WHERE cat_id='\".Database::escape_string($id).\"'\";\r\n\t$result=api_sql_query($sql);\r\n\r\n\twhile ($row=mysql_fetch_array($result))\r\n\t{\r\n\t\t$dropboxfile=new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor);\r\n\t\tif ($action=='deletereceivedcategory')\r\n\t\t{\r\n\t\t\t$dropboxfile->deleteReceivedWork($row[$id_field]);\r\n\t\t}\r\n\t\tif ($action=='deletesentcategory')\r\n\t\t{\r\n\t\t\t$dropboxfile->deleteSentWork($row[$id_field]);\r\n\t\t}\r\n\t}\r\n}", "public function delete(): void\n {\n $query_lang = 'DELETE FROM '. rex::getTablePrefix() .'d2u_linkbox_categories '\n .'WHERE category_id = '. $this->category_id;\n $result_lang = rex_sql::factory();\n $result_lang->setQuery($query_lang);\n }", "public function deletecategory($args)\n {\n if (!SecurityUtil::checkPermission('Dizkus::', \"::\", ACCESS_ADMIN)) {\n return LogUtil::registerPermissionError();\n }\n \n if (isset($args['cat_id'])) {\n // read all the forums in this category\n $forums = $this->readforums(array('cat_id' => $args['cat_id']));\n if (is_array($forums) && count($forums)>0) {\n foreach ($forums as $forum) {\n // remove all forums in this category\n ModUtil::apiFunc('Dizkus', 'admin', 'deleteforum',\n array('forum_id' => $forum['forum_id'],\n 'ok' => 1));\n } //foreach forum\n }\n // now we can delete the category\n return DBUtil::deleteObject($args, 'dizkus_categories', null, 'cat_id');\n }\n \n return LogUtil::registerError($this->__('Error! The action you wanted to perform was not successful for some reason, maybe because of a problem with what you input. Please check and try again.'));\n }", "public function destroy($kw_category_id = 0, $id)\n {\n\n }", "public function deleteAction()\n {\n // enforce permissions.\n $this->acl->check('categories', 'manage');\n\n // require post request method.\n $request = $this->getRequest();\n if (!$request->isPost()) {\n throw new P4Cms_AccessDeniedException(\n \"Cannot delete category. Request method must be http post.\"\n );\n }\n\n $id = $request->getParam('id', $request->getParam('category'));\n $category = Category_Model_Category::fetch($id);\n $category->delete();\n\n $this->view->category = $category;\n }", "public function delete(Request $request, $categoryId)\n {\n //delete Category\n $category = Category::find($categoryId);\n $category -> delete();\n $categories = Category::orderBy('year1', 'asc')->get();\n foreach ($categories as $category) {\n $category->sex;\n }\n return response()->json([\n 'message' => 'successfully deleted',\n 'categories' => $categories\n ], 200);\n }", "public function delete(){\n $sql = \"DELETE FROM categorias WHERE id={$this->getId()}\";\n $delete = $this->db->query($sql);\n\t\t$result = false;\n\t\tif($delete){\n\t\t\t$result = true;\n\t\t}\n\t\treturn $result;\n }", "public function delete($id_category){\n $category = \\App\\Models\\Category::find($id_category); // find the id and save it to variable category\n $category->delete();\n return redirect('/category')->with('success', 'Delete data success');\n }", "function delete_MaterialCategory($id)\n {\n $this->db->where('id',$id);\n return $this->db->update('prj_mtrl_category',array('delete_status'=>'1'));\n }", "function delete_campaign_list($id, $taxonomy) {\n if ($taxonomy === 'category') {\n require_once 'createsend-php-5.1.2/csrest_lists.php';\n $auth = array('api_key' => CM_API_KEY);\n $wrap = new CS_REST_Lists(get_term_meta($id, 'list_id', true), $auth);\n\n $result = $wrap->delete();\n }\n}", "public function test_can_delete_items_by_category_id()\n {\n $response = $this->delete('/api/items/destroy/1');\n\n $response->assertStatus(200);\n\n $response->assertSee(0);\n }", "public function deleteDiscount();" ]
[ "0.69728845", "0.69309986", "0.68059367", "0.65877753", "0.6557906", "0.6525597", "0.6450585", "0.64371765", "0.6426727", "0.64032364", "0.6383666", "0.633878", "0.6333474", "0.6313338", "0.6311642", "0.6310584", "0.63052934", "0.6280416", "0.62617826", "0.6255811", "0.6216993", "0.6195242", "0.61556023", "0.61548173", "0.6153808", "0.6134707", "0.6121158", "0.6118323", "0.6112253", "0.6103092", "0.60978776", "0.6095505", "0.6091429", "0.60906434", "0.6086456", "0.60742044", "0.60713565", "0.6061699", "0.6054668", "0.60545784", "0.6041406", "0.60397613", "0.6039111", "0.6034644", "0.60341537", "0.60318935", "0.6026513", "0.60238975", "0.60218084", "0.60109776", "0.6008808", "0.60055286", "0.6001689", "0.5994725", "0.59937024", "0.5993664", "0.5978546", "0.5977637", "0.5957695", "0.5954176", "0.59526026", "0.5951619", "0.5933277", "0.59297097", "0.59255075", "0.59252685", "0.5917141", "0.5912622", "0.5896643", "0.5882863", "0.587878", "0.5873214", "0.58692485", "0.58658713", "0.58502644", "0.58487207", "0.5845853", "0.58454555", "0.583669", "0.58356136", "0.58315367", "0.58261", "0.5815604", "0.5813431", "0.58105415", "0.58082926", "0.58047163", "0.5798433", "0.5798364", "0.5796951", "0.5794174", "0.5791732", "0.5781972", "0.57811487", "0.5778946", "0.57773733", "0.57712245", "0.5770273", "0.5770177", "0.5767194" ]
0.70054156
0
List all the projects.
public function findAll(GoogleAccount $account);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function all_projects(){\n /**\n * @var \\AWorDS\\App\\Models\\Project $project\n */\n $project = $this->set_model();\n $logged_in = $project->login_check();\n if($logged_in){\n $this->set('logged_in', $logged_in);\n $this->set('active_tab', 'projects');\n $this->set('projects', $project->getAll());\n }else $this->redirect();\n }", "public static function retrieveAllProjects() {\n return R::getAll('SELECT * FROM project');\n }", "public function index()\n\t{\n\t\treturn Project::all();\n\t}", "public function index()\n {\n $projects = Project::all();\n\n return $this->showAll($projects);\n }", "public function index()\n {\n return Project::all();\n }", "public function index()\n {\n return Project::all();\n }", "public function getAll()\n {\n return $this->performQuery(\n $this->createUrl('project')\n );\n }", "function index() {\n\t\t$this->Project->recursive = 0;\n\t\t$this->set('projects', $this->paginate());\n\t}", "private function getAllProjects()\n {\n $url = $this->base_uri.'project?expand=description,lead,issueTypes,url,projectKeys';\n $projects = $this->request($url);\n return $projects;\n }", "public function index()\n {\n $projects = new ProjectsResource(\n $this->project->with(['company:id,name,primary_contact'])\n ->orderByDesc('id')\n ->paginate(50)\n );\n return response($projects, Response::HTTP_OK);\n }", "public function index()\n {\n try{\n return response(ProjectResource::collection(Project::all()));\n } catch(Exception $e) {\n return $this->errorResponse($e);\n }\n }", "public function index() {\n\n $projects = Project::whereRaw('1=1')->get();\n //->paginate(self::COUNT_PER_PAGE);\n\n return view('backend.project.list', [\n 'projects' => $projects\n ]);\n }", "public function index()\n {\n $Project = Project::paginate();\n return ProjectResource::collection($Project);\n }", "public function index(): Collection\n {\n return Project::all();\n }", "public function index()\n {\n $projects = Project::all();\n return ProjectResource::collection($projects);\n }", "public function index()\n {\n $projects = Api::get('api/v1/project', Session::get('session.token'));\n return View::make('project::site.project.list', ['projects' => $projects]);\n }", "public function getProjects();", "public function index()\n {\n return 'list of all projects';\n }", "public function index()\n\t{\n\t\t$db = DB::getInstance();\n\t\t$stmt = $db->prepare(\"SELECT * FROM project \");\n\t\t$stmt->execute();\n\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\n\t}", "public function index()\n {\n $projects = DB::table('projects')->paginate(2);\n return view('admin.project.list', ['projects' => $projects]);\n }", "public function getProjectsAction(){\n\n $projects = $this->getDoctrine()->getRepository(\"GithubProjectsBundle:Project\")->findAll();\n return array('projects' => $projects);\n }", "public function actionIndex() {\n $searchModel = new ProjectsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function get_project_all(){\n }", "public function index()\n {\n return new ProjectCollection(Project::paginate());\n }", "public function get_project_list_get()\n {\n \t$result = $this->Post_project_model->get_project_list();\n \treturn $this->response($result);\n }", "public function index()\n {\n\n $projects = Project::orderBy('id', 'desc')->get();\n return view('project.index', compact('projects'))->with('title',\"All Project List\");\n }", "public function index()\n {\n //\n return view('admin.projects.index')->with('projects', Project::all());\n }", "public function getList() {\n $projects = Project::all();\n\n return response()->success(compact('projects'));\n }", "public function index() // метод для отображения данных всех проектов\n {\n return view('project.index',\n [\n \"projects\" => $this->projects->all(),\n //\"task\" => $this->tasks->all(),\n ]\n );\n }", "public function get_projects() {\n\t\treturn $this->request( array(\n\t\t\t'function' => 'projects',\n\t\t\t'method' => 'GET',\n\t\t) );\n\t}", "public function listProjects(ProjectListRequest $request)\n {\n $sorting = $request->getSortKey();\n $friendly = $request->getSortKeyFriendly();\n $order = $request->getSortOrderFriendly();\n \n return $request->renderViewOrEmpty('projects', compact(['sorting', 'friendly', 'order']));\n }", "public function index()\n {\n return Project::where('user', auth()->user()->id)->paginate(10);\n }", "public function listProjects()\n {\n\n\t\t$data = ProjectsRepository::findByUser($_SESSION[\"uuid\"]);\n\t\treturn array(\"data\" => $data);\n\n }", "public function getProjectList() { \n $q = Doctrine_Query::create()->from('Project')\n ->orderBy('id');\n \n return $q->execute(); \n }", "public function actionIndex()\n {\n $searchModel = new ProjectSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionIndex()\n {\n $searchModel = new ProjectSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $data = $this->projectRepository->getAll();\n\n return response()->json($data);\n }", "public function user_can_view_all_projects()\n {\n $this->get('/api/projects')\n ->assertStatus(200)\n ->assertJsonStructure(['data']);\n }", "public function index()\n\t{\n $projects = $this->project->all();\n\n\t\treturn view('projects.index', compact('projects'));\n\t}", "public function index()\n {\n $projects = Project::paginate(10);\n return view('projects.index')->with('projects', $projects);\n }", "public function index()\n {\n $projects = Project::all();\n\n return response()->json($projects);\n }", "public function index()\n {\n $projects = Project::paginate(10);\n return view('projects.index')->withProjects($projects);\n\n }", "public function index()\n {\n $projects = Project::latest()->with('user')->paginate(5);\n return view('admin.allprojects' ,compact('projects'));\n }", "public function index()\n {\n $projects = Project::paginate(12);\n\n return view('admin.project.index', [\n 'records' => $projects,\n 'base' => $this->base\n ]);\n }", "public function index()\n {\n $projects = Project::loadProjects();\n return response()->json($projects);\n \n }", "public function index()\n {\n $projects = Project::all();\n\n return view('projects.index', compact('projects'));\n }", "public function actionIndex()\n {\n $searchModel = new ProjectsSearch();\n $searchModel->status = 'active';\n $searchModel->visible = 1;\n //$searchModel->user_id = Yii::$app->user->id;\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $projects = Project::orderBy('id', 'DESC')->paginate(10);\n return view('admin.projects.index', compact('projects'));\n }", "public function index()\n {\n $projects = Project::all();\n\n return response()->json([\n 'success' => true,\n 'data' => $projects\n ], 200);\n }", "public function index()\n {\n //\n $projects = Project::orderBy('id', 'desc')->paginate(5);\n return response()->json($projects, 200);\n }", "public function index()\n {\n $data = Project::all();\n return view('contractor.projects.index', compact('data'));\n }", "public function index()\n {\n $data = Project::all();\n\n return view('backend.projects.index', compact('data'));\n }", "public static function projectList() {\n\t\tif(!Authenticate::isAuthorized()) {\n \t\t throw new NotifyException(\"You are not authorized for this method\", 1);\n \t}\n else {\n\t\t\t$api_end_point = \"project\";\n\t\t\t$request_data=[];\n\t\t\treturn Request::sendRequest($api_end_point, $request_data);\n\t\t}\n\t}", "public function index()\n {\n $projects = Project::all();\n return view('projects.index', compact('projects'));\n }", "public function index()\n {\n \n $projects = Project::all();\n\n return view('projects.index', ['projects' => $projects]);\n \n }", "public function actionIndex()\n\t{\n\t\t$projects = SlideProject::model()->findAllByAttributes(array('status'=>1), array('order'=>'t.id ASC'));\n\t\t$this->render('index', array(\n\t\t\t'projects'=>$projects\n\t\t\t));\n\t}", "public function projects()\n {\n $query = 'project';\n return json_decode($this->client->request('GET', $query, $this->options)->getBody(), true);\n }", "public function index()\n {\n $project = Project::paginate(10);\n return view('backend.project.index', compact('project'));\n }", "public function index()\n { \n $projects = Project::get();\n return view('project.index',compact('projects'));\n }", "public function indexAction()\n {\n /** @var \\Doctrine\\ORM\\EntityManager $em */\n $em = $this->getDoctrine()->getManager();\n $username = $this->getUser()->getUsername();\n $entity = new Project();\n if (false === $this->get('security.authorization_checker')->isGranted('VIEW_LIST', $entity, $username)) {\n $entities = $em->getRepository('OroProjectBundle:Project')->findByProjectMember($this->getUser()->getId());\n } else {\n $entities = $em->getRepository('OroProjectBundle:Project')->findAll();\n }\n return array(\n 'entities' => $entities,\n );\n }", "public function index() {\n\n return Auth::user()->projects()->paginate();\n }", "public function index()\n {\n\n $this->repository->pushCriteria(new ProjectCriteria);\n $projects = $this->repository->paginate(env('PER_PAGE'));\n $links = str_replace('/?', '?', $projects->render());\n\n return view('helpdesk.projects.index', compact('projects', 'links'));\n }", "public function index() \n {\n $projects = Project::where('systemID', app('system')->id)->get();\n return view('projects.index', compact('projects'));\n }", "public function index()\n {\n //\n $data = Project::paginate(5);\n\n return view('admin.projects.index',compact('data'));\n }", "public function index()\n {\n return view('business.projects.index', [\n 'projects' => Project::all()\n ]);\n }", "public function index(){\n return Responser::ok('Projects available',Auth::user()->companies->reduce(function($carry,$company){\n $company->projects->each(function($project) use(&$carry){\n $project->load('company');\n $carry[] = $project;\n });\n\n return $carry;\n },[]));\n }", "public function index()\n {\n $projects = Project::get();\n return view('project.index', compact('projects'));\n }", "public function index()\n {\n return response()->json(Project::get());\n }", "public function actionIndex()\n {\n $searchModel = new SearchProject();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n return view('project.index', $this->repository->projectResources())->with('nav', $this->nav);\n ;\n }", "public function index()\n {\n //\n $rows=\\App\\Models\\Project::paginate(15);\n return view('Project.list')->with(compact('rows'));\n }", "public function index()\n {\n $project = Project::all();\n return view('admin.projects.index', ['projects' => $projects]);\n }", "public function index()\n {\n $projects = Project::all();\n return view('users.projects.index', compact('projects'));\n }", "public function projects()\n {\n return $this->request('get', 'api/teams/'.Helpers::config('team').'/projects');\n }", "public function actionIndex()\n {\n $currentUser = Yii::$app->user->identity;\n\n $allProjects = $this->projectService->findAll();\n\n $userProjects = $this->projectService->findProjectsByUser($currentUser->id);\n\n $projectUserMap = [];\n foreach ($userProjects as $userProject)\n {\n $projectUserMap[$userProject->id] = true;\n }\n\n return $this->render('index', [\n 'allProjects' => $allProjects,\n 'projectUserMap' => $projectUserMap\n ]);\n }", "public function index()\n {\n $projects = $this->project->all();\n $statistics = $this->project->getStatistics();\n $canDo = auth()->user()->role->canDoAll();\n $storeBelongs = true;\n $licensors = $this->project->getLicensors();\n $stores = $this->project->getStores();\n $teams = $this->project->getAllTeams();\n $project_categories = $this->project->getAllCategories();\n $categories = $this->project->getAllCategories();\n $skill_levels = $this->project->getSkillLevels();\n $skills = $this->project->getAllSkills();\n $sub_categories = $this->project->getAllSubCategories();\n $services = $this->project->getAllServices();\n\n return view('pages.projects.index', compact('canDo', 'services', 'sub_categories', 'skills', 'categories', 'stores', 'licensors', 'project_categories', 'teams', 'skill_levels', 'projects', 'statistics', 'storeBelongs'));\n }", "public function getGroupList() {\n\t\t$thisUser = Auth::user();\n\n\t\t$groups = ProjectHandler::listProjects();\n\t\t$projects = [];\n\t\t\n\t\t$isAdmin = PermissionHandler::checkAdmin($thisUser, Permissions::ALLOW_ALL);\n\t\t\n\t\tforeach ($groups as $group) {\n\t\t\t$canView = PermissionHandler::checkProject($thisUser, $group, Permissions::PROJECT_READ);\n\t\t\t\n\t\t\t$users = 0;\n\t\t\tforeach(Roles::$PROJECT_ROLE_NAMES as $role) {\n\t\t\t\t// List userts with $role in this group -- make [] when none\n\t\t\t\t$projectRole = Sentry::findGroupByName($group.':'.$role);\n\t\t\t\t$users += sizeOf($projectRole['user_agent_ids']);\n\t\t\t}\n\t\t\t\n\t\t\t// if user is not admin, do not show the admin group\n\t\t\tif($group != 'admin') {\n\t\t\t\tarray_push($projects, [\n\t\t\t\t\t'name' => $group,\n\t\t\t\t\t'canview' => $canView,\n\t\t\t\t\t'users' => $users\n\t\t\t\t]);\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\treturn View::make('projects.list')\n\t\t\t->with('projects', $projects)\n\t\t\t->with('isAdmin', $isAdmin);\n\t}", "public function getAllProjects()\n {\n $sql = \"SELECT pid, price, first_name, last_name \n FROM project natural join purchase_project \n natural join user\";\n $query = $this->db->prepare($sql);\n $query->execute();\n\n // fetchAll() is the PDO method that gets all result rows, here in object-style because we defined this in\n // core/controller.php! If you prefer to get an associative array as the result, then do\n // $query->fetchAll(PDO::FETCH_ASSOC); or change core/controller.php's PDO options to\n // $options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC ...\n return $query->fetchAll();\n }", "public function index()\n {\n $projects = DB::table('projects')->get();\n //$projects = Project::all();\n return view('project.index', ['projects' => $projects]);\n //dd($projects);\n }", "public function Query() {\n return FactoryService::ProjectService()->GetList()->ToList();\n }", "public function index() {\n $sortby = Input::get('sortby');\n $order = Input::get('order');\n// Retrieve all projects from the database\n\n if ($sortby && $order) {\n $projectList = $this->projectRepo->orderBy($sortby, $order);\n } else {\n $projectList = $this->projectRepo->getAllProjects();\n }\n\n// Return that to the list view\n return View::make('project.index', compact('sortby', 'order'))->with('projects', $projectList);\n }", "public function index()\n {\n $projects = $this->projects->paginate(10);\n return view('backend.projects.index', compact('projects', 'getThemes'));\n }", "public function index()\n {\n $projects=Project::paginate(50);\n return view('project.index')->with(compact('projects'));\n }", "public function index()\n {\n $projects = Project::getAll();\n require_once('views/projects/index.php');\n }", "public function index()\n {\n return Project::orderBy('created_at', 'desc')->limit(6)->get();\n }", "public function index()\n {\n $projects = Project::all();\n return view('project.index', ['projects' => $projects]);\n }", "public function index()\n {\n $title = 'Index - project';\n $projects = Project::paginate(6);\n return view('project.index',compact('projects','title'));\n }", "public function index()\n {\n $projects = Project::all();\n $formats = Format::all();\n $format_terms = FormatTerm::all();\n $archetypes = Archetype::all();\n\n return view('projects.index', ['projects' => $projects, 'formats' => $formats, 'archetypes' => $archetypes,\n 'format_terms' => $format_terms]);\n }", "public function index()\n {\n $projects = Project::where('user_id', '=', Auth::user()->id)->get()->toArray();\n\n Log::info('Found Projects : ' . print_r($projects, true));\n return Response::string(\n ['data' => $projects]\n );\n }", "public function projects (){\n\t\t$projects = Project::orderBy('created_at', 'desc')->get();\n\t\t$status = $this->finished();\n\t\t//return view('project.projects', compact('projects','status'));\n return response()->json($projects);\n\t}", "function getProjectList()\n\t{\n\t\t//Update Project List\n\t\t$this->Project_List = null;\n\t\t$assigned_projects_rows = returnRowsDeveloperAssignments($this->getUsername(), 'Project');\n\t\tforeach($assigned_projects_rows as $assigned_project)\n\t\t\t$this->Project_List[] = new Projects( $assigned_project['ClientProjectTask'] );\n\t\treturn $this->Project_List;\n\t}", "public function index()\n {\n $this->authorize('projects.index');\n $projects = $this->projectRepository->getInCompany($this->user->company_id);\n\n return view('projects.index', compact('projects'));\n }", "public function all()\n {\n\n $limit = Input::get('limit')?:4;\n $projects = Project::whereIn('status',array('open_for_funding','unfunded_open'))->paginate($limit);\n return $this->respond([\n\n 'data'=>$projects->toArray(),\n\n ]);\n }", "public function getProjects()\n\t{\n\t\t$query = $this->db->getQuery(true);\n\t\t$query->select('id, name, alias')\n\t\t\t->from('#__monitor_projects');\n\n\t\t$this->countItems($query);\n\n\t\tif ($this->list !== null && isset($this->list['fullordering']) && in_array($this->list['fullordering'], $this->orderOptions))\n\t\t{\n\t\t\t$query->order($this->list['fullordering']);\n\t\t}\n\n\t\t$this->db->setQuery($query);\n\n\t\treturn $this->db->loadObjectList();\n\t}", "public function callProjectList(array $params = array())\n {\n return $this->call('projekt/list', $params);\n }", "public function getListOfProjectsAll()\n {\n $projectList = $this->project\n ->select('projects.id','customers.name AS customer_name','projects.project_name','projects.otl_project_code','projects.project_type',\n 'projects.activity_type','projects.project_status','projects.meta_activity','projects.region',\n 'projects.country','projects.technology','projects.description','projects.estimated_start_date','projects.estimated_end_date',\n 'projects.comments','projects.LoE_onshore','projects.LoE_nearshore',\n 'projects.LoE_offshore', 'projects.LoE_contractor', 'projects.gold_order_number', 'projects.product_code', 'projects.revenue', 'projects.win_ratio');\n $projectList->leftjoin('customers', 'projects.customer_id', '=', 'customers.id');\n\n $data = Datatables::of($projectList)->make(true);\n\n return $data;\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => ProjectDomain::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index()\n {\n $projets = Projet::all();\n \n return view('projet.all',compact('projets'));\n }", "public function index()\n { \n $projects=project::all();\n return view('projects/index',compact('projects'));\n }", "public function index()\n {\n $projects = Project::where('username',auth()->user()->username)->get();\n $anggota = AnggotaProject::All();\n $ang = AnggotaProject::where('username',auth()->user()->username)->get();\n $pegawais = User::where('status','Pegawai')->get();\n return view('pegawai/project-list',compact('projects','pegawais','anggota','ang'))->with('i');\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $projectes = $em->getRepository('GestorDeProjectesBundle:Projecte')->findAll();\n\n return $this->render('GestorDeProjectesBundle:projecte:index.html.twig', array(\n 'projectes' => $projectes,\n ));\n }" ]
[ "0.8293205", "0.8117821", "0.8059335", "0.802318", "0.7975119", "0.7975119", "0.7949665", "0.78485227", "0.78437656", "0.77988726", "0.7795526", "0.7727843", "0.7670076", "0.76566744", "0.76439637", "0.76098233", "0.7597514", "0.7591218", "0.7580886", "0.7527415", "0.75109035", "0.75106156", "0.748675", "0.747812", "0.7466015", "0.746312", "0.7453127", "0.7450454", "0.7448708", "0.74262697", "0.7407922", "0.7392408", "0.73881894", "0.73753357", "0.73526233", "0.73526233", "0.7338062", "0.7336387", "0.73320895", "0.73254704", "0.73224753", "0.73147404", "0.73027354", "0.72991806", "0.7294256", "0.72873616", "0.72835535", "0.728349", "0.7278089", "0.7276392", "0.7275139", "0.72730476", "0.72676694", "0.72658557", "0.72609323", "0.7253493", "0.7253083", "0.7251145", "0.7249373", "0.72454125", "0.72410405", "0.7240953", "0.72338873", "0.7232733", "0.7229238", "0.7227068", "0.72246903", "0.7221728", "0.72163945", "0.7208984", "0.72084534", "0.7201372", "0.7198903", "0.7196839", "0.71876657", "0.71802294", "0.7180089", "0.71736974", "0.71731496", "0.7171433", "0.7165631", "0.715677", "0.7154487", "0.71230555", "0.7122613", "0.7122232", "0.7119359", "0.7098813", "0.70899475", "0.70802164", "0.70781726", "0.70541376", "0.70427823", "0.70264226", "0.70180297", "0.701193", "0.70006675", "0.6967403", "0.69646525", "0.6941899", "0.69252837" ]
0.0
-1
Run the database seeds.
public function run() { $this->name = 'Liberia'; $this->official_name = 'Republic of Liberia'; $this->iso_alpha_2 = 'LR'; $this->iso_alpha_3 = 'LBR'; $this->iso_numeric = '430'; $this->international_phone = '231'; $this->languages = ['en']; $this->tld = ['.lr']; $this->wmo = 'LI'; $this->geoname_id = '2275384'; $this->emoji = [ 'img' => '🇱🇷', 'uCode' => 'U+1F1F1 U+1F1F7', ]; $this->color = [ 'hex' => [ '#ff0000', '#ffffff', '#00008b', ], 'rgb' => [ '255,0,0', '255,255,255', '0,0,139', ], ]; $this->coordinates = [ 'latitude' => [ 'classic' => '6 30 N', 'desc' => '6.411512851715088', ], 'longitude' => [ 'classic' => '9 30 W', 'desc' => '-9.323492050170898', ], ]; $this->coordinates_limit = [ 'latitude' => [ 'max' => '9.5', 'min' => '4.328333', ], 'longitude' => [ 'max' => '-4', 'min' => '-11.472222', ], ]; $this->geographical = json_decode($this->geographical(), true); Builder::country($this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => 'simpleadressemail@mail.com', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"admin@admin.com\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => 'admin@petstore.com',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => 'prosales@researchmobile.co',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => 'movil@researchmobile.co',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'test@yandex.ru'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => 'admin@yahoo.com',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => 'programmerlemar@gmail.com',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => 'qwerty@gmail.com',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> 'admin@example.com',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => 'admin@admin.com',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => 'ignacio@dh.com',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = your.email@domain.com\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => 'admin@gmail.com',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'papesambandour@hotmail.com',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => 'sovon.kucse@gmail.com']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => 'eddyjaair@gmail.com']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => 'barbozagonzalesjose@gmail.com',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => 'empresa02@gmail.com',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => 'carlos@email.com',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => 'pedrito@juase.com',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.80140394", "0.7980541", "0.79775697", "0.79547316", "0.79514134", "0.79500794", "0.79444957", "0.794259", "0.79382807", "0.7937482", "0.7934376", "0.7892533", "0.7881253", "0.78794724", "0.7879101", "0.7875628", "0.787215", "0.7870168", "0.78515327", "0.7850979", "0.7841958", "0.7834691", "0.78279406", "0.78198457", "0.78093415", "0.78030044", "0.7802443", "0.7801398", "0.7798975", "0.77957946", "0.77905124", "0.7789201", "0.77866685", "0.77786297", "0.7777914", "0.7764813", "0.7762958", "0.7762118", "0.77620417", "0.77614594", "0.7760672", "0.77599436", "0.77577287", "0.7753593", "0.7749794", "0.7749715", "0.77473587", "0.77301705", "0.77296484", "0.77280766", "0.77165425", "0.77143145", "0.7714117", "0.77136046", "0.7712814", "0.7712705", "0.7711485", "0.7711305", "0.77110684", "0.77102643", "0.7705902", "0.77048075", "0.77041686", "0.77038115", "0.7703085", "0.7702133", "0.77009964", "0.7698874", "0.769864", "0.76973957", "0.7696364", "0.7694127", "0.7692633", "0.76910555", "0.7690765", "0.7688756", "0.76879585", "0.76873547", "0.76871854", "0.7685407", "0.7683626", "0.76794547", "0.7678361", "0.7678022", "0.7676884", "0.7672536", "0.76717764", "0.7669418", "0.76692647", "0.76690245", "0.76667875", "0.76628584", "0.76624", "0.76618767", "0.7660002", "0.76567614", "0.76542175", "0.76541024", "0.7652618", "0.76524657", "0.7651689" ]
0.0
-1
Dump and die function
function viewdump($data) { if (PLATFORM === 'development') { echo '<pre>'; echo var_dump($data); echo '</pre>'; exit(); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dump($die = false);", "abstract function doDump();", "function dump_die ($data){\n echo \"<pre>\";\n var_dump($data);\n echo \"</pre>\";\n die();\n}", "function dumpAndDie ($value): void {\n\tvar_dump($value);\n\tdie();\n}", "public function dump() {}", "public function dump();", "public function dump();", "function stage_dump($dump)\n{\n if (is_array($dump) || is_object($dump)) {\n $message = '<pre>' . print_r($dump) . '</pre>';\n } else {\n $message = $dump;\n }\n\n wp_die($message);\n}", "function dumpX($var)\n{\n dump($var);\n exit;\n}", "function dd ($par) {\n\tdie($par);\n}", "function dd(...$args)\n {\n foreach ($args as $x) {\n (new Dumper)->dump($x);\n }\n\n die(1);\n }", "function dd(...$args)\n {\n Helpers::die(Kint::dump(...$args));\n }", "function toDie($msg) {\n $data = array(\"error\" => $msg);\n print_result($data);\n die();\n}", "function dd()\n {\n if (! Sage::enabled()) {\n return '';\n }\n\n $_ = func_get_args();\n call_user_func_array(array('Sage', 'dump'), $_);\n die;\n }", "function dump()\n {\n $arguments = func_get_args();\n require (\"dump.php\");\n exit;\n }", "function dd($data) {\r\n dump($data);\r\n die();\r\n}", "function err_dump( $obj )\n{\n ob_start();\n var_dump($obj);\n $tmp = ob_get_contents();\n ob_end_clean();\n error_log( $tmp );\n}", "function dd($data, $data_name='$data') {\n $tmp_var = debug_backtrace(1);\n $caller = array_shift($tmp_var);\n\n error_reporting(-1);\n header('Content-Type: text/html; charset=utf-8');\n\n echo '<code>File: ' . $caller['file'] . ' / Line: ' . $caller['line'] . '</code>';\n echo '<pre>';\n echo $data_name . '=', PHP_EOL;\n VarDumper::dump($data, 10, true);\n echo '</pre>';\n\n die();\n}", "public function diagnose() {}", "function ktd()\n {\n Helpers::die(Kint::trace());\n }", "function dd($data)\n{\n echo \"<pre>\";\n var_dump($data);\n echo \"</pre>\";\n die();\n}", "function printCallstackAndDie() {\n echo \"Fatal Error. Please contact your system administrator.<br/>\";\n\n $callers = debug_backtrace();\n\n echo \"Dump Trace<br/>\";\n foreach ($callers as $caller) {\n echo \"Function: \" . $caller['function'] . \" Line: \" \n . $caller['line'] . \"<br/>\";\n }\n die();\n}", "function dumper($error) {\n\n echo '<pre>';\n echo '<br />' . print_r($error) . '</pre><br />';\n echo '<hr>';\n}", "function ddd()\n {\n if (! Sage::enabled()) {\n return '';\n }\n\n $_ = func_get_args();\n call_user_func_array(array('Sage', 'dump'), $_);\n die;\n }", "function dump($content)\n {\n die(var_dump($content));\n exit;\n }", "public function die(): void;", "function dumper($error)\n{\n $d = debug_backtrace();\n echo '<pre>';\n echo '<br />';\n echo $d[0]['file'] . ' on line ' . $d[0]['line'];\n echo '<br />';\n echo print_r($error, TRUE);\n //echo '<hr>';\n echo '</pre>';\n}", "function dd($output)\n {\n var_dump($output);\n die();\n }", "function dump() {\r\n\t\treturn $this->_send(array('cmd'=>'dump'));\r\n\t}", "function dd($var): void\n {\n call_user_func('dump', $var);\n die(1);\n }", "public function dieAction()\n {\n die(var_dump($this->getParam('hihi')));\n }", "static public function dump(){\n \n $args = func_get_args();\n if( empty($args) ) return;\n \n $console = new \\Altumo\\Utils\\Console();\n call_user_func_array( array($console, 'writeDump'), $args );\n unset($console);\n \n }", "public function recover();", "function dd($obj){\n echo '<pre>';\n print_r($obj);\n echo '</pre>';\n die();\n}", "public function dump()\n {\n var_dump($this); exit;\n }", "final public function dump($exit=false, array $options=[])\n {\n $default_options = [\n 'callstack_depth' => 2,\n 'mode' => 'string',\n // 'show_instance' => false,\n ];\n foreach ($default_options as $default_option => &$default_value) {\n if ( ! isset($options[ $default_option ])) {\n $options[ $default_option ] = $default_value;\n }\n }\n extract($options);\n\n $bt = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $callstack_depth);\n $caller = $bt[ $callstack_depth - 2 ];\n\n echo \"\\n\" . $caller['file'] . ':' . $caller['line'] . \"\\n\";\n if ('string' == $mode) {\n if ( ! isset($options['indent_unit'])) {\n $options['indent_unit'] = \" \";\n }\n\n echo($this->toString($options));\n }\n elseif ('dump' == $mode) {\n if ($xdebug_enabled = ini_get('xdebug.overload_var_dump')) {\n ini_set('xdebug.overload_var_dump', 0);\n }\n\n var_dump($this->toArray($options));\n\n if ($xdebug_enabled) {\n ini_set('xdebug.overload_var_dump', 1);\n }\n }\n elseif ('xdebug' == $mode) {\n if ( ! function_exists('xdebug_is_enabled')) {\n throw new \\RuntimeException(\"Xdebug is not installed\");\n }\n if ( ! xdebug_is_enabled()) {\n throw new \\RuntimeException(\"Xdebug is disabled\");\n }\n\n if ($xdebug_enabled = ini_get('xdebug.overload_var_dump')) {\n ini_set('xdebug.overload_var_dump', 1);\n }\n\n var_dump($this->toArray($options));\n\n if ($xdebug_enabled) {\n ini_set('xdebug.overload_var_dump', 0);\n }\n }\n elseif ('export' == $mode) {\n var_export($this->toArray($options));\n }\n else {\n throw new \\InvalidArgumentException(\n \"'mode' option must belong to ['string', 'export', 'dump'] \"\n .\"instead of \" . var_export($mode, true)\n );\n }\n echo \"\\n\\n\";\n\n if ($exit) {\n exit;\n }\n\n return $this;\n }", "public static function dump()\n {\n self::$arrBacktrace = array_shift(debug_backtrace());\n self::$strFunc = 'var_dump';\n $strDisplay = self::write();\n\n if (self::$isPretty && self::$end) {\n exit(self::displayHtmlBody());\n } elseif (self::$isPretty) {\n exit(self::displayHtmlBody());\n } elseif (self::$end) {\n exit($strDisplay);\n } else {\n echo $strDisplay;\n }\n\n return $strDisplay;\n }", "function dump($mixed = null)\n{\n echo '<pre>';\n var_dump($mixed);\n echo '</pre>';\n}", "public function writeDump(){\n \n $args = func_get_args();\n if( empty($args) ) return;\n ob_start();\n foreach( $args as $arg ){\n var_dump($arg);\n }\n $output = ob_get_contents();\n ob_end_clean();\n \n $this->write($output);\n \n }", "function dd($var) {\n echo '<pre>';\n var_dump($var);\n echo '</pre>';\n exit();\n}", "function died($error) {\n \n echo \"Oeps, de volgende dingen zijn er fout gegaan!<br />\";\n echo $error.\"<br /><br />\";\n die(); \n }", "function dd($parsed)\n{\n\t echo '<pre>';\n\t var_dump($parsed);\n\t echo '</pre>';\n die;\n}", "function pp( $data, $die = 0, $dump = 0 ) {\n\t\techo '<pre>';\n\t\tif ( 1 === $dump ) {\n\t\t\tvar_dump( $data );\n\t\t} else {\n\t\t\tprint_r( $data );\n\t\t}\n\t\t\techo '</pre>';\n\t\tif ( 1 === $die ) {\n\t\t\twp_die(\n\t\t\t\t'', '', [\n\t\t\t\t\t'response' => 200,\n\t\t\t\t]\n\t\t\t);\n\t\t}\n\t}", "function bye($msg=null){\n print $msg . \"\\n\";\n exit;\n}", "function dd($value)\n{\n var_dump($value);\n die();\n}", "protected function dumpPage() {\n\t\tif ($this->_debugCatcher !== null) {\n\t\t\t$this->_debugCatcher->flush();\n\t\t}\n\n\t\t$this->_dumped = true;\n\t\tparent::dumpPage();\n\t}", "public static function ddump($variable) {\r\n\t\tif(Debug::enabled()) {\r\n\t\t\tif(func_num_args() >= 1) {\r\n\t\t\t\techo \"<pre>\";\r\n\t\t\t\t$args = func_get_args();\r\n\t\t\t\t\r\n\t\t\t\t$count = count($args);\r\n\t\t\t\tfor($x = 0; $x < $count; $x++) {\r\n\t\t\t\t\tvar_dump($args[$x]);\r\n\t\t\t\t}\r\n\t\t\t\techo Debug::getBackTrace('', 1, 'fdumped in');\r\n\t\t\t\techo \"\\n\\n\";\r\n\t\t\t\techo \"</pre>\"; \r\n\t\t\t}\r\n\t\t}\r\n\t\texit(-1);\r\n\t}", "function dump($arg){\r\n echo \"<pre>\";\r\n print_r($arg);\r\n echo \"</pre>\";\r\n}", "function recover() {\n\t}", "public function mg_dump($arg){\n\t\t$debug = '<br /><br />Debug Output:<br /><pre>';\n\t\t$debug.= print_r($arg,true);\n\t\t$debug .= '</pre><br /><br />';\n\t\treturn $debug;\n\t}", "function dd($value,$die=null) {\n echo '<pre>';\n print_r($value);\n echo '</pre>';\n \n if (!is_null($die)) {\n exit();\n }\n}", "function dd($vars) {\n\tvar_dump($vars);\n\tdie();\n}", "function dump($var, $name='') {\r\n}", "function dump($var)\n{\n var_dump($var);\n return $var;\n}", "function xdd(...$vars)\n {\n screens()->runtime()->addNl(\n (new VarDump(...$vars))\n ->toString()\n )->emit();\n die(0);\n }", "function dump(array $options = array()) {\n\n }", "private function error_report($msg){\n die($msg);\n }", "public function dump() {\n @var_dump($this->get, $this->post, $this->server, $this->files);\n }", "function dd()\n{\n $output = new ConsoleOutput;\n\n foreach (func_get_args() as $value) {\n $output->write($value);\n }\n\n die;\n}", "function dd( $var ){\n echo \"<prev>\";\n die(print_r($var));//Finaliza la ejecucion\n}", "function app_debug($value, bool $die = null)\n{\n echo \"<pre>\";\n print_r($value);\n echo \"</pre>\";\n\n if ($die === true) die('<strong> End of debug </strong>');\n\n}", "function dd()\r\n{\r\n\t_r(func_get_args());\r\n\tdie;\r\n}", "function var_dump_ret($mixed = null) {\r\n\t ob_start();\r\n\t var_dump($mixed);\r\n\t $content = ob_get_contents();\r\n\t ob_end_clean();\r\n\t return $content;\r\n\t}", "public function dump($variable) {}", "function dd( $param ) {\r\n var_dump( $param );\r\n die();\r\n}", "function grab_dump($var)\n{\n ob_start();\n var_dump($var);\n return ob_get_clean();\n}", "function avoca_debug($var, $is_die = false)\n{\n echo '<pre>';\n print_r($var);\n echo '</pre>';\n\n if ($is_die) {\n die();\n }\n}", "function defail($de=0)\n {\n ob_start(); $tn=dbug::trap(); dbug::trap('hush');\n if($de){error_reporting(0);};\n return $tn;\n }", "function dd($arg) {\n die(var_dump($arg));\n }", "function die_log($a) {\n error_log($a);\n echo $a;\n exit;\n}", "function dump(mixed ...$data): void\n {\n new Libraries\\Dump(...$data);\n }", "function dbg ($x)\r\n{\r\n print_r ($x);\r\n exit;\r\n}", "private function dbug() {\n if (!isset($doc_root)) {\n $doc_root = str_replace('\\\\', '/', $_SERVER['DOCUMENT_ROOT']);\n }\n $back = debug_backtrace();\n // you may want not to htmlspecialchars here\n $line = htmlspecialchars($back[0]['line']);\n $file = htmlspecialchars(str_replace(array('\\\\', $doc_root), array('/', ''), $back[0]['file']));\n\n $k = ($back[1]['class'] == 'SQL') ? 3 : 1;\n\n $class = !empty($back[$k]['class']) ? htmlspecialchars($back[$k]['class']) . '::' : '';\n $function = !empty($back[$k]['function']) ? htmlspecialchars($back[$k]['function']) . '() ' : '';\n $args = (count($back[0]['args'] > 0)) ? $back[0]['args'] : $back[0]['object'];\n $args = (count($args) == 1 && $args[0] != '') ? $args[0] : $args;\n\n print '<div style=\"background-color:#eee; width:100%; font-size:11px; font-family: Courier, monospace;\" class=\"myDebug\"><div style=\" font-size:12px; padding:3px; background-color:#ccc\">';\n print \"<b>$class$function =&gt;$file #$line</b></div>\";\n print '<div style=\"padding:5px;\">';\n if (is_array($args) || is_object($args)) {\n print '<pre>';\n print_r($args);\n print '</pre></div>';\n } else {\n print $args . '</div>';\n }\n print '</div>';\n }", "function dump($var)\n{\n echo '<br /><pre>';\n var_dump($var);\n echo'</pre><hr />';\n}", "public static function out() {\r\n\t\t\tdisplayCallerCode(1);\r\n\t\t\t$aData = func_get_args();\r\n\t\t\tvar_dump_list($aData);\r\n\t\t\tdie();\r\n\t\t}", "private function dump($data){\n var_dump($data);\n }", "public static function dump()\n\t{\n\t\techo nl2br(print_r(self::$data));\n\t}", "function sd(...$args)\n {\n Helpers::die(Helpers::s(...$args));\n }", "public function dump(): string\n\t{\n\t\treturn \"Null()\";\n\t}", "function log_dump($var, $header = false, $return = true){\n\t$ret = '';\n\tif ($header) $ret .= $header .':'; //As is and only explicitly given, without any magic\n\t$ret .= dump_utils::transformCorrect_print_r(print_r($var, true)).\"\\n\";\n\tif ($return) return $ret;\n\telse echo $ret;\n}", "public function show()\n {\n echo 1;die;\n }", "function _dd($var)\r\n{\r\n $caller = array_shift(debug_backtrace(1));\r\n d($var,$caller);\r\n die();\r\n}", "function dd($text)\n{\n\tif(is_array($text) || is_object($text)) {\n\t\tvar_dump($text);\n\t\tdie();\n\t}\n\telse {\n\t\tdie($text);\n\t}\n}", "function dd($params = [], $die = true) {\n\n echo \"<pre>\";\n print_r($params);\n echo \"</pre>\";\n\n if ($die) die();\n\n}", "function drush_drushutils_array_dump() {\n $fn = array_pop(drush_get_arguments());\n drush_print(dt('Function: @function', array('@function' => $fn)));\n\n $info = call_user_func($fn);\n if ($info) {\n if (is_array($info)) {\n $lines = _drush_utils_array_fold($info);\n array_walk($lines, function(&$item, $key) {\n drush_print(\"$key = $item\");\n });\n }\n else {\n drush_set_error('ERROR', dt('The return value from @function() was not an array (@type found).', array(\n '@function' => $fn,\n '@type' => gettype($info),\n )));\n }\n }\n else {\n drush_set_error('ERROR', dt('An error occurred when calling @function() or @function() returned NULL.', array(\n '@function' => $fn,\n )));\n }\n}", "function base_deployVardump($vartodump,$filename){\n ob_flush();\n ob_start();\n var_dump($vartodump);\n file_put_contents($filename, ob_get_flush());\n ob_end_flush();\n}", "public function prepareDump(): bool;", "public static function dumper($ex)\n {\n print('<pre>');\n var_dump($ex);\n print('</pre>');\n exit();\n }", "public static function dump()\n {\n array_map(\n function ($x) {\n (new Dumper)->dump($x);\n },\n func_get_args()\n );\n }", "function pr( $var, $die = true ) {\n\techo '<pre>';\n\tprint_r( $var );\n\techo '</pre>';\n\tif ( $die ) {\n\t\tdie();\n\t}\n}", "public static function var_dumpp()\n {\n echo \"<pre>\";\n if(func_num_args()>0)\n foreach(func_get_args() as $argv)\n {\n var_dump($argv);\n }\n echo \"</pre>\";\n\n }", "function debug($var, $die = false) {\n\techo \"<pre>\" . print_r($var, true) . \"</pre>\";\n\tif ($die) {\n\t\tdie;\n\t}\n}", "function __destruct()\n {\n echo \"Die \". $this->name.\"\\n\";\n }", "function saged()\n {\n if (! Sage::enabled()) {\n return '';\n }\n\n $_ = func_get_args();\n call_user_func_array(array('Sage', 'dump'), $_);\n die;\n }", "public function debug();", "public function debug();", "function dd($arg = \"\"){\n echo '<pre>';\n var_dump($arg);\n echo '</pre>';\n die();\n }", "function dd(){\n $args = func_get_args();\n ob_start();\n echo '<pre>';\n foreach($args as $vars){\n if(is_bool($vars) || is_null($vars))\n var_dump($vars);\n else\n echo htmlspecialchars(print_r($vars, true), ENT_QUOTES);\n echo PHP_EOL;\n }\n echo '</pre>';\n \n $ctx = ob_get_contents();\n ob_end_clean();\n \n echo $ctx;\n die;\n}", "public function dump(DumperContextInterface $context);", "function die_mysql($mes,$query=NULL) {\n global $trace;\n if ($trace)\n if ($query)\n $mes .= ' ['.htmlspecialchars($query).']';\n $mes .= ': '.htmlspecialchars(mysql_error());\n die($mes);\n}", "public function __destruct() {\n\t\tvar_dump(\"DESTRUIR\");\n\t}" ]
[ "0.79750234", "0.7531294", "0.75060105", "0.73076326", "0.69344354", "0.6788386", "0.6788386", "0.6749551", "0.6651697", "0.6525088", "0.64781", "0.6474842", "0.6422564", "0.6396751", "0.6370888", "0.6286499", "0.6253153", "0.6247015", "0.6235126", "0.622372", "0.6188854", "0.6144312", "0.61155814", "0.6112787", "0.6097904", "0.6073338", "0.6020223", "0.6005317", "0.5994548", "0.5981223", "0.59761214", "0.59672034", "0.5942853", "0.59291786", "0.5900869", "0.5887002", "0.5882944", "0.5879112", "0.58717054", "0.5855327", "0.5851142", "0.58479184", "0.579696", "0.5789872", "0.5785757", "0.57783943", "0.5776046", "0.57556635", "0.5704373", "0.5696829", "0.56784827", "0.56721115", "0.565887", "0.56576973", "0.56562483", "0.565531", "0.56540847", "0.56535834", "0.56514853", "0.5644169", "0.56283236", "0.56176543", "0.56154525", "0.56150055", "0.5612322", "0.5606293", "0.5605407", "0.5605145", "0.5603694", "0.56030434", "0.56022114", "0.5587404", "0.5586895", "0.55861413", "0.5585954", "0.557833", "0.55776155", "0.5560448", "0.5554152", "0.5547002", "0.5541196", "0.5537746", "0.5532746", "0.5523919", "0.5506485", "0.55042017", "0.5494061", "0.54937565", "0.54755515", "0.54732263", "0.5464749", "0.5464152", "0.54595774", "0.54561543", "0.5454388", "0.5454388", "0.544714", "0.5445688", "0.5443267", "0.5438937", "0.54315937" ]
0.0
-1
Get a customer payment plan from the Checkout.com server. How to use this: $customer_payment_plan = new CustomerPaymentPlan; $customer_payment_plan>id = 'rp_000000000000000'; $customer_payment_plan>get(); $customer_payment_plan = new CustomerPaymentPlan; $customer_payment_plan>customerId = 'cust_000000000000000'; $customer_payment_plan>planId = 'rp_000000000000000'; $customer_payment_plan>get();
public function get() { if ($this->db_get() || $this->api_query()) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPaymentPlan()\n {\n return $this->payment_plan;\n }", "public function getPlan();", "private function get_plan()\n\t{\n\t\treturn $this->m_plan;\n\t}", "public function getBillingPlan(User $user, $id);", "public function getSubscriptionPlan() {\n $categoryId = Config::get('custom_config.WOOCOMMERCE_CATEGORY_ID');\n if (empty($categoryId)) {\n return response()->json(\n ['error' => __('woocommerce category ID not set')\n ],\n 400\n );\n }\n $data = $this->wooCommerceService->getSubscriptionPlan();\n \\Log::info(\"===== data \", ['subscription_package' => $data]);\n\n if ($data) {\n return response()->json(['data' => $data], 200);\n }\n\n return response()->json(\n ['error' => __('messages.un_processable_request')\n ],\n 400\n );\n }", "public function getPlanById()\n {\n // Arrange\n // Act\n if (! isset($this->plans)) {\n $this->getsAListOfPlans();\n }\n $plans = $this->plans;\n $plan = $plans['data'][0];\n\n $plan = Ezypay::getPlan($plan['id']);\n\n // Assert\n $this->assertNotNull($plan);\n $this->assertEquals($plan['id'], $plan['id']);\n }", "public function show($id)\n {\n Log::debug(\"SHOW PLAN IN CONTROLLER\");\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->findPlan($id);\n\n if ($result['message'] == 'Success'){\n\n return new StripePlanResource($result['plan']);\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n\n return redirect()->back();\n\n }\n\n }", "function TestPlan_get($plan_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.get', array(new xmlrpcval($plan_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function get($planIdOrKey)\n {\n $ret = $this->exec($this->uri.\"/$planIdOrKey?expand=plans\", null);\n\n $this->log->addInfo('Result='.$ret);\n\n $prj = $this->json_mapper->map(\n json_decode($ret), new Plan()\n );\n\n return $prj;\n }", "public function getPlan()\n {\n return Saas::getPlan($this->getPlanIdentifier());\n }", "public function show($id)\n {\n $plan = Plan::find($id);\n return $plan;\n }", "public function billingPlan($id)\n {\n $this->shellshock(request(), [\n 'number' => 'required|numeric',\n 'exp_month' => 'required|numeric',\n 'exp_year' => 'required|numeric',\n 'cvc' => 'required|numeric',\n ]);\n\n Stripe::setApiKey(config('turtle.billing.stripe_secret_key'));\n\n // create card token\n $token = Token::create([\n 'card' => [\n 'number' => request()->input('number'),\n 'exp_month' => request()->input('exp_month'),\n 'exp_year' => request()->input('exp_year'),\n 'cvc' => request()->input('cvc'),\n ],\n ]);\n\n // create/update customer\n if (!auth()->user()->billing_customer) {\n $customer = Customer::create([\n 'source' => $token->id,\n 'email' => auth()->user()->email,\n ]);\n }\n else {\n $customer = Customer::retrieve(auth()->user()->billing_customer);\n $customer->source = $token->id;\n $customer->save();\n }\n\n // create/update subscription\n if (!auth()->user()->billing_subscription) {\n $subscription = Subscription::create([\n 'customer' => $customer->id,\n 'items' => [['plan' => $id]],\n ]);\n }\n else {\n $subscription = Subscription::retrieve(auth()->user()->billing_subscription);\n Subscription::update($subscription->id, [\n 'items' => [[\n 'id' => $subscription->items->data[0]->id,\n 'plan' => $id,\n ]],\n ]);\n }\n\n // update user\n auth()->user()->update([\n 'billing_customer' => $customer->id,\n 'billing_subscription' => $subscription->id,\n 'billing_plan' => $id,\n 'billing_cc_last4' => $token->card->last4,\n 'billing_period_ends' => Carbon::createFromTimestamp($subscription->current_period_end),\n ]);\n\n activity('Subscribed to '.$id);\n flash('success', 'Thanks for subscribing!');\n\n return response()->json(['reload_page' => true]);\n }", "public function getBilling();", "public function show(Plan $plan)\n {\n //\n }", "public function purchased_plan()\n {\n return $this->hasOne(PurchasedPlanProxy::modelClass(), 'saas_subscription_recurring_profile_id');\n }", "private function stripePlan()\n {\n $all_plans = $this->stripeDBPlan->paginate(10);\n\n $plans = collect([]);\n\n try {\n foreach ($all_plans as $val) {\n if ($this->stripePlan->getStripePlan($val->plan_id)) {\n foreach ($this->stripeDBPlan->wherePlanId($val->plan_id)->get() as $plan) {\n $plans->push($plan);\n }\n }\n }\n } catch (ApiConnectionException $th) {\n $error_msg = $th->getMessage();\n } catch (AuthenticationException $th) {\n $error_msg = $th->getMessage();\n } catch (InvalidRequestException $th) {\n } catch (ApiErrorException $th) {\n $error_msg = $th->getError();\n }\n return view('subscription.stripePlans', [\n 'plans'=> $plans,\n ]);\n }", "public function getPaymentplans() {\n return $this->paymentPlans;\n }", "public function getPlan(): ?string\n {\n return $this->plan;\n }", "public static function get_payment_plan_search_field() {\n\n check_ajax_referer( 'sumo-pp-get-payment-plan-search-field' , 'security' ) ;\n\n wp_send_json( array (\n 'search_field' => _sumo_pp_wc_search_field( array (\n 'class' => 'wc-product-search' ,\n 'action' => '_sumo_pp_json_search_sumo_payment_plans' ,\n 'id' => isset( $_POST[ 'loop' ] ) ? \"selected_{$_POST[ 'col' ]}_payment_plan_{$_POST[ 'rowID' ]}{$_POST[ 'loop' ]}\" : \"selected_{$_POST[ 'col' ]}_payment_plan_{$_POST[ 'rowID' ]}\" ,\n 'name' => isset( $_POST[ 'loop' ] ) ? \"_sumo_pp_selected_plans[{$_POST[ 'loop' ]}][{$_POST[ 'col' ]}][{$_POST[ 'rowID' ]}]\" : \"_sumo_pp_selected_plans[{$_POST[ 'col' ]}][{$_POST[ 'rowID' ]}]\" ,\n 'type' => 'payment_plans' ,\n 'selected' => false ,\n 'multiple' => false ,\n 'placeholder' => __( 'Search for a payment plan&hellip;' , _sumo_pp()->text_domain ) ,\n ) , false ) ,\n ) ) ;\n }", "public function getPlanById(int $id){\n $this->open();\n\n $result = $this->query('SELECT * FROM '.$this->TABLE_NAME.' WHERE id=:id', array(\n new QueryParam(':id', $id, PDO::PARAM_INT)\n ));\n\n // Close connection\n $this->close();\n\n // Check if is found\n if($result->rowCount() > 0){\n\n // Check result\n while($row = $result->fetch(PDO::FETCH_OBJ)){\n $foundPlan = new Plan(\n $row->id,\n $row->name,\n $row->price,\n $row->detail,\n $row->docsUrl\n );\n\n return $foundPlan;\n }\n\n }\n else{\n // It isn't found so return false\n return false;\n }\n\n }", "public static function checkout_order_payment_plan() {\n\n check_ajax_referer( 'sumo-pp-checkout-order-payment-plan' , 'security' ) ;\n\n if ( 'yes' === $_POST[ 'enabled' ] ) {\n $payment_type = wc_clean( $_POST[ 'payment_type' ] ) ;\n $deposited_amount = null ;\n $chosen_payment_plan = null ;\n\n switch ( $payment_type ) {\n case 'pay-in-deposit':\n if ( isset( $_POST[ 'deposited_amount' ] ) ) {\n $deposited_amount = $_POST[ 'deposited_amount' ] ;\n }\n break ;\n case 'payment-plans':\n if ( isset( $_POST[ 'chosen_payment_plan' ] ) ) {\n $chosen_payment_plan = $_POST[ 'chosen_payment_plan' ] ;\n }\n break ;\n }\n\n if ( ! is_null( $deposited_amount ) || ! is_null( $chosen_payment_plan ) ) {\n WC()->session->__unset( _sumo_pp()->prefix . 'order_payment_plan_props' ) ;\n WC()->session->set( _sumo_pp()->prefix . 'order_payment_plan_props' , SUMO_PP_Order_Payment_Plan::set_order_props( $deposited_amount , $chosen_payment_plan ) ) ;\n } else {\n WC()->session->set( _sumo_pp()->prefix . 'order_payment_plan_props' , array () ) ;\n }\n } else {\n WC()->session->set( _sumo_pp()->prefix . 'order_payment_plan_props' , array () ) ;\n }\n die() ;\n }", "public function getCustomer($customer_id);", "public function index()\n {\n $user = \\Auth::guard('api')->user();\n \n // authorize\n if (!$user->can('read', new \\Acelle\\Model\\Plan())) {\n return \\Response::json(array('message' => 'Unauthorized'), 401);\n }\n \n $rows = \\Acelle\\Model\\Plan::getAll()->limit(100)\n ->get();\n \n $plans = $rows->map(function ($plan) {\n return [\n 'uid' => $plan->uid, \n 'name' => $plan->name,\n 'price' => $plan->price,\n 'currency_code' => $plan->currency->code,\n 'frequency_amount' => $plan->frequency_amount,\n 'frequency_unit' => $plan->frequency_unit,\n 'options' => $plan->getOptions(),\n 'status' => $plan->status,\n 'color' => $plan->color,\n 'quota' => $plan->quota,\n 'custom_order' => $plan->custom_order,\n 'created_at' => $plan->created_at,\n 'updated_at' => $plan->updated_at,\n ];\n });\n\n return \\Response::json($plans, 200);\n }", "public function getPaymentPlan()\n {\n if (!$this->hasPaymentPlan()) {\n return null;\n }\n\n $plan = $this->getData()->hire_purchase[0]->instl_plan[0];\n\n $return = [\n 'num_inst' => (string)$plan['num_inst'],\n 'duration' => (string)$plan->calc[0]->duration,\n 'fee_percent' => (string)$plan->calc[0]->fee_percent,\n 'fee_total' => bcdiv((string)$plan->calc[0]->fee_total, 100, 2),\n 'pre_payment' => bcdiv((string)$plan->calc[0]->pre_payment, 100, 2),\n 'total_amount' => bcdiv((string)$plan->calc[0]->total_amount, 100, 2),\n 'eff_anual' => bcdiv((string)$plan->calc[0]->eff_anual, 100, 2),\n 'nominal' => bcdiv((string)$plan->calc[0]->nominal, 100, 2),\n 'instl' => $this->getPaymentPlanInstallments()\n ];\n\n return $return;\n }", "public function show(Plan $plan)\n {\n //\n return view('plan.show',['plan'=>$plan]);\n }", "public function plan_info( $plan_id ) {\r\n\t\treturn $this->_send_request( 'plans/'.$plan_id );\r\n\t}", "public function getPlans()\n {\n try{\n \n $aPlans = $this->request('plans', 'GET');\n if( $aPlans->status ){\n throw new Exception( $aPlans->status.'-'.$aPlans->details[0]->message );\n }else{\n return $aPlans;\n }\n }catch(Exception $e){\n $this->exception($e);\n }\n }", "public function model()\n {\n return Plan::class;\n }", "public function get_plan($planId){\n try {\n $plan = Plan::get($planId, $this->_api_context);\n $returnArray['RESULT'] = 'Success';\n $returnArray['PLAN'] = $plan->toArray();\n $returnArray['RAWREQUEST']='{id:'.$planId.'}';\n $returnArray['RAWRESPONSE']=$plan->toJSON();\n return $returnArray;\n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "public function getProviderPlanAttribute()\n {\n return $this->stripe_plan;\n }", "public static function getByName($ratePlan, $options = NULL, $customClient = NULL) {\n\t\t$ratePlanID = Bf_ProductRatePlan::getIdentifier($ratePlan);\n\n\t\t$endpoint = sprintf(\"%s\",\n\t\t\trawurlencode($ratePlanID)\n\t\t\t);\n\n\t\treturn static::getCollection($endpoint, $options, $customClient);\n\t}", "public function index()\n {\n\n Log::debug(\"INDEX PLAN\");\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->listPlans();\n\n if ($result['message'] == 'Success'){\n\n $plan = $result['plans'];\n\n for ( $i = 0; $i < count($plan->data); $i++) {\n \n // determine length of stripe amount field so we can add a deciaml point and display it correctly as currency\n $amountLen = strlen($plan->data[$i]['amount_decimal']); \n $amount = substr_replace( $plan->data[$i]['amount_decimal'], '.', $amountLen - 2, 0 ); \n\n $planArray[$i]['id'] = $plan->data[$i]['id'];\n $planArray[$i]['product'] = $plan->data[$i]['product'];\n $planArray[$i]['interval'] = $plan->data[$i]['interval'];\n $planArray[$i]['amount_decimal'] = $amount;\n $planArray[$i]['nickname'] = $plan->data[$i]['nickname'];\n \n }\n\n Log::debug($planArray);\n\n $plans = json_decode(json_encode($planArray), FALSE);\n \n return view('stripe.plan.index', ['plans' => $plans ]);\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n\n return redirect()->back();\n\n }\n\n }", "public function plan()\n {\n return $this->belongsTo('App\\Models\\Flights\\FlightPlan', 'plan_id');\n }", "public function show($id)\n {\n $plan = Plan::find($id);\n $clients = $plan->clients;\n return view('plans.show' , ['plan' => $plan , 'clients' => $clients]);\n }", "public function subscribe(string $plan): Model\n {\n return MarqantPay::subscribe($this, $plan);\n }", "public function getUserPlan($userId) {\n\n $database = new Database();\n\n $query = 'SELECT * FROM user_plan WHERE User_Id=:User_Id';\n\n $result = $database->prepareQuery($query, 'User_Id', [$userId], TRUE, TRUE);\n \n return $result;\n }", "public function getPlanIdentifier()\n {\n return $this->stripe_price;\n }", "public function show($id){\n $data = UserPlan::where('user_id', '=', $id)\n ->get();\n\n return response()->json($data);\n }", "public function plan()\n {\n return $this->hasOne('App\\UserPlan');\n }", "public function plan_detail(Request $request) {\n\n $validator = Validator::make($request->all(), [\n 'plan_id' => 'required|exists:subscriptions,id', \n ], array(\n 'exists' => 'The :attribute doesn\\'t exists',\n ));\n \n if ($validator->fails()) {\n\n $error_messages = implode(',', $validator->messages()->all());\n\n $response_array = array('success' => false, 'error_messages'=>$error_messages , 'error_code' => 101);\n\n return response()->json($response_array);\n }\n \n $currency = Setting::get('currency');\n\n $model = Subscription::select('id as plan_id', 'title', 'description', 'plan', 'amount', 'status', 'popular_status', 'created_at', 'unique_id', DB::raw(\"'$currency' as currency\"))->where('id',$request->plan_id)->first();\n\n if ($model) {\n\n return response()->json(['success'=>true, 'data'=>$model]);\n\n } else {\n \n return response()->json(['success'=>false, 'message'=>tr('subscription_not_found')]);\n }\n\n }", "private function getPaymentInfo()\n {\n $baseUrl = 'http://embeddables.eastus2.cloudapp.azure.com/payment/';\n\n return json_decode(\n file_get_contents(\n $baseUrl . 'payment.json'\n )\n );\n }", "public function getCustomerPaymentDataAction()\n {\n $request = $this->Request()->getParams();\n $customerId = $request['customerId'];\n $paymentId = $request['paymentId'];\n\n /** @var \\Shopware_Components_CreateBackendOrder $createBackendOrder */\n $createBackendOrder = Shopware()->CreateBackendOrder();\n $paymentModel = $createBackendOrder->getCustomerPaymentData($customerId, $paymentId);\n /** @var Shopware\\Models\\Customer\\PaymentData $payment */\n $payment = Shopware()->Models()->toArray($paymentModel);\n\n $this->view->assign(\n [\n 'success' => true,\n 'data' => $payment\n ]\n );\n }", "public function plan()\n {\n return $this->belongsTo('App\\Plan');\n }", "public static function byPlan($plan_id)\n {\n $payload = [\n 'recurringplan' => [\n 'recurringplanid' => $plan_id,\n ],\n ];\n\n return static::all($payload);\n }", "public function getPlan( $name ) {\n\t\t\treturn $this->_tablePlans->fetchRow( array (\n\t\t\t\t'name = ?' => $name\n\t\t\t) );\n\t\t}", "function TestCase_get_plans($case_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.get_plans', array(new xmlrpcval($case_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function plan() {\n return $this->belongsTo('Models\\Plan');\n }", "public function getPlanById($id)\n {\n try {\n return $this->plan->find($id);\n } catch (\\Exception $e) {\n self::logErr($e->getMessage());\n return false;\n }\n }", "public function plans() {\n return new Plan($this);\n }", "public function getCustomer();", "public function getCustomerTest(){\n $this->load->helper('ExactOnline/vendor/autoload');\n $this->load->model('Exactonline_model');\n $this->load->model('Projects_model');\n $this->load->model('Shopify_exact_model');\n $this->load->library('Shopify_restapi');\n \n $projectId = 38;\n $this->Exactonline_model->setData(\n array(\n 'projectId' => $projectId,\n 'redirectUrl' => $this->Projects_model->getValue('exactonline_redirect_url', $projectId),\n 'clientId' => $this->Projects_model->getValue('exactonline_client_id', $projectId),\n 'clientSecret' => $this->Projects_model->getValue('exactonline_secret_key', $projectId),\n )\n );\n\n $offset = $this->Projects_model->getValue('exactonline_customers_offset', $projectId) ? $this->Projects_model->getValue('exactonline_customers_offset', $projectId) : NULL;\n $amount = $this->Projects_model->getValue('customers_amount', $projectId) ? $this->Projects_model->getValue('customers_amount', $projectId) : 1000;\n $customerId = isset($_GET['customerId'])?$_GET['customerId']:'';\n\n $connection = $this->Exactonline_model->makeConnection($projectId);\n /*echo \"<pre>\";\n print_r($connection);\n exit();*/\n if ($connection) {\n $customers = $this->Shopify_exact_model->getExactCustomersTest($connection, $customerId, NULL, $amount);\n echo \"<pre>\";\n print_r($customers);\n exit();\n }\n }", "private function getPayment() {\r\n\r\n\t\t\t$refreshed_token = new Token($this->id, $this->secret, null);\r\n\r\n\t\t\t// Get bill id from URI\r\n\t\t\t$sections = explode(\"/\", $_SERVER['REQUEST_URI']);\r\n\t\t\t$bill_id = $sections[1];\r\n\r\n\t\t\t$payments = $this->user->getPayments($bill_id);\r\n\r\n\t\t\tif($payments) {\r\n\r\n\t\t\t\techo json_encode([\r\n\t\t\t\t\t'code' => 200,\r\n\t\t\t\t\t'message' => 'OK',\r\n\t\t\t\t\t'payments' => $payments,\r\n\t\t\t\t\t'token' => $refreshed_token->getTokenString()\r\n\t\t\t\t]);\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\techo json_encode([\r\n\t\t\t\t\t'code' => 404,\r\n\t\t\t\t\t'message' => 'Not found',\r\n\t\t\t\t\t'payments' => '',\r\n\t\t\t\t\t'token' => $refreshed_token->getTokenString()\r\n\t\t\t\t]);\r\n\r\n\t\t\t}\r\n\r\n\t\t}", "public function show($id)\n {\n $plan = App\\Plan::findOrFail($id);\n //carpeta plan, dentro show.blade.php\n //return view('plan.show', compact('plan'));\n return $plan;\n }", "public function getAgencyplan(){\n $data = Plan::where('user_type','agency')->get();\n return response()->json($data);\n }", "public function plans() {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Verify if account is confirmed\n $this->_check_unconfirmed_account();\n \n if ( $this->session->userdata( 'member' ) ) {\n show_404();\n }\n \n // Get all plans\n $get_plans = $this->plans->get_all_plans();\n \n // Get user plan\n $user_plan = $this->plans->get_user_plan($this->user_id);\n \n // Check if user plan expires soon\n $check_plan = $this->plans->check_if_plan_ended($this->user_id);\n \n $expires_soon = 0;\n \n if ( $check_plan ) {\n \n if ( $check_plan < time() + 432000 ) {\n \n $expires_soon = 1;\n \n }\n \n }\n \n $upgrade = '';\n \n if ( $this->session->flashdata('upgrade') ) {\n \n $upgrade = $this->session->flashdata('upgrade');\n \n }\n \n // Load view/user/plans.php file\n $this->body = 'user/plans';\n $this->content = ['plans' => $get_plans, 'user_plan' => $user_plan, 'expires_soon' => $expires_soon, 'upgrade' => $upgrade];\n $this->user_layout();\n \n }", "public function getBtcPayClient();", "public function index()\n {\n $data = Plan::latest()->paginate(10);\n $response = [\n 'pagination' => [\n 'total' => $data->total(),\n 'per_page' => $data->perPage(),\n 'current_page' => $data->currentPage(),\n 'last_page' => $data->lastPage(),\n 'from' => $data->firstItem(),\n 'to' => $data->lastItem()\n ],\n 'data' => $data\n ];\n return response()->json($response);\n }", "public function GetPlanDetails($planID) {\n\t\t$planID = mysqli_real_escape_string($this->db, $planID);\n\t\tif ($this->CheckPlanExist($planID) == '1') {\n\t\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_premium_plans WHERE plan_id = '$planID'\") or die(mysqli_error($this->db));\n\t\t\t$data = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\t\treturn $data;\n\t\t} else {return false;}\n\t}", "public function getBillingPlans(User $user, StandardProduct $product);", "function GetUserplan()\n\t{\t\n\t\t\t$userid=$this->input->post('userID');\n\t\t\t$propertyID=$this->input->post('PropertyID');\n\t\t\tif(!empty($userid))\n\t\t\t{\n\t\t\t\t\t$userplan=$this->AddProperty_model->GetUserplan($this->input->post('userID'));\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($userplan)){\n\t\t\t\t\t\techo\"<option value=''>Select User</option>\";\n\t\t\t\t\t\tforeach($userplan as $userplans){\n\t\t\t\t\t\t\t?><option value=\"<?=$userplans->planID?>\" <?php if(!empty($propertyID)){ $PlaneDetail=$this->AddProperty_model->Getotherdata('rp_dbho_plan_mapping',array('objectID'=>$propertyID,'objectType'=>'property')); if(!empty($PlaneDetail[0]->planID)){if($PlaneDetail[0]->planID==$userplans->planID){ echo 'selected'; } }} ?>><?=$userplans->planTitle;?></option>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t<?php }\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo\"<option value=''>No Plan Found!</option>\";\n\t\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t\n\t\t\t}\n\t\t\n\t}", "private function getPlanInfo($account_id)\n {\n if (!$account_id) {\n trigger_error('Unable to get get plan info, no $account_id parameter provided', E_USER_ERROR);\n return;\n }\n\n if ($this->planType == 'account') {\n if ($GLOBALS['account_info']['plan']) {\n $plan = $GLOBALS['account_info']['plan'];\n } else {\n $plan = $this->plans[$this->planID];\n }\n } else {\n $GLOBALS['reefless']->loadClass('Plan');\n $plan = $GLOBALS['rlPlan']->getPlan($this->planID, $account_id);\n }\n\n return $plan;\n }", "public function create_plan($requestData){\n \n // ### Create Plan\n try {\n // Create a new instance of Plan object\n $plan = new Plan();\n if(isset($requestData['plan'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['plan']), $plan);\n } \n // # Payment definitions for this billing plan.\n $paymentDefinition = new PaymentDefinition(); \n $paymentDefinition\n ->setAmount(new Currency($requestData['paymentDefinition']['Amount']));\n array_pop($requestData['paymentDefinition']);\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $this->setArrayToMethods(array_filter($requestData['paymentDefinition']), $paymentDefinition); \n }\n \n // Charge Models\n $chargeModel = new ChargeModel();\n $chargeModel->setAmount(new Currency($requestData['chargeModel']['Amount']));\n array_pop($requestData['chargeModel']);\n if(!empty($this->checkEmptyObject((array)$chargeModel))){\n $this->setArrayToMethods(array_filter($requestData['chargeModel']), $chargeModel); \n $paymentDefinition->setChargeModels(array($chargeModel));\n }\n \n $merchantPreferences = new MerchantPreferences();\n $baseUrl = $requestData['baseUrl'];\n\n $merchantPreferences->setReturnUrl($baseUrl.$requestData['ReturnUrl'])\n ->setCancelUrl($baseUrl.$requestData['CancelUrl']);\n if(!empty($this->checkEmptyObject($requestData['merchant_preferences']['SetupFee']))){\n $merchantPreferences->setSetupFee(new Currency($requestData['merchant_preferences']['SetupFee']));\n }\n array_pop($requestData['merchant_preferences']);\n \n if(isset($requestData['merchant_preferences'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['merchant_preferences']), $merchantPreferences);\n }\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $plan->setPaymentDefinitions(array($paymentDefinition));\n }\n if(!empty($this->checkEmptyObject((array)$merchantPreferences))){\n $plan->setMerchantPreferences($merchantPreferences);\n } \n $requestArray= clone $plan;\n $output = $plan->create($this->_api_context); \n $returnArray['RESULT'] = 'Success';\n $returnArray['PLAN'] = $output->toArray();\n $returnArray['RAWREQUEST']=$requestArray->toJSON();\n $returnArray['RAWRESPONSE']=$output->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "public function show( $planId )\n\t{\n\t\t$plan = Plan::with('website', 'product')\n\t\t\t->findOrFail($planId);\n\n\t\treturn view('admin/products/billingplans/show', [\n\t\t\t'website' => $plan->product->website,\n\t\t\t'product' => $plan->product,\n\t\t\t'plan' => $plan,\n\t\t\t'periodicity' => $this->periodicity,\n\t\t]);\n\t}", "public function showPlan($id){\n $plan = App\\Plan::findOrFail($id);\n return view('plan.show',compact('plan'));\n }", "public function plan()\n {\n return $this->belongsTo(PolicyPlan::class);\n }", "public function index()\n {\n return Plan::all();\n }", "public static function getInstance()\n {\n if (!is_object(self::$_instance)) //or if( is_null(self::$_instance) ) or if( self::$_instance == null )\n self::$_instance = new Plan();\n return self::$_instance;\n }", "public function getBillingProfile();", "public function show(Client $client)\n {\n return $client->load('plan');\n }", "public function getsAListOfPlans()\n {\n // Arrange\n // Act\n $plans = Ezypay::getPlans();\n\n // Assert\n //$this->assertEquals(3, sizeof($plans->data)); // Causing issues as there are aditional plans\n $this->assertNotNull($plans);\n\n $this->plans = $plans;\n }", "public function index(){\n return Client::with('plan')->latest()->get();\n }", "public function pay_bill_get(){\r\n if (!$this->pronet_model->pay_bill(1, '882332411098', '4999999999999999', '4521','12','2022')) {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }", "public function getPlans()\n {\n return response()->json(Spark::plans());\n }", "public function plan_renewal_ci()\n\t{\n\t\t// * there should only be 1 such renewal\n\t\t$sql = \"SELECT ci.* FROM co_component_item ci \n\t\t\tINNER JOIN co_component_set cs \n\t\t\tON ci.component_set_id = cs.id \n\t\t\tAND (ci.is_renewable = 1 OR ci.is_auto_renew_enabled = 1)\n\t\t\tAND cs.user_id = ? \n\t\t\tINNER JOIN co_item i \n\t\t\tON ci.item_id = i.id AND i.type = ?\n\t\t\tLIMIT 1\";\n\t\t\t\n\t\t$db_result = $this->db->query($sql, \n\t\t\tarray($this->id, Model_Item::TYPE_PLAN));\n\t\t$ex_component_item = Model_Component_Item::from_db($db_result);\n\t\treturn $ex_component_item;\n\t}", "public function listPlans()\n\t{\n\t\t\n\t\t/* If 1.4 and no backward, then leave */\n\t\tif (!$this->backward)\n\t\t\treturn;\n\t\t\t\n\t include_once(dirname(__FILE__).'/lib/Stripe.php');\n\t\t\\Stripe\\Stripe::setApiKey(Configuration::get('STRIPE_MODE') ? Configuration::get('STRIPE_PRIVATE_KEY_LIVE') : Configuration::get('STRIPE_PRIVATE_KEY_TEST'));\n\n\t\t/* Try to process the capture and catch any error message */\n\t\ttry\n\t\t{\n\t\t\t$result_json = \\Stripe\\Plan::all();\n\t\t\t\t\t\t\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\n\t\t\t$this->_errors['stripe_subscription_error'] = $e->getMessage();\n\t\t\tif (class_exists('Logger'))\n\t\t\t\tLogger::addLog($this->l('Stripe - Plans list update failed').' '.$e->getMessage(), 1, null, 'Customer', (int)Tools::getIsset('id_customer'), true);\n\t\t}\n\t\t\n\t\tif(!isset($this->_errors['stripe_subscription_error'])){\n\t\t\tDb::getInstance()->Execute('TRUNCATE TABLE '._DB_PREFIX_.'stripepro_plans');\n\t\t\tfor($i=0;$i<count($result_json->data); $i++){\n\t\t\t Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'stripepro_plans (`stripe_plan_id`, `name`, `interval`, `amount`, `currency`, `interval_count`, `trial_period_days`) VALUES (\\''.$result_json->data[$i]->id.'\\', \\''.$result_json->data[$i]->name.'\\', \\''.$result_json->data[$i]->interval.'\\','.sprintf(\"%.2f\", $result_json->data[$i]->amount / 100).', \\''.$result_json->data[$i]->currency.'\\', '.(int)$result_json->data[$i]->interval_count.','.(int)$result_json->data[$i]->trial_period_days.')');\n\t\t\t }\n\t\t\t}\n\t\n\treturn true;\n\t\n\t}", "public function getQueryPlan()\n {\n return $this->query_plan;\n }", "public function show($id)\n {\n $plan = Plan::find($id);\n return view('admin.plans.show', compact('plan'));\n }", "public function billingPlanModal($id)\n {\n return view('turtle::auth.billing.plan', compact('id'));\n }", "public function purchaseSMSPlan()\n {\n $price_plan = SMSPricePlan::where('status', 'Active')->get();\n return view('client.sms-price-plan', compact('price_plan'));\n }", "function wp_stripe_subscribe_customer_to_plan($email, $card, $plan_id, $description) {\n\n $customer = array(\n 'email' => $email,\n 'card' => $card,\n 'plan' => $plan_id\n );\n\n if ( $description ) {\n $customer['description'] = $description;\n }\n\n $response = Stripe_Customer::create($customer);\n\n return $response;\n}", "public function getPlanPriceDetail($planId, $month)\n {\n return PlanPrice::where(['plan_id' => $planId, 'plan_month' => $month])->first(['id', 'price', 'regular_price']);\n }", "public static function data_for_plan_page_returns() {\n $uc = user_competency_exporter::get_read_structure();\n $ucp = user_competency_plan_exporter::get_read_structure();\n\n $uc->required = VALUE_OPTIONAL;\n $ucp->required = VALUE_OPTIONAL;\n\n return new external_single_structure(array (\n 'plan' => plan_exporter::get_read_structure(),\n 'contextid' => new external_value(PARAM_INT, 'Context ID.'),\n 'pluginbaseurl' => new external_value(PARAM_URL, 'Plugin base URL.'),\n 'competencies' => new external_multiple_structure(\n new external_single_structure(array(\n 'competency' => competency_exporter::get_read_structure(),\n 'comppath' => competency_path_exporter::get_read_structure(),\n 'usercompetency' => $uc,\n 'usercompetencyplan' => $ucp\n ))\n ),\n 'competencycount' => new external_value(PARAM_INT, 'Count of competencies'),\n 'proficientcompetencycount' => new external_value(PARAM_INT, 'Count of proficientcompetencies'),\n 'proficientcompetencypercentage' => new external_value(PARAM_FLOAT, 'Percentage of competencies proficient'),\n 'proficientcompetencypercentageformatted' => new external_value(PARAM_RAW, 'Displayable percentage'),\n ));\n }", "public function upgrade($plan_id, $pay = NULL ) {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Get plan price\n $price = $this->plans->get_plan_price($plan_id);\n \n if ($price[0]->plan_price > 0) {\n \n // Require the Payments interface\n require_once APPPATH . 'interfaces/Payments.php';\n \n // Verify if $pay is not null\n if ( $pay ) {\n \n $total_to_pay = $price[0]->plan_price;\n \n // Get discount if exists\n $discount = get_user_option( 'user_coupon_value' );\n \n if ( $discount ) {\n \n // Calculate total discount\n $total = ( $discount / 100) * $price[0]->plan_price; \n \n // Set new price\n $total_to_pay = $total_to_pay - $total;\n \n }\n \n \n if ( file_exists(APPPATH . 'payments/' . ucfirst($pay) . '.php') ) {\n\n require_once APPPATH . 'payments/' . ucfirst($pay) . '.php';\n \n // Call the class\n $pay_class = ucfirst(str_replace('-', '_', $pay));\n\n $get = new $pay_class;\n \n $get->process( $plan_id, $total_to_pay, $price[0]->currency_code);\n\n } else {\n \n display_mess(47);\n\n }\n \n } else {\n \n // Delete the user coupon code\n $this->user->delete_user_option( $this->user_id, 'user_coupon_code' );\n\n // Delete the user discount value\n $this->user->delete_user_option( $this->user_id, 'user_coupon_value' );\n\n // Create the classes array variable\n $classes = [];\n\n // Get all available payments gateways\n foreach (glob(APPPATH . 'payments/*.php') as $filename) {\n\n // Require the payments gateways\n require_once $filename;\n\n // Clean the class name\n $className = str_replace([APPPATH . 'payments/', '.php'], '', $filename);\n\n // Verify if the payment's gateway is enabled\n if ( ($this->options->check_enabled(strtolower($className)) == FALSE) ) {\n\n continue;\n\n }\n\n // Call the class name\n $get = new $className();\n\n // Get class info\n $classes [] = $get->info();\n\n }\n\n // Set the layout\n $this->body = 'user/gateways';\n\n // Set the layout's content\n $this->content = [\n 'plan' => $plan_id,\n 'plann' => $price,\n 'payments' => $classes\n ];\n\n // Call the layout\n $this->user_layout();\n\n }\n \n } else {\n \n if ( $this->plans->change_plan($plan_id, $this->user_id) ) {\n \n $this->session->set_flashdata('upgrade', display_mess(105));\n \n } else {\n \n $this->session->set_flashdata('upgrade', display_mess(106));\n \n }\n \n // go to plans page\n redirect('user/plans');\n \n }\n \n }", "function wp_stripe_find_customer_subscription_charge($customer_id, $plan_id) {\n\n $customer_invoices = Stripe_Invoice::all(array('customer' => $customer_id));\n\n $matching_invoice = null; \n\n // Loop through invoices looking for a matching subscription\n foreach( $customer_invoices->data as $invoice) {\n if ( $invoice->lines->subscriptions ) {\n foreach( $invoice->lines->subscriptions as $subscription ) {\n if ( $subscription->plan->id == $plan_id ) {\n $matching_invoice = $invoice; \n break 2;\n }\n }\n }\n }\n\n // Get the charge if we found a matching invoice\n $charge = $matching_invoice ? Stripe_Charge::retrieve($matching_invoice->charge) : null;\n\n return $charge;\n}", "public function __construct()\n {\n $this->plan = new Plan();\n }", "public function show(Customer $customer)\n {\n $date=Carbon::now();\n $paymentSchedules=DB::table('payment_schedules')->select('*','payment_schedules.id as pid','payment_schedules.amount as pamount')\n ->join('policies','payment_schedules.policy_id','=','policies.id')\n ->join('customers','policies.customer_id','=','customers.id')\n ->join('vehicles','policies.vehicle_id','=','vehicles.id')\n ->whereDate('payment_schedules.due_date','<',$date)\n ->where('payment_schedules.status','open')\n ->where('payment_schedules.lifeline_status','active')\n ->where('customers.id',$customer->id)\n ->orderBy('payment_schedules.id','desc')\n ->get();\n\n return view('customers.show',['customer'=>$customer,'paymentSchedules'=>$paymentSchedules]);\n }", "public function get_listing_plans($id, $type)\n {\n header('Content-Type: application/json');\n $output['token'] = $this->security->get_csrf_hash();\n $data = $this->database->_get_row_data('tbl_purchases', array('plan_id' => $id, 'listing_type' => $type));\n if (!empty($data)) {\n $output['response'] = $data;\n } else {\n $output['response'] = false;\n }\n\n exit(json_encode($output));\n }", "public function show(VendorSubscriptionPlans $vendorSubscriptionPlans)\n {\n //\n }", "public function list_plan($parameters){\n try {\n $planList = Plan::all(array_filter($parameters), $this->_api_context); \n $returnArray['RESULT'] = 'Success';\n $returnArray['PLANS'] = $planList->toArray();\n $returnArray['RAWREQUEST']= json_encode($parameters);\n $returnArray['RAWRESPONSE']=$planList->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n } \n }", "public function customer_get($customerId){\t\t\t\t\t\t\t\t\n\t\t$params = array('customerId' => $customerId);\t\t\n\t\ttry {\n\t\t\t$flow = $this->send('customer/get', $params, 'GET');\t \t\t\t\n\t\t\treturn $flow;\n\t\t} catch (Exception $e) { return $e->getCode().\" - \".$e->getMessage(); }\n\t}", "public function show(Plan $plan)\n {\n $this->authorize('view', $plan);\n\n return view('admin.plans.show');\n }", "public static function getByProductAndRatePlanID(\n\t\t$product,\n\t\t$ratePlan,\n\t\t$queryParams = array(),\n\t\t$customClient = NULL\n\t\t) {\n\t\t$productID = Bf_Product::getIdentifier($product);\n\t\t$ratePlanID = Bf_ProductRatePlan::getIdentifier($ratePlan);\n\n\t\t$endpoint = sprintf(\"product/%s/rate-plan/%s\",\n\t\t\trawurlencode($productID),\n\t\t\trawurlencode($ratePlanID)\n\t\t\t);\n\n\t\treturn static::getFirst(\n\t\t\t$endpoint,\n\t\t\t$queryParams,\n\t\t\t$customClient\n\t\t\t);\n\t}", "public function getSubscriptionPlanDetails(Request $request) { \n $getSubscriptionPlanDetails = SubscriptionPlanDetails::where('sub_plan_id', $request['plan_id'])\n ->orderBy('duration', 'ASC')->get();\n \n return $getSubscriptionPlanDetails; \n }", "protected function getPackPlan(): ?SubscriptionPlanContract\n {\n /** @var PlanQueryContract */\n $query = app()->make(PlanQueryContract::class);\n\n /** @var AccountContract */\n $account = $this->accounts->first();\n $account->getChargebee()->getPlan()->isYearlyBilled() ?\n $query->beingYearly()\n : $query->beingMonthly();\n\n /** @var ?PlanContract */\n $plan = $query->whereGlobal()->first();\n \n return $plan?->toSubscriptionPlan();\n }", "public function get_bl_customers(){\r\n\t\t//ClientId: ed4d82fc-b6d7-4518-a292-abad6eadb9fb\r\n\t\t//ClientSecret: d8a11026-4a8c-4650-b159-32c791e7a1b9\r\n\r\n\t\t$post_data = array(\r\n\t\t\t\"grant_type\"=>\"client_credentials\",\r\n\t\t\t\"scope\"=>\"\",\r\n\t\t\t\"client_id\"=>\"ed4d82fc-b6d7-4518-a292-abad6eadb9fb\",\r\n\t\t\t\"client_secret\"=>\"d8a11026-4a8c-4650-b159-32c791e7a1b9\"\r\n\t\t);\r\n\r\n\t\t$this->call_bl_api_auth($post_data);\r\n\t\t//$result = CallAPI(\"POST\",\"https://apigateway.blinfo.se/auth/oauth/v2/token\")\r\n\t}", "function get() {\n\n\n $node_id = $this->input->post('node_id');\n $plans = Doctrine_Core::getTable('Plan')->retrieveCurrents($node_id);\n\n //ESTA INTRUCCION SOLO SE OCUPA SI SE ESTA EN UN SERVODOR WINDOWS\n $dir = str_replace(\"\\\\\", \"/\", $this->config->item('plan_dir'));\n // si posee algun plano asociado\n if ($plans->count()) {\n $size = $plans->count();\n $plans = $plans->toArray();\n\n $ruta = 'plans/' . $plans[0]['plan_filename'];\n\n if (!file_exists($ruta)) {\n\n $plans[0]['plan_filename'] = \"not_image_icon.png\";\n }\n\n echo '({\"total\":\"' . $size . '\", \"plan_dir\": \"' . $dir . '\", \"results\":' . $this->json->encode($plans) . '})';\n } else {\n\n //El caso de no poseer plano se busca si posee linea asociada\n $line = Doctrine_Core::getTable('PlanNode')->findPlanNode($node_id);\n\n if ($line->count()) {\n $line = $line->toArray();\n $nodeLine = intval($line[0]['nodeLine']);\n $associatedLine = Doctrine_Core::getTable('Plan')->retrieveCurrents($nodeLine);\n if ($associatedLine->count()) {\n $associatedLine = $associatedLine->toArray();\n $associatedLine[0]['handler'] = $line[0]['handler'];\n $associatedLine[0]['plan_node_id'] = $line[0]['plan_node_id'];\n $associatedLine[0]['plan_section_id'] = $line[0]['plan_section_id'];\n\n echo '({\"total\":\"' . $plans->count() . '\", \"plan_dir\": \"' . $dir . '\", \"results\":' . $this->json->encode($associatedLine) . '})';\n } else {\n echo '({\"total\":\"0\", \"results\":[]})';\n }\n }\n }\n }", "public function show($id)\n {\n return response()->json(customer_point::where('id_business',Auth::user()->id_business)->where('id',$id)->get());\n }", "function payplan($id=0){\r\n\t\t$row = $this->accounts_model->getAccountById($id);\r\n\r\n\t\tif(count($row) <= 0){\r\n\t\t\t$this->session->set_flashdata('error_msg', 'Account info incorrect');\r\n\t\t\tredirect('/');\r\n\t\t}\r\n\r\n\t\tif (strpos($row['role'], 'pro_artist')) {\r\n\t\t\t$price = $row['pay_plan'] == 'annually' ? 12*12 : 18;//us$\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$price = $row['pay_plan'] == 'annually' ? 25*12 : 32;//us$\t\r\n\t\t}\r\n\r\n\t\t$this->load->view('header/header');\r\n\t\t$this->load->view('payplan_view', ['row'=>$row, 'price'=>$price]);\r\n\t\t$this->load->view('footer');\r\n\t}", "public function testCustomerPaymentMethodGetCustomerPaymentMethodBycustomerIdcustomerPaymentMethodId()\n {\n }", "public function plan()\n {\n return $this->hasManyThrough('Modules\\Plan\\Entities\\Plan',\n 'Modules\\Plan\\Entities\\Deducible',\n \t\t\t\t\t\t\t\t'plan_deducible_id',\n 'plan_id');\n }", "public function setPlan(?string $plan): self\n {\n $this->plan = $plan;\n\n return $this;\n }" ]
[ "0.6677754", "0.6611684", "0.64265364", "0.6259155", "0.6233449", "0.61645", "0.61427605", "0.6124666", "0.61142963", "0.61086214", "0.6094174", "0.6077126", "0.60749197", "0.5969812", "0.5885546", "0.5881825", "0.5859189", "0.58482456", "0.5809344", "0.57992136", "0.577942", "0.5758392", "0.5751274", "0.57385665", "0.5704562", "0.56829876", "0.5674157", "0.5665975", "0.56596243", "0.5639566", "0.5632855", "0.5619579", "0.5608687", "0.56033427", "0.5569265", "0.55689263", "0.55657005", "0.55449104", "0.55435777", "0.5529333", "0.5526992", "0.5517237", "0.5514643", "0.55118984", "0.5502418", "0.5499597", "0.54959387", "0.5493247", "0.5489834", "0.54755974", "0.5475262", "0.54747355", "0.544344", "0.5432746", "0.5422446", "0.5419297", "0.54160184", "0.5400259", "0.53680146", "0.5354518", "0.5351642", "0.53482103", "0.534656", "0.53434366", "0.53414124", "0.5337594", "0.53368396", "0.53344065", "0.53284365", "0.53269595", "0.53164494", "0.5314463", "0.5312082", "0.5311283", "0.5306123", "0.530416", "0.53037184", "0.53013164", "0.5290259", "0.5286972", "0.52842206", "0.52835214", "0.5269842", "0.5265294", "0.52641684", "0.52516395", "0.5240363", "0.5230004", "0.52294177", "0.5224494", "0.52185136", "0.5206997", "0.5205983", "0.5205391", "0.52033097", "0.51998353", "0.51858234", "0.51856434", "0.518422", "0.51835024", "0.51818657" ]
0.0
-1
Queries for a customer paymentplan from the Checkout.com API. Minimal usage: $this>customerId = 'cust_000000000000000'; $this>planId = 'rp_000000000000000'; $this>api_query();
private function api_query() { if ($this->trackId == null) { return false; } $class[] = 'includes/checkout-php-library/autoload'; $class[] = 'includes/checkout-php-library/com/checkout/Apiclient'; $class[] = 'includes/checkout-php-library/com/checkout/Apiservices/Reporting/Reportingservice'; $class[] = 'includes/checkout-php-library/com/checkout/Apiservices/Reporting/Requestmodels/Transactionfilter'; foreach ($class as $path) { module_load_include('php', 'uc_checkoutpayment', $path); } $apiClient = new com\checkout\Apiclient(variable_get('cko_private_key'),variable_get('cko_mode')); $service = $apiClient->Reportingservice(); $request = new com\checkout\Apiservices\Reporting\Requestmodels\Transactionfilter(); $request->setPageSize('100'); $request->setSortColumn('date'); $request->setFilters( array( "action" => "include", "field" => "TrackID", "operator" => "EQUALS", "value" => $this->trackId, ) ); $response = $service->queryTransaction($request); if (!empty($response)) { foreach ($response as $value) { $this->id = $value->id; $this->created = $value->created; $this->trackId = $value->track_id; $this->currency = $value->currency; $this->responseMessage = $value->responseMessage; $this->responseCode = $value->responseCode; $this->status = $value->status; $this->value = $data->value; $this->email = $data->email; $this->db_add(); } return $this->db_get(); } return FALSE; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBillingPlan(User $user, $id);", "public function billingPlan($id)\n {\n $this->shellshock(request(), [\n 'number' => 'required|numeric',\n 'exp_month' => 'required|numeric',\n 'exp_year' => 'required|numeric',\n 'cvc' => 'required|numeric',\n ]);\n\n Stripe::setApiKey(config('turtle.billing.stripe_secret_key'));\n\n // create card token\n $token = Token::create([\n 'card' => [\n 'number' => request()->input('number'),\n 'exp_month' => request()->input('exp_month'),\n 'exp_year' => request()->input('exp_year'),\n 'cvc' => request()->input('cvc'),\n ],\n ]);\n\n // create/update customer\n if (!auth()->user()->billing_customer) {\n $customer = Customer::create([\n 'source' => $token->id,\n 'email' => auth()->user()->email,\n ]);\n }\n else {\n $customer = Customer::retrieve(auth()->user()->billing_customer);\n $customer->source = $token->id;\n $customer->save();\n }\n\n // create/update subscription\n if (!auth()->user()->billing_subscription) {\n $subscription = Subscription::create([\n 'customer' => $customer->id,\n 'items' => [['plan' => $id]],\n ]);\n }\n else {\n $subscription = Subscription::retrieve(auth()->user()->billing_subscription);\n Subscription::update($subscription->id, [\n 'items' => [[\n 'id' => $subscription->items->data[0]->id,\n 'plan' => $id,\n ]],\n ]);\n }\n\n // update user\n auth()->user()->update([\n 'billing_customer' => $customer->id,\n 'billing_subscription' => $subscription->id,\n 'billing_plan' => $id,\n 'billing_cc_last4' => $token->card->last4,\n 'billing_period_ends' => Carbon::createFromTimestamp($subscription->current_period_end),\n ]);\n\n activity('Subscribed to '.$id);\n flash('success', 'Thanks for subscribing!');\n\n return response()->json(['reload_page' => true]);\n }", "public function getCustomerTest(){\n $this->load->helper('ExactOnline/vendor/autoload');\n $this->load->model('Exactonline_model');\n $this->load->model('Projects_model');\n $this->load->model('Shopify_exact_model');\n $this->load->library('Shopify_restapi');\n \n $projectId = 38;\n $this->Exactonline_model->setData(\n array(\n 'projectId' => $projectId,\n 'redirectUrl' => $this->Projects_model->getValue('exactonline_redirect_url', $projectId),\n 'clientId' => $this->Projects_model->getValue('exactonline_client_id', $projectId),\n 'clientSecret' => $this->Projects_model->getValue('exactonline_secret_key', $projectId),\n )\n );\n\n $offset = $this->Projects_model->getValue('exactonline_customers_offset', $projectId) ? $this->Projects_model->getValue('exactonline_customers_offset', $projectId) : NULL;\n $amount = $this->Projects_model->getValue('customers_amount', $projectId) ? $this->Projects_model->getValue('customers_amount', $projectId) : 1000;\n $customerId = isset($_GET['customerId'])?$_GET['customerId']:'';\n\n $connection = $this->Exactonline_model->makeConnection($projectId);\n /*echo \"<pre>\";\n print_r($connection);\n exit();*/\n if ($connection) {\n $customers = $this->Shopify_exact_model->getExactCustomersTest($connection, $customerId, NULL, $amount);\n echo \"<pre>\";\n print_r($customers);\n exit();\n }\n }", "public function getCustomer($customer_id);", "public function getPlan();", "public function show(Plan $plan)\n {\n //\n }", "public function getPaymentPlan()\n {\n return $this->payment_plan;\n }", "private function get_plan()\n\t{\n\t\treturn $this->m_plan;\n\t}", "function TestPlan_get($plan_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.get', array(new xmlrpcval($plan_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function user_by_plan(Request $req, $id)\n {\n $this->check_account($req);\n\n // $param_insert = array(\n // 'name' => 'user_by_plan',\n // 'params' => json_encode(collect($req)->toArray()),\n // 'result' => ''\n // );\n\n // $access_log_id = $this->create_access_log($param_insert);\n\n $plan = new Plan;\n $plan = $plan->with('user', 'guide');\n $plan = $plan->where('user_id', $id);\n $plan = $plan->where('status', '!=', 'deleted');\n\n // search query\n if ($req->input('search_query')) {\n $search_query = $req->input('search_query') ? $req->input('search_query') : '';\n\n $plan = $plan->where('start_date', 'LIKE', '%'.$search_query.'%');\n }\n\n // where custom\n if ($req->input('where_by') && $req->input('where_value')) {\n $explode_by = explode('|', $req->input('where_by'));\n $explode_value = explode('|', $req->input('where_value'));\n\n if ((count($explode_by)==count($explode_value)) && ($this->check_where($explode_by, $this->fields_plans))) {\n foreach ($explode_by as $key => $value) {\n if ($explode_value[$key]=='except_active') {\n $plan = $plan->where($explode_by[$key], '!=', 'active');\n } else {\n $plan = $plan->where($explode_by[$key], '=', $explode_value[$key]);\n }\n }\n } else {\n $result = $this->generate_response($plan, 400, 'Bad Request.', true);\n\n // $this->update_access_log($access_log_id, $result);\n\n return response()->json($result, 400);\n }\n }\n\n if (!$req->input('order_by')) {\n $plan = $plan->orderBy(\"id\", \"desc\");\n }\n\n // order\n if ($req->input('order_by')) {\n if (in_array($req->input('order_by'), $this->fields_plans)) {\n $order_type = $req->input('order_type') ? $req->input('order_type') : 'asc';\n\n $plan = $plan->orderBy($req->input('order_by'), $order_type);\n } else {\n $result = $this->generate_response($plan, 400, 'Bad Request.', true);\n\n // $this->update_access_log($access_log_id, $result);\n\n return response()->json($result, 400);\n }\n }\n\n // limit\n if ($req->input('limit')) {\n $offset = $req->input('offset') ? $req->input('offset') : 0;\n\n $plan = $plan->offset($offset);\n $plan = $plan->limit($req->input('limit'));\n }\n\n $plan = $plan->get();\n\n $result = $this->generate_response($plan, 200, 'All Data.', false);\n\n // $this->update_access_log($access_log_id, $result);\n\n return response()->json($result, 200);\n }", "public function getQueryPlan()\n {\n return $this->query_plan;\n }", "public static function get_payment_plan_search_field() {\n\n check_ajax_referer( 'sumo-pp-get-payment-plan-search-field' , 'security' ) ;\n\n wp_send_json( array (\n 'search_field' => _sumo_pp_wc_search_field( array (\n 'class' => 'wc-product-search' ,\n 'action' => '_sumo_pp_json_search_sumo_payment_plans' ,\n 'id' => isset( $_POST[ 'loop' ] ) ? \"selected_{$_POST[ 'col' ]}_payment_plan_{$_POST[ 'rowID' ]}{$_POST[ 'loop' ]}\" : \"selected_{$_POST[ 'col' ]}_payment_plan_{$_POST[ 'rowID' ]}\" ,\n 'name' => isset( $_POST[ 'loop' ] ) ? \"_sumo_pp_selected_plans[{$_POST[ 'loop' ]}][{$_POST[ 'col' ]}][{$_POST[ 'rowID' ]}]\" : \"_sumo_pp_selected_plans[{$_POST[ 'col' ]}][{$_POST[ 'rowID' ]}]\" ,\n 'type' => 'payment_plans' ,\n 'selected' => false ,\n 'multiple' => false ,\n 'placeholder' => __( 'Search for a payment plan&hellip;' , _sumo_pp()->text_domain ) ,\n ) , false ) ,\n ) ) ;\n }", "public function GetCustomer($customer_id) {\n\n //set up the query\n $this->sql = \"SELECT *\n FROM customers\n WHERE customerID = :customer_id\";\n \n //execute the query\n $this->RunAdvancedQuery([\n ':customer_id' => $customer_id,\n ]);\n }", "public function plan_info( $plan_id ) {\r\n\t\treturn $this->_send_request( 'plans/'.$plan_id );\r\n\t}", "public function show($id)\n {\n Log::debug(\"SHOW PLAN IN CONTROLLER\");\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->findPlan($id);\n\n if ($result['message'] == 'Success'){\n\n return new StripePlanResource($result['plan']);\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n\n return redirect()->back();\n\n }\n\n }", "function wp_stripe_find_customer_subscription_charge($customer_id, $plan_id) {\n\n $customer_invoices = Stripe_Invoice::all(array('customer' => $customer_id));\n\n $matching_invoice = null; \n\n // Loop through invoices looking for a matching subscription\n foreach( $customer_invoices->data as $invoice) {\n if ( $invoice->lines->subscriptions ) {\n foreach( $invoice->lines->subscriptions as $subscription ) {\n if ( $subscription->plan->id == $plan_id ) {\n $matching_invoice = $invoice; \n break 2;\n }\n }\n }\n }\n\n // Get the charge if we found a matching invoice\n $charge = $matching_invoice ? Stripe_Charge::retrieve($matching_invoice->charge) : null;\n\n return $charge;\n}", "public static function byPlan($plan_id)\n {\n $payload = [\n 'recurringplan' => [\n 'recurringplanid' => $plan_id,\n ],\n ];\n\n return static::all($payload);\n }", "public function show($id)\n {\n $plan = Plan::find($id);\n return $plan;\n }", "public function getCreditCardById($customer_id, $card_id)\n {\n \n // verify the required parameter 'customer_id' is set\n if ($customer_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $customer_id when calling getCreditCardById');\n }\n // verify the required parameter 'card_id' is set\n if ($card_id === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $card_id when calling getCreditCardById');\n }\n \n // parse inputs\n $resourcePath = \"/customer/{customer_id}/credit_card/{card_id}\";\n $resourcePath = str_replace(\"{format}\", \"json\", $resourcePath);\n $method = \"GET\";\n $httpBody = '';\n $queryParams = array();\n $headerParams = array();\n $formParams = array();\n $_header_accept = ApiClient::selectHeaderAccept(array('application/json'));\n if (!is_null($_header_accept)) {\n $headerParams['Accept'] = $_header_accept;\n }\n $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json'));\n \n \n \n // path params\n if ($customer_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"customer_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($customer_id),\n $resourcePath\n );\n }// path params\n if ($card_id !== null) {\n $resourcePath = str_replace(\n \"{\" . \"card_id\" . \"}\",\n $this->apiClient->getSerializer()->toPathValue($card_id),\n $resourcePath\n );\n }\n \n \n \n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n } else if (count($formParams) > 0) {\n $httpBody = $formParams; // for HTTP post (form)\n }\n \n $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . \":\" . $this->apiClient->getConfig()->getPassword());\n \n \n // make the API Call\n try\n {\n list($response, $httpHeader) = $this->apiClient->callApi(\n $resourcePath, $method,\n $queryParams, $httpBody,\n $headerParams, '\\Tpaga\\Model\\CreditCard'\n );\n \n if (!$response) {\n return null;\n }\n\n return $this->apiClient->getSerializer()->deserialize($response, '\\Tpaga\\Model\\CreditCard', $httpHeader);\n \n } catch (ApiException $e) {\n switch ($e->getCode()) { \n case 200:\n $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\\Tpaga\\Model\\CreditCard', $e->getResponseHeaders());\n $e->setResponseObject($data);\n break;\n }\n \n throw $e;\n }\n \n return null;\n \n }", "public function show(Customer $customer)\n {\n $date=Carbon::now();\n $paymentSchedules=DB::table('payment_schedules')->select('*','payment_schedules.id as pid','payment_schedules.amount as pamount')\n ->join('policies','payment_schedules.policy_id','=','policies.id')\n ->join('customers','policies.customer_id','=','customers.id')\n ->join('vehicles','policies.vehicle_id','=','vehicles.id')\n ->whereDate('payment_schedules.due_date','<',$date)\n ->where('payment_schedules.status','open')\n ->where('payment_schedules.lifeline_status','active')\n ->where('customers.id',$customer->id)\n ->orderBy('payment_schedules.id','desc')\n ->get();\n\n return view('customers.show',['customer'=>$customer,'paymentSchedules'=>$paymentSchedules]);\n }", "public function get_bl_customers(){\r\n\t\t//ClientId: ed4d82fc-b6d7-4518-a292-abad6eadb9fb\r\n\t\t//ClientSecret: d8a11026-4a8c-4650-b159-32c791e7a1b9\r\n\r\n\t\t$post_data = array(\r\n\t\t\t\"grant_type\"=>\"client_credentials\",\r\n\t\t\t\"scope\"=>\"\",\r\n\t\t\t\"client_id\"=>\"ed4d82fc-b6d7-4518-a292-abad6eadb9fb\",\r\n\t\t\t\"client_secret\"=>\"d8a11026-4a8c-4650-b159-32c791e7a1b9\"\r\n\t\t);\r\n\r\n\t\t$this->call_bl_api_auth($post_data);\r\n\t\t//$result = CallAPI(\"POST\",\"https://apigateway.blinfo.se/auth/oauth/v2/token\")\r\n\t}", "public function index()\n {\n $user = \\Auth::guard('api')->user();\n \n // authorize\n if (!$user->can('read', new \\Acelle\\Model\\Plan())) {\n return \\Response::json(array('message' => 'Unauthorized'), 401);\n }\n \n $rows = \\Acelle\\Model\\Plan::getAll()->limit(100)\n ->get();\n \n $plans = $rows->map(function ($plan) {\n return [\n 'uid' => $plan->uid, \n 'name' => $plan->name,\n 'price' => $plan->price,\n 'currency_code' => $plan->currency->code,\n 'frequency_amount' => $plan->frequency_amount,\n 'frequency_unit' => $plan->frequency_unit,\n 'options' => $plan->getOptions(),\n 'status' => $plan->status,\n 'color' => $plan->color,\n 'quota' => $plan->quota,\n 'custom_order' => $plan->custom_order,\n 'created_at' => $plan->created_at,\n 'updated_at' => $plan->updated_at,\n ];\n });\n\n return \\Response::json($plans, 200);\n }", "public function getBilling();", "public function show(Customer $customer)\n {\n //\n }", "public function getBillingPlans(User $user, StandardProduct $product);", "public function getPlanById()\n {\n // Arrange\n // Act\n if (! isset($this->plans)) {\n $this->getsAListOfPlans();\n }\n $plans = $this->plans;\n $plan = $plans['data'][0];\n\n $plan = Ezypay::getPlan($plan['id']);\n\n // Assert\n $this->assertNotNull($plan);\n $this->assertEquals($plan['id'], $plan['id']);\n }", "public function customer_subscribe( $customer_id, $plan_id, $options = array() ) {\r\n\t\t$options['plan'] = $plan_id;\r\n\t\t\r\n\t\treturn $this->_send_request( 'customers/'.$customer_id.'/subscription', $options, STRIPE_METHOD_POST );\r\n\t}", "public function getCustomerPaymentDataAction()\n {\n $request = $this->Request()->getParams();\n $customerId = $request['customerId'];\n $paymentId = $request['paymentId'];\n\n /** @var \\Shopware_Components_CreateBackendOrder $createBackendOrder */\n $createBackendOrder = Shopware()->CreateBackendOrder();\n $paymentModel = $createBackendOrder->getCustomerPaymentData($customerId, $paymentId);\n /** @var Shopware\\Models\\Customer\\PaymentData $payment */\n $payment = Shopware()->Models()->toArray($paymentModel);\n\n $this->view->assign(\n [\n 'success' => true,\n 'data' => $payment\n ]\n );\n }", "public function show(Customer $customer)\n {\n //\n }", "public function show(Customer $customer)\n {\n //\n }", "public function show(Customer $customer)\n {\n //\n }", "public function show(Customer $customer)\n {\n //\n }", "public function show(Customer $customer)\n {\n //\n }", "public function show(Customer $customer)\n {\n //\n }", "public function show(Customer $customer)\n {\n //\n }", "public function show(Customer $customer)\n {\n //\n }", "public function quickbooksms_oneoff_payment($params)\n\t{\n\t\t$this->_api_method = 'CustomerCreditCardChargeRq';\n\t\t$this->_request = $this->_build_request($params);\t\t\t\n\t\treturn $this->_handle_query();\n\t}", "public static function byCustomer($customer_id)\n {\n $payload = [\n 'subscription' => [\n 'subscriptionid' => $customer_id,\n ],\n ];\n\n return static::all($payload);\n }", "public function get($planIdOrKey)\n {\n $ret = $this->exec($this->uri.\"/$planIdOrKey?expand=plans\", null);\n\n $this->log->addInfo('Result='.$ret);\n\n $prj = $this->json_mapper->map(\n json_decode($ret), new Plan()\n );\n\n return $prj;\n }", "public function getCustomerAction()\n {\n $data = $this->Request()->getParams();\n\n /** @var Shopware_Components_CustomerInformationHandler $customerInformationHandler */\n $customerInformationHandler = Shopware()->CustomerInformationHandler();\n\n //Checks if the user used the live search or selected a customer from the drop down list\n if (isset($data['filter'][0]['value'])) {\n $result = $customerInformationHandler->getCustomerList($data['filter'][0]['value']);\n } else {\n $search = $this->Request()->get('searchParam');\n $result = $customerInformationHandler->getCustomer($search);\n }\n\n foreach ($result as $i => $customer) {\n $result[$i] = $this->extractCustomerData($customer);\n }\n\n $total = count($result);\n\n $this->view->assign(\n [\n 'data' => $result,\n 'total' => $total,\n 'success' => true\n ]\n );\n }", "public function get_plan($planId){\n try {\n $plan = Plan::get($planId, $this->_api_context);\n $returnArray['RESULT'] = 'Success';\n $returnArray['PLAN'] = $plan->toArray();\n $returnArray['RAWREQUEST']='{id:'.$planId.'}';\n $returnArray['RAWRESPONSE']=$plan->toJSON();\n return $returnArray;\n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "public function index()\n {\n $data = Plan::latest()->paginate(10);\n $response = [\n 'pagination' => [\n 'total' => $data->total(),\n 'per_page' => $data->perPage(),\n 'current_page' => $data->currentPage(),\n 'last_page' => $data->lastPage(),\n 'from' => $data->firstItem(),\n 'to' => $data->lastItem()\n ],\n 'data' => $data\n ];\n return response()->json($response);\n }", "public function setQueryPlan($var)\n {\n GPBUtil::checkString($var, True);\n $this->query_plan = $var;\n\n return $this;\n }", "public function show(Client $client)\n {\n return $client->load('plan');\n }", "public function show(Plan $plan)\n {\n //\n return view('plan.show',['plan'=>$plan]);\n }", "public function getSubscriptionPlan() {\n $categoryId = Config::get('custom_config.WOOCOMMERCE_CATEGORY_ID');\n if (empty($categoryId)) {\n return response()->json(\n ['error' => __('woocommerce category ID not set')\n ],\n 400\n );\n }\n $data = $this->wooCommerceService->getSubscriptionPlan();\n \\Log::info(\"===== data \", ['subscription_package' => $data]);\n\n if ($data) {\n return response()->json(['data' => $data], 200);\n }\n\n return response()->json(\n ['error' => __('messages.un_processable_request')\n ],\n 400\n );\n }", "private function stripePlan()\n {\n $all_plans = $this->stripeDBPlan->paginate(10);\n\n $plans = collect([]);\n\n try {\n foreach ($all_plans as $val) {\n if ($this->stripePlan->getStripePlan($val->plan_id)) {\n foreach ($this->stripeDBPlan->wherePlanId($val->plan_id)->get() as $plan) {\n $plans->push($plan);\n }\n }\n }\n } catch (ApiConnectionException $th) {\n $error_msg = $th->getMessage();\n } catch (AuthenticationException $th) {\n $error_msg = $th->getMessage();\n } catch (InvalidRequestException $th) {\n } catch (ApiErrorException $th) {\n $error_msg = $th->getError();\n }\n return view('subscription.stripePlans', [\n 'plans'=> $plans,\n ]);\n }", "public function show(VendorSubscriptionPlans $vendorSubscriptionPlans)\n {\n //\n }", "public function getUserPlan($userId) {\n\n $database = new Database();\n\n $query = 'SELECT * FROM user_plan WHERE User_Id=:User_Id';\n\n $result = $database->prepareQuery($query, 'User_Id', [$userId], TRUE, TRUE);\n \n return $result;\n }", "public function query()\n {\n return Customer::query();\n }", "public function show($id){\n $data = UserPlan::where('user_id', '=', $id)\n ->get();\n\n return response()->json($data);\n }", "public function show(MerchantPayment $merchantPayment)\n {\n //\n }", "function _get_datatables_query_payment($customer_id = \"\")\n {\n $customer_ids = $this->uri->segment(4);\n $this->company_db->select(\"ih.invoice_id\");\n $this->company_db->from('invoice_header_payment ih');\n $this->company_db->where('ih.customer_id' ,$customer_ids);\n }", "public function testCustomerPaymentMethodGetCustomerPaymentMethodBycustomerIdcustomerPaymentMethodId()\n {\n }", "function get_payment_datatables($customer_id = \"\")\n {\n $offset = ($_REQUEST['datatable']['pagination']['page'] - 1)*$_REQUEST['datatable']['pagination']['perpage'];\n $this->_get_datatables_payment_query($customer_id);\n if($_REQUEST['datatable']['pagination']['perpage'] != -1)\n $this->company_db->limit($_REQUEST['datatable']['pagination']['perpage'], $offset);\n $query = $this->company_db->get(); \n \n if($query->num_rows() > 0)\n {\n foreach ($query->result() as $row)\n {\n \n }\n return $query->result();\n }\n else\n {\n return false;\n }\n }", "public function create_plan($requestData){\n \n // ### Create Plan\n try {\n // Create a new instance of Plan object\n $plan = new Plan();\n if(isset($requestData['plan'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['plan']), $plan);\n } \n // # Payment definitions for this billing plan.\n $paymentDefinition = new PaymentDefinition(); \n $paymentDefinition\n ->setAmount(new Currency($requestData['paymentDefinition']['Amount']));\n array_pop($requestData['paymentDefinition']);\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $this->setArrayToMethods(array_filter($requestData['paymentDefinition']), $paymentDefinition); \n }\n \n // Charge Models\n $chargeModel = new ChargeModel();\n $chargeModel->setAmount(new Currency($requestData['chargeModel']['Amount']));\n array_pop($requestData['chargeModel']);\n if(!empty($this->checkEmptyObject((array)$chargeModel))){\n $this->setArrayToMethods(array_filter($requestData['chargeModel']), $chargeModel); \n $paymentDefinition->setChargeModels(array($chargeModel));\n }\n \n $merchantPreferences = new MerchantPreferences();\n $baseUrl = $requestData['baseUrl'];\n\n $merchantPreferences->setReturnUrl($baseUrl.$requestData['ReturnUrl'])\n ->setCancelUrl($baseUrl.$requestData['CancelUrl']);\n if(!empty($this->checkEmptyObject($requestData['merchant_preferences']['SetupFee']))){\n $merchantPreferences->setSetupFee(new Currency($requestData['merchant_preferences']['SetupFee']));\n }\n array_pop($requestData['merchant_preferences']);\n \n if(isset($requestData['merchant_preferences'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['merchant_preferences']), $merchantPreferences);\n }\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $plan->setPaymentDefinitions(array($paymentDefinition));\n }\n if(!empty($this->checkEmptyObject((array)$merchantPreferences))){\n $plan->setMerchantPreferences($merchantPreferences);\n } \n $requestArray= clone $plan;\n $output = $plan->create($this->_api_context); \n $returnArray['RESULT'] = 'Success';\n $returnArray['PLAN'] = $output->toArray();\n $returnArray['RAWREQUEST']=$requestArray->toJSON();\n $returnArray['RAWRESPONSE']=$output->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "public function customer_get($customerId){\t\t\t\t\t\t\t\t\n\t\t$params = array('customerId' => $customerId);\t\t\n\t\ttry {\n\t\t\t$flow = $this->send('customer/get', $params, 'GET');\t \t\t\t\n\t\t\treturn $flow;\n\t\t} catch (Exception $e) { return $e->getCode().\" - \".$e->getMessage(); }\n\t}", "public function consumerSurveyByCustomer($customer_id)\n {\n if (!$this->isAuthorized) {\n return prepareResult(false, [], [], \"User not authenticate\", $this->unauthorized);\n }\n\n $consumer_survey = Survey::with(\n 'surveyCustomer',\n 'surveyCustomer.customer:id,firstname,lastname',\n 'surveyCustomer.customer.customerInfo:id,user_id,customer_code',\n 'surveyQuestion')\n ->where('survey_type_id', 2)\n ->whereDate('start_date', '<=', date('Y-m-d'))\n ->whereDate('end_date', '>=', date('Y-m-d'))\n ->whereHas('surveyCustomer', function ($query) use ($customer_id) {\n $query->where('customer_id', $customer_id);\n })\n ->orderBy('id', 'desc')\n ->get();\n\n return prepareResult(true, $consumer_survey, [], \"Consumer Survey by customer listing\", $this->success);\n }", "public function subscribe(string $plan): Model\n {\n return MarqantPay::subscribe($this, $plan);\n }", "public function getPlanById(int $id){\n $this->open();\n\n $result = $this->query('SELECT * FROM '.$this->TABLE_NAME.' WHERE id=:id', array(\n new QueryParam(':id', $id, PDO::PARAM_INT)\n ));\n\n // Close connection\n $this->close();\n\n // Check if is found\n if($result->rowCount() > 0){\n\n // Check result\n while($row = $result->fetch(PDO::FETCH_OBJ)){\n $foundPlan = new Plan(\n $row->id,\n $row->name,\n $row->price,\n $row->detail,\n $row->docsUrl\n );\n\n return $foundPlan;\n }\n\n }\n else{\n // It isn't found so return false\n return false;\n }\n\n }", "public function testCustomerPaymentMethodGetCustomerPaymentMethodsBycustomerId()\n {\n }", "public function customer_info( $customer_id ) {\r\n\t\treturn $this->_send_request( 'customers/'.$customer_id );\r\n\t}", "function TestCase_get_plans($case_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.get_plans', array(new xmlrpcval($case_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function getAllCustomers() {\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/customers',\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\techo \"<pre>\";\n\tprint_r($resp_decode);\n\techo \"</pre>\";\n}", "public function getCustomerBy_ID($customer_id) { /* this fun is used to get customer deatails */\n\n $sqlselect = \"SELECT * FROM customer_details WHERE cust_id = '$customer_id'\";\n\n $result = $this->db->query($sqlselect);\n\n if ($result->num_rows() <= 0) {\n $response = array(\n 'status' => 0,\n 'status_message' => 'No Records Found.');\n } else {\n $response = $result->result_array();\n }\n return $response;\n }", "public function plan_detail(Request $request) {\n\n $validator = Validator::make($request->all(), [\n 'plan_id' => 'required|exists:subscriptions,id', \n ], array(\n 'exists' => 'The :attribute doesn\\'t exists',\n ));\n \n if ($validator->fails()) {\n\n $error_messages = implode(',', $validator->messages()->all());\n\n $response_array = array('success' => false, 'error_messages'=>$error_messages , 'error_code' => 101);\n\n return response()->json($response_array);\n }\n \n $currency = Setting::get('currency');\n\n $model = Subscription::select('id as plan_id', 'title', 'description', 'plan', 'amount', 'status', 'popular_status', 'created_at', 'unique_id', DB::raw(\"'$currency' as currency\"))->where('id',$request->plan_id)->first();\n\n if ($model) {\n\n return response()->json(['success'=>true, 'data'=>$model]);\n\n } else {\n \n return response()->json(['success'=>false, 'message'=>tr('subscription_not_found')]);\n }\n\n }", "public function getCustomerById($customer_id)\n {\n $client = $this->httpClientFactory->create();\n $client->setUri($this->chronos_url.\"customers/$customer_id/detail/\");\n $client->setMethod(\\Zend_Http_Client::GET);\n $client->setHeaders([\n 'Content-Type: application/json', \n 'Accept: application/json',\n \"Authorization: Token $this->token\"\n ]);\n try {\n $response = $client->request();\n $body = $response->getBody();\n $string = json_decode(json_encode($body),true);\n $customer_data=json_decode($string);\n \n return $customer_data;\n } catch (\\Zend_Http_Client_Exception $e) {\n $this->logger->addInfo('Chronos customer save helper', [\"Get customer error\"=>$e->getMessage()]);\n return false;\n }\n }", "public function getPlan(): ?string\n {\n return $this->plan;\n }", "public function getPlan()\n {\n return Saas::getPlan($this->getPlanIdentifier());\n }", "public function setPlan(?string $plan): self\n {\n $this->plan = $plan;\n\n return $this;\n }", "public function listPaymentMethods(string $customer_id): array;", "public function list_plan($parameters){\n try {\n $planList = Plan::all(array_filter($parameters), $this->_api_context); \n $returnArray['RESULT'] = 'Success';\n $returnArray['PLANS'] = $planList->toArray();\n $returnArray['RAWREQUEST']= json_encode($parameters);\n $returnArray['RAWRESPONSE']=$planList->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n } \n }", "public function index()\n {\n\n Log::debug(\"INDEX PLAN\");\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->listPlans();\n\n if ($result['message'] == 'Success'){\n\n $plan = $result['plans'];\n\n for ( $i = 0; $i < count($plan->data); $i++) {\n \n // determine length of stripe amount field so we can add a deciaml point and display it correctly as currency\n $amountLen = strlen($plan->data[$i]['amount_decimal']); \n $amount = substr_replace( $plan->data[$i]['amount_decimal'], '.', $amountLen - 2, 0 ); \n\n $planArray[$i]['id'] = $plan->data[$i]['id'];\n $planArray[$i]['product'] = $plan->data[$i]['product'];\n $planArray[$i]['interval'] = $plan->data[$i]['interval'];\n $planArray[$i]['amount_decimal'] = $amount;\n $planArray[$i]['nickname'] = $plan->data[$i]['nickname'];\n \n }\n\n Log::debug($planArray);\n\n $plans = json_decode(json_encode($planArray), FALSE);\n \n return view('stripe.plan.index', ['plans' => $plans ]);\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n\n return redirect()->back();\n\n }\n\n }", "protected function callPlanGetRequest($accountid)\n {\n // verify the required parameter 'accountid' is set\n if ($accountid === null || (is_array($accountid) && count($accountid) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $accountid when calling callPlanGet'\n );\n }\n\n $resourcePath = '/{accountid}/callplan';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n // path params\n if ($accountid !== null) {\n $resourcePath = str_replace(\n '{' . 'accountid' . '}',\n ObjectSerializer::toPathValue($accountid),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\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\\build_query($formParams);\n }\n }\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 $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function GetCustomers() {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM customers\";\n \n //execute the query\n $this->RunBasicQuery();\n }", "public function plans() {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Verify if account is confirmed\n $this->_check_unconfirmed_account();\n \n if ( $this->session->userdata( 'member' ) ) {\n show_404();\n }\n \n // Get all plans\n $get_plans = $this->plans->get_all_plans();\n \n // Get user plan\n $user_plan = $this->plans->get_user_plan($this->user_id);\n \n // Check if user plan expires soon\n $check_plan = $this->plans->check_if_plan_ended($this->user_id);\n \n $expires_soon = 0;\n \n if ( $check_plan ) {\n \n if ( $check_plan < time() + 432000 ) {\n \n $expires_soon = 1;\n \n }\n \n }\n \n $upgrade = '';\n \n if ( $this->session->flashdata('upgrade') ) {\n \n $upgrade = $this->session->flashdata('upgrade');\n \n }\n \n // Load view/user/plans.php file\n $this->body = 'user/plans';\n $this->content = ['plans' => $get_plans, 'user_plan' => $user_plan, 'expires_soon' => $expires_soon, 'upgrade' => $upgrade];\n $this->user_layout();\n \n }", "public function listPlans()\n\t{\n\t\t\n\t\t/* If 1.4 and no backward, then leave */\n\t\tif (!$this->backward)\n\t\t\treturn;\n\t\t\t\n\t include_once(dirname(__FILE__).'/lib/Stripe.php');\n\t\t\\Stripe\\Stripe::setApiKey(Configuration::get('STRIPE_MODE') ? Configuration::get('STRIPE_PRIVATE_KEY_LIVE') : Configuration::get('STRIPE_PRIVATE_KEY_TEST'));\n\n\t\t/* Try to process the capture and catch any error message */\n\t\ttry\n\t\t{\n\t\t\t$result_json = \\Stripe\\Plan::all();\n\t\t\t\t\t\t\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\n\t\t\t$this->_errors['stripe_subscription_error'] = $e->getMessage();\n\t\t\tif (class_exists('Logger'))\n\t\t\t\tLogger::addLog($this->l('Stripe - Plans list update failed').' '.$e->getMessage(), 1, null, 'Customer', (int)Tools::getIsset('id_customer'), true);\n\t\t}\n\t\t\n\t\tif(!isset($this->_errors['stripe_subscription_error'])){\n\t\t\tDb::getInstance()->Execute('TRUNCATE TABLE '._DB_PREFIX_.'stripepro_plans');\n\t\t\tfor($i=0;$i<count($result_json->data); $i++){\n\t\t\t Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'stripepro_plans (`stripe_plan_id`, `name`, `interval`, `amount`, `currency`, `interval_count`, `trial_period_days`) VALUES (\\''.$result_json->data[$i]->id.'\\', \\''.$result_json->data[$i]->name.'\\', \\''.$result_json->data[$i]->interval.'\\','.sprintf(\"%.2f\", $result_json->data[$i]->amount / 100).', \\''.$result_json->data[$i]->currency.'\\', '.(int)$result_json->data[$i]->interval_count.','.(int)$result_json->data[$i]->trial_period_days.')');\n\t\t\t }\n\t\t\t}\n\t\n\treturn true;\n\t\n\t}", "public function show($id)\n {\n $plan = Plan::find($id);\n $clients = $plan->clients;\n return view('plans.show' , ['plan' => $plan , 'clients' => $clients]);\n }", "public function getCustomer();", "public function showData($customer_Id)\n {\n $connection=new server(); //accessing connection from the server.php file\n $connection=$connection->serverConnnection();//accessing connection from the server.php file\n \n $sql=\"CALL show_Customer(:customer_Id)\"; //command for the sql to show data of the customer for example his name or city\n \n $PDOStatement=$connection->prepare($sql); //preapring connection to the sql\n $PDOStatement->bindParam(\":customer_Id\",$customer_Id); //binding perimeter\n $PDOStatement->execute(); // executing data\n if($row=$PDOStatement->fetch(PDO::FETCH_ASSOC)) // fetching data\n {\n $this->customer_Id=$row[\"customer_Id\"];\n $this->first_Name=$row[\"first_Name\"];\n $this->last_Name=$row[\"last_Name\"];\n $this->City=$row[\"City\"];\n $this->Province=$row[\"Province\"];\n $this->postal_Code=$row[\"postal_Code\"];\n $this->user_Name=$row[\"user_Name\"];\n $this->user_Password=$row[\"user_Password\"];\n \n }\n }", "public static function getByName($ratePlan, $options = NULL, $customClient = NULL) {\n\t\t$ratePlanID = Bf_ProductRatePlan::getIdentifier($ratePlan);\n\n\t\t$endpoint = sprintf(\"%s\",\n\t\t\trawurlencode($ratePlanID)\n\t\t\t);\n\n\t\treturn static::getCollection($endpoint, $options, $customClient);\n\t}", "public function getProviderPlanAttribute()\n {\n return $this->stripe_plan;\n }", "public static function json_search_sumo_payment_plans() {\n ob_start() ;\n\n $term = ( string ) wc_clean( stripslashes( isset( $_GET[ 'term' ] ) ? $_GET[ 'term' ] : '' ) ) ;\n $exclude = array () ;\n\n if ( isset( $_GET[ 'exclude' ] ) && ! empty( $_GET[ 'exclude' ] ) ) {\n $exclude = array_map( 'intval' , explode( ',' , $_GET[ 'exclude' ] ) ) ;\n }\n\n $args = array (\n 'type' => 'sumo_payment_plans' ,\n 'status' => 'publish' ,\n 'return' => 'posts' ,\n 'order' => 'ASC' ,\n 'orderby' => 'parent title' ,\n 's' => $term ,\n 'exclude' => $exclude ,\n ) ;\n\n $posts = _sumo_pp()->query->get( $args ) ;\n $found_plans = array () ;\n\n if ( ! empty( $posts ) ) {\n foreach ( $posts as $post ) {\n $found_plans[ $post->ID ] = $post->post_title ;\n }\n }\n wp_send_json( $found_plans ) ;\n }", "public function get_plans() {\n if (empty($this->user->admin)) {\n Router::redirect('/');\n die();\n }\n\n // extract passed parameters from jtable\n $query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);\n parse_str($query, $params);\n \n\n // count all records query\n $q = \"SELECT COUNT(*) as count\n FROM plans AS p inner join\n users as u on p.modified_by=u.user_id\n inner JOIN contacts AS c ON u.user_id=c.user_id\n and c.modified_date = (select max(modified_date) from\n contacts as c where c.user_id=p.modified_by)\n \";\n // run query\n $count = DB::instance(DB_NAME)->select_row($q);\n $order = isset($params['jtSorting']) ? $params['jtSorting'] : 'plan_id DESC';\n \n # Set up query\n $q = \"SELECT\n p.plan_id, p.description,p.time,p.public, c.first_name, c.last_name, p.modified_date, p.show\n FROM plans AS p inner join\n users as u on p.modified_by=u.user_id\n inner JOIN contacts AS c ON u.user_id=c.user_id\n and c.modified_date = (select max(modified_date) from\n contacts as c where c.user_id=p.modified_by)\n ORDER BY {$order} \n LIMIT {$params['jtStartIndex']}, {$params['jtPageSize']}\n \";\n \n # Run query\n $plans = DB::instance(DB_NAME)->select_rows($q);\n $items = array();\n $i = 0;\n foreach($plans as $plan) {\n $items[] = array(\n \"plan_id\" => $plan[\"plan_id\"],\n \"modified_date\" => Time::display($plan['modified_date'],'Y-m-d H:m:s'),\n \"first_name\" => $plan[\"first_name\"],\n \"last_name\" => $plan[\"last_name\"],\n \"public\" => $plan[\"public\"],\n \"show\" => $plan[\"show\"],\n \"description\" => $plan[\"description\"],\n \"time\" => $plan[\"time\"]\n );\n }\n\n //Return result to jTable\n $jTableResult = array();\n $jTableResult['Result'] = \"OK\";\n $jTableResult['TotalRecordCount'] = $count['count'];\n $jTableResult['Records'] = $items;\n print json_encode($jTableResult);\n }", "public function index()\n {\n return Plan::all();\n }", "public function getPlan( $name ) {\n\t\t\treturn $this->_tablePlans->fetchRow( array (\n\t\t\t\t'name = ?' => $name\n\t\t\t) );\n\t\t}", "function GetUserplan()\n\t{\t\n\t\t\t$userid=$this->input->post('userID');\n\t\t\t$propertyID=$this->input->post('PropertyID');\n\t\t\tif(!empty($userid))\n\t\t\t{\n\t\t\t\t\t$userplan=$this->AddProperty_model->GetUserplan($this->input->post('userID'));\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($userplan)){\n\t\t\t\t\t\techo\"<option value=''>Select User</option>\";\n\t\t\t\t\t\tforeach($userplan as $userplans){\n\t\t\t\t\t\t\t?><option value=\"<?=$userplans->planID?>\" <?php if(!empty($propertyID)){ $PlaneDetail=$this->AddProperty_model->Getotherdata('rp_dbho_plan_mapping',array('objectID'=>$propertyID,'objectType'=>'property')); if(!empty($PlaneDetail[0]->planID)){if($PlaneDetail[0]->planID==$userplans->planID){ echo 'selected'; } }} ?>><?=$userplans->planTitle;?></option>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t<?php }\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo\"<option value=''>No Plan Found!</option>\";\n\t\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t\n\t\t\t}\n\t\t\n\t}", "public function getPaymentPlan()\n {\n if (!$this->hasPaymentPlan()) {\n return null;\n }\n\n $plan = $this->getData()->hire_purchase[0]->instl_plan[0];\n\n $return = [\n 'num_inst' => (string)$plan['num_inst'],\n 'duration' => (string)$plan->calc[0]->duration,\n 'fee_percent' => (string)$plan->calc[0]->fee_percent,\n 'fee_total' => bcdiv((string)$plan->calc[0]->fee_total, 100, 2),\n 'pre_payment' => bcdiv((string)$plan->calc[0]->pre_payment, 100, 2),\n 'total_amount' => bcdiv((string)$plan->calc[0]->total_amount, 100, 2),\n 'eff_anual' => bcdiv((string)$plan->calc[0]->eff_anual, 100, 2),\n 'nominal' => bcdiv((string)$plan->calc[0]->nominal, 100, 2),\n 'instl' => $this->getPaymentPlanInstallments()\n ];\n\n return $return;\n }", "abstract function has_paid_plan();", "public static function initiatePayLaterPlans($params = [])\n {\n $requiredParams = [\n 'customer_id',\n 'channel_code',\n 'currency',\n 'amount',\n 'order_items',\n ];\n\n self::validateParams($params, $requiredParams);\n\n $url = static::classUrl() . '/plans';\n\n return static::_request('POST', $url, $params);\n }", "function getCcInfoByCustId($customerid) {\n $query = \"SELECT * FROM `creditcards` WHERE CustomerId='\".$customerid.\"'\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result[0];\n }\n }", "public function query(CustomerPassport $model) {\n $model = $model->newQuery();\n\n // Making Query\n if (isset($this->data['full_name'])) {\n $model->where('full_name', 'like', '%' . $this->data['full_name'] .'%');\n }\n if (isset($this->data['passport_no'])) {\n $model->where('passport_no', '=', $this->data['passport_no']);\n }\n if (isset($this->data['date_of_birth'])) {\n $model->where('date_of_birth', '=', Carbon::parse($this->data['date_of_birth'])->format('Y-m-d'));\n }\n if (isset($this->data['issue_date'])) {\n $model->where('issue_date', '=', Carbon::parse($this->data['issue_date'])->format('Y-m-d'));\n }\n if (isset($this->data['expiry_date'])) {\n $model->where('expiry_date', '=', Carbon::parse($this->data['expiry_date'])->format('Y-m-d'));\n }\n if (isset($this->data['issue_location'])) {\n $model->where('issue_location', 'like', '%' . $this->data['issue_location'] . '%');\n }\n // End Of Making Query\n return $model;\n }", "public function planFind($id);", "public function getPlanById($id)\n {\n try {\n return $this->plan->find($id);\n } catch (\\Exception $e) {\n self::logErr($e->getMessage());\n return false;\n }\n }", "public function updateBillingInfo($customer_id, $billing_addr_params) {\n try {\n $result = ChargeBee_Customer::updateBillingInfo($customer_id, $billing_addr_params);\n //$jsonResponse = array(\"forward\" => \"/ssp-php/subscription\");\n //print json_encode($jsonResponse, true);\n }\n catch(ChargeBee_InvalidRequestException $e) {\n handleInvalidRequestErrors($e);\n $result = false;\n }\n catch (Exception $e) {\n handleGeneralErrors($e);\n $result = false;\n }\n\n return $result;\n }", "public function show($idPlan)\n\t{\n\t\t$this->db->select('Block.idBlock');\n\t\t$this->db->select('Block.name as name');\n\t\t$this->db->select('Block.state');\n\t\t$this->db->select('Block.idPlan');\n\t\t$this->db->select('Plan.name as planName');\n\t\t$this->db->from('Block');\n\t\t$this->db->join('Plan', 'Block.idPlan = Plan.idPlan');\n\n\t\tif ($idPlan)\n\t\t{\n\t\t\t$this->db->where('Block.idPlan', $idPlan);\n\t\t}\n\n\t\t$query = $this->db->get();\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query;\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function customer_list(){\r\n\t\t\r\n\t\t$query = isset($_POST['query']) ? $_POST['query'] : \"\";\r\n\t\t$start = (integer) (isset($_POST['start']) ? $_POST['start'] : $_GET['start']);\r\n\t\t$end = (integer) (isset($_POST['limit']) ? $_POST['limit'] : $_GET['limit']);\r\n\r\n\t\t$result=$this->m_customer->customer_list($query,$start,$end);\r\n\t\techo $result;\r\n\t}", "public function getCustomer($url, $customerUUID);", "public function show(Customer $customer)\n {\n return new CustomerResource($customer);\n }", "public function getPaymentplans() {\n return $this->paymentPlans;\n }", "public function show(Customer $customer)\n {\n return $customer->load(['city','zipcode']);\n }" ]
[ "0.59946686", "0.5803131", "0.577185", "0.574437", "0.56849277", "0.5673585", "0.5654416", "0.5637344", "0.5628221", "0.56029874", "0.5549823", "0.5522442", "0.5508262", "0.5487575", "0.54442525", "0.543383", "0.5418427", "0.54067606", "0.5406201", "0.5376684", "0.5349627", "0.53396595", "0.5322474", "0.53079593", "0.5285013", "0.527226", "0.5259238", "0.5249009", "0.5245061", "0.5245061", "0.5245061", "0.5245061", "0.5245061", "0.5245061", "0.5245061", "0.5245061", "0.5218971", "0.5199072", "0.5197247", "0.5181683", "0.51756954", "0.5174791", "0.5170715", "0.5162735", "0.5157041", "0.5150052", "0.5124048", "0.51060945", "0.5097817", "0.5094089", "0.5085838", "0.5083529", "0.5079535", "0.50746024", "0.50666976", "0.50564843", "0.50361794", "0.50345564", "0.5033858", "0.5029262", "0.5021352", "0.501966", "0.49742696", "0.49738282", "0.49698734", "0.49644607", "0.49634853", "0.4963301", "0.4962687", "0.49587762", "0.49460092", "0.4943432", "0.494327", "0.49365202", "0.49351677", "0.48913488", "0.4890296", "0.4885513", "0.4874612", "0.48691067", "0.4868884", "0.48651502", "0.48618492", "0.4861671", "0.48570567", "0.48537847", "0.4852777", "0.4844136", "0.4840666", "0.483672", "0.48295295", "0.48279223", "0.48277816", "0.48274064", "0.48228914", "0.4819007", "0.4815487", "0.48068234", "0.48023793", "0.48017782", "0.47919568" ]
0.0
-1
Gets this customer payment plan from the local database. Minimal usage: $this>id = 'cp_000000000000000'; $this>db_get(); $this>customerId = 'cust_000000000000000'; $this>planId = 'rp_000000000000000'; $this>db_get();
private function db_get() { if ($this->trackId == null) { return FALSE; } $sqlRepsonse = db_select('uc_checkoutpayment_hub_communication', 'c') ->fields('c') ->condition('track_id', $this->trackId, '=') ->orderBy('created', 'DESC') ->execute() ->fetchAll(); if (!empty($sqlRepsonse)) { $data = reset($sqlRepsonse); $default = end($sqlRepsonse); $this->email = $default->email; foreach ($sqlRepsonse as $charge) { if ($charge->status == $data->status) { $this->value += $charge->value; } if ($charge->responseCode == '10100') { $data->responseMessage = $charge->responseMessage; } } $this->id = $data->id; $this->created = $data->created; $this->trackId = $data->track_id; $this->currency = $data->currency; $this->responseMessage = $data->responseMessage; $this->responseCode = $data->responseCode; $this->status = $data->status; return TRUE; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_plan()\n\t{\n\t\treturn $this->m_plan;\n\t}", "function TestPlan_get($plan_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestPlan.get', array(new xmlrpcval($plan_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function getPlan();", "public function show($id)\n {\n $plan = Plan::find($id);\n return $plan;\n }", "public function getBillingPlan(User $user, $id);", "public function get($planIdOrKey)\n {\n $ret = $this->exec($this->uri.\"/$planIdOrKey?expand=plans\", null);\n\n $this->log->addInfo('Result='.$ret);\n\n $prj = $this->json_mapper->map(\n json_decode($ret), new Plan()\n );\n\n return $prj;\n }", "public function getPlanById()\n {\n // Arrange\n // Act\n if (! isset($this->plans)) {\n $this->getsAListOfPlans();\n }\n $plans = $this->plans;\n $plan = $plans['data'][0];\n\n $plan = Ezypay::getPlan($plan['id']);\n\n // Assert\n $this->assertNotNull($plan);\n $this->assertEquals($plan['id'], $plan['id']);\n }", "public function getPlanById(int $id){\n $this->open();\n\n $result = $this->query('SELECT * FROM '.$this->TABLE_NAME.' WHERE id=:id', array(\n new QueryParam(':id', $id, PDO::PARAM_INT)\n ));\n\n // Close connection\n $this->close();\n\n // Check if is found\n if($result->rowCount() > 0){\n\n // Check result\n while($row = $result->fetch(PDO::FETCH_OBJ)){\n $foundPlan = new Plan(\n $row->id,\n $row->name,\n $row->price,\n $row->detail,\n $row->docsUrl\n );\n\n return $foundPlan;\n }\n\n }\n else{\n // It isn't found so return false\n return false;\n }\n\n }", "public function getBilling();", "public static function getByID($id)\n\t{\n\t\t$db = UserConfig::getDB();\n\t\t$account = null;\n\n\t\tif ($stmt = $db->prepare('SELECT name, plan FROM '.UserConfig::$mysql_prefix.'accounts WHERE id = ?'))\n\t\t{\n\t\t\tif (!$stmt->bind_param('i', $id))\n\t\t\t{\n\t\t\t\t throw new Exception(\"Can't bind parameter\".$stmt->error);\n\t\t\t}\n\t\t\tif (!$stmt->execute())\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Can't execute statement: \".$stmt->error);\n\t\t\t}\n\t\t\tif (!$stmt->bind_result($name, $plan_id))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Can't bind result: \".$stmt->error);\n\t\t\t}\n\n\t\t\tif ($stmt->fetch() === TRUE)\n\t\t\t{\n\t\t\t\t$account = new self($id, $name, Plan::getByID($plan_id), Account::ROLE_USER);\n\t\t\t}\n\n\t\t\t$stmt->close();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception(\"Can't prepare statement: \".$db->error);\n\t\t}\n\n\t\treturn $account;\n\t}", "public function GetPlanDetails($planID) {\n\t\t$planID = mysqli_real_escape_string($this->db, $planID);\n\t\tif ($this->CheckPlanExist($planID) == '1') {\n\t\t\t$query = mysqli_query($this->db, \"SELECT * FROM i_premium_plans WHERE plan_id = '$planID'\") or die(mysqli_error($this->db));\n\t\t\t$data = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\t\treturn $data;\n\t\t} else {return false;}\n\t}", "private function get()\n {\n $db = 'Ernio\\\\Bankas\\\\' . $this->settings;\n return $db::get();\n }", "public function get_customer($id = null) {\n $this->db->select('*');\n if ($id != NULL) {\n $this->db->where('customer_id_pri', $id);\n }\n $this->db->order_by('customer_id_pri');\n return $this->db->get('customer');\n }", "public function getPaymentPlan()\n {\n return $this->payment_plan;\n }", "public function getUserPlan($userId) {\n\n $database = new Database();\n\n $query = 'SELECT * FROM user_plan WHERE User_Id=:User_Id';\n\n $result = $database->prepareQuery($query, 'User_Id', [$userId], TRUE, TRUE);\n \n return $result;\n }", "public function getPlanData(){\n\t\t$sql = \"SELECT * FROM plan\";\n\t\t$query = $this->db->query($sql);\n\t\treturn $query->result_array();\n\t}", "public function getCustomer($customer_id);", "public function getPlan( $name ) {\n\t\t\treturn $this->_tablePlans->fetchRow( array (\n\t\t\t\t'name = ?' => $name\n\t\t\t) );\n\t\t}", "public function getPlanById($id)\n {\n try {\n return $this->plan->find($id);\n } catch (\\Exception $e) {\n self::logErr($e->getMessage());\n return false;\n }\n }", "function GetUserplan($userid=false,$IdentityVariable=false)\n\t{\t\t\n\t\t\tif($IdentityVariable=='')\n\t\t\t{\n\t\t\t\t$IdentityVariable='Project';\n\t\t\t}\n\t\t\t$qry = $this->db->query(\"select rp_dbho_campaignplan.planID,planTitle,rp_dbho_campaignmaster.campaignID from rp_dbho_campaignmaster,rp_dbho_campaignplan,rp_user_plan_details,rp_dbho_user_plans_subdetail where\n\t\t\t\t\t\t\t\t\trp_dbho_campaignmaster.userID=$userid and\n\t\t\t\t\t\t\t\t\trp_dbho_campaignmaster.campaignID=rp_dbho_campaignplan.campaignID and\n\t\t\t\t\t\t\t\t\trp_dbho_campaignplan.planID=rp_user_plan_details.planID and\n\t\t\t\t\t\t\t\t\trp_dbho_campaignplan.planID=rp_dbho_user_plans_subdetail.planID and\n\t\t\t\t\t\t\t\t\trp_dbho_user_plans_subdetail.listingType='$IdentityVariable' and\n\t\t\t\t\t\t\t\t\trp_user_plan_details.languageID='1' and rp_dbho_campaignplan.status!='completed'\");\t\n\t\t\treturn $qry->Result();\t\n\t}", "function get()\n\t{\n\t\tif (empty($this->use_db)) $this->use_db = false; //use default connection\n\t\t$this->sql = 'SELECT * FROM ' . $this->table;\n\t\t$this->apply_filters();\n\t\t$this->apply_sort();\n\t\treturn $this->fetch_records();\n\t}", "public function getPlan()\n {\n return Saas::getPlan($this->getPlanIdentifier());\n }", "public static function getInstance()\n {\n if (!is_object(self::$_instance)) //or if( is_null(self::$_instance) ) or if( self::$_instance == null )\n self::$_instance = new Plan();\n return self::$_instance;\n }", "public function getCustomerById($id){ \n $query = \"SELECT * FROM tbl_customer WHERE id = '$id' \";\n $result = $this->db->select($query);\n return $result;\n }", "public function show($id)\n {\n Log::debug(\"SHOW PLAN IN CONTROLLER\");\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->findPlan($id);\n\n if ($result['message'] == 'Success'){\n\n return new StripePlanResource($result['plan']);\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n\n return redirect()->back();\n\n }\n\n }", "public function get($id)\n {\n return Customer::find($id);\n }", "public function purchased_plan()\n {\n return $this->hasOne(PurchasedPlanProxy::modelClass(), 'saas_subscription_recurring_profile_id');\n }", "public function getCustomer();", "function fetchPlanId($id) // user-profile.php\r\n\r\n{\r\n\r\n\tglobal $mysqli,$db_table_prefix; \r\n\r\n\t$stmt = $mysqli->prepare(\"SELECT \r\n\r\n\t\tplan_id\r\n\r\n\t\tFROM \".$db_table_prefix.\"users\r\n\t\t\r\n\t\tWHERE\r\n\t\t\r\n\t\tid = ?\");\r\n\r\n\t$stmt->bind_param(\"i\", $id);\r\n\t\r\n\t$stmt->execute();\r\n\r\n\t$stmt->bind_result($planid);\r\n\t\r\n\twhile ($stmt->fetch()){\r\n\r\n\t\t$row[] = array('planid' => $planid);\r\n\r\n\t}\r\n\r\n\t$stmt->close();\r\n\t\r\n\treturn ($row);\r\n\r\n}", "public function getBilling()\n {\n return isset($this->billing) ? $this->billing : null;\n }", "public function GetCustomer($customer_id) {\n\n //set up the query\n $this->sql = \"SELECT *\n FROM customers\n WHERE customerID = :customer_id\";\n \n //execute the query\n $this->RunAdvancedQuery([\n ':customer_id' => $customer_id,\n ]);\n }", "public function planFind($id);", "public function query()\n {\n return Customer::query();\n }", "public function getCustomer(int $id)\n {\n return Customer::where('id', $id)->first();\n }", "public static function get_customer( $id=0 ) {\r\n\t\tglobal $wpdb;\r\n\r\n\t\treturn $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$wpdb->prefix}customers WHERE id = %d\", $id ) );\r\n\t}", "public function getProviderPlanAttribute()\n {\n return $this->stripe_plan;\n }", "public function plan_renewal_ci()\n\t{\n\t\t// * there should only be 1 such renewal\n\t\t$sql = \"SELECT ci.* FROM co_component_item ci \n\t\t\tINNER JOIN co_component_set cs \n\t\t\tON ci.component_set_id = cs.id \n\t\t\tAND (ci.is_renewable = 1 OR ci.is_auto_renew_enabled = 1)\n\t\t\tAND cs.user_id = ? \n\t\t\tINNER JOIN co_item i \n\t\t\tON ci.item_id = i.id AND i.type = ?\n\t\t\tLIMIT 1\";\n\t\t\t\n\t\t$db_result = $this->db->query($sql, \n\t\t\tarray($this->id, Model_Item::TYPE_PLAN));\n\t\t$ex_component_item = Model_Component_Item::from_db($db_result);\n\t\treturn $ex_component_item;\n\t}", "function getCustomer($db_link, $custID){\n\t\t$sql_cust = \"SELECT * FROM customer LEFT JOIN custsex ON customer.custsex_id = custsex.custsex_id LEFT JOIN custmarried ON customer.custmarried_id = custmarried.custmarried_id LEFT JOIN custsick ON customer.custsick_id = custsick.custsick_id LEFT JOIN user ON customer.user_id = user.user_id WHERE cust_id = '$custID'\";\n\t\t$query_cust = mysqli_query($db_link, $sql_cust);\n\t\tcheckSQL($db_link, $query_cust, $db_link);\n\t\t$result_cust = mysqli_fetch_assoc($query_cust);\n\n\t\treturn $result_cust;\n\t}", "public function plan()\n {\n return $this->belongsTo('App\\Models\\Flights\\FlightPlan', 'plan_id');\n }", "public function plan()\n {\n return $this->hasOne('App\\UserPlan');\n }", "function getCcInfoByCustId($customerid) {\n $query = \"SELECT * FROM `creditcards` WHERE CustomerId='\".$customerid.\"'\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result[0];\n }\n }", "public function show($idPlan)\n\t{\n\t\t$this->db->select('Block.idBlock');\n\t\t$this->db->select('Block.name as name');\n\t\t$this->db->select('Block.state');\n\t\t$this->db->select('Block.idPlan');\n\t\t$this->db->select('Plan.name as planName');\n\t\t$this->db->from('Block');\n\t\t$this->db->join('Plan', 'Block.idPlan = Plan.idPlan');\n\n\t\tif ($idPlan)\n\t\t{\n\t\t\t$this->db->where('Block.idPlan', $idPlan);\n\t\t}\n\n\t\t$query = $this->db->get();\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query;\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function getCustomer()\n {\n if (null === $customer && isset($this['CUSTOMER_ID']))\n {\n $this->customer = \\Fastbill\\Customer\\Finder::findOneById($this['CUSTOMER_ID']);\n }\n return $this->customer;\n }", "public function getBilling()\n {\n return $this->billing;\n }", "public function getBilling()\n {\n return $this->billing;\n }", "function GetUserplan()\n\t{\t\n\t\t\t$userid=$this->input->post('userID');\n\t\t\t$propertyID=$this->input->post('PropertyID');\n\t\t\tif(!empty($userid))\n\t\t\t{\n\t\t\t\t\t$userplan=$this->AddProperty_model->GetUserplan($this->input->post('userID'));\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($userplan)){\n\t\t\t\t\t\techo\"<option value=''>Select User</option>\";\n\t\t\t\t\t\tforeach($userplan as $userplans){\n\t\t\t\t\t\t\t?><option value=\"<?=$userplans->planID?>\" <?php if(!empty($propertyID)){ $PlaneDetail=$this->AddProperty_model->Getotherdata('rp_dbho_plan_mapping',array('objectID'=>$propertyID,'objectType'=>'property')); if(!empty($PlaneDetail[0]->planID)){if($PlaneDetail[0]->planID==$userplans->planID){ echo 'selected'; } }} ?>><?=$userplans->planTitle;?></option>\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t<?php }\n\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\techo\"<option value=''>No Plan Found!</option>\";\n\t\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t\n\t\t\t}\n\t\t\n\t}", "public function getQueryPlan()\n {\n return $this->query_plan;\n }", "public function cargarCuentas($idPlan)\n\t{\n\t\t$sql='SELECT ID_SUBTIPOCUENTA,DESCRIPCION_CUENTA from Cuenta WHERE ID_PLANCUENTA='.$idPlan.'';\n\t\t$connection = Yii::app()->db;\n $command = $connection->createCommand($sql);\n $dataReader = $command->queryAll();\n return $dataReader;\n\t}", "public function getPlan(): ?string\n {\n return $this->plan;\n }", "private function getPlanInfo($account_id)\n {\n if (!$account_id) {\n trigger_error('Unable to get get plan info, no $account_id parameter provided', E_USER_ERROR);\n return;\n }\n\n if ($this->planType == 'account') {\n if ($GLOBALS['account_info']['plan']) {\n $plan = $GLOBALS['account_info']['plan'];\n } else {\n $plan = $this->plans[$this->planID];\n }\n } else {\n $GLOBALS['reefless']->loadClass('Plan');\n $plan = $GLOBALS['rlPlan']->getPlan($this->planID, $account_id);\n }\n\n return $plan;\n }", "function getPlanServices($conn, $planID){\n\n\t$sql = \"SELECT * FROM planservice WHERE planId = :planID\";\n\t\n\t$sth = $conn->prepare($sql);\n\t$sth->bindParam(':planID', $planID, PDO::PARAM_INT, 11);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows;\n}", "public function get()\n {\n $filePath = resource_path() . '/sql/' . $this->filename . '.sql';\n\n // Get the contents of the file\n $fileContents = File::get($filePath);\n\n // Run the query\n $result = DB::select($fileContents, $this->parameters);\n\n // Return the result\n return $result;\n }", "public function billingPlan($id)\n {\n $this->shellshock(request(), [\n 'number' => 'required|numeric',\n 'exp_month' => 'required|numeric',\n 'exp_year' => 'required|numeric',\n 'cvc' => 'required|numeric',\n ]);\n\n Stripe::setApiKey(config('turtle.billing.stripe_secret_key'));\n\n // create card token\n $token = Token::create([\n 'card' => [\n 'number' => request()->input('number'),\n 'exp_month' => request()->input('exp_month'),\n 'exp_year' => request()->input('exp_year'),\n 'cvc' => request()->input('cvc'),\n ],\n ]);\n\n // create/update customer\n if (!auth()->user()->billing_customer) {\n $customer = Customer::create([\n 'source' => $token->id,\n 'email' => auth()->user()->email,\n ]);\n }\n else {\n $customer = Customer::retrieve(auth()->user()->billing_customer);\n $customer->source = $token->id;\n $customer->save();\n }\n\n // create/update subscription\n if (!auth()->user()->billing_subscription) {\n $subscription = Subscription::create([\n 'customer' => $customer->id,\n 'items' => [['plan' => $id]],\n ]);\n }\n else {\n $subscription = Subscription::retrieve(auth()->user()->billing_subscription);\n Subscription::update($subscription->id, [\n 'items' => [[\n 'id' => $subscription->items->data[0]->id,\n 'plan' => $id,\n ]],\n ]);\n }\n\n // update user\n auth()->user()->update([\n 'billing_customer' => $customer->id,\n 'billing_subscription' => $subscription->id,\n 'billing_plan' => $id,\n 'billing_cc_last4' => $token->card->last4,\n 'billing_period_ends' => Carbon::createFromTimestamp($subscription->current_period_end),\n ]);\n\n activity('Subscribed to '.$id);\n flash('success', 'Thanks for subscribing!');\n\n return response()->json(['reload_page' => true]);\n }", "public function GetCustomers() {\n \n //set up the query\n $this->sql = \"SELECT *\n FROM customers\";\n \n //execute the query\n $this->RunBasicQuery();\n }", "function getCustomer()\n {\n\n $id_profile = $this->session->userdata('sess_id_profile');\n $query = \"SELECT * FROM customer WHERE id_profile = '$id_profile'\";\n $hasil = $this->db->query($query);\n\n return $hasil;\n }", "function getBillByID($billID) {\n\t$db = connectDB();\n $sql = <<<SQL\n \tSELECT billID, startDate, destination, description, cost, isPaid, userID\n \tFROM bills\n\t\tWHERE billID = ?\nSQL;\n\n\t$stmt = $db->prepare($sql);\n\t$stmt->bind_param(\"i\", $billID);\n\t$stmt->execute();\n\n\t$res = $stmt->get_result()->fetch_assoc();\n\n\t$stmt->close();\n\t$db->close();\n\treturn $res;\n}", "function getMemberDetailPT()\n{\n\tglobal $con;\n\t$custID = $_POST['IDtoView'];\n\tif (!$con) {\n\t\techo 'failed to connect:' . mysqli_connect_error();\n\t\texit;\n\t} else {\n\t\t$sql = \"SELECT * from product_order WHERE cust_ID='$custID'\";\n\t\t$qry = mysqli_query($con, $sql);\n\t\treturn $qry;\n\t}\n}", "function TestCase_get_plans($case_id) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.get_plans', array(new xmlrpcval($case_id, \"int\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "public function get() {\r\n if ($this->_db == null) {\r\n $this->connect();\r\n }\r\n return $this->_db->get($this->key);\r\n }", "abstract public function getCustomer($ID);", "public function get_plan($planId){\n try {\n $plan = Plan::get($planId, $this->_api_context);\n $returnArray['RESULT'] = 'Success';\n $returnArray['PLAN'] = $plan->toArray();\n $returnArray['RAWREQUEST']='{id:'.$planId.'}';\n $returnArray['RAWRESPONSE']=$plan->toJSON();\n return $returnArray;\n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "public static function byPlan($plan_id)\n {\n $payload = [\n 'recurringplan' => [\n 'recurringplanid' => $plan_id,\n ],\n ];\n\n return static::all($payload);\n }", "public function getCustomerData($id){\n $query = \"SELECT * FROM tbl_customer WHERE id = '$id' \";\n $result = $this->db->select($query); \n return $result;\n }", "function getCustomerById_customer($id_customer)\n {\n\n\n\n $query = \"SELECT * FROM `customer` WHERE id_customer = '$id_customer'\";\n $hasil = $this->db->query($query);\n\n return $hasil;\n }", "public function getPlanPriceDetail($planId, $month)\n {\n return PlanPrice::where(['plan_id' => $planId, 'plan_month' => $month])->first(['id', 'price', 'regular_price']);\n }", "public function read()\n {\n // Create query\n $query = '\n SELECT *\n FROM ' . $this->table . ' \n WHERE user_id = ?';\n \n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Bind ID\n $stmt->bindParam(1, $this->user_id);\n\n // Execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function model()\n {\n return Plan::class;\n }", "public function getPlanIdentifier()\n {\n return $this->stripe_price;\n }", "public function getBillingProfile();", "public static function getByName($ratePlan, $options = NULL, $customClient = NULL) {\n\t\t$ratePlanID = Bf_ProductRatePlan::getIdentifier($ratePlan);\n\n\t\t$endpoint = sprintf(\"%s\",\n\t\t\trawurlencode($ratePlanID)\n\t\t\t);\n\n\t\treturn static::getCollection($endpoint, $options, $customClient);\n\t}", "protected function db()\n {\n $this->loadDb();\n\n return $this->resource;\n }", "public function listPlans()\n\t{\n\t\t\n\t\t/* If 1.4 and no backward, then leave */\n\t\tif (!$this->backward)\n\t\t\treturn;\n\t\t\t\n\t include_once(dirname(__FILE__).'/lib/Stripe.php');\n\t\t\\Stripe\\Stripe::setApiKey(Configuration::get('STRIPE_MODE') ? Configuration::get('STRIPE_PRIVATE_KEY_LIVE') : Configuration::get('STRIPE_PRIVATE_KEY_TEST'));\n\n\t\t/* Try to process the capture and catch any error message */\n\t\ttry\n\t\t{\n\t\t\t$result_json = \\Stripe\\Plan::all();\n\t\t\t\t\t\t\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\n\t\t\t$this->_errors['stripe_subscription_error'] = $e->getMessage();\n\t\t\tif (class_exists('Logger'))\n\t\t\t\tLogger::addLog($this->l('Stripe - Plans list update failed').' '.$e->getMessage(), 1, null, 'Customer', (int)Tools::getIsset('id_customer'), true);\n\t\t}\n\t\t\n\t\tif(!isset($this->_errors['stripe_subscription_error'])){\n\t\t\tDb::getInstance()->Execute('TRUNCATE TABLE '._DB_PREFIX_.'stripepro_plans');\n\t\t\tfor($i=0;$i<count($result_json->data); $i++){\n\t\t\t Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'stripepro_plans (`stripe_plan_id`, `name`, `interval`, `amount`, `currency`, `interval_count`, `trial_period_days`) VALUES (\\''.$result_json->data[$i]->id.'\\', \\''.$result_json->data[$i]->name.'\\', \\''.$result_json->data[$i]->interval.'\\','.sprintf(\"%.2f\", $result_json->data[$i]->amount / 100).', \\''.$result_json->data[$i]->currency.'\\', '.(int)$result_json->data[$i]->interval_count.','.(int)$result_json->data[$i]->trial_period_days.')');\n\t\t\t }\n\t\t\t}\n\t\n\treturn true;\n\t\n\t}", "public function find($id)\n {\n foreach ($this->plans as $plan) {\n if ($plan->id === $id) {\n return $plan;\n }\n }\n\n throw new Exception(\"Unable to find plan with ID [{$id}].\");\n }", "public function get_plans()\n {\n //\n\n \n $user_id = Auth::user()->id;\n\n $listing_code = Session::get('listing_code');\n\n\n $listing = Listing::where('listing_code', $listing_code)->where('agent_id', $user_id)->first();\n\n try {\n //code...\n\n $floor_plans = ListingFloorPLan::where('listing_id', $listing->id)->latest()->get();\n\n } catch (\\Throwable $th) {\n //throw $th;\n\n return $th;\n }\n\n \n\n\n\n return $floor_plans;\n }", "public function get($cust_id){\n\t\t/* ensure cust_id is an integer */\n\t\tif(!is_numeric($cust_id)) throw new Exception(\"cust_id of customer must be an integer\");\n\n\t\t$result=mysql_query(\"SELECT * FROM customer WHERE cust_id=$cust_id\");\n\t\tif($result){/*ensure query success*/\n\t\t\tif($row = mysql_fetch_array($result)){/*ensure record*/\n\t\t\t\t$vo = new customer($row['uid'],$row['name'],$row['firm_name'],$row['address'],$row['phone'],$row['email']);\n\t\t\t\t$vo->cust_id = $cust_id;\n\t\t\t\treturn $vo;\n\t\t\t}\n\t\t}\n\n\t\treturn NULL;\n\t}", "public function show($id)\n {\n $plan = App\\Plan::findOrFail($id);\n //carpeta plan, dentro show.blade.php\n //return view('plan.show', compact('plan'));\n return $plan;\n }", "public function plan_info( $plan_id ) {\r\n\t\treturn $this->_send_request( 'plans/'.$plan_id );\r\n\t}", "public function customer()\n {\n return Customer::retrieve($this->customer);\n }", "protected function getCustomer()\n {\n if($this->isAdmin()) {\n return Mage::getModel('customer/customer')->load(Mage::getSingleton('adminhtml/session_quote')->getCustomerId()); // Get customer from admin panel quote\n } else {\n return Mage::getModel('customer/session')->getCustomer(); // Get customer from frontend quote\n }\n }", "public function plan()\n {\n return $this->belongsTo('App\\Plan');\n }", "public function getFromDB() {}", "function get($id) {\n $tablename = $this->table_name;\n $query = \"SELECT * from \".$tablename.\" WHERE id='\".$id.\"';\";\n // prepare query statement\n if(!($result = mysqli_query($this->conn, $query))) {\n echo \"Could not execute query!<br>\";\n echo(\"Error description: \" . mysqli_error($this->conn));\n die(mysqli_error($this->conn));\n } else {\n return $result;\n }\n }", "public function plans() {\n return new Plan($this);\n }", "public function index()\n {\n return DB::select('call sp_getCustomerDetail('.Auth::user()->id.')');\n }", "public function get_plans() {\n if (empty($this->user->admin)) {\n Router::redirect('/');\n die();\n }\n\n // extract passed parameters from jtable\n $query = parse_url($_SERVER['REQUEST_URI'], PHP_URL_QUERY);\n parse_str($query, $params);\n \n\n // count all records query\n $q = \"SELECT COUNT(*) as count\n FROM plans AS p inner join\n users as u on p.modified_by=u.user_id\n inner JOIN contacts AS c ON u.user_id=c.user_id\n and c.modified_date = (select max(modified_date) from\n contacts as c where c.user_id=p.modified_by)\n \";\n // run query\n $count = DB::instance(DB_NAME)->select_row($q);\n $order = isset($params['jtSorting']) ? $params['jtSorting'] : 'plan_id DESC';\n \n # Set up query\n $q = \"SELECT\n p.plan_id, p.description,p.time,p.public, c.first_name, c.last_name, p.modified_date, p.show\n FROM plans AS p inner join\n users as u on p.modified_by=u.user_id\n inner JOIN contacts AS c ON u.user_id=c.user_id\n and c.modified_date = (select max(modified_date) from\n contacts as c where c.user_id=p.modified_by)\n ORDER BY {$order} \n LIMIT {$params['jtStartIndex']}, {$params['jtPageSize']}\n \";\n \n # Run query\n $plans = DB::instance(DB_NAME)->select_rows($q);\n $items = array();\n $i = 0;\n foreach($plans as $plan) {\n $items[] = array(\n \"plan_id\" => $plan[\"plan_id\"],\n \"modified_date\" => Time::display($plan['modified_date'],'Y-m-d H:m:s'),\n \"first_name\" => $plan[\"first_name\"],\n \"last_name\" => $plan[\"last_name\"],\n \"public\" => $plan[\"public\"],\n \"show\" => $plan[\"show\"],\n \"description\" => $plan[\"description\"],\n \"time\" => $plan[\"time\"]\n );\n }\n\n //Return result to jTable\n $jTableResult = array();\n $jTableResult['Result'] = \"OK\";\n $jTableResult['TotalRecordCount'] = $count['count'];\n $jTableResult['Records'] = $items;\n print json_encode($jTableResult);\n }", "static public function mdlCustomer($table){\n\n\t\t$stmt = Connect::connection()->prepare(\"SELECT * FROM $table\");\n\n\t\t$stmt -> execute();\n\n\t\treturn $stmt -> fetchAll();\n\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\n\t}", "public function getPaymentPlan()\n {\n if (!$this->hasPaymentPlan()) {\n return null;\n }\n\n $plan = $this->getData()->hire_purchase[0]->instl_plan[0];\n\n $return = [\n 'num_inst' => (string)$plan['num_inst'],\n 'duration' => (string)$plan->calc[0]->duration,\n 'fee_percent' => (string)$plan->calc[0]->fee_percent,\n 'fee_total' => bcdiv((string)$plan->calc[0]->fee_total, 100, 2),\n 'pre_payment' => bcdiv((string)$plan->calc[0]->pre_payment, 100, 2),\n 'total_amount' => bcdiv((string)$plan->calc[0]->total_amount, 100, 2),\n 'eff_anual' => bcdiv((string)$plan->calc[0]->eff_anual, 100, 2),\n 'nominal' => bcdiv((string)$plan->calc[0]->nominal, 100, 2),\n 'instl' => $this->getPaymentPlanInstallments()\n ];\n\n return $return;\n }", "function getCurrentContinueReport($conn, $planID){\n\t$sql = \"SELECT * FROM plan WHERE PlanId = :planID\";\n\n\tsession_start();\n\t\t$_SESSION['planID'] = $planID;\n\tsession_write_close();\n\t\n\t$sth = $conn->prepare($sql);\n\t$sth->bindParam(':planID', $planID, PDO::PARAM_INT, 11);\n\t$sth->execute();\n\t\n\t$row = $sth->fetch(PDO::FETCH_ASSOC);\n\t\n\t$row['serviceArray'] = getPlanServices($conn, $planID);\n\t$row['inspectorArray'] = getInspectedBy($conn, $planID);\n\t$row['dateArray'] = getDatesInspected($conn, $planID);\n\t$row['planComponents'] = getPlanComponents($conn, $planID);\n\t$row['incompleteComponents'] = getIncompleteComponents($conn, $planID);\n\t//deleteContinueReport($conn, $planID);\n\treturn $row;\n}", "public function show( $planId )\n\t{\n\t\t$plan = Plan::with('website', 'product')\n\t\t\t->findOrFail($planId);\n\n\t\treturn view('admin/products/billingplans/show', [\n\t\t\t'website' => $plan->product->website,\n\t\t\t'product' => $plan->product,\n\t\t\t'plan' => $plan,\n\t\t\t'periodicity' => $this->periodicity,\n\t\t]);\n\t}", "public function findEagerly($id)\n {\n $query = $this->getEntityManager()->createQuery('\n SELECT bp\n FROM VeniceAppBundle:BillingPlan AS bp\n WHERE bp.id = :id\n ')\n ->setParameter('id', $id);\n\n return $query->getOneOrNullResult();\n }", "function db_backend_get($db, $id)\n\t{\n\t\t$sql = '\n\t\t\tSELECT\n\t\t\t\t\"id\", \"added\", \"ttl\", \"password\", (EXTRACT(EPOCH FROM now()) - added ) as age\n\t\t\tFROM\n\t\t\t\tpastes\n\t\t\tWHERE\n\t\t\t\tid = $1\n\t\t\tLIMIT\n\t\t\t\t1\n\t\t\t';\n\n\t\t$res = pg_query_params($db, $sql, array($id)) or die(\"Failed to execute query '$sql'\");\n\n\t\treturn pg_fetch_assoc($res);\n\t}", "public function leer($idplan)\n {\n include_once 'controlador/util/bd_conexion_pdo.php';\n\n $conexion = (new Conexion())->conectarPDO();\n\n $sentencia = $conexion->prepare(\"SELECT * FROM plan WHERE idplan = :idplan\");\n $sentencia->bindParam(\":idplan\", $idplan, PDO::PARAM_INT);\n $sentencia->execute();\n\n $resultado = $sentencia->fetchAll(PDO::FETCH_ASSOC);\n\n $sentencia = null;\n $conexion = null;\n\n return $resultado;\n }", "public function get()\n {\n // Siapkan sintak untuk query satu member\n $sql = \"SELECT * FROM member WHERE id = $this->id\";\n // Jalankan query\n $res = mysqli_query($this->db, $sql);\n // Return data yang sudah di fetch\n return mysqli_fetch_assoc($res);\n }", "public function getBillingDetails()\n {\n return $this->_billing;\n }", "function getPlanComponents($conn, $planID){\n\t$sql = \"SELECT * FROM plancomponent WHERE planId = :planID\";\n\t\n\t$sth = $conn->prepare($sql);\n\t$sth->bindParam(':planID', $planID, PDO::PARAM_INT, 11);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows;\n}", "function getModule($conn, $planID, $levelFourID){\n\t$sql = \"SELECT * FROM plancomponent WHERE PlanId = :planID AND LevelFourId = :levelFourID\";\t\n\t$sth = $conn->prepare($sql);\n\n\t\n\t$sth->bindParam(':planID', $planID, PDO::PARAM_INT, 11);\n\t$sth->bindParam(':levelFourID', $levelFourID, PDO::PARAM_INT, 11);\n\t$sth->execute();\n\t\n\t$row = $sth->fetch(PDO::FETCH_ASSOC);\n\treturn $row;\n}", "public function get() {\r\n $this->checkGateway();\r\n\r\n $id = func_get_args();\r\n\r\n // Create the SQL Query\r\n $sql = \"SELECT * FROM {$this->name} WHERE \";\r\n foreach ((array) $this->primary as $key => $primary) {\r\n\r\n // More primary keys than parameters\r\n if (! isset($id[$key])) {\r\n throw new DatabaseGatewayException(\"The 'get' method requires every primary keys as parameters to be given in the same order\");\r\n }\r\n\r\n // Query parameter\r\n $sql .= $primary . \" = :$primary AND \";\r\n\r\n // Safe query\r\n $this->db->bind($primary, $id[$key]);\r\n }\r\n $sql = trim($sql, \" AND \");\r\n\r\n // Result\r\n return $this->db->row($sql);\r\n }", "public static function getCustomerByID($id){\n\t\t// Initialize SQL statement to edit individual customer\n\t\t$sql = \"\n\t\t\tSELECT *\n\t\t\tFROM customer\n\t\t\tWHERE id = :id\n\t\t\t\";\n\n\t\t$sql_values = [\n\t\t\t':id' => $id\n\t\t\t];\n\n\t\t// Make a PDO statement\n\t\t$statement = DB::prepare($sql);\n\n\t\t// Execute\n\t\tDB::execute($statement, $sql_values);\n\n\t\t// Get all the results of the statement into an array\n\t\t$results = $statement->fetch();\n\t\treturn $results;\n\t}", "public function findById($id){\n $customer = Customer::find($id);\n return $customer;\n }", "public static function obtenerint(){\n if (self::$db === null){\n \tself::$db = new self();\n }\n return self::$db;\n }", "public function getCurrentPaid($registrationNo,$paymentFor,$via) {\n\n$con = ($GLOBALS[\"___mysqli_ston\"] = mysqli_connect($this->myHost, $this->username, $this->password));\nif (!$con)\n {\n die('Could not connect: ' . ((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\n }\n\n((bool)mysqli_query( $con, \"USE \" . $this->database));\n\nif($via == \"cashUnpaid\") {\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT sum(amountPaid) as amountPaid FROM patientPayment WHERE registrationNo = '$registrationNo' and paymentFor = '$paymentFor' \");\n}else {\n$result = mysqli_query($GLOBALS[\"___mysqli_ston\"], \"SELECT sum($via) as amountPaid FROM patientCharges WHERE registrationNo = '$registrationNo' and title = '$paymentFor' \");\n}\n\n\nwhile($row = mysqli_fetch_array($result))\n {\n\nreturn $row['amountPaid'];\n\n }\n\n}" ]
[ "0.6144168", "0.6015181", "0.59715974", "0.5874402", "0.586615", "0.58638555", "0.58001757", "0.5774641", "0.5713231", "0.5711915", "0.56871223", "0.56824815", "0.56503165", "0.5622329", "0.5617317", "0.559445", "0.555296", "0.5528892", "0.5429408", "0.54237854", "0.54033685", "0.5363729", "0.5350082", "0.5328185", "0.53256315", "0.5304102", "0.52870387", "0.5286646", "0.52845865", "0.5268803", "0.52611125", "0.5258595", "0.52544093", "0.5250486", "0.52414924", "0.5232819", "0.5231354", "0.52219456", "0.521573", "0.5215275", "0.5214699", "0.52086496", "0.52076334", "0.51987195", "0.51987195", "0.5193785", "0.5191113", "0.51901263", "0.5184674", "0.51846063", "0.5173571", "0.51580125", "0.5157815", "0.51443815", "0.5136759", "0.513304", "0.5127561", "0.5121992", "0.51113683", "0.50977886", "0.5094148", "0.50710577", "0.5066508", "0.505185", "0.5051048", "0.5045575", "0.501322", "0.50073916", "0.4997886", "0.4996946", "0.49959874", "0.4994452", "0.49898046", "0.4989013", "0.4988534", "0.49867117", "0.4985757", "0.49844834", "0.49738488", "0.49732924", "0.49727717", "0.4968917", "0.4967168", "0.49622434", "0.495712", "0.49515685", "0.4949496", "0.4947744", "0.4940148", "0.49395475", "0.49389625", "0.4928544", "0.4926297", "0.4920401", "0.4918427", "0.49109697", "0.49090827", "0.49032336", "0.4899096", "0.4891664", "0.48911595" ]
0.0
-1
Adds this customer payment plan to the local database. Minimal usage: $this>id = 'cp_000000000000000'; $this>planId = 'rp_000000000000000'; $this>customerId = 'cust_000000000000000'; $this>db_add();
private function db_add() { try { db_insert('uc_checkoutpayment_hub_communication') ->fields(array( 'id' => $this->id, 'created' => $this->created, 'email' => $this->email, 'track_id' => $this->trackId, 'value' => $this->value, 'currency' => $this->currency, 'responseMessage' => $this->responseMessage, 'responseCode' => $this->responseCode, 'status' => $this->status, )) ->execute(); } catch (Exception $e) { watchdog( 'Checkout.com', 'Notice: The charge wasn\'t added to the the local database. (:errorMessage)', array( ':errorMessage' => $e->getMessage(), ), WATCHDOG_NOTICE ); return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show_plan_add() {\n //must check that the user has the required capability \n if (!current_user_can('manage_options')) {\n csm_error('You do not have sufficient permissions to access this page', true);\n }\n \n $CsmWorkplace = new CsmWorkplace();\n $workplaces = $CsmWorkplace->all();\n \n //Add the member\n if (isset($_POST['action']) && $_POST['action'] === 'addplan') {\n $data = $_POST;\n $Csmplan = new CsmPlan();\n try {\n $Csmplan->create($_POST);\n csm_set_update('New membership plan was added');\n hacky_redirect('csm-plans');\n } catch (\\Exception $e) {\n csm_error($e->getMessage());\n }\n }\n \n include(CSM_PLUGIN_PATH . 'app/views/plan-add.view.php');\n}", "public function add() {\n $dataH['CustomerBankAccount'] = $_lib['sess']->get_companydef('BankAccount');\n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $dataH['CustomerAccountPlanID'] = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber')));\n }", "function add_customer()\n\t{\n\t\tglobal $db;\n\n\t\t$vals = array(\n\t\t\t'NULL',\n\t\t\t$this->preorderID,\n\t\t\tmysql_real_escape_string($this->customerinfo['fname']),\n\t\t\tmysql_real_escape_string($this->customerinfo['lname']),\n\t\t\t$this->customerinfo['amountdown'],\n\t\t\tNO\n\t\t);\n\n\t\t$sql = \"INSERT INTO preorder_customers VALUES ('\".implode(\"','\",$vals).\"')\";\n\t\tmysql_query($sql,$db);\n\t\t$this->error->mysql(__FILE__,__LINE__);\n\t}", "private function insertPlan($accountId, $planId, $effectiveDate) {\n $stmt = $this->pdo->prepare(\n 'INSERT INTO account_plans(account_id,plan_id,effective_date) '\n . 'VALUES(:account_id,:plan_id,:effective_date)');\n \n return $stmt->execute([\n ':account_id' => $accountId,\n ':plan_id' => $planId,\n ':effective_date' => $effectiveDate,\n ]);\n }", "function Add()\n\t{\n\t\t// Check user authorization and permissions\n\t\tAuthenticatedUser()->CheckAuth();\n\t\t// The User needs both Rate Management and Admin Permissions\n\t\tAuthenticatedUser()->PermissionOrDie(PERMISSION_RATE_MANAGEMENT | PERMISSION_ADMIN);\n\n\t\t// Context menu\n\t\t// Nothing to add\n\n\t\t// Breadcrumb menu\n\t\tBreadCrumb()->Employee_Console();\n\t\tBreadCrumb()->AvailablePlans(TRUE);\n\t\tBreadCrumb()->SetCurrentPage(\"Add Rate Plan\");\n\n\t\t// Handle form submittion\n\t\tif (SubmittedForm('AddPlan', 'Commit') || SubmittedForm('AddPlan', 'Save as Draft'))\n\t\t{\n\t\t\t// Validate the plan\n\t\t\t$mixResult = $this->_ValidatePlan();\n\t\t\tif ($mixResult !== TRUE && $mixResult !== FALSE)\n\t\t\t{\n\t\t\t\t// The plan is invalid and an error message has been returned\n\t\t\t\tAjax()->AddCommand(\"Alert\", $mixResult);\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telseif ($mixResult === FALSE)\n\t\t\t{\n\t\t\t\t// The plan is invalid and no error message was specified, so it is assumed appropraite actions have already taken place\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The plan is valid. Save it to the database\n\t\t\t\tTransactionStart();\n\t\t\t\t$mixResult = $this->_SavePlan();\n\t\t\t\tif ($mixResult !== TRUE && $mixResult !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t// Saving the plan failed, and an error message has been returned\n\t\t\t\t\tTransactionRollback();\n\t\t\t\t\tAjax()->AddCommand(\"Alert\", $mixResult);\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t\telseif ($mixResult === FALSE)\n\t\t\t\t{\n\t\t\t\t\t// Saving the plan failed, and no error message was specified, so it is assumed appropraite actions have already taken place\n\t\t\t\t\tTransactionRollback();\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// The plan was successfully saved to the database\n\t\t\t\t\tTransactionCommit();\n\n\t\t\t\t\t// If we've saved as a draft, then filter our Plan List to Drafts\n\t\t\t\t\tif (DBO()->Plan->Archived->Value == RATE_STATUS_DRAFT) {\n\t\t\t\t\t\t$_SESSION['AvailablePlansPage']['Filter']['Status']\t= RATE_STATUS_DRAFT;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set the message appropriate to the action\n\t\t\t\t\t$strSuccessMsg = (DBO()->Plan->Archived->Value == RATE_STATUS_ACTIVE)? \"The plan has been successfully saved\" : \"The plan has been successfully saved as a draft\";\n\t\t\t\t\tAjax()->AddCommand(\"AlertAndRelocate\", Array(\"Alert\" => $strSuccessMsg, \"Location\" => Href()->AvailablePlans().'?RatePlan.Status='.RATE_STATUS_DRAFT));\n\t\t\t\t\treturn TRUE;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Check if there has been a BaseRatePlan.Id specified, to base the new RatePlan on\n\t\tif (DBO()->BaseRatePlan->Id->Value)\n\t\t{\n\t\t\t// There is, so load it\n\t\t\tDBO()->RatePlan->Id = DBO()->BaseRatePlan->Id->Value;\n\t\t\tif (!DBO()->RatePlan->Load())\n\t\t\t{\n\t\t\t\t// Could not load the RatePlan\n\t\t\t\tDBO()->Error->Message = \"The RatePlan with id: \". DBO()->RatePlan->Id->value .\" could not be found\";\n\t\t\t\t$this->LoadPage('error');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t// Reset the Id of the RatePlan, because we are creating a new one, not editing an existing one\n\t\t\tDBO()->RatePlan->Id = 0;\n\t\t}\n\t\telseif (DBO()->RatePlan->Id->Value)\n\t\t{\n\t\t\t// We are opening an existing RatePlan for editing\n\t\t\t// Update the Breadcrumb menu\n\t\t\tBreadCrumb()->SetCurrentPage(\"Edit Draft Rate Plan\");\n\n\t\t\t// We want to display an existing RatePlan\n\t\t\tif (!DBO()->RatePlan->Load())\n\t\t\t{\n\t\t\t\t// Could not load the RatePlan\n\t\t\t\tDBO()->Error->Message = \"The RatePlan with id: \". DBO()->RatePlan->Id->value .\" could not be found\";\n\t\t\t\t$this->LoadPage('error');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t// Make sure the Rate Plan is a draft\n\t\t\tif (DBO()->RatePlan->Archived->Value != RATE_STATUS_DRAFT)\n\t\t\t{\n\t\t\t\t// Can't edit the Rate Plan\n\t\t\t\tDBO()->Error->Message = \"The RatePlan with id: \". DBO()->RatePlan->Id->value .\" and Name \\\"\". DBO()->RatePlan->Name->Value .\"\\\" is not a draft and therefore cannot be edited\";\n\t\t\t\t$this->LoadPage('error');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// We want to add a new RatePlan\n\t\t\tDBO()->RatePlan->Id = 0;\n\t\t}\n\n\t\t$this->LoadPage('rate_plan_add');\n\n\t\treturn TRUE;\n\n\t}", "public function addAccount($firstName, $lastName, $planId, $effectiveDate) {\n try {\n // start the transaction\n $this->pdo->beginTransaction();\n \n // insert an account and get the ID back\n $accountId = $this->insertAccount($firstName, $lastName);\n \n // add plan for the account\n $this->insertPlan($accountId, $planId, $effectiveDate);\n \n // commit the changes\n $this->pdo->commit();\n } catch (\\PDOException $e) {\n // rollback the changes\n $this->pdo->rollBack();\n throw $e;\n }\n }", "private function addPaymentToDatabase()\n {\n $this->setReceiptKey();\n \n $this->createDonorEntry();\n $this->createDonationEntry();\n $this->createDonationContentEntry();\n $this->createDonorAddressEntry();\n $this->addDonationToFundraisersTotalRaise();\n \n $this->redirect('donations');\n }", "public function create_plan() {\n if (empty($this->user->admin)) {\n Router::redirect('/');\n die();\n }\n\n # Set up query\n $q = \"INSERT INTO plans SET\n\t\t\t description='\".$_POST['description'].\"', time='\".$_POST['time'].\"', public='\".(!empty($_POST['public'])?1:0).\"',\n\t\t\t modified_date='\".Time::now().\"', modified_by='\".$this->user->user_id.\"'\";\n $plans = DB::instance(DB_NAME)->query($q);\n\n # Set up query\n $q = \"SELECT\n\t\t\t p.plan_id, p.description,p.time,p.public, c.first_name, c.last_name, p.modified_date, p.show\n\t\t\t FROM plans AS p inner join\n\t\t\t users as u on p.modified_by=u.user_id\n \t\t inner JOIN contacts AS c ON u.user_id=c.user_id\n\t\t\t and c.modified_date = (select max(modified_date) from\n\t\t\t contacts as c where c.user_id=p.modified_by) and p.plan_id = LAST_INSERT_ID()\n \";\n\n # Run query\n $result = DB::instance(DB_NAME)->select_row($q);\n $result[\"posted_on\"] = Time::display($result['modified_date'],'Y-m-d H:m:s');\n\n #Adding action to System Log\n $data3 = Array (\n\n \"modified_date\" => Time::now(),\n \"FK_id\" => $result[\"plan_id\"],\n \"FK_table\" => 'plans',\n \"login\" => false,\n \"modified_by\" => $this->user->user_id\n );\n DB::instance(DB_NAME)->insert('logs',$data3);\n\n //Return result to jTable\n $jTableResult = array();\n $jTableResult['Result'] = \"OK\";\n $jTableResult['Record'] = $result;\n print json_encode($jTableResult);\n }", "private function createPlan(){\n if(!$this->request->plan_name || !$this->request->plan_description) {\n return false;\n }\n $this->plan = Planes::create([\n 'name' => $this->request->plan_name,\n 'description' => $this->request->plan_description,\n 'price' => $this->request->price,\n 'product_id' => $this->request->product_id,\n 'balance' => $this->request->balance,\n ]);\n $this->plan = new PlanesFormatter($this->plan);\n }", "public function add(Plan $plan)\n {\n $this->plans[] = $plan;\n\n return $plan;\n }", "private function _SavePlan()\n\t{\n\t\t/*\n\t\t * Saving process:\n\t\t *\t\tS1: Set up values for properties of the RatePlan object that are not already defined, or not in their database correct format\n\t\t *\t\tS2: Save the record to the RatePlan table\n\t\t *\t\tS3: Remove any records in the RatePlanRateGroup table\n\t\t *\t\tS4: For each RateGroup belonging to this RatePlan:\n\t\t *\t\t\t\tadd a record to the RatePlanRateGroup table\n\t\t *\t\tS5: If the RatePlan is being Committed: (not being saved as a draft)\n\t\t *\t\t\t\tFor each draft RateGroup belonging to this RatePlan:\n\t\t *\t\t\t\t\tupdate the Archived property of the RateGroup in the RateGroup table so that it is now a committed RateGroup, not a draft\n\t\t *\t\t\t\t\tFor each draft Rate belonging to the draft RateGroup:\n\t\t *\t\t\t\t\t\tupdate the Archived property of the Rate in the Rate table so that it is now a committed Rate, not a draft\n\t\t */\n\n\t\t// S1: Set up the remaing fields required of a RatePlan record\n\t\tDBO()->RatePlan->MinMonthly\t= ltrim(DBO()->RatePlan->MinMonthly->Value, \"$\");\n\t\tDBO()->RatePlan->ChargeCap\t= ltrim(DBO()->RatePlan->ChargeCap->Value, \"$\");\n\t\tDBO()->RatePlan->UsageCap\t= ltrim(DBO()->RatePlan->UsageCap->Value, \"$\");\n\n\t\tif (SubmittedForm('AddPlan', 'Save as Draft'))\n\t\t{\n\t\t\t// Flag the plan as being a draft\n\t\t\tDBO()->RatePlan->Archived = RATE_STATUS_DRAFT;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// The plan is not being saved as a draft\n\t\t\tDBO()->RatePlan->Archived = RATE_STATUS_ACTIVE;\n\t\t}\n\n\t\tDBO()->RatePlan->modified_employee_id\t= Flex::getUserId();\n\t\tif (!DBO()->RatePlan->Id->Value)\n\t\t{\n\t\t\t// Plan has not been saved before\n\t\t\tDBO()->RatePlan->created_employee_id\t= Flex::getUserId();\n\t\t}\n\n\t\t// If the RatePlan has already been saved as a draft then load in the details that don't get edited here, so they don't get erased\n\t\tif (DBO()->RatePlan->Id->Value)\n\t\t{\n\t\t\tDBO()->RatePlan->LoadMerge();\n\t\t}\n\n\t\t// S2: Save the plan to the database\n\t\tif (!DBO()->RatePlan->Save())\n\t\t{\n\t\t\t// Saving failed\n\t\t\treturn \"ERROR: Saving the RatePlan to the RatePlan database table failed, unexpectedly\";\n\t\t}\n\n\t\t// S3: Remove all records from the RatePlanRateGroup table where RatePlan == DBO()->RatePlan->Id->Value\n\t\t$delRatePlanRateGroup = new Query();\n\t\t$delRatePlanRateGroup->Execute(\"DELETE FROM RatePlanRateGroup WHERE RatePlan = \" . DBO()->RatePlan->Id->Value);\n\n\t\t// S4: Save each of the RateGroups associated with the RatePlan to the RatePlanRateGroup table\n\t\tDBO()->RatePlanRateGroup->RatePlan = DBO()->RatePlan->Id->Value;\n\t\tforeach ($this->_arrRateGroups as $intRateGroup)\n\t\t{\n\t\t\tDBO()->RatePlanRateGroup->Id = 0;\n\t\t\tDBO()->RatePlanRateGroup->RateGroup = $intRateGroup;\n\n\t\t\tif (!DBO()->RatePlanRateGroup->Save())\n\t\t\t{\n\t\t\t\t// Saving failed\n\t\t\t\treturn \"ERROR: Saving one of the RateGroup - RatePlan associations failed, unexpectedly.<br />The RatePlan has not been saved\";\n\t\t\t}\n\t\t}\n\n\t\t// S5: Remove all records from the rate_plan_discount table where RatePlan == DBO()->RatePlan->Id->Value\n\t\t$delRatePlanDiscount\t= new Query();\n\t\t$delRatePlanDiscount->Execute(\"DELETE FROM rate_plan_discount WHERE rate_plan_id = \" . DBO()->RatePlan->Id->Value);\n\n\t\t// S6: Remove any records from the discount table which are no longer linked to any Rate Plans (Discounts cannot be shared between Plans)\n\t\t$delUnlinkedDiscounts\t= new Query();\n\t\t$delUnlinkedDiscounts->Execute(\"DELETE FROM discount WHERE (SELECT id FROM rate_plan_discount WHERE discount_id = discount.id LIMIT 1) IS NULL\");\n\n\t\t// S7: Save each of the Discounts which are linked between this Rate Plan and a Record Type\n\t\t$aDiscountReferenceMap\t= array();\n\t\tforeach (DBL()->RecordType as $dboRecordType)\n\t\t{\n\t\t\t$sRecordTypeObjectName\t\t= \"RecordType_{$dboRecordType->Id->Value}\";\n\t\t\t$iDiscountReference\t= (int)DBO()->{$sRecordTypeObjectName}->discount_id->Value;\n\n\t\t\t// Has the Discount already been created?\n\t\t\tif ($iDiscountReference && $iDiscountReference > 0)\n\t\t\t{\n\t\t\t\tif (!array_key_exists($iDiscountReference, $aDiscountReferenceMap))\n\t\t\t\t{\n\t\t\t\t\t// Create the Discount\n\t\t\t\t\t$sDiscountObjectName\t= \"discount_{$iDiscountReference}\";\n\n\t\t\t\t\t$oDiscount\t\t\t\t\t= new Discount();\n\t\t\t\t\t$oDiscount->name\t\t\t= trim(DBO()->{$sDiscountObjectName}->name->Value);\n\t\t\t\t\t$oDiscount->description\t\t= trim(DBO()->{$sDiscountObjectName}->description->Value);\n\n\t\t\t\t\tif (DBO()->{$sDiscountObjectName}->limit_type->Value === 'UNITS')\n\t\t\t\t\t{\n\t\t\t\t\t\t$oDiscount->charge_limit\t= null;\n\t\t\t\t\t\t$oDiscount->unit_limit\t\t= abs((int)trim(DBO()->{$sDiscountObjectName}->limit->Value));\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$oDiscount->charge_limit\t= abs((float)trim(DBO()->{$sDiscountObjectName}->limit->Value));\n\t\t\t\t\t\t$oDiscount->unit_limit\t\t= null;\n\t\t\t\t\t}\n\t\t\t\t\t$oDiscount->charge_limit\t= ($oDiscount->charge_limit) ? $oDiscount->charge_limit : null;\n\t\t\t\t\t$oDiscount->unit_limit\t\t= ($oDiscount->unit_limit) ? $oDiscount->unit_limit : null;\n\n\t\t\t\t\t$oDiscount->save();\n\n\t\t\t\t\t// Create the Discount<->RatePlan Link\n\t\t\t\t\t$oRatePlanDiscount\t\t\t\t\t= new Rate_Plan_Discount();\n\t\t\t\t\t$oRatePlanDiscount->rate_plan_id\t= DBO()->RatePlan->Id->Value;\n\t\t\t\t\t$oRatePlanDiscount->discount_id\t\t= $oDiscount->id;\n\t\t\t\t\t$oRatePlanDiscount->save();\n\n\t\t\t\t\t$aDiscountReferenceMap[$iDiscountReference]\t= $oDiscount->id;\n\t\t\t\t}\n\n\t\t\t\t// Save Link\n\t\t\t\t$oDiscountRecordType\t\t\t\t\t= new Discount_Record_Type();\n\t\t\t\t$oDiscountRecordType->discount_id\t\t= $aDiscountReferenceMap[$iDiscountReference];\n\t\t\t\t$oDiscountRecordType->record_type_id\t= $dboRecordType->Id->Value;\n\t\t\t\t$oDiscountRecordType->save();\n\t\t\t}\n\t\t}\n\n\t\t// S8: If the RatePlan is being committed then all draft RateGroups used by it must be commited and all draft Rates\n\t\t// used by the draft RateGroups must be committed\n\t\tif ((SubmittedForm('AddPlan', 'Commit')) && (count($this->_arrRateGroups) > 0))\n\t\t{\n\t\t\t$strRateGroups \t= implode(',', $this->_arrRateGroups);\n\t\t\t$arrUpdate\t\t= Array(\"Archived\" => RATE_STATUS_ACTIVE);\n\t\t\t$updRateGroups \t= new StatementUpdate(\"RateGroup\", \"Archived = \". RATE_STATUS_DRAFT .\" AND Id IN ($strRateGroups)\", $arrUpdate);\n\t\t\t$updRates \t\t= new StatementUpdate(\"Rate\", \"Archived = \". RATE_STATUS_DRAFT .\" AND Id IN (SELECT Rate FROM RateGroupRate WHERE RateGroup IN ($strRateGroups))\", $arrUpdate);\n\n\t\t\tif ($updRateGroups->Execute($arrUpdate, NULL) === FALSE)\n\t\t\t{\n\t\t\t\treturn \"ERROR: Commiting one of the Draft Rate Groups, used by this Rate Plan, failed.<br />The RatePlan has not been saved\";\n\t\t\t}\n\n\t\t\tif ($updRates->Execute($arrUpdate, NULL) === FALSE)\n\t\t\t{\n\t\t\t\treturn \"ERROR: Commiting one of the Draft Rates, used by this Rate Plan, failed.<br />The RatePlan has not been saved\";\n\t\t\t}\n\t\t}\n\n\t\t// Everything has been saved\n\t\treturn TRUE;\n\t}", "public function create($planData)\n {\n \t$planPurchase \t\t\t\t = new PlanPurchase();\n\t\t$planPurchase->user_id \t\t = $this->user->id;\n\t\t$planPurchase->plan_id \t\t = $planData->plan_id;\n\t\t$planPurchase->country_code = $planData->country_code;\n\t\t$planPurchase->gold_price = (float)$this->plan->gold_price;\n\t\t$planPurchase->transaction_id = $planData->transaction_id;\n\t\t$planPurchase->save();\n\n \t/** Add Chest Capacity value in user's table **/\n \t(new ChestService)->setUser($this->user)->expand($this->plan->bucket);\n \t\n /** Deduct User Gold **/\n $goldBalance = (new UserRepository($this->user))->deductGold($this->plan->gold_price);\n\n \t/** return the available skeleton keys **/\n \treturn ['chest_bucket'=> $this->user->buckets['chests'], 'available_gold_balance'=> $goldBalance];\n }", "public function add()\r\n {\r\n $this->start();\r\n $this->write_to_db();\r\n }", "function add_customer($params){\n $this->company_db->insert('tbl_customer', $params);\n return $this->company_db->insert_id();\n }", "function addBilling($shipmentID, $freightCharge, $addOnCharge, $cratingCharge, $osaCharge, $valuationCharge, $totalCharge) {\n try {\n /** Instantiate the Database model. **/\n $db = Database::getInstance();\n\n /** Connect to the database. **/\n $dbh = $db->getConnection();\n\n /** Prepare the sql query to be used. **/\n $stmt = $dbh->prepare(\"INSERT INTO billing (shipmentID, freightCharge, addOnCharge, cratingCharge, osaCharge, valuationCharge, totalCharge) VALUES(:shipmentID, :freightCharge, :addOnCharge, :cratingCharge, :osaCharge, :valuationCharge, :totalCharge)\");\n\n /** Bind the parameters to the sql query. **/\n $stmt->bindParam(':shipmentID', $shipmentID);\n $stmt->bindParam(':freightCharge', $freightCharge);\n $stmt->bindParam(':addOnCharge', $addOnCharge);\n $stmt->bindParam(':cratingCharge', $cratingCharge);\n $stmt->bindParam(':osaCharge', $osaCharge);\n $stmt->bindParam(':valuationCharge', $valuationCharge);\n $stmt->bindParam(':totalCharge', $totalCharge);\n\n /** Execute the query. **/\n $stmt->execute();\n\n /** Check if insert was successful. **/\n $count = $stmt->rowCount();\n if($count > 0) {\n return true;\n }\n\n else {\n return false;\n }\n }\n catch(PDOException $e) {\n echo $e->getMessage();\n }\n }", "public function iN_InsertNewPointPlan($userID, $planKey, $planPointAmount, $planAmount) {\n\t\tif ($this->iN_CheckIsAdmin($userID) == 1) {\n\t\t\tmysqli_query($this->db, \"INSERT INTO i_premium_plans(plan_name_key, plan_amount,amount,plan_status)VALUES('$planKey','$planPointAmount','$planAmount','0')\") or die(mysqli_error($this->db));\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function run()\n {\n Plan::create([\n \t'name' => 'Free Plan',\n\t\t\t'plan_identifier' => 'free_plan',\n\t\t\t'limit_list' => 3,\n\t\t\t'limit_space' => 1500,\n\t\t\t'price' => 0\n ]); \n }", "public function run()\n {\n $data = [\n ['name' => 'Basic', 'price' => 6000 , 'commission' => 300],\n ['name' => 'Standard', 'price' => 7500 , 'commission' => 400],\n ['name' => 'Premium', 'price' => 10000 , 'commission' => 500],\n ];\n \\App\\Models\\Plan::insert($data);\n }", "public function create_plan($requestData){\n \n // ### Create Plan\n try {\n // Create a new instance of Plan object\n $plan = new Plan();\n if(isset($requestData['plan'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['plan']), $plan);\n } \n // # Payment definitions for this billing plan.\n $paymentDefinition = new PaymentDefinition(); \n $paymentDefinition\n ->setAmount(new Currency($requestData['paymentDefinition']['Amount']));\n array_pop($requestData['paymentDefinition']);\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $this->setArrayToMethods(array_filter($requestData['paymentDefinition']), $paymentDefinition); \n }\n \n // Charge Models\n $chargeModel = new ChargeModel();\n $chargeModel->setAmount(new Currency($requestData['chargeModel']['Amount']));\n array_pop($requestData['chargeModel']);\n if(!empty($this->checkEmptyObject((array)$chargeModel))){\n $this->setArrayToMethods(array_filter($requestData['chargeModel']), $chargeModel); \n $paymentDefinition->setChargeModels(array($chargeModel));\n }\n \n $merchantPreferences = new MerchantPreferences();\n $baseUrl = $requestData['baseUrl'];\n\n $merchantPreferences->setReturnUrl($baseUrl.$requestData['ReturnUrl'])\n ->setCancelUrl($baseUrl.$requestData['CancelUrl']);\n if(!empty($this->checkEmptyObject($requestData['merchant_preferences']['SetupFee']))){\n $merchantPreferences->setSetupFee(new Currency($requestData['merchant_preferences']['SetupFee']));\n }\n array_pop($requestData['merchant_preferences']);\n \n if(isset($requestData['merchant_preferences'])){\n $this->setArrayToMethods($this->checkEmptyObject($requestData['merchant_preferences']), $merchantPreferences);\n }\n if(!empty($this->checkEmptyObject((array)$paymentDefinition))){\n $plan->setPaymentDefinitions(array($paymentDefinition));\n }\n if(!empty($this->checkEmptyObject((array)$merchantPreferences))){\n $plan->setMerchantPreferences($merchantPreferences);\n } \n $requestArray= clone $plan;\n $output = $plan->create($this->_api_context); \n $returnArray['RESULT'] = 'Success';\n $returnArray['PLAN'] = $output->toArray();\n $returnArray['RAWREQUEST']=$requestArray->toJSON();\n $returnArray['RAWRESPONSE']=$output->toJSON();\n return $returnArray; \n } catch (\\PayPal\\Exception\\PayPalConnectionException $ex) {\n return $this->createErrorResponse($ex);\n }\n }", "public function add() {\n\n $sql = \"INSERT INTO persona(id,nombre,apellido_paterno,apellido_materno,estado_salud,telefono,ubicacion)\n VALUES(null,'{$this->nombre}','{$this->apellido_paterno}','{$this->apellido_materno}',\n '{$this->estado_salud}','{$this->telefono}','{$this->ubicacion}')\";\n $this->con->consultaSimple($sql);\n }", "public function plan_create( $plan_id, $amount, $name, $interval, $trial_days = FALSE ) {\r\n\t\t$params = array(\r\n\t\t\t'id' => $plan_id,\r\n\t\t\t'amount' => $amount,\r\n\t\t\t'name' => $name,\r\n\t\t\t'currency' => 'usd',\r\n\t\t\t'interval' => $interval\r\n\t\t);\r\n\t\tif( $trial_days )\r\n\t\t\t$params['trial_period_days'] = $trial_days;\r\n\t\t\t\r\n\t\treturn $this->_send_request( 'plans', $params, STRIPE_METHOD_POST );\r\n\t}", "public function create($name, $id)\n {\n return $this->add(new Plan($name, $id));\n }", "public function addStripeSubscription($stripe_customer_id, $stripe_plan_id)\n\t{\n\t\t\n\t\t/* If 1.4 and no backward, then leave */\n\t\tif (!$this->backward)\n\t\t\treturn;\n\n\t\tinclude_once(dirname(__FILE__).'/lib/Stripe.php');\n\t\t\\Stripe\\Stripe::setApiKey(Configuration::get('STRIPE_MODE') ? Configuration::get('STRIPE_PRIVATE_KEY_LIVE') : Configuration::get('STRIPE_PRIVATE_KEY_TEST'));\n\n\t\t/* Try to process the capture and catch any error message */\n\t\ttry\n\t\t{\n\t\t\t$customer = \\Stripe\\Customer::retrieve($stripe_customer_id);\n\t\t\t$result_json = $customer->subscriptions->create(array(\"plan\" => $stripe_plan_id));\n\t\t\t\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\n\t\t\t$this->_errors['stripe_subscription_error'] = $e->getMessage();\n\t\t\tif (class_exists('Logger'))\n\t\t\t\tLogger::addLog($this->l('Stripe - subscription failed').' '.$e->getMessage(), 1, null, 'Customer', (int)Tools::getIsset('id_customer'), true);\n\t\t}\n\t\t\n if(!isset($this->_errors['stripe_subscription_error']))\n\t\tDb::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'stripepro_subscription (stripe_subscription_id, stripe_customer_id, id_customer, stripe_plan_id, quantity, current_period_start, current_period_end, status, date_add) VALUES (\\''.$result_json->id.'\\', \\''.$stripe_customer_id.'\\', '.(int)Tools::getValue('id_customer').',\\''.$stripe_plan_id.'\\', '.$result_json->quantity.', \\''.$result_json->current_period_start.'\\',\n\t\t\\''.$result_json->current_period_end.'\\', \\''.$result_json->status.'\\', NOW())');\n\t\t\n\n\t\t\n\t\treturn true;\n\t}", "public function run()\n {\n Plan::create([\n 'name' =>'November Subscription Plan',\n 'description'=>\"It's time to increase your customers! Buy our subscription plan and save a spot of your choice amongst the top 20 restaurants that will be listed for a date night Hurry!\"\n ]);\n }", "public function create_or_update_plan( $plan_data ) {\n\t\t$item_id = $plan_data['id'];\n\t\t$all_items = MS_Factory::get_transient( 'ms_stripecheckout_plans' );\n\t\t$all_items = mslib3()->array->get( $all_items );\n\n\t\tif ( ! isset( $all_items[ $item_id ] )\n\t\t || ! is_a( $all_items[ $item_id ], 'StripeCheckoutPlan' )\n\t\t) {\n\t\t\ttry {\n\t\t\t\t$item = StripeCheckoutPlan::retrieve( $item_id );\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t// If the plan does not exist then stripe will throw an Exception.\n\t\t\t\t$item = false;\n\t\t\t}\n\t\t\t$all_items[ $item_id ] = $item;\n\t\t} else {\n\t\t\t$item = $all_items[ $item_id ];\n\t\t}\n\n\t\t/*\n\t\t * Stripe can only update the plan-name, so we have to delete and\n\t\t * recreate the plan manually.\n\t\t */\n\t\tif ( $item && is_a( $item, 'StripeCheckoutPlan' ) ) {\n\t\t\t$item->delete();\n\t\t\t$all_items[ $item_id ] = false;\n\t\t}\n\n\t\tif ( $plan_data['amount'] > 0 ) {\n\t\t\ttry {\n\t\t\t\t$item = StripeCheckoutPlan::create( $plan_data );\n\t\t\t\t$all_items[ $item_id ] = $item;\n\t\t\t} catch ( Exception $e ) {\n\t\t\t\t// Nothing.\n\t\t\t}\n\t\t}\n\n\t\tMS_Factory::set_transient(\n\t\t\t'ms_stripecheckout_plans',\n\t\t\t$all_items,\n\t\t\tHOUR_IN_SECONDS\n\t\t);\n\t}", "public function add_to_plan(Request $request, $id)\n {\n $rules = [\n 'plan_id' => 'required|numeric',\n ];\n $attrs = [\n 'plan_id' => '出团计划id',\n ];\n $this->validate($request, $rules, [], $attrs);\n\n $obj = SaleOrder::find($id);\n $obj->fill($request->all());\n $obj->save();\n return redirect('/sale_order');\n \n }", "public function savePlan($plan)\n {\n return Stripe\\Plan::create(array(\n \"amount\" => $plan->price,\n \"interval\" => $plan->interval,\n \"name\" => $plan->name,\n \"currency\" => \"usd\",\n 'id' => $plan->level\n ));\n }", "public function c_add()\n {\n\t\t$this->getC();\n $customer = $this->Customers->newEntity();\n if ($this->request->is('post')) {\n $customer = $this->Customers->patchEntity($customer, $this->request->data);\n if ($this->Customers->save($customer)) {\n $this->Flash->success('The customer has been saved.');\n return $this->redirect(['action' => 'c_index']);\n } else {\n $this->Flash->error('The customer could not be saved. Please, try again.');\n }\n }\n $this->set(compact('customer'));\n $this->set('_serialize', ['customer']);\n }", "function add_predefined_innovation_plan($params)\n {\n $this->db->insert('predefined_innovation_plan', $params);\n $id = $this->db->insert_id();\n $db_error = $this->db->error();\n if (! empty($db_error['code'])) {\n echo 'Database error! Error Code [' . $db_error['code'] . '] Error: ' . $db_error['message'];\n exit();\n }\n return $id;\n }", "public function __construct()\n {\n $this->plan = new Plan();\n }", "public function store(StoreStripePlanRequest $request)\n {\n Log::debug(\"STORE PLAN\");\n\n $amount = $request->amount . '00';\n\n $stripeService = new StripeService();\n $stripeService->setStripeKey();\n\n $stripeSubscriptionService = new StripeSubscriptionService();\n $result = $stripeSubscriptionService->createPlan($amount, $request->name, $request->product, $request->interval);\n\n if ($result['message'] == 'Success'){\n\n session()->flash('success', 'Plan created successfully.');\n \n return redirect( route ('plans.index') );\n\n } else {\n\n Log::debug($result['message']);\n\n session()->flash('error', $result['message']);\n \n return redirect()->back();\n\n }\n\n }", "public function run()\n {\n DB::table('plans')->insert(array(\n \n array('name' => 'Monthly',\n 'price' => 3500),\n\n array('name' => 'Yearly',\n 'price' => 19700)\n ));\n }", "public function add_plan() {\n $add_plan_name = $this->input->post('add_plan_name');\n $add_order_type = $this->input->post('add_order_type');\n $add_no_of_order = $this->input->post('add_no_of_order');\n $add_plan_price_amt = $this->input->post('add_plan_price');\n $add_plan_price = number_format((float) $add_plan_price_amt, 2, '.', '');\n $sess_data = $this->session->all_userdata();\n $inserted_id = $sess_data['admin_id'];\n $data = array(\n 'Plan_Name' => $add_plan_name,\n 'Type' => $add_order_type,\n 'Status' => 1\n );\n $this->db->where($data);\n $q = $this->db->get('tbl_plan');\n $count = $q->num_rows();\n if ($count == 0) {\n $insert_data = array(\n 'Plan_Name' => $add_plan_name,\n 'Type' => $add_order_type,\n 'Price' => $add_plan_price,\n 'No_Of_Order' => $add_no_of_order,\n 'Inserted_By' => $inserted_id,\n 'Inserted_Date' => date('Y-m-d H:i:s'),\n 'Status' => 1\n );\n $q = $this->db->insert('tbl_plan', $insert_data);\n if ($q) {\n echo \"success\";\n } else {\n echo \"fail\";\n }\n } else {\n echo \"exists\";\n }\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}", "function addPlanId($id, $planid) // user_cancel_subscription.php, user_charge_subscription.php\r\n\r\n{\r\n\r\n\tglobal $mysqli,$db_table_prefix;\r\n\r\n\t$stmt = $mysqli->prepare(\"UPDATE \".$db_table_prefix.\"users\r\n\r\n\t\tSET\r\n\r\n\t\tplan_id = ?\r\n\r\n\t\tWHERE\r\n\r\n\t\tid = ?\");\r\n\r\n\t$stmt->bind_param(\"si\", $planid, $id);\r\n\r\n\t$result = $stmt->execute();\r\n\r\n\t$stmt->close();\r\n\r\n\treturn $result;\r\n\r\n}", "public function addCustomer(CustomerModel $custData)\n {\n try \n {\n \n //define the query to search the database for the credentials\n $this->dbQuery = \"INSERT INTo customer\n (FirstName, LastName)\n VALUES \n ('{$custData->getFirstName()}', '{$custData->getLastName()}')\";\n //if the selected query returns a resultset\n //$result = mysqli_query($this->conn,$this->dbQuery);\n \n if( $this->dbObj->query($this->dbQuery))\n {\n // $this->conn->closeDbConnect();\n return true;\n }\n else\n {\n $this->conn->closeDbConnect();\n return false;\n }\n } catch (Exception $e) \n {\n echo $e->getMessage();\n }\n \n }", "function add_billing_data($billObj) {\n\n $item = new stdClass();\n $item->trans_id = $billObj->transId;\n $item->cardholder = $billObj->billTo->firstName . ' ' . $billObj->billTo->lastName;\n $item->type = 'a';\n $item->address = $billObj->billTo->address;\n $item->state = $billObj->billTo->state;\n $item->city = $billObj->billTo->city;\n $item->zip = $billObj->billTo->zip;\n $item->pdate = time();\n\n $exists = $this->is_billing_data_exists($item->trans_id);\n if ($exists == 0) {\n $query = \"insert into mdl_billing_data \"\n . \"(transaction_id,\"\n . \"cardholder,\"\n . \"type,\"\n . \"address,\"\n . \"state,\"\n . \"city,\"\n . \"zip,\"\n . \"pdate) \"\n . \"values ('$item->trans_id',\"\n . \"'\" . addslashes($item->cardholder) . \"',\"\n . \"'$item->type',\"\n . \"'\" . addslashes($item->address) . \"',\"\n . \"'$item->state',\"\n . \"'\" . addslashes($item->city) . \"',\"\n . \"'$item->zip',\"\n . \"'$item->pdate')\";\n $this->db->query($query);\n } // end if $exists == 0\n }", "function add_customer($params)\n {\n $this->db->insert('customer',$params);\n return $this->db->insert_id();\n }", "function copy_plan($userId,$planId,$new_name=\"\"){\n if( is_numeric($userId) && is_numeric($planId) ){\n \n if($new_name == \"\" ){\n // Retrive plan from plan table.\n $query = \"select * from plan where plan_id = '{$planId}' \";\n $result = @mysql_query($query);\n $row = @mysql_fetch_array($result);\n $new_name = $row['plan_name'];\n }\n \n // Create array for inserting record.\n $insertArr = array(\n 'plan_name'=> $new_name,\n 'parent_template_id' => NULL,\n 'user_id' => $userId,\n 'patient_id' => NULL,\n 'user_type' => 2,\n 'is_public' => NULL,\n 'creation_date' => $row['creation_date'], \n 'status' => 1\n );\n \n // Insert record.\n $result = $this->insert('plan',$insertArr);\n \n //Get new plan id\n $newlyPlanId = $this->insert_id();\n \n // Copy treatments associated with planId.\n if(is_numeric($newlyPlanId)){\n // copy treatments in the plan.\n $this->copy_plan_treatment($newlyPlanId,$planId);\n // copy articles in the plan.\n $this->copy_article($newlyPlanId,$planId);\n }\n } \n \n }", "public function run()\n {\n Plan::create([\n 'name' => 'Free Plan',\n 'trial_days' => 7,\n 'max_workspaces' => 1,\n 'max_users' => 5,\n 'max_clients' => 5,\n 'max_projects' => 5,\n 'image' => 'free_plan.png',\n 'status' => 1,\n ]);\n }", "public function billingPlan($id)\n {\n $this->shellshock(request(), [\n 'number' => 'required|numeric',\n 'exp_month' => 'required|numeric',\n 'exp_year' => 'required|numeric',\n 'cvc' => 'required|numeric',\n ]);\n\n Stripe::setApiKey(config('turtle.billing.stripe_secret_key'));\n\n // create card token\n $token = Token::create([\n 'card' => [\n 'number' => request()->input('number'),\n 'exp_month' => request()->input('exp_month'),\n 'exp_year' => request()->input('exp_year'),\n 'cvc' => request()->input('cvc'),\n ],\n ]);\n\n // create/update customer\n if (!auth()->user()->billing_customer) {\n $customer = Customer::create([\n 'source' => $token->id,\n 'email' => auth()->user()->email,\n ]);\n }\n else {\n $customer = Customer::retrieve(auth()->user()->billing_customer);\n $customer->source = $token->id;\n $customer->save();\n }\n\n // create/update subscription\n if (!auth()->user()->billing_subscription) {\n $subscription = Subscription::create([\n 'customer' => $customer->id,\n 'items' => [['plan' => $id]],\n ]);\n }\n else {\n $subscription = Subscription::retrieve(auth()->user()->billing_subscription);\n Subscription::update($subscription->id, [\n 'items' => [[\n 'id' => $subscription->items->data[0]->id,\n 'plan' => $id,\n ]],\n ]);\n }\n\n // update user\n auth()->user()->update([\n 'billing_customer' => $customer->id,\n 'billing_subscription' => $subscription->id,\n 'billing_plan' => $id,\n 'billing_cc_last4' => $token->card->last4,\n 'billing_period_ends' => Carbon::createFromTimestamp($subscription->current_period_end),\n ]);\n\n activity('Subscribed to '.$id);\n flash('success', 'Thanks for subscribing!');\n\n return response()->json(['reload_page' => true]);\n }", "public function add()\n {\n echo '客户需求添加一个新需求' . PHP_EOL;\n }", "function insertCustomer($customer) {\n //define the query\n $sql = \"INSERT INTO `customers`(`package_id`, `fname`, `lname`, `phone`, `email`, `state`)\n VALUES (:package_id, :fname, :lname, :phone, :email, :state)\";\n\n //Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //Bind the parameters\n $statement->bindParam(':package_id', $customer->getPackageId(), PDO::PARAM_STR);\n $statement->bindParam(':fname', $customer->getFname(), PDO::PARAM_STR);\n $statement->bindParam(':lname', $customer->getLname(), PDO::PARAM_STR);\n $statement->bindParam(':phone', $customer->getPhone(), PDO::PARAM_STR);\n $statement->bindParam(':email', $customer->getEmail(), PDO::PARAM_STR);\n $statement->bindParam(':state', $customer->getState(), PDO::PARAM_STR);\n\n //Execute\n $statement->execute();\n }", "public function store()\n\t{\n\t\t$travelPlan = new Travelplan;\n\n\t\t$travelPlan->agency_id = Input::get(\"agency_id\");\n\t\t$travelPlan->location_id = Input::get(\"location_id\");\n\t\t$travelPlan->destination_id = Input::get(\"destination_id\");\n\t\t$travelPlan->price = Input::get(\"price\");\n\n\t\t$pickup_date = Input::get(\"pickup_date\");\n\t\t$travel_date = Carbon::parse($pickup_date);\n\t\t$date_formatted = $travel_date->toFormattedDateString();\n\t\t$travel_date = $travel_date->toDateString();\n\t\t$travelPlan->pickup_date = $travel_date;\n\t\t\n\t\t\n\n\t\t$travelPlan->pickup_time = Input::get(\"pickup_time\");\n\t\t$travelPlan->pickup_location = Input::get(\"pickup_location\");\n\t\t$travelPlan->dropoff_location = Input::get(\"dropoff_location\");\n\n\t\tif($travelPlan->save())\n\t\t{\n\t\t\t// Store the activity\n\t\t\t$activity = new Activity;\n\t\t\t$activity->type = \" Add New Travel Plan \";\n\t\t\t$activity->details = \"Travel Plan From \".$travelPlan->location_id.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\" To \".$travelPlan->destination_id.\" By Agency \".$travelPlan->agency_id.\" Added \";\n\t\t\t$activity->activity_by = Auth::user()->fullName;\n\t\t\t$activity->save();\n\n\t\t\treturn Redirect::to(\"/admin/travelplan\");\n\t\t}\n\n\t}", "function wp_stripe_subscribe_customer_to_plan($email, $card, $plan_id, $description) {\n\n $customer = array(\n 'email' => $email,\n 'card' => $card,\n 'plan' => $plan_id\n );\n\n if ( $description ) {\n $customer['description'] = $description;\n }\n\n $response = Stripe_Customer::create($customer);\n\n return $response;\n}", "public function creating(Plan $plan)//troquei o created por creating\n {\n $plan->url = Str::kebab($plan->name);\n }", "public function create($customer, $plan)\n {\n // update subscription model\n if ($customer->subscription) {\n $subscription = $customer->subscription;\n } else {\n $subscription = new Subscription();\n $subscription->user_id = $customer->getBillableId();\n } \n // @todo when is exactly started at?\n $subscription->started_at = \\Carbon\\Carbon::now();\n \n $subscription->user_id = $customer->getBillableId();\n $subscription->plan_id = $plan->getBillableId();\n $subscription->status = Subscription::STATUS_NEW;\n \n $subscription->save();\n \n return $subscription;\n }", "function create() {\n\n global $conn;\n\n $stmt = $conn->prepare('\n INSERT INTO Customer ( Username, Name, Surname, Email, Phone, Pass )\n VALUES ( :Username, :Name, :Surname, :Email, :Phone, :Pass );\n ');\n\n $encrypted_pass = sha1($this->Pass);\n\n $stmt->bindParam(':Username', $this->Username);\n $stmt->bindParam(':Name', $this->Name);\n $stmt->bindParam(':Surname', $this->Surname);\n $stmt->bindParam(':Email', $this->Email);\n $stmt->bindParam(':Phone', $this->Phone);\n $stmt->bindParam(':Pass', $encrypted_pass);\n\n $result = $stmt->execute();\n\n if (!$result) {\n return FALSE;\n }\n\n $this->Customer_id = $conn->lastInsertId();\n return $this;\n\n }", "function insert() {\n\t\t$sql = \"INSERT INTO cost_detail (cd_fr_id, cd_seq, cd_start_time, cd_end_time, cd_hour, cd_minute, cd_cost, cd_update, cd_user_update)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq, $this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update));\n\t\t$this->last_insert_id = $this->ffm->insert_id();\n\t}", "public function run()\n {\n $plans = [\n [\n 'name' => 'Monthly',\n 'slug' => 'monthly',\n 'gateway_id' => 'month_6',\n 'price' => 6.00,\n 'active' => true,\n 'teams_enabled' => false,\n 'teams_limit' => null,\n ],\n [\n 'name' => 'Yearly',\n 'slug' => 'yearly',\n 'gateway_id' => 'year_60',\n 'price' => 60.00,\n 'active' => true,\n 'teams_enabled' => false,\n 'teams_limit' => null,\n ],\n [\n 'name' => 'Monthly for 10 users',\n 'slug' => 'monthly-for-10-users',\n 'gateway_id' => 'team_month_55',\n 'price' => 55.00,\n 'active' => true,\n 'teams_enabled' => true,\n 'teams_limit' => 10,\n ],\n ];\n\n Plan::insert($plans);\n }", "public function __construct($controller, $name = \"StripePaymentDetailsForm\", $plan_id = null)\n {\n $this->plan_id = $plan_id;\n \n parent::__construct($controller, $name);\n\n // if no plan is set, log a message and disable this form\n if (!$plan_id) {\n $this->sessionMessage(\n _t(\"StripeForms.SelectStripePlan\", \"You need to select a plan before paying\"),\n \"bad\"\n );\n\n $this->makeReadOnly();\n }\n }", "public function insertDB(){\n // Query to input into customers table\n $this->qry_insert_customer = \"INSERT INTO customers (company, firstname, lastname, email, phone, description)\n VALUES ('$this->company','$this->firstname', '$this->lastname', '$this->email', '$this->phone', '$this->description')\";\n\n // Query to input into customers table\n $this->qry_insert_address = \"INSERT INTO addresses (address, city, country, postal_code)\n VALUES ('$this->street','$this->place','$this->country','$this->zipcode')\";\n\n //Execute both queries\n mysqli_query($this->db, $this->qry_insert_customer);\n mysqli_query($this->db, $this->qry_insert_address); \n }", "public function run()\n {\n DB::table('plans')->insert([\n 'title' => 'Plan FILEX Premium',\n 'identifier' => 'Premium',\n 'stripe_id' => 'price_1IDFbPKYWi6uPg51ZU3knGTj',\n ]);\n\n DB::table('plans')->insert([\n 'title' => 'Plan FILEX Básico',\n 'identifier' => 'Básico',\n 'stripe_id' => 'price_1IDFOaKYWi6uPg51beIFrspu',\n ]);\n }", "function CreateTravelRate() {\r\n $conn = conn();\r\n $sql = \"INSERT INTO `travelrates`(`TravelCode`, `TravelAmount`, `Modified`, `ModifiedBy`) \r\n VALUES ('$this->TravCode','$this->TravRate',NOW(),'$this->ModifiedBy')\";\r\n if ($conn->exec($sql)) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n $conn = NULL;\r\n }", "function sql_addCustomer($kunde){\r\n\t\t\r\n\t\tglobal $database;\r\n\t\t$id = $database->insert(\"kunden\", [\r\n\t\t\t\t\"name\" => $kunde\r\n\t\t]);\r\n\t\t\r\n\t\treturn $id;\r\n\t\t\r\n\t}", "public function addPlan(AppsPlans $plan, int $quantity = 1) : self\n {\n if ($this->countPlans('apps_plans_id =' . $plan->getId())) {\n throw SubscriptionException::duplicatePlan($plan);\n }\n\n $subscription = $this->asStripeSubscription();\n\n $item = $subscription->items->create(array_merge([\n 'plan' => $plan->stripe_id,\n 'quantity' => $quantity,\n 'metadata' => [\n 'appPlan' => $plan->getId()\n ]\n ]));\n\n $subscriptionItem = new SubscriptionItems();\n $subscriptionItem->subscription_id = $this->getId();\n $subscriptionItem->apps_plans_id = $item->metadata->appPlan ?: 0;\n $subscriptionItem->stripe_id = $item->id;\n $subscriptionItem->stripe_plan = $item->plan->id;\n $subscriptionItem->quantity = $item->quantity;\n $subscriptionItem->saveOrFail();\n\n return $this;\n }", "public function actionSetup($plan)\n {\n // Redirect back to billing page if already has a plan active\n $isBillingActive = Yii::$app->user->identity->getBillingDaysLeft();\n if($isBillingActive){\n return $this->redirect(['billing/index']);\n }\n\n // Find the Pricing Option the user wants to setup\n $pricing = \\common\\models\\Pricing::findOne($plan);\n if(!$pricing){\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n\n // Check if is trial\n $isTrial = Yii::$app->user->identity->agent_trial_days > 0? true: false;\n\n // If user is attempting to setup a package which is for less than\n // the number of accounts he has attached, show error and redirect to billing\n $currentAccountCount = count(Yii::$app->ownedAccountManager->ownedAccounts);\n $planLimit = $pricing->pricing_account_quantity;\n if($planLimit < $currentAccountCount){\n Yii::$app->getSession()\n ->setFlash('warning', \"[Selected plan only allows $planLimit accounts. You have $currentAccountCount you administer. ] You may remove an account by clicking the <b>Remove</b> button on its right sidebar.\");\n\n return $this->redirect(['billing/index']);\n }\n\n // Calculate Discount if Available\n $discount = 0;\n if($isTrial){\n // Give 30% discount for trial users\n $discount = ($pricing->pricing_price - round($pricing->pricing_price * 0.7)) * -1;\n }\n\n // Setup new billing model\n $billingModel = new Billing();\n $billingModel->agent_id = Yii::$app->user->identity->agent_id;\n $billingModel->pricing_id = $pricing->pricing_id;\n $billingModel->billing_total = $pricing->pricing_price + $discount; // Store initial billed amount\n $billingModel->billing_email = Yii::$app->user->identity->agent_email;\n $billingModel->billing_name = Yii::$app->user->identity->agent_name;\n $billingModel->billing_currency = \"USD\";\n\n // Handle AJAX Validation\n if (Yii::$app->request->isAjax && $billingModel->load(Yii::$app->request->post())) {\n Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return \\yii\\widgets\\ActiveForm::validate($billingModel);\n }\n\n if($billingModel->load(Yii::$app->request->post())){\n // Token returned from 2CO after creditcard input\n $billingModel->twoco_token = Yii::$app->request->post('token');\n\n // If Token exists and record of bill is saved\n if($billingModel->twoco_token && $billingModel->save()){\n $token = Yii::$app->request->post('token');\n\n // Your sellerId(account number) and privateKey are required to make the Payment API Authorization call.\n Twocheckout::privateKey(Yii::$app->params['2co.privateKey']);\n Twocheckout::sellerId(Yii::$app->params['2co.sellerId']);\n // Your username and password are required to make any Admin API call.\n Twocheckout::username(Yii::$app->params['2co.username']);\n Twocheckout::password(Yii::$app->params['2co.password']);\n // If you want to turn off SSL verification (Please don't do this in your production environment)\n Twocheckout::verifySSL(Yii::$app->params['2co.verifySSL']); // this is set to true by default\n // To use your sandbox account set sandbox to true\n Twocheckout::sandbox(Yii::$app->params['2co.isSandbox']);\n\n\n // Use the token to create a sale\n try {\n $charge = Twocheckout_Charge::auth([\n \"merchantOrderId\" => $billingModel->billing_id,\n \"token\" => $token,\n \"currency\" => $billingModel->billing_currency,\n \"billingAddr\" => [\n // Card holder’s name. (128 characters max)\n \"name\" => $billingModel->billing_name,\n // Card holder’s street address. (64 characters max) Required\n \"addrLine1\" => $billingModel->billing_address_line1,\n // Card holder’s street address line 2. (64 characters max)\n // Required if “country” value is: CHN, JPN, RUS - Optional for all other “country” values.\n \"addrLine2\" => $billingModel->billing_address_line1? $billingModel->billing_address_line1:\"\",\n // Card holder’s city. (64 characters max) Required\n \"city\" => $billingModel->billing_city,\n /**\n * Card holder’s state. (64 characters max) Required if “country” value is ARG, AUS, BGR, CAN, CHN, CYP,\n * EGY, FRA, IND, IDN, ITA, JPN, MYS, MEX, NLD, PAN, PHL, POL, ROU, RUS, SRB, SGP, ZAF, ESP, SWE, THA, TUR,\n * GBR, USA - Optional for all other “country” values.\n */\n \"state\" => $billingModel->billing_state? $billingModel->billing_state:\"\",\n /**\n * Card holder’s zip. (16 characters max) Required if “country” value is ARG, AUS, BGR, CAN, CHN, CYP, EGY, FRA,\n * IND, IDN, ITA, JPN, MYS, MEX, NLD, PAN, PHL, POL, ROU, RUS, SRB, SGP, ZAF, ESP, SWE, THA, TUR, GBR,\n * USA - Optional for all other “country” values.\n */\n \"zipCode\" => $billingModel->billing_zip_code? $billingModel->billing_zip_code:\"\",\n // Card holder’s country. (64 characters max) Required\n \"country\" => $billingModel->country->country_iso_code_3,\n // Card holder’s email. (64 characters max) Required\n \"email\" => $billingModel->billing_email,\n // Card holder’s phone. (16 characters max) Optional\n // \"phoneNumber\" => '555-555-5555'\n ],\n \"lineItems\" => [\n [\n \"type\" => \"product\",\n \"name\" => \"Plugn \".$pricing->pricing_title.\" Plan\",\n \"price\" => $pricing->pricing_price,\n \"tangible\" => \"N\",\n \"productId\" => $pricing->pricing_id,\n \"recurrence\" => \"1 Month\",\n \"duration\" => \"Forever\",\n \"startupFee\" => $discount?$discount:\"\"\n ]\n ]\n ]);\n\n $billingModel->processTwoCheckoutSuccess($charge);\n return $this->redirect(['billing/index']);\n } catch (Twocheckout_Error $e) {\n $billingModel->processTwoCheckoutError($e);\n }\n }\n }\n\n // List of Zip / State Required Countries\n $zipStateCountries = \\common\\models\\Country::find()->select('country_id')\n ->where(['country_zipstate_required' => 1])->asArray()->all();\n\n // List of Addr Line 2 required countries\n $addrCountries = \\common\\models\\Country::find()->select('country_id')\n ->where(['country_addrline2_required' => 1])->asArray()->all();\n\n\n return $this->render('setup', [\n // Form\n 'model' => $billingModel,\n 'zipStateCountries' => json_encode($zipStateCountries),\n 'addrCountries' => json_encode($addrCountries),\n\n // Pricing\n 'pricing' => $pricing,\n 'isTrial' => $isTrial,\n\n // 2 CO\n 'processFormUrl' => Url::to(['billing/process']),\n 'environment' => Yii::$app->params['2co.environment'],\n 'sellerId' => Yii::$app->params['2co.sellerId'],\n 'publishableKey' => Yii::$app->params['2co.publishableKey'],\n ]);\n }", "public function run()\n {\n Plan::factory()->createMany([\n ['id' => Plan::FREE_PLAN, 'name' => 'Free', 'monthly_payment' => 0],\n ['id' => Plan::BASIC_PLAN, 'name' => 'Basic', 'monthly_payment' => 100],\n ['id' => Plan::PLUS_PLAN, 'name' => 'Plus', 'monthly_payment' => 187],\n ]);\n }", "public function testNewPaidMonthlyAccountAddValidRecord()\n {\n $this->assertEquals(0, $this->connection->executeFirstCell(\"SELECT COUNT(`id`) AS 'row_count' FROM {$this->insight->getTableName('accounts')}\"));\n $this->insight->accounts->addPaid(12345, new PlanL(), new Monthly());\n $this->assertEquals(1, $this->connection->executeFirstCell(\"SELECT COUNT(`id`) AS 'row_count' FROM {$this->insight->getTableName('accounts')}\"));\n\n $row = $this->connection->executeFirstRow(\"SELECT * FROM {$this->insight->getTableName('accounts')} WHERE `id` = ?\", 12345);\n\n $this->assertInternalType('array', $row);\n $this->assertEquals(12345, $row['id']);\n $this->assertEquals(PlanL::class, $row['plan']);\n $this->assertEquals(Monthly::class, $row['billing_period']);\n $this->assertEquals(AccountsInterface::PAID, $row['status']);\n $this->assertEquals($this->current_timestamp->format('Y-m-d H:i:s'), $row['created_at']);\n $this->assertEquals(date('Y'), $row['cohort_year']);\n $this->assertEquals(date('m'), $row['cohort_month']);\n $this->assertNull($row['canceled_at']);\n $this->assertEquals(99, $row['mrr_value']);\n $this->assertFalse($row['had_trial']);\n }", "public function add_customer($data){\n\t\t\n\t\t\t$this->db->insert('customers',$data);\n\t\t\tredirect('Customer');\n\t\t\n\t}", "function manage_bonus_plans(){}", "public function create_simple($data) {\n\n $plan = $this->csmplan->get($data['plan_id']);\n if (empty($plan)) {\n throw new Exception('Something went wrong. Membership plan does not exist');\n } else {\n $this->gump->validation_rules(array(\n 'user_id' => 'required|max_len,100',\n 'plan_id' => 'required|numeric',\n 'plan_start' => 'required|date',\n 'vat' => 'required|numeric'\n ));\n\n $validated_data = $this->gump->run($data);\n if ($validated_data === false) {\n $errArr = $this->gump->get_readable_errors();\n $errString = \"\";\n foreach ($errArr as $k => $err) {\n $errString .= $err . '<br>';\n }\n throw new Exception($errString);\n } else {\n $response = $this->create(array(\n 'user_id' => $data['user_id'],\n 'plan_id' => $plan['plan_id'],\n 'plan_start' => $data['plan_start'],\n 'plan_end' => date('Y-m-d', (strtotime($data['plan_start']) + ($plan['days'] * 60 * 60 * 24))),\n 'approved' => $data['approved'] ? 1 : 0,\n 'payment' => $data['payment'] ? 1 : 0,\n 'payment_method' => $data['payment_method'],\n 'payment_at' => $data['payment_at'],\n 'price' => $plan['price'],\n 'vat' => $plan['vat'],\n 'price_total' => $plan['price'] + (($plan['price'] / 100) * $data['vat'])\n ));\n if ($response !== 1) {\n throw new Exception('Something went wrong');\n } else {\n return $response;\n }\n }\n }\n }", "function insertTemporaryReport($conn, $planID){\n\t$sql = \"INSERT INTO temporaryreport (PlanId, DatePaused) VALUES (:planID, CURDATE())\";\t\n\t$sth = $conn->prepare($sql);\n\n\t\n\t$sth->bindParam(':planID', $planID, PDO::PARAM_INT, 11);\n\t\n\t$sth->execute();\n\t$sth->closeCursor();\n\t\n\t\n\t\n\t$return = ['message' => 'Successfully added the order'];\n\treturn $return;\n}", "function addNewCustomer($customerName, $mailingAddress1, $mailingAddress2, $mailingCity, $mailingState, $mailingZipcode,\r\n \t\t\t\t\t\t $phoneNumber, $billingAddress1, $billingAddress2, $billingCity, $billingState, $billingZipcode,\r\n \t\t\t\t\t\t $ccType, $ccNumber, $ccCode, $ccExpiration)\r\n {\r\n $q = \"INSERT INTO \".TBL_CUSTOMERS.\" VALUES (NULL, '$customerName', '$mailingAddress1', '$mailingAddress2', \r\n '$mailingCity', '$mailingState', '$mailingZipcode', '$phoneNumber', '$billingAddress1', '$mailingAddress2',\r\n '$billingCity', '$billingState', '$billingZipcode', 'No Status', '$ccType', '$ccNumber', '$ccCode', '$ccExpiration',\r\n $billingZipcode, 'True')\";\r\n return mysql_query($q, $this->connection);\r\n }", "public function upgrade($plan_id, $pay = NULL ) {\n \n // Check if the current user is admin and if session exists\n $this->check_session($this->user_role, 0);\n \n // Get plan price\n $price = $this->plans->get_plan_price($plan_id);\n \n if ($price[0]->plan_price > 0) {\n \n // Require the Payments interface\n require_once APPPATH . 'interfaces/Payments.php';\n \n // Verify if $pay is not null\n if ( $pay ) {\n \n $total_to_pay = $price[0]->plan_price;\n \n // Get discount if exists\n $discount = get_user_option( 'user_coupon_value' );\n \n if ( $discount ) {\n \n // Calculate total discount\n $total = ( $discount / 100) * $price[0]->plan_price; \n \n // Set new price\n $total_to_pay = $total_to_pay - $total;\n \n }\n \n \n if ( file_exists(APPPATH . 'payments/' . ucfirst($pay) . '.php') ) {\n\n require_once APPPATH . 'payments/' . ucfirst($pay) . '.php';\n \n // Call the class\n $pay_class = ucfirst(str_replace('-', '_', $pay));\n\n $get = new $pay_class;\n \n $get->process( $plan_id, $total_to_pay, $price[0]->currency_code);\n\n } else {\n \n display_mess(47);\n\n }\n \n } else {\n \n // Delete the user coupon code\n $this->user->delete_user_option( $this->user_id, 'user_coupon_code' );\n\n // Delete the user discount value\n $this->user->delete_user_option( $this->user_id, 'user_coupon_value' );\n\n // Create the classes array variable\n $classes = [];\n\n // Get all available payments gateways\n foreach (glob(APPPATH . 'payments/*.php') as $filename) {\n\n // Require the payments gateways\n require_once $filename;\n\n // Clean the class name\n $className = str_replace([APPPATH . 'payments/', '.php'], '', $filename);\n\n // Verify if the payment's gateway is enabled\n if ( ($this->options->check_enabled(strtolower($className)) == FALSE) ) {\n\n continue;\n\n }\n\n // Call the class name\n $get = new $className();\n\n // Get class info\n $classes [] = $get->info();\n\n }\n\n // Set the layout\n $this->body = 'user/gateways';\n\n // Set the layout's content\n $this->content = [\n 'plan' => $plan_id,\n 'plann' => $price,\n 'payments' => $classes\n ];\n\n // Call the layout\n $this->user_layout();\n\n }\n \n } else {\n \n if ( $this->plans->change_plan($plan_id, $this->user_id) ) {\n \n $this->session->set_flashdata('upgrade', display_mess(105));\n \n } else {\n \n $this->session->set_flashdata('upgrade', display_mess(106));\n \n }\n \n // go to plans page\n redirect('user/plans');\n \n }\n \n }", "function createCustomer($db, $post, $credentialID){\n\t$AGENTID = 20; //online agent\n\n\t// Creates a customer object\n\t$customer = createCustomerObject($post);\n\n\t// Extract customer information\n\t$firstName = $customer->getFirstName();\n\t$lastName = $customer->getLastName();\n\t$address = $customer->getAddress();\n\t$city = $customer->getCity();\n\t$province = $customer->getProvince();\n\t$postal = $customer->getPostal();\n\t$country = $customer->getCountry();\n\t$homePhone = $customer->getHomePhone();\n\t$businessPhone = $customer->getBusinessPhone();\n\t$email = $customer->getEmail();\n\n\t// SQL statement to insert customer into customers table\n\t$sql = \"INSERT INTO customers \n\t(CustFirstName, CustLastName, CustAddress, CustCity, CustProv, CustPostal, CustCountry, CustHomePhone, CustBusPhone, CustEmail, AgentId, credentialID)\n VALUES ('$firstName', '$lastName', '$address', '$city', '$province', '$postal', '$country', '$homePhone', '$businessPhone', '$email', $AGENTID, $credentialID)\";\n\n // Execute database query\n if ($db->query($sql) === TRUE) {\n \t\techo 'Customer created';\n \t} else {\n \t\techo 'Error occured in customer ' . $db->error;\n \t}\n}", "public function addSubscription()\n {\n $custId = $this->request->id;\n $customerObj = $this->_customer->find($custId);\n if (! is_object($customerObj)) {\n return false;\n }\n $fromDate = $this->request->start_date;\n $planId = $this->request->subscription_plan;\n $orderId = $this->request->orderid;\n $getPlan = SubscriptionPlan::where('id', $planId)->first();\n $duration = $getPlan->duration;\n $planName = $getPlan->name;\n $date = Carbon::createFromFormat('d-m-Y', $fromDate);\n $fromDate = Carbon::createFromFormat('d-m-Y', $fromDate)->format('Y-m-d');\n $endDate = $date->addDays($duration);\n $customerObj->expires_at = $endDate;\n $customerObj->save();\n $subscriber = new Subscribers();\n $subscriber->subscription_plan_id = $planId;\n $subscriber->customer_id = $custId;\n $subscriber->start_date = $fromDate;\n $subscriber->end_date = $endDate;\n $subscriber->is_active = 1;\n $subscriber->save();\n $paymentTrans = new PaymentTransactions();\n $paymentTrans->payment_method_id = 2;\n $paymentTrans->customer_id = $custId;\n $paymentTrans->status = \"Success\";\n $paymentTrans->transaction_message = \"Success\";\n $paymentTrans->transaction_id = $orderId;\n $paymentTrans->response = \"Success\";\n $paymentTrans->plan_name = $planName;\n $paymentTrans->subscriber_id = $custId;\n $paymentTrans->subscription_plan_id = $planId;\n $paymentTrans->save();\n return true;\n }", "public function UsePlan($plan_id) {\n\t\t$this->Param('plan_id', $plan_id, 'recur');\n\n\t\treturn true;\n\t}", "public function addCartItem($rateplanId, $quantity){\r\n\t\terror_log('cart.php rateplanId is: ' . $rateplanId, 0);\r\n\t\terror_log('cart.php quantity is: ' . $quantity, 0);\r\n\t\t//$newCartItem = new Cart_Item($rateplanId, $quantity, $this->latestItemId);\r\n\r\n\r\n\r\n\t\t$newCartItem = new Cart_Item();\r\n\t\t$newCartItem->ratePlanId = $rateplanId;\r\n\t\terror_log('cart.php ratePlanId2 is: ' . $newCartItem->ratePlanId, 0);\r\n\t\t$newCartItem->itemId = $this->latestItemId++;\r\n\t\terror_log('cart.php itemId is: ' . $newCartItem->itemId, 0);\r\n\t\t$newCartItem->quantity = $quantity;\r\n\r\n\t\t//$plan = Catalog::getRatePlan($newCartItem->ratePlanId);\r\n\t\t$rpId = $newCartItem->ratePlanId;\r\n\r\n\t\r\n\r\n\r\n\t\t$catalog_groups = self::readCache();\t//should be in associative array already.\r\n\r\n\t\t$catalog_products = $catalog_groups->products;\t//returns enture product array.\r\n\t\t//error_log(print_r($catalog_products, true));\r\n\t\t//error_log(print_r($catalog_products[2], true));\t//returns a product array with productrateplan and productrateplancharges arrays embedded inside.\r\n\t\t$catalog_rateplans = $catalog_products[0]->productRatePlans;\r\n\t\t//error_log(print_r($catalog_rateplans, true));\r\n\r\n\r\n\r\n\t\t//Commented out for DEMO\r\n\t\t// foreach($catalog_groups as $group){\r\n\t\t// \t\r\n\t\t// \tforeach($group->products as $product){\r\n\t\t// \t\t\r\n\t\t// \t\tforeach($product->productRatePlans as $ratePlan){\r\n\t\t// \t\t\tif($ratePlan->id == $rpId){\r\n\t\t// \t\t\t\t$plan = $ratePlan;\r\n\t\t// \t\t\t}\r\n\t\t// \t\t}\r\n\t\t// \t}\r\n\t\t// }\r\n\t\t// $plan = NULL;\r\n\r\n\t/**\r\n\t * Given a RatePlan ID, retrieves all rateplan information by searching through the cached catalog file\r\n\t * @return RatePlan model\r\n\t */\r\n\t// public static function getRatePlan($rpId){\r\n\t// \t$catalog_groups = self::readCache();\r\n\t// \tforeach($catalog_groups as $group){\r\n\t// \t\tforeach($group->products as $product){\r\n\t// \t\t\tforeach($product->ratePlans as $ratePlan){\r\n\t// \t\t\t\tif($ratePlan->Id == $rpId){\r\n\t// \t\t\t\t\treturn $ratePlan;\r\n\t// \t\t\t\t}\r\n\t// \t\t\t}\r\n\t// \t\t}\r\n\t// \t}\r\n\t// \treturn NULL;\r\n\t// }\r\n\r\n\r\n/*\t\t//Not needed? no Uom. \r\n\t\tif(isset($plan->Uom)){\r\n\t\t\t$newCartItem->uom = $plan->Uom;\r\n\t\t} else {\r\n\t\t\t$newCartItem->uom = null;\t\t\t\r\n\t\t}\r\n*/\t\r\n\t\t// $newCartItem->ratePlanName = $plan!=null ? $plan->Name : 'Invalid Product';\r\n\t\t// $newCartItem->ProductName = $plan!=null ? $plan->productName : 'Invalid Product';\r\n\r\n\t\t//Commented out for DEMO\r\n\t\t// $newCartItem->ratePlanName = $plan!=null ? $plan->name : 'Invalid Product';\r\n\t\t// $newCartItem->productName = $plan!=null ? $plan->productName : 'Invalid Product';\r\n\t\tarray_push($this->cart_items, $newCartItem);\r\n\t}", "function addRecord($con, $inpTeam, $inpEnv, $inpTech, $inpType, $inpInitial, $inpFinal, $totSavings, $inpCause, $inpSteps, $inpDate, $inpProj, $userID)\n\t{\n\t\t$stmt_insert = $con->prepare(\"INSERT INTO costsavings (csCause, csSteps, csDate, csSavings, csInitial, csFinal, teamID, techID, envID, typeID, projectID, userID) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\");\n\t\t$stmt_insert->bind_param(\"sssdddiiiiii\", $inpCause, $inpSteps, $inpDate, $totSavings, $inpInitial, $inpFinal, $inpTeam, $inpTech, $inpEnv, $inpType, $inpProj, $userID);\n\t\t$stmt_insert->execute() or die(mysqli_error($con));\n\n\t\t$msgDisplay = successAlert(\"Successfully inserted a new record.\");\n\n\t\treturn $msgDisplay;\n\t}", "public function create($plan, array $properties = array());", "public static function add($data, $customerId, $userId) {\n\t\t\t\n\t\t\t$data['customer_id'] = $customerId;\n\t\t\t$data['user_id'] = $userId;\n\t\t\tCustomer::create($data);\n\t\t}", "public function add()\n {\n // if we have POST data to create a new customer entry. If button 'submit_add_customer' in view customers/index has clicked\n if (isset($_POST['submit_add_vendedor'])) {\n // Instance new Model (Customers)\n $Vendedor = new VendedoresModel();\n // do add() in model/Customer.php\n $Vendedor->add($_POST['nome'], $_POST['email']);\n\t // where to go after Customer has been added\n\t header('location: ' . URL . 'vendedores/index');\t\n }\n\n // load views. within the views we can echo out $customer easily\n\t\t$view = new VendedoresView();\n\t\t$view->add('vendedores','add');\n }", "public function subscription_create($customerId, $planId){\n\t\t$params = array(\n\t\t\t'planId' => $planId,\n\t\t\t'customerId' => $customerId,\n\t\t);\n\t\t\n\t\t$flow = $this->send('subscription/create', $params, 'POST');\t\t\n\t\t$response = array(\n\t\t\t'subscriptionId' => $flow['subscriptionId'],\n\t\t\t'planId' => $flow['planId'],\n\t\t\t'plan_name' => $flow['plan_name'],\n\t\t\t'customerId' => $flow['customerId'],\n\t\t\t'created' => $flow['created'],\n\t\t\t'subscription_start' => $flow['subscription_start'],\n\t\t\t'subscription_end' => $flow['subscription_end'],\n\t\t\t'period_start' => $flow['period_start'],\n\t\t\t'period_end' => $flow['period_end'],\n\t\t\t'next_invoice_date' => $flow['next_invoice_date'],\n\t\t\t'trial_period_days' => $flow['trial_period_days'],\n\t\t\t'trial_start' => $flow['trial_start'],\n\t\t\t'trial_end' => $flow['trial_end'],\n\t\t\t'cancel_at_period_end' => $flow['cancel_at_period_end'],\n\t\t\t'cancel_at' => $flow['cancel_at'],\n\t\t\t'periods_number' => $flow['periods_number'],\n\t\t\t'days_until_due' => $flow['days_until_due'],\n\t\t\t'status' => $flow['status'],\n\t\t\t'morose' => $flow['morose'],\n\t\t\t'discount' => $flow['discount'],\n\t\t\t'invoices' => $flow['invoices']\n\t\t);\n\t\treturn $response['customerId'];\n\t}", "function add_costumer($params)\n {\n $this->db->insert('costumer',$params);\n return $this->db->insert_id();\n }", "public function run()\n {\n DB::table('disc_plan_orders')->insert([\n 'order_id' => 1 ,\n 'disc_plan_id' => 1 ,\n 'quantity' => 1 ,\n 'price' => 0 ,\n 'total' => 0 ,\n 'tax' => 0 \n ]);\n }", "public function addDB()\n {\n $this->model->addDB();\n header('location:index.php?controller=new');\n }", "public function testNewFreeAccountAddValidRecord()\n {\n $this->assertEquals(0, $this->connection->executeFirstCell(\"SELECT COUNT(`id`) AS 'row_count' FROM {$this->insight->getTableName('accounts')}\"));\n $this->insight->accounts->addFree(12345, new FreePlan());\n $this->assertEquals(1, $this->connection->executeFirstCell(\"SELECT COUNT(`id`) AS 'row_count' FROM {$this->insight->getTableName('accounts')}\"));\n\n $row = $this->connection->executeFirstRow(\"SELECT * FROM {$this->insight->getTableName('accounts')} WHERE `id` = ?\", 12345);\n\n $this->assertInternalType('array', $row);\n $this->assertEquals(12345, $row['id']);\n $this->assertEquals(AccountsInterface::FREE, $row['status']);\n $this->assertEquals(FreePlan::class, $row['plan']);\n $this->assertNull($row['billing_period']);\n $this->assertEquals($this->current_timestamp->format('Y-m-d H:i:s'), $row['created_at']);\n $this->assertEquals(date('Y'), $row['cohort_year']);\n $this->assertEquals(date('m'), $row['cohort_month']);\n $this->assertEquals($this->current_timestamp->format('Y-m-d H:i:s'), $row['converted_to_free_at']->format('Y-m-d H:i:s'));\n $this->assertNull($row['canceled_at']);\n $this->assertEquals(0, $row['mrr_value']);\n $this->assertFalse($row['had_trial']);\n }", "public function create()\n {\n $user = Auth::user();\n if (!$user || !$user->is_back_user()) {\n return redirect()->intended(route('admin/login'));\n }\n elseif (!$user->can('create-membership-plans')){\n return redirect()->intended(route('admin/error/permission_denied'));\n }\n\n $cash_terminals = CashTerminal::with('shopLocation')->get();\n $shops = ShopLocations::all();\n\n $breadcrumbs = [\n 'Home' => route('admin'),\n 'Administration' => route('admin'),\n 'Back End User' => route('admin'),\n 'Permissions' => '',\n ];\n $text_parts = [\n 'title' => 'Add new membership plan',\n 'subtitle' => '',\n 'table_head_text1' => 'Membership Plans - Create New'\n ];\n $sidebar_link = 'admin-backend-memberships-new_plans';\n\n return view('admin/membership_plans/add_plan', [\n 'breadcrumbs' => $breadcrumbs,\n 'text_parts' => $text_parts,\n 'in_sidebar' => $sidebar_link,\n 'cash_terminals' => $cash_terminals,\n 'shops' => $shops,\n ]);\n }", "public function add(\\dbprggmr\\Database $db, $id = null)\n {\n if (null == $id) {\n if ($this->_default == \\prggmr::GLOBAL_DEFAULT) {\n $id = \\prggmr::GLOBAL_DEFAULT;\n } else {\n $f = false;\n while(!$f) { $id = str_random(8); if (!isset($this->_connections[$id])) $f = true; }\n }\n }\n\n $this->_default = $id;\n $this->_connections[$id] = $db;\n }", "public function p_add() {\n $_POST['user_id'] = $this->user->user_id;\n\n # Unix timestamp of when this post was created / modified\n $_POST['created'] = Time::now();\n $_POST['modified'] = Time::now();\n\n\n # Insert\n # Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n DB::instance(DB_NAME)->insert('activities', $_POST);\n\n # Send them back to home page\n Router::redirect('/activities/index');\n\n }", "public function action_addcreditcard() {\n $package = Model::factory('package');\n $btn_card_confirm = arr::get($_REQUEST, 'btn_card_confirm');\n $config_country['taxicountry'] = $this->country_info();\n $this->session = Session::instance();\n $errors = array();\n $userid = $this->session->get('userid');\n $postvalue = Arr::map('trim', $this->request->post());\n\n $getadmin_profile_info = $package->getadmin_profile_info();\n\n\n $post_values = Securityvalid::sanitize_inputs($postvalue);\n $billing_card_info_details = $package->billing_card_info_details();\n if (empty($billing_card_info_details)) {\n $billing_info_id = '';\n } else {\n $billing_info_id = $billing_card_info_details[0]['_id'];\n }\n if (isset($btn_card_confirm) && Validation::factory($_POST)) {\n $validator = $package->upgrade_plan_validate(arr::extract($post_values, array('cardnumber', 'cvv', 'expirydate', 'firstName', 'lastname', 'address', 'postal_code', 'terms', 'country', 'state', 'city')), $userid);\n if ($validator->check()) {\n $cardnumber = $postvalue['cardnumber'];\n $cvv = $postvalue['cvv'];\n $expirydate = explode('/', $postvalue['expirydate']);\n $firstname = $postvalue['firstName'];\n $lastname = $postvalue['lastname'];\n $address = $postvalue['address'];\n $city = $postvalue['city'];\n $country = $postvalue['country'];\n $state = $postvalue['state'];\n $postal_code = $postvalue['postal_code'];\n $package_upgrade_time = PACKAGE_UPGRADE_TIME;\n $cardnumber = preg_replace('/\\s+/', '', $cardnumber);\n \n $this->billing_info['card_number'] = $cardnumber;\n $this->billing_info['cvv'] = $cvv;\n $this->billing_info['expirationMonth'] = $expirydate[0];\n $this->billing_info['expirationYear'] = $expirydate[1];\n $this->billing_info['firstName'] = $firstname;\n $this->billing_info['lastname'] = $lastname;\n $this->billing_info['address'] = $address;\n $this->billing_info['city'] = $city;\n $this->billing_info['country'] = $country;\n $this->billing_info['state'] = $state;\n $this->billing_info['postal_code'] = $postal_code;\n $this->billing_info['createdate'] = $package_upgrade_time; \n $this->billing_info['currency']=CLOUD_CURRENCY_FORMAT; \n $billing_info_reg = $package->billing_registration($this->billing_info, $billing_info_id);\n if ($billing_info_reg) {\n Message::success(__('billing_updated_sucessfully'));\n }\n } else {\n $errors = $validator->errors('errors');\n }\n }\n $view = View::factory(ADMINVIEW . 'package_plan/addcreditcard')\n ->bind('postedvalues', $this->userPost)\n ->bind('errors', $errors)\n ->bind('getadmin_profile_info', $getadmin_profile_info)\n ->bind('subscription_cost_month', $subscription_cost_month)\n ->bind('billing_card_info_details', $billing_card_info_details)\n ->bind('all_country_list', $config_country['taxicountry'])\n ->bind('setup_cost', $setup_cost)\n ->bind('postvalue', $post_values);\n $this->template->title = CLOUD_SITENAME . \" | \" . __('add_credit_card');\n $this->template->page_title = __('add_credit_card');\n $this->template->content = $view;\n }", "public function run()\n {\n DB::table('plans')->delete();\n $plans = [\n [\n 'name' => 'small',\n 'slug' => 'small',\n 'stripe_plan' => 'Small Plan',\n 'cost' => 5.00,\n 'description' => 'Small Plan Package',\n 'created_at' => new DateTime(),\n 'updated_at' => new DateTime()\n ],\n [\n 'name' => 'big',\n 'slug' => 'Big',\n 'stripe_plan' => 'Big Plan',\n 'cost' => 10.00,\n 'description' => 'Big Plan Package',\n 'created_at' => new DateTime(),\n 'updated_at' => new DateTime()\n ]\n ];\n\n Plan::insert($plans);\n }", "public function created(PlanSubscription $planSubscription)\n {\n //\n }", "function addMerchant($vars){\n\tglobal $db;\n\t//should do some kind of security checks to prevent duplicate entries...(not in scope)\n\t$id = $db->insert('merchants', $vars);\n\tif($id){\n\t\t//return id merchantid\n\t\treturn $id;\n\t}else{\n\t\treturn false;\n\t}\n\t\n}", "public function doSavePaymentDetails($data)\n {\n $token = $data[\"StripeToken\"];\n $plan_id = $this->plan_id;\n\n Stripe::setApiKey(StripeForms::secret_key());\n\n if ($token) {\n $member = Member::currentUser();\n\n // Try to setup stripe customer and add them to plan\n try {\n $member->saveStripeCustomer($token);\n $already_subscribed = true;\n\n // See if we have any existing plans that match our ID\n $existing_plans = $member\n ->StripeSubscriptions()\n ->filter(array(\n \"Status\" => StripeSubscription::config()->active_status,\n \"PlanID\" => $plan_id\n ));\n\n if (!$existing_plans->exists()) {\n // First cancel any existing subscriptions (if needed)\n if (StripeForms::config()->cancel_subscriptions_on_setup && $member->StripeSubscriptions()->exists()) {\n foreach($member->StripeSubscriptions() as $subscription) {\n $subscription->cancel();\n $subscription->write();\n }\n }\n\n // First clear any existing subscriptions (if needed)\n if (StripeForms::config()->clear_subscriptions_on_setup && $member->StripeSubscriptions()->exists()) {\n foreach($member->StripeSubscriptions() as $subscription) {\n $subscription->delete();\n }\n }\n\n // Associate subscription in stripe\n $stripe_subscription = StripeAPISubscription::create(array(\n \"customer\" => $member->StripeID,\n \"plan\" => $plan_id\n ));\n\n $subscription = StripeSubscription::create();\n $subscription->Status = $stripe_subscription->status;\n $subscription->StripeID = $stripe_subscription->id;\n $subscription->PlanID = $plan_id;\n $subscription->MemberID = $member->ID;\n $subscription->write();\n\n $member->PaymentAttempts = 0;\n $member->write();\n }\n\n $this->extend(\"onSuccessfulSavePaymentDetails\", $data);\n\n $this->sessionMessage(\n _t(\"StripeForms.SubscriptionSetup\", \"Payment details saved and subscription setup\"),\n \"good\"\n );\n } catch (Exception $e) {\n $this->sessionMessage($e->getmessage(),\"bad\");\n }\n }\n\n return $this->controller->redirectBack();\n }", "public function add() \n { // metodo add, complementar\n $str = \"insert into \".self::$tablename.\"(nitHotel, idCiudad, nomHotel, dirHotel, telHotel1, telHotel2, correoHotel, tipoHotel, Administrador, idRedes, aforo, tipoHabitaciones, status)\";\n $str.= \" values ('$this->nitHotel', $this->idCiudad, '$this->nomHotel', '$this->dirHotel', '$this->telHotel1', '$this->telHotel2', '$this->correoHotel', $this->tipoHotel, '$this->Administrador', $this->idRedes, $this->aforo, $this->tipoHabitaciones, $this->status);\";\n }", "function insertAccountManager()\n {\n $stmt = \"INSERT INTO\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"customer_account_manager\n (\n cam_prj_id,\n cam_customer_id,\n cam_usr_id,\n cam_type\n ) VALUES (\n \" . Misc::escapeInteger($_POST['project']) . \",\n \" . Misc::escapeInteger($_POST['customer']) . \",\n \" . Misc::escapeInteger($_POST['manager']) . \",\n '\" . Misc::escapeString($_POST['type']) . \"'\n )\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return -1;\n } else {\n return 1;\n }\n }", "public function add_new_customer()\n {\n if ($this->input->post())\n {\n $ac_receivable = $this->MSettings->get_by_company_id($this->session->user_company);\n $chart = $this->MAc_charts->get_by_id($ac_receivable['ac_receivable']);\n $siblings = $this->MAc_charts->get_by_parent_id($ac_receivable['ac_receivable']);\n if (count($siblings) > 0)\n {\n $ac_code_temp = explode('.', $siblings['code']);\n $ac_last = count( $ac_code_temp ) - 1;\n $ac_new = (int)$ac_code_temp[$ac_last] + 10;\n $ac_code = $chart['code'] . '.' . $ac_new;\n }\n else\n {\n $ac_code = $chart['code'] . '.10';\n }\n\n $ac_id = $this->MAc_charts->account_create($ac_receivable['ac_receivable'], $ac_code, $this->input->post('name'));\n $insert_id = $this->MCustomers->create(trim($this->input->post('code')), $ac_id);\n $customers = $this->MCustomers->get_all();\n $html = '';\n foreach ($customers as $customer)\n {\n if ($insert_id == $customer['id'])\n {\n $html .= '<option value=\"' . $customer['id'] . '\" selected>' . $customer['name'] . '</option>';\n }\n else\n {\n $html .= '<option value=\"' . $customer['id'] . '\">' . $customer['name'] . '</option>';\n }\n }\n echo $html;\n }\n }", "public function create( Request $request, Plan $plan)\n {\n $plan = Plan::findOrFail($request->get('plan'));\n \n $request->user()\n ->newSubscription('main', $plan->stripe_plan)\n ->create($request->stripeToken);\n \n return redirect()->route('home')->with('success', 'Your plan subscribed successfully');\n }", "function addNewUser($memberName, $memberPassword, $firstName, $lastName, $userEmail, $phoneNumber, $customerId, $myqueueId,\r\n \t\t\t\t\t $securityQuestion, $securityAnswer, $membershipPlan )\r\n {\r\n $time = time();\r\n /* If admin sign up, give admin user level */\r\n if(strcasecmp($memberName, ADMIN_NAME) == 0){\r\n $ulevel = ADMIN_LEVEL;\r\n }else{\r\n $ulevel = USER_LEVEL;\r\n }\r\n $q = \"INSERT INTO \".TBL_USERS.\" VALUES (NULL, '$memberName', '$memberPassword', '$firstName', '$lastName', '$userEmail',\r\n 'Approved', '$phoneNumber', '', '$customerId', '$myqueueId', '$securityQuestion', '$securityAnswer', '$membershipPlan',\r\n $time, '', 0, $ulevel)\";\r\n return mysql_query($q, $this->connection);\r\n }", "public function admin_add_paypal_payment() {\n\t\t$this->request->data['PaypalPaymentModule']['name'] = 'Paypal ' . $this->request->data['PaypalPaymentModule']['name'];\n\t\t\n\t\t$this->request->data['ShopsPaymentModule']['payment_module_id'] = PAYPAL_PAYMENT_MODULE;\n\t\t$this->request->data['ShopsPaymentModule']['shop_id'] = Shop::get('Shop.id');\n\t\t$this->request->data['ShopsPaymentModule']['display_name'] = $this->request->data['PaypalPaymentModule']['name'];\n\t\t\n\t\t$paymentModuleInShop = $this->Payment->ShopsPaymentModule;\n\t\t$paymentModule = $paymentModuleInShop->PaymentModule;\n\t\t\n\t\t$paymentModule->create();\n\t\t$paymentModuleInShop->create();\n\t\t\n\t\t\n\t\tif ($paymentModuleInShop->saveAll($this->request->data)) {\n\t\t\t$this->Session->setFlash(__('Paypal payment has been activated'), 'default', array('class'=>'flash_success'));\n\t\t} else {\n\t\t\t$this->Session->setFlash(__('Paypal payment could not be saved. Please, try again.'), 'default', array('class'=>'flash_failure'));\n\t\t}\n\t\t\n\t\t$this->redirect(array('action'=>'index'));\n\t}", "function add_customer ($db) {\n \n global $fnameErr, $lnameErr, $ageErr, $ssnErr, $errMsg, $add_to_DB;\n global $fname, $lname, $age, $ssn;\n \n if (empty($_POST[\"firstname\"])) {\n $fnameErr = \"* First Name is required\"; \n\t} else {\n\t $fname = process_input($_POST[\"firstname\"]);\n\t\t$add_to_DB = true;\n }\n\t\t\n if (empty($_POST[\"lastname\"])) {\n\t$lnameErr = \"* Last Name is required\"; \n $add_to_DB = false;\n\t} else {\n\t $lname = process_input($_POST[\"lastname\"]);\n }\n\t\t\n if (empty($_POST[\"custage\"])) {\n\t$ageErr = \"* Age is required\";\n $add_to_DB = false; \n\t} else {\n\t $age = process_input($_POST[\"custage\"]);\n }\n\t\t\n if (empty($_POST[\"custssn\"])) {\n\t$ssnErr = \"* SSN is required\"; \n\t$add_to_DB = false;\n\t} else {\n\t $ssn = process_input($_POST[\"custssn\"]);\n }\n\t \n\t \n if ($add_to_DB)\n if ($db) {\n $query_string = \"INSERT INTO Customers \" .\n\t \"(First, Last, Age, SSN) \" .\n \"VALUES ('$fname', '$lname', $age, $ssn)\";\n\t if (mysqli_query($db, $query_string)) {\n\t return 1;\n } else {\n\t $errMsg = \"Error adding record: \" . mysqli_error($db);\n\t return 0;\n\t }\n }\n}", "public function run()\n\t{\n\t\tModel::unguard();\n\n\t\tPlan::create([\n\t\t\t'name' => 'Gratuito', \n\t\t\t'quantity_oportunities' => 1, \n\t\t\t'price' => 0.0]);\n\t\tPlan::create([\n\t\t\t'name' => 'Básico', \n\t\t\t'quantity_oportunities' => 10, \n\t\t\t'price' => 99.0]);\n\t\tPlan::create([\n\t\t\t'name' => 'Premium', \n\t\t\t'quantity_oportunities' => 50, \n\t\t\t'price' => 149.0]);\n\t}", "public function run()\n {\n Bill::create([\n 'customer_id'->customer_id,\n 'date_order'->date_order,\n 'total'->total\n ]);\n }", "public function run()\n {\n Plan::create([\n 'name' => 'low_monthly',\n 'braintree_plan_id' => 'low_monthly',\n 'price' => '500',\n 'priceName' => 'Five',\n 'period' => 'month',\n ]);\n\n Plan::create([\n 'name' => 'high_monthly',\n 'braintree_plan_id' => 'high_monthly',\n 'price' => '1000',\n 'priceName' => 'Ten',\n 'period' => 'month',\n ]);\n }", "public function whmcs_add_credit($params = array()) {\n\t\t$params['action'] = 'AddCredit';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}", "function Add() \n\t{\n\t\tglobal $dal_info;\n\t\t\n\t\t$insertFields = \"\";\n\t\t$insertValues = \"\";\n\t\t$tableinfo = &$dal_info[ $this->infoKey ];\n\t\t$blobs = array();\n\t\t//\tprepare parameters\t\t\n\t\tforeach($tableinfo as $fieldname => $fld)\n\t\t{\n\t\t\tif( isset($this->{$fld['varname']}) )\n\t\t\t{\n\t\t\t\t$this->Value[ $fieldname ] = $this->{$fld['varname']};\n\t\t\t}\n\t\t\t\n\t\t\tforeach($this->Value as $field => $value)\n\t\t\t{\n\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t$insertFields.= $this->_connection->addFieldWrappers( $fieldname ).\",\";\n\t\t\t\t$insertValues.= $this->PrepareValue($value,$fld[\"type\"]) . \",\";\n\t\t\t\t\n\t\t\t\tif( $this->_connection->dbType == nDATABASE_Oracle || $this->_connection->dbType == nDATABASE_DB2 || $this->_connection->dbType == nDATABASE_Informix )\n\t\t\t\t{\n\t\t\t\t\tif( IsBinaryType( $fld[\"type\"] ) )\n\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\n\t\t\t\t\t\t\n\t\t\t\t\tif( $this->_connection->dbType == nDATABASE_Informix && IsTextType( $fld[\"type\"] ) )\n\t\t\t\t\t\t$blobs[ $fieldname ] = $value;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//\tprepare and exec SQL\n\t\tif( $insertFields != \"\" && $insertValues != \"\" )\t\t\n\t\t{\n\t\t\t$insertFields = substr($insertFields, 0, -1);\n\t\t\t$insertValues = substr($insertValues, 0, -1);\n\t\t\t$dalSQL = \"insert into \".$this->_connection->addTableWrappers( $this->m_TableName ).\" (\".$insertFields.\") values (\".$insertValues.\")\";\n\t\t\t$this->Execute_Query($blobs, $dalSQL, $tableinfo);\n\t\t}\n\t\t//\tcleanup\t\t\n\t $this->Reset();\n\t}", "function process_form() {\n global $db;\n\n // Get a unique ID for this customer\n $customer_id = $db->nextID('customers');\n\n // Insert the new customer into the table\n $db->query('INSERT INTO customers (customer_id, customer_name, phone, favorite_dish_id) VALUES (?,?,?,?)',\n array($customer_id, $_POST['customer_name'], $_POST['phone'], $_POST['favorite_dish_id']));\n\n // Tell the user that we added a customer.\n print 'Added ' . htmlentities($_POST['customer_name']) . ' to the database.';\n}", "function CreateDeposit() {\r\n $conn = conn();\r\n\r\n $sql = \"INSERT INTO `deposit`(`CompanyId`, `DepositAmount`, `PreviousBalance`, `CurrentBalance`, `Comments`, `RecEntered`, `RecEnteredBy`) VALUES \"\r\n . \"('$this->CompanyId','$this->DepositAmount','$this->PreviousBalance','$this->CurrentBalance','$this->Comments',NOW(), '$this->ReEnteredBy')\";\r\n if ($conn->exec($sql)) {\r\n $this->auditok = 1;\r\n } else {\r\n $this->auditok = 0;\r\n }\r\n $conn = NULL;\r\n }" ]
[ "0.65479475", "0.6377597", "0.62411183", "0.6048483", "0.6036802", "0.6023666", "0.6006261", "0.57970154", "0.5762466", "0.5743073", "0.57256174", "0.570475", "0.56551737", "0.5650669", "0.56371844", "0.5574069", "0.5561849", "0.55351794", "0.55299133", "0.5515849", "0.55044943", "0.5490805", "0.54581857", "0.54486215", "0.54386085", "0.5435885", "0.5432982", "0.54132557", "0.5387326", "0.53776497", "0.5372029", "0.53617626", "0.5341537", "0.53368235", "0.5327845", "0.52737004", "0.52725714", "0.52375656", "0.52369887", "0.5234797", "0.52251667", "0.5222938", "0.52159667", "0.52108705", "0.52071476", "0.52055454", "0.52016395", "0.5190731", "0.5182866", "0.51797426", "0.5170829", "0.516883", "0.51600647", "0.51595837", "0.51561135", "0.51449084", "0.5143265", "0.5140509", "0.51302767", "0.511477", "0.5108057", "0.5099579", "0.50971615", "0.5090312", "0.50902367", "0.5086664", "0.5086446", "0.5082608", "0.5073958", "0.506733", "0.5061274", "0.5056853", "0.5042893", "0.5038622", "0.50302017", "0.50231606", "0.50152266", "0.5002264", "0.5000038", "0.49927175", "0.49838352", "0.49820912", "0.49795285", "0.49778828", "0.49704263", "0.49684379", "0.49631807", "0.49601007", "0.4957977", "0.49548203", "0.49543145", "0.49533954", "0.49477574", "0.49468616", "0.49364585", "0.49313256", "0.49233326", "0.49231455", "0.4920112", "0.49159512" ]
0.55928415
15
Get candidates that have this label
public function users() { return $this->belongsToMany('App/User', 'users_labels'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCandidates()\n {\n foreach ($this->cand_ids as $id) {\n // Use a generator to save on memory/resources\n // load accounts from DB one at a time only when required\n yield (new CandidateModel())->load($id);\n }\n }", "public function getCandidates()\n {\n foreach ($this->candidates as $id) {\n $this->numOfCandidates++;\n // Use a generator to save on memory/resources\n // load accounts from DB one at a time only when required\n yield (new CandidateModel())->load($id);\n }\n }", "public function contains($label);", "public function getGroupCandidates(){\n\t\t$groups = GroupQuery::create()\n\t\t\t\t\t \t\t\t->select(\"Id\")\n\t\t\t\t\t\t\t\t->filterByUser($this)\n\t\t\t\t\t\t\t\t->find(); \n\n\t\t$candidates = GroupQuery::create()\n\t\t\t\t\t\t\t\t\t\t\t->filterById($groups, Criteria::NOT_IN)\n\t\t\t\t\t\t\t\t\t\t\t->find();\n\t\treturn $candidates;\n\t}", "public function getLabels();", "public function getLabels();", "public function getLabels();", "public function getCandidatesNamesForUsers()\n {\n $db = Zend_Db_Table::getDefaultAdapter();\n $query = \"select c.id,c.candidate_name,c.emailid from main_candidatedetails c \n where c.isactive = 1 and c.cand_status = 'Selected' and c.backgroundchk_status in ('Yet to start','Completed') and c.id not in (select rccandidatename from main_users \n where isactive = 1 and rccandidatename is not null)\";\n $result = $db->query($query);\n $data = array();\n while($row = $result->fetch())\n {\n \n $data[$row['id']] = $row['candidate_name'];\n \n }\n return $data;\n }", "public function getLabels ()\n {\n $origin = $this->getOriginCompanies();\n\n $labels = $this->tabla . \"_etiqueta\";\n $sql = \"SELECT uid_etiqueta FROM {$labels} WHERE uid_empresa IN ({$origin->toComaList()})\";\n $array = $this->db->query($sql, \"*\", 0, \"etiqueta\");\n\n if ($array && count($array)) {\n return new ArrayObjectList($array);\n }\n\n return new ArrayObjectList;\n }", "public function listAll() {\n\t\t$data = parent::listAll();\n\t\t$listing = [];\n\t\tforeach ($data as $value) {\n\t\t\t$candidate = new Candidate();\n\t\t\t$candidate->id = $value['id'];\n\t\t\t$candidate->name = $value['name'];\n\t\t\t$candidate->testScore = $value['test_score'];\n\t\t\t$candidate->experienceScore = $value['experience_score'];\n\t\t\t$candidate->interviewScore = $value['interview_score'];\n\t\t\t$listing[] = $candidate;\n\t\t}\n\t\t\n return $listing;\n }", "public static function getCandidates($type);", "private function getSuggestions()\n {\n $category = $this->nodeStorage->load($this->categoryId);\n $secondaryTagIds = $this->getTagIds($category->field_moj_secondary_tags);\n $matchingIds = array_unique($this->getSecondaryTagItemsFor($secondaryTagIds));\n\n if (count($matchingIds) < $this->numberOfResults) {\n $matchingSecondaryTagIds = $this->getAllSecondaryTagItemsFor($secondaryTagIds);\n $matchingIds = array_unique(array_merge($matchingIds, $matchingSecondaryTagIds));\n }\n\n if (count($matchingIds) < $this->numberOfResults) {\n $primaryTagIds = $this->getTagIds($category->field_moj_top_level_categories);\n $matchingPrimaryTagIds = $this->getPrimaryTagItemsFor($primaryTagIds);\n $matchingIds = array_unique(array_merge($matchingIds, $matchingPrimaryTagIds));\n }\n\n $categoryIdIndex = array_search($this->categoryId, $matchingIds);\n\n if ($categoryIdIndex !== false) {\n unset($matchingIds[$categoryIdIndex]);\n }\n\n return $this->loadNodesDetails(array_slice($matchingIds, 0, $this->numberOfResults));\n }", "function intersection($searcher = array(), $candidate = array()){\r\n\t\t$set = array();\r\n\t\tforeach($searcher[\"MemberProfile\"] as $key_searchee=>$temp1){\r\n\t\t\tif ($key_searchee==\"member_id\"){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach($candidate[\"MemberProfile\"] as $key_candidate=>$temp2){\r\n\t\t\t\tif ($key_candidate==$key_searchee){\r\n\t\t\t\t\tif ($temp1[$key_searchee]==$temp2[$key_candidate]){\r\n\t\t\t\t\t\t$set[] = array($key_searchee=>$temp1);\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\t\t\t\r\n\t\t\t}\t\t\r\n\t\t}\r\n\t\treturn $set;\r\n\t}", "public function getLabelsList(){\n return $this->_get(2);\n }", "public function getLabels()\n {\n if (is_null($this->labels)) {\n $this->labels = collect();\n $testlabel_models = TestLabel::where([\n ['buildid', '=', $this->buildid],\n ['outputid', '=', $this->outputid],\n ])->get();\n foreach ($testlabel_models as $testlabel_model) {\n $label = new Label();\n $label->Id = $testlabel_model->labelid;\n $text = $label->GetText();\n $this->labels->put($text, $label);\n }\n }\n return $this->labels;\n }", "public function getLabelsList(){\n return $this->_get(6);\n }", "public function hasLabels(){\n return $this->_has(2);\n }", "public static function getLabels(): array;", "public function getLabels() {\n\t\tif ($this->labels === null) {\n\t\t\t$this->labels = new LabelList();\n\t\t\t$this->labels->getConditionBuilder()->add(\"label.objectTypeID IN (?)\", array(array_keys($this->cache['objectTypes'])));\n\t\t\t$this->labels->sqlLimit = 0;\n\t\t\t$this->labels->readObjects();\n\t\t}\n\t\t\n\t\treturn $this->labels;\n\t}", "protected function matched(): array\n {\n $s = mb_strtolower($this->searchKey);\n $foundRecords = [];\n foreach ($this->source->getRecords() as $index => $word) {\n $found = mb_strpos($s, mb_strtolower($word));\n if (false !== $found) {\n $foundRecords[$index] = intval($found);\n }\n }\n return $foundRecords;\n }", "public function getMatchTargetLabels()\n {\n return $this->match_target_labels;\n }", "public function getLabels()\n {\n return array_values(array_unique($this->labels));\n }", "public function suggest() {\n \n $query = ['query' => ['match_all' => []]];\n if (Request::has('q')) {\n $query = [\n 'query' => [\n 'nested' => [\n 'path' => 'prefLabels',\n 'query' => [\n 'bool' => [\n 'must' => [\n [ 'prefix' => [ 'prefLabels.label' => Request::get('q') ] ],\n [ 'match' => [ 'prefLabels.lang' => 'en' ] ]\n ]\n ]\n ]\n ]\n ]\n ];\n }\n \n $hits = Subject::suggest($query, 'resource');\n return response()\n ->json($hits)\n ->header(\"Vary\", \"Accept\");\n }", "public function labels()\n {\n return array();\n }", "public function getLabels() {\r\n return $this->labels;\r\n }", "public function getSelectedCandidatesDetails()\n {\n \t$db = Zend_Db_Table::getDefaultAdapter();\n \t$query = \"select c.id,c.candidate_name,c.emailid from main_candidatedetails c\n where c.isactive = 1 and c.cand_status = 'Selected' and c.backgroundchk_status in ('Yet to start','Completed') and c.id not in (select rccandidatename from main_users\n where isactive = 1 and rccandidatename is not null)\";\n \t \n \t$result = $db->query($query);\n \t$candidateData= $result->fetchAll();\n \treturn $candidateData;\n \t \n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return $this->labels;\n }", "public function show_qualified_candidate(){\r\n\t\tif(function_exists('date_default_timezone_set')) {\r\n\t\t\tdate_default_timezone_set(\"Asia/Kolkata\");\r\n\t\t}\r\n\t\t$date = date(\"Y-m-d\");\r\n\t\t$query = $this->conn->query(\"select candidate.cnum, candidate.name, candidate.department, candidate.profile, candidate.register_time from candidate\r\n\t\tinner join interview\r\n\t\ton (candidate.cnum=interview.cnum and interview.recomendation = 'proceed' and candidate.register_date = '$date')\");\r\n\t\t\r\n\t\twhile($row = $query->fetch_array(MYSQLI_ASSOC)){\r\n\t\t\t$this->candidate[] = $row;\r\n\t\t\t\r\n\t\t}\r\n\t\treturn $this->candidate;\r\n\t\t\r\n\t}", "public function findByLabels(array $labels);", "public function getTagsForCheckboxes() {\n $tags = $this->orderBy('name','ASC')->get();\n $tagsForCheckboxes = [];\n foreach($tags as $tag) {\n $tagsForCheckboxes[$tag['id']] = $tag;\n }\n return $tagsForCheckboxes;\n }", "public function attributeLabels()\n\t{\n\t\t$labels = array();\n\t\tforeach($this->searchFields as $field=>$data)\n\t\t\t$labels[$field] = isset($data['label']) ? $data['label'] : parent::generateAttributeLabel($field);\n\t\treturn $labels;\n\t}", "public function forConstituency(Constituency $constituency)\n\t{\n\t\t$repository = $this->getRepository('ConstituencyCandidacy');\n\t\t/** @var ConstituencyCandidacy[] $candidacies */\n\t\t$candidacies = $repository->findBy(array('constituency' => $constituency));\n\n\t\t$candidates = array();\n\t\tforeach ($candidacies as $candidacy) {\n\t\t\t$candidates[] = $candidacy->getCandidate();\n\t\t}\n\n\t\treturn $candidates;\n\t}", "public function getLabels(): array\n {\n return $this->labels;\n }", "public function getLabels()\n {\n return isset($this->labels) ? $this->labels : null;\n }", "public function labels()\n {\n return $this->morphToMany(\\VentureDrake\\LaravelCrm\\Models\\Label::class, config('laravel-crm.db_table_prefix').'labelable');\n }", "public function byLabel($name);", "public function getLabelFilters()\n {\n return $this->label_filters;\n }", "public function searchCandidates(){\n\t\t$vacancy=$_POST['vacancy'];\n\n\t\t$this->load->model('SAR/CandidatesModel');\n\t\t$data['array']=$this->CandidatesModel->getAll($vacancy);\n\t\t$data['position']=$vacancy;\n\t\t$this->load->view('includes/header');\n\t\t$this->load->view('users/SAR/viewcategorized',$data);\n\t\t$this->load->view('includes/footer');\n\n\t}", "public function hasLabels(){\n return $this->_has(6);\n }", "protected function getImageCandidates()\n\t{\n\t\t$result = array();\n\t\tforeach ($this->imgElements as $imgElement)\n\t\t{\n\t\t\t$imageDimensions = $this->getImageDimensions($imgElement);\n\t\t\tif($imageDimensions['width'] >= self::MIN_IMAGE_WIDTH && $imageDimensions['height'] >= self::MIN_IMAGE_HEIGHT)\n\t\t\t{\n\t\t\t\t$result[] = $imgElement['src'];\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "protected static function labelLookup($label, $type, array $bundles = array()) {\n $ids = array();\n\n $entity_info = entity_get_info($type);\n if (!empty($entity_info['entity keys']['label'])) {\n $label_property = $entity_info['entity keys']['label'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', $type);\n if (!empty($bundles)) {\n $query->entityCondition('bundle', $bundles, 'IN');\n }\n $query->propertyCondition($label_property, $label, '=');\n\n $results = $query->execute();\n\n if (isset($results[$type])) {\n $ids = array_keys($results[$type]);\n }\n }\n\n return $ids;\n }", "function getLabel($data, $neighbors)\n{\n $results = array();\n $neighbors = array_keys($neighbors);\n print_r($neighbors);\n foreach ($neighbors as $neighbor) {\n $results[] = $data[$neighbor][2];\n }\n $values = array_count_values($results);\n $values = array_flip($values);\n ksort($values);\n return array_pop($values);\n}", "public function getCustomLabels() {\r\n return $this->labels->getItems();\r\n }", "public function getAll()\n {\n return $this->candidateRepository->getAll();\n }", "public function getSearchableForCurrentProvider(): array;", "public function get_search()\n\t\t{\n\t\t\t$retArr = null;\n\t\t\tforeach($this->obj as $obj)\n\t\t\t{\n\t\t\t\t$retArr[] = $obj->getBasics($this->response_profile);\n\t\t\t}\n\t\t\treturn $retArr;\n\t\t}", "public function getPluginLabels() {}", "protected function activityPartners()\n {\n $activityPartners = [];\n\n foreach ($this->partners as $partner) {\n if (array_has(array_flip($partner->used_by), $this->activityId)) {\n $activityPartners[] = $partner;\n }\n }\n\n return $activityPartners;\n }", "public function getAllPossibleRefits()\n {\n // Get the SEs filtered by Permissible Refits, or same SB and are Incomplete\n $sb_list = SkeletalBone::where('refit' ,'=' , true)->orWhere('id', $this->sb_id)->pluck('id')->toArray();\n return SkeletalElement::whereIn('sb_id', $sb_list)->where('completeness', '=', 'Incomplete')->get();\n }", "function discoverCandidateClasses($recursive = FALSE);", "public function getObjects() : array\n {\n $net = SsdDnn::readNetFromTensorflow();\n\n $net->setInput(SsdDnn::blobFromImage($this->image), '');\n\n $detected = [];\n $detections = $net->forward();\n $categories = SsdDnn::getCategories();\n\n for ($i = 0; $i < $detections->shape[2]; $i++) {\n $classId = $detections->atIdx([0, 0, $i, 1]);\n $confidence = intval($detections->atIdx([0, 0, $i, 2]) * 100);\n\n if ($classId && $confidence > $this->threshold) {\n $detected[] = $categories[$classId];\n }\n }\n\n return $detected;\n }", "abstract function labels();", "public function getSearchArray();", "public function getChoices();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getLabel();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function getTags();", "public function get_label();", "public function get_label();", "private function getProjectCandidates($contract) {\n $candidates = array();\n $team = TeamCache::getInstance()->getTeam($contract->getTeamid());\n\n $projList = $team->getProjects();\n $currentProjects = $contract->getProjects();\n\n foreach ($projList as $projectid => $name) {\n if (($team->isSideTasksProject($projectid)) &&\n (!array_key_exists($projectid, $currentProjects))) {\n $candidates[$projectid] = $name;\n }\n }\n return $candidates;\n }", "private function findRecommendation(){\n $placeModel = new Place();\n $places = $placeModel->getAllCategorized();\n $bestScore = PHP_INT_MAX;\n $idBest = 0;\n\n foreach($places as $place){\n $currScore = 0;\n $currScore += abs($place->heritage - $this->score['heritage'] );\n $currScore += abs($place->relax - $this->score['relax'] );\n $currScore += abs($place->sightseeing - $this->score['sightseeing']);\n $currScore += abs($place->weather - $this->score['weather']) ;\n $currScore += abs($place->populated - $this->score['populated'] );\n\n if($currScore < $bestScore){\n $bestScore = $currScore;\n $idBest = $place->id_plc;\n }\n\n }\n\n return $idBest;\n }", "public function buildPkeyCriteria()\n {\n $criteria = new Criteria(FeatureCvtermPeer::DATABASE_NAME);\n $criteria->add(FeatureCvtermPeer::FEATURE_CVTERM_ID, $this->feature_cvterm_id);\n\n return $criteria;\n }", "public function search($val): AnonymousResourceCollection\n {\n $election = Election::where('election_name', 'like', '%'.$val.'%')->paginate(4);\n\n return ElectionResource::collection($election);\n }", "public function labels(): array\n {\n return [];\n }", "public function getLabels()\n {\n $headers = $this->getDefaultHeaders();\n $response = $this->client->request(\n 'GET',\n $this->api . $this->repo . \"/labels\",\n array(\n \"headers\" => $headers\n )\n );\n \n if ($response->getStatusCode() == 200) {\n $body = $response->getBody();\n $body = json_decode($body, true);\n return $body;\n }\n\n return array();\n }", "public function candidates()\n {\n return $this->belongsTo('App\\Models\\Candidates','id');\n }", "public function getLabelResult()\n {\n return $this->readOneof(41);\n }", "public function actionFindcandidate($id)\n {\n \t$jobposModel = $this->findModel($id);\n \t$skillsModelList = $jobposModel->getSkills();\n \t$skills = array();\n \tforeach ($skillsModelList as $sk)\n \t{\n \t\t$skills[] = $sk->skill;\n \t}\n \t$title = $jobposModel->title;\n \t$title = $this->properSearchTitle($title);\n \t \n \t$titleKeyList = explode(' ', $title);\n \t\n \t$usersModels = CandidateskillBase::find()->where(['in', 'skill', $skills])->all();\n \t\n \t$users = [];\n \t\n \tforeach($usersModels as $user)\n \t{\n \t\t$users[$user->candidateid] = $user->candidateid;\n \t}\n\n \t$usersModels = CandidatejobapplyBase::find()->where(['jobposid' => $id])->all();\n \t\n \tforeach($usersModels as $user)\n \t{\n \t\t$users[$user->userid] = $user->userid;\n \t}\n\n \t/*$usersModels = CandidateBase::find()->where(['jobposid' => $id])->all();\n \t\n \tforeach($usersModels as $user)\n \t{\n \t\t$users[$user->userid] = $user->userid;\n \t}*/\n \t$searchModel = new CandidateSearchBase();\n \t$dataProvider = $searchModel->searchList($users);\n \t\n \treturn $this->render('findcandidate', [\n \t\t\t'jobposModel' => $jobposModel,\n \t\t\t'dataProvider' => $dataProvider,\n \t]);\n \t \n \t \n \t//print_r($dataProvider);\n \t//exit;\n\n \t\n }", "public function neighbors()\n {\n $parent = $this->parent;\n $exclude = $this->term_id;\n\n $query = static::where('term_id', '!=', $exclude);\n\n return $parent ? $query->where('parent', $parent) : $query->whereNull('parent');\n }" ]
[ "0.578034", "0.5647531", "0.5560754", "0.54641813", "0.5454056", "0.5454056", "0.5454056", "0.5453678", "0.5319106", "0.53170294", "0.52748007", "0.5224645", "0.51084334", "0.50491625", "0.50306606", "0.5023338", "0.49820012", "0.49566698", "0.4931831", "0.4877894", "0.48449826", "0.48150557", "0.48107263", "0.47934052", "0.47883695", "0.478476", "0.47715247", "0.47715247", "0.47715247", "0.47715247", "0.47715247", "0.47715247", "0.47715247", "0.47715247", "0.47715247", "0.47715247", "0.47715247", "0.47715247", "0.47715247", "0.47715247", "0.47715247", "0.47715247", "0.46936217", "0.46873015", "0.46862894", "0.4681611", "0.46479392", "0.46466944", "0.46394894", "0.46370158", "0.46331477", "0.46151257", "0.45909986", "0.45904702", "0.45881087", "0.4560142", "0.45544705", "0.45263562", "0.45152834", "0.4483937", "0.44623867", "0.44566453", "0.44456792", "0.4435256", "0.44031388", "0.44020587", "0.4400888", "0.43984225", "0.4393383", "0.43895936", "0.43895936", "0.43895936", "0.43895936", "0.43895936", "0.43895936", "0.43895936", "0.43895936", "0.43895936", "0.43895936", "0.43895936", "0.43895936", "0.43895936", "0.43895936", "0.43895936", "0.43831933", "0.43831933", "0.43831933", "0.43831933", "0.43831933", "0.43809593", "0.43809593", "0.4373486", "0.4360454", "0.43540034", "0.4351277", "0.43482396", "0.43428582", "0.43393773", "0.43298048", "0.43251178", "0.43245304" ]
0.0
-1
Get jobs that have this label
public function jobs() { return $this->belongsToMany('App/Job', 'jobs_labels'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_job_list() {\n return $this->find_all_jobs();\n }", "public function getJobs();", "public function getJobs();", "public function getJobNames();", "public function getJobs()\n {\n return $this->jobs;\n }", "public function getJobs()\n {\n return $this->jobs;\n }", "function get_title_runjobs() {\n return $this->get_title_listinstancejobs();\n }", "public static function getJobs() {\n\t\treturn self::$jobs;\n\t}", "public function getInProgressJobs() {\r\n $qry = $this->db->select('*')\r\n ->from('jobs')\r\n ->join('urls', 'urls.job_uuid=jobs.uuid')\r\n ->where('urls.is_following', 0)\r\n ->where('jobs.status', 0)\r\n ->get();\r\n\r\n if ($qry->num_rows() > 0)\r\n return $qry->result_array();\r\n return false;\r\n }", "public function getRunningJobs(){\n\t\t$jobs=Array();\n\t\t$command = QSTAT.\" -u $this->username | awk '$1 ~ /[0-9]+/ {print $1\\\"\\t\\\"$5\\\"\\t\\\"$6 $7}'\";\n\t\texec($command,$queueJobs);\n\n\t\tif (!isset($queueJobs[0])){\n log_addInfo($jobid,\"Job not running anymore\");\n\t\t\treturn $jobs;\n }else{\n\t\t\tforeach ($queueJobs as $jobLine){\n\t\t\t\tlist($pid,$state,$start)=explode(\"\\t\",$jobLine);\n\t\t\t\t$cmd = QSTAT. \" -j $pid | grep job_name | cut -d: -f2 | tr -d \\\" \\\"\";\n\t\t\t\texec($cmd,$jobName);\n\t\t\t\t$jobs[$pid]=Array(\n\t\t\t\t\t'name' => $jobName[0],\n\t\t\t\t\t'start' => $start,\n\t\t\t\t\t'state' => $this->jobState[$state]\n\t\t \t\t);\n\t\t\t}\n\t\t}\n\t}", "public function relevantJobs() {\n require_once 'libs/DB.php';\n\n $seekerId = $this->id();\n $seekerLocation = $this->preferredLocation();\n\n $query = \"SELECT J.*, JS.job_id, COUNT(JS.job_id) AS rank\n FROM job_skill JS, job J\n WHERE J.id=JS.job_id\n AND J.location_name='$seekerLocation'\n AND JS.skill_name IN (SELECT skill_name FROM seeker_skill WHERE seeker_id='$seekerId')\n GROUP BY JS.job_id\n ORDER BY rank DESC\";\n\n $conn = DB::connect();\n\n $res = $conn->query($query);\n\n $jobs = Array();\n\n while($row = $res->fetch(PDO::FETCH_ASSOC)) {\n array_push($jobs, $row);\n }\n\n $query = \"SELECT J.*, JS.job_id, COUNT(JS.job_id) AS rank\n FROM job_skill JS, job J\n WHERE J.id=JS.job_id\n AND JS.skill_name IN (SELECT skill_name FROM seeker_skill WHERE seeker_id='$seekerId')\n GROUP BY JS.job_id\n ORDER BY rank DESC\";\n\n $res = $conn->query($query);\n\n while($row = $res->fetch(PDO::FETCH_ASSOC)) {\n array_push($jobs, $row);\n }\n\n $jobs = array_map(\"unserialize\", array_unique(array_map(\"serialize\", $jobs)));\n\n return $jobs;\n }", "public function jobIdList()\n {\n return Job::all();\n }", "public function hasJob($name);", "public function getJobsByName($name)\n {\n return $this->findBy(['name' => $name]);\n }", "public function getInactive()\n {\n $jobs = array();\n \n $inactive = $this->_em->getRepository($this->_entityClass)->findByActive(0);\n foreach ($inactive as $record) {\n $job = new $this->_jobClass(call_user_func($this->_adapterClass . '::factory', $this->_options, $record, $this->_em, $this->_logger));\n array_push($jobs, $job);\n }\n \n return $jobs;\n \n }", "function get_title_copyjobs() {\n return $this->get_title_listinstancejobs();\n }", "public function getJobs($filter = false)\n {\n $jobs = array();\n\n $CSO = $this->getResource('CSO');\n foreach($CSO->getJobs($filter) as $job)\n {\n array_push($jobs, $job);\n }\n\n $OpenOnderwijs = $this->getResource('OpenOnderwijs');\n foreach($OpenOnderwijs->getJobs($filter) as $job)\n {\n array_push($jobs, $job);\n }\n\n return $this->output($jobs);\n }", "public function getActive()\n {\n $jobs = array();\n \n $active = $this->_em->getRepository($this->_entityClass)->findByActive(1);\n foreach ($active as $record) {\n $job = new $this->_jobClass(call_user_func($this->_adapterClass . '::factory', $this->_options, $record, $this->_em, $this->_logger));\n array_push($jobs, $job);\n }\n \n return $jobs;\n }", "function get_title_deletejobs() {\n return $this->get_title_listinstancejobs();\n }", "public function getJob()\n\t{\n\t\treturn $this->compose('Job', 'Jobs');\n\t}", "public function getJobsInfo(){ return $this->APICallSub( '/jobs', '', \"Couldn't lookup the job list\" ); }", "private function find_all_jobs() {\n $jobs = array();\n foreach( glob( $this->crony_job_root . '/*.php') as $job_file ) {\n $job_class = basename( $job_file, '.php' );\n\n // Before we include this job in the job list, we need to make sure it implements \\Crony\\TaskInterface\n $implementations = class_implements( $this->crony_job_namespace . '\\\\' . $job_class );\n if ( in_array( 'Crony\\TaskInterface', $implementations ) ) {\n array_push( $jobs, $job_class );\n }\n }\n\n return $jobs;\n }", "public static function getJobs() {\n\t\tstatic $jobslist = null; # cache\n\t\tif( is_null($jobslist) ) {\n\t\t\t$jobslist = self::getSubDirs(JENKINS_JOBS);\n\t\t}\n\t\treturn $jobslist;\n\t}", "public function job()\n\t{\n\t\t$job = Resque::redis()->get('worker:' . $this);\n\t\tif (!$job) {\n\t\t\treturn array();\n\t\t} else {\n\t\t\treturn json_decode($job, true);\n\t\t}\n\t}", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getJob()\n {\n return $this->get(self::_JOB);\n }", "public function getJobsByCategory() {\n return $this->hasMany('App\\jobs', 'category_id', 'id');\n }", "public function getJobs()\n {\n $this->refreshConfig();\n return $this->get();\n }", "public function contains($label);", "public function getJobsToProcess()\n {\n return $this->jobs_process;\n }", "static function getByStatusLabel($label)\n {\n return self::findOne(['label' => $label]);\n }", "public function getScheduled()\n {\n $jobs = array();\n \n $scheduled = $this\n ->_em\n ->getRepository($this->_entityClass)\n ->createQueryBuilder('s')\n ->andWhere('s.schedule is not NULL')\n ->andWhere('s.active = :active')\n ->setParameters(array('active' => 0))\n ->getQuery()\n ->getResult(); \n \n foreach ($scheduled as $record) {\n $job = new $this->_jobClass(call_user_func($this->_adapterClass . '::factory', $this->_options, $record, $this->_em, $this->_logger));\n array_push($jobs, $job);\n }\n return $jobs;\n \n }", "public function getJobSearchWidget(Request $request)\n {\n return $this->jobRepo->getJobSearchWidget($request);\n }", "public function get_tag_job($param){\n $tag_relation = $this->_get_relation_list($param);\n\n\n $result = array();\n if($tag_relation && ! empty($tag_relation)){\n foreach( (array) $tag_relation as $item ){\n $tag_id = $item['tag_id'];\n $result[] = $this->get_single_detail($tag_id);\n }\n return $result;\n }\n\n return false;\n }", "private function getJobTitleList() {\n $jobTitleList = $this->getJobTitleService()->getJobTitleList();\n $list = array(\"\" => __('All'));\n foreach ($jobTitleList as $jobTitle) {\n $list[$jobTitle->getId()] = $jobTitle->getJobTitleName();\n }\n return $list;\n }", "public function jobs() {\n return Job::where('company_uid',$this->uid)->get();\n }", "public function getJobs($jobUuid = null) {\r\n $this->db->select('uuid, url_address, job_created_date,'\r\n . \"CASE jobs.status WHEN 0 THEN 'in_progress'\r\n ELSE 'completed' END as job_status\")\r\n ->from('jobs')\r\n ->join('urls', 'urls.job_uuid=jobs.uuid')\r\n ->where('urls.is_following', 0);\r\n\r\n if ($jobUuid != NULL) {\r\n $this->db->where('jobs.uuid', $jobUuid);\r\n }\r\n $qry = $this->db->get();\r\n if ($qry->num_rows() > 0)\r\n return $qry->result_array();\r\n return false;\r\n }", "public static function get_jobs()\n\t{\n\t\t$output = shell_exec('crontab -l');\n\t\treturn self::string_to_array($output);\n\t}", "public function getAllJobs()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobHistoryDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getAllJobs($userID);\n }", "public function job_app_list()\n\t{\n\t\treturn $this->EE->job_applications->job_app_list();\n\t}", "public function getSetJob()\n {\n return $this->get(self::_SET_JOB);\n }", "public static function get_jobs($args) {\n require_once 'Careerjet_API.php';\n $args = self::format_args(wp_parse_args($args, self::get_default_args()));\n \n $api = new Careerjet_API('en_GB') ;\n \n $transient_name = 'careerjet_' . md5(json_encode($args));\n \n if (false === ( $results = get_transient($transient_name) )) {\n $results = array();\n $result = $api->search($args);\n \n if ($result->type == 'JOBS') {\n $num_jobs = $result->hits;\n $total_pages = $result->pages;\n $results = $result->jobs;\n\n if (!empty($results)) {\n set_transient($transient_name, $results, 1800);\n }\n }\n }\n\n return $results;\n }", "public static function getJobs($aCid = 0) {\n $lCid = intval($aCid);\n $lSql = 'SELECT DISTINCT `jobid` FROM `al_cms_ref_job` WHERE `content_id`='.esc($lCid);\n $lJobs = CCor_Qry::getArr($lSql);\n \n return ($lJobs == FALSE) ? array() : $lJobs;\n }", "public function getJobDescriptions(){\n return JobDescription::all();\n }", "public function jobsRunning()\n {\n $this->validateManagerType('dtc_queue.manager.job');\n $this->checkDtcGridBundle();\n $managerType = $this->container->getParameter('dtc_queue.manager.job');\n $rendererFactory = $this->container->get('dtc_grid.renderer.factory');\n $renderer = $rendererFactory->create('datatables');\n $gridSource = $this->container->get('dtc_queue.grid_source.jobs_running.'.('mongodb' === $managerType ? 'odm' : $managerType));\n $renderer->bind($gridSource);\n $params = $renderer->getParams();\n $this->addCssJs($params);\n\n $params['worker_methods'] = $this->container->get('dtc_queue.manager.job')->getWorkersAndMethods(BaseJob::STATUS_RUNNING);\n $params['prompt_message'] = 'This will prune all stalled jobs';\n\n return $this->render('@DtcQueue/Queue/jobs_running.html.twig', $params);\n }", "public function getJobs()\n {\n return $this->hasMany(Job::class, ['id' => 'job_id'])\n ->via('jobsByCategory');\n }", "public function jobs($tag)\n {\n return (array) $this->connection()->zrange($tag, 0, -1);\n }", "public function getJob()\n {\n return $this->job;\n }", "public function getJob()\n {\n return $this->job;\n }", "public function getJobs(){\r\n\t\t//make life easy\r\n\t\t$rank = $_SESSION['rank'];\r\n\t\t// Query\r\n\t\t$query = \"SELECT jobID, userID, category, title, price, description, timeStamp FROM jobs WHERE rank='$rank'\";\r\n\t\t$data = $this -> multiSelectQuery($query);\r\n\t\treturn $data;\r\n\t}", "public function jobs()\n {\n return $this->onQueue();\n }", "public function jobs()\n {\n return $this->hasMany('App\\Entities\\Projects\\Job', 'worker_id');\n }", "public function getLabels() {\n\t\tif ($this->labels === null) {\n\t\t\t$this->labels = new LabelList();\n\t\t\t$this->labels->getConditionBuilder()->add(\"label.objectTypeID IN (?)\", array(array_keys($this->cache['objectTypes'])));\n\t\t\t$this->labels->sqlLimit = 0;\n\t\t\t$this->labels->readObjects();\n\t\t}\n\t\t\n\t\treturn $this->labels;\n\t}", "public function dueJobs()\n {\n $currentTime = new DateTime('now', $this->timezone);\n return array_filter($this->jobs, static function (AbstractJob $job) use ($currentTime) {\n return $job->isDue($currentTime);\n });\n }", "public function hasJob(): bool;", "public function getCurrentJob()\n {\n // last of active jobs\n $em = $this->doctrine->getManager();\n $q = $this->doctrine->getManager()->createQueryBuilder()\n ->select('job')\n ->from('OpenviewExportBundle:DataExportJob', 'job')\n ->where('(job.active=true)')\n ->orderBy('job.createdAt', 'DESC')\n ->setFirstResult(0)\n ->setMaxResults(1)\n ->getQuery();\n $jobs = $q->getResult();\n \n if ($jobs) {\n return $jobs[0];\n } else {\n return null;\n }\n }", "public function jobs()\n {\n return $this->morphedByMany('App\\Job', 'taggable');\n }", "public function getLabels();", "public function getLabels();", "public function getLabels();", "public function getSqsJob()\n {\n return $this->job;\n }", "public function getJob()\n {\n return $this->hasOne(Jobs::className(), ['job_id' => 'job_id']);\n }", "public function listJobschedule()\n {\n $batch_date = $this->getDate();\n\n $data = sprintf(\"GET\\n\\n\\n\\n\\n\\n%s\\n\\n\\n\\n\\n\\n/%s/jobschedules\\napi-version:%s\\ntimeout:20\",\n $batch_date,\n $this->batch_account,\n $this->api_version\n );\n\n $signature = $this->signatureString($data);\n\n $response = Curl::to(sprintf(\"%s/jobschedules?api-version=%s&timeout=20\", $this->batch_url, $this->api_version))\n ->withHeader(sprintf(\"Authorization: SharedKey %s:%s\", $this->batch_account, $signature))\n ->withHeader('Date: ' . $batch_date)\n ->returnResponseObject()\n ->get();\n\n if ($response->status == 200) {\n\n $contents = json_decode($response->content);\n $jobs = $contents->value;\n\n return $jobs;\n\n } else {\n return [];\n }\n }", "public function list_job_apps()\n\t{\n\t\treturn $this->EE->job_applications->list_job_apps();\n\t}", "public function getQueuedJobs($limit = null) {\n //Create a querybuilder\n $qb = $this->createQueryBuilder('job');\n\n //Join on the job status table to get jobs with a status of queued\n $qb\n ->select('job')\n ->join('job.currentStatus', 'jobStatus')\n ->join('jobStatus.status', 'status')\n ->where('status.shortName = :queueStatus')\n ->setParameter('queueStatus', 'In Queue')\n ;\n\n if (null !== $limit) {\n $qb->setMaxResults($limit);\n }\n\n //Return the jobs\n return $qb->getQuery()->getResult();\n }", "public function getJobsString();", "public function getJobsWithStatus($status)\n {\n if (!\\in_array($status, $this->statuses, true)) {\n throw new InvalidArgumentException(sprintf('Expected status to be one of %s', implode(',', $this->statuses)));\n }\n\n return $this->request('/translation/', array('status' => $status));\n }", "public function loadAllJobs()\n {\n // foreach ($jobs as $key => $job) {\n // $job_due_date = Carbon::parse($job->due_date);\n // $current_date = Carbon::now()->subDay();\n // if ($current_date->gt($job_due_date)) {\n // $job->isJobExpired = true;\n // } else {\n // $job->isJobExpired = false;\n // }\n // }\n\n // return $jobs;\n $jobs = [];\n $unassignedTasks = Task::where(['isAssigned' => 0, ['Time02', '!=', 0]])->orderBy('id', 'DESC')->groupBy('job_id')->get();\n foreach ($unassignedTasks as $key => $task) {\n $job = Job::find($task->job_id);\n $job_due_date = Carbon::parse($job->due_date);\n $current_date = Carbon::now()->subDay();\n if ($current_date->gt($job_due_date)) {\n $job->isJobExpired = true;\n } else {\n $job->isJobExpired = false;\n }\n array_push($jobs, $job);\n }\n\n return $jobs;\n }", "function search_jobs($name='', $thinktank_id='', $role='', $current_job=false, $exclude_report_authors=false) {\n $sql = \"SELECT * FROM people INNER JOIN people_thinktank ON people.person_id=people_thinktank.person_id\"; \n\n $where_clause_array=array();\n\n if(!empty($name)) {\n $name = mysql_real_escape_string($name); \n $where_clause_array[] = \" name_primary = '$name' \";\n }\n\n if(!empty($thinktank_id)) {\n $where_clause_array[] = \" thinktank_id = '$thinktank_id' \";\n }\n\n if(!empty($role)) {\n $name = mysql_real_escape_string($role); \n $where_clause_array[] = \" role = '$role' \";\n } \n \n if($exclude_report_authors) { \n $where_clause_array[] = \" role != 'report_author_only' \";\n } \n\n if ($current_job) { \n $where_clause_array[] = \" end_date=0\";\n }\n\n if (count($where_clause_array) > 0) { \n $sql .= \" WHERE \" . implode('&&', $where_clause_array); \n }\n\n $result = $this->fetch($sql);\n return($result);\n }", "public static function GET_MAIL_JOBS(){\n\t $SQL_String = \"SELECT * FROM system_mailer WHERE _status_code=0 AND _keep=1 AND _mail_date=:mail_date;\";\n\t return $SQL_String;\n\t}", "public function getJobsByCategory()\n {\n return $this->hasMany(JobsByCategory::class, ['category_id' => 'id']);\n }", "Public Function GetJobstatus($jobId)\n {\n \t$this->jobId = $jobId;\n \t$this->status = 'Not in bevomedia_queue';\n \t\n \t\t$DatabaseObj = Zend_Registry::get('Instance/DatabaseObj');\n\t\t\t\n \t//Lets get all entries that have envelopes and have not been started\n \t$Query = \"\n \t\tSELECT\n \t\t\tstarted, completed, Deleted\n \t\tFROM\n \t\t\tbevomedia_queue\n \t\tWHERE\n \t\t\tjobId = '{$this->jobId}'\t\n \t\t\n \t\";\n \t\n \t$Results = $DatabaseObj->fetchAll($Query);\n \tif(count($Results)>0)\n \t{\n\t \tforeach($Results as $Value)\n\t \t{\n\t \t\tif($Value->started == '0000-00-00 00:00:00' && $Value->completed == '0000-00-00 00:00:00')\n\t \t\t{\n\t \t\t\t$this->status = 'bevomedia_queued';\n\t \t\t}\n\t \t\telseif($Value->started == '0000-00-00 00:00:00' && $Value->completed != '0000-00-00 00:00:00')\n\t \t\t{\n\t \t\t\t$this->status = 'Processing';\n\t \t\t}\n\t \t\telseif($Value->started != '0000-00-00 00:00:00' && $Value->completed != '0000-00-00 00:00:00')\n\t \t\t{\n\t \t\t\t$this->status = 'completed';\n\t \t\t}\n\t \t\telseif($Value->Deleted == 1)\n\t \t\t{\n\t \t\t\t$this->status = 'Deleted';\n\t \t\t}\n\t \t\telse \n\t \t\t{\n\t \t\t\t//Not sure what this could be\n\t \t\t\t$this->status = 'Error';\n\t \t\t}\n\t \t}\n \t}\n\n \treturn $this->status; \t\n \t\n }", "public function findJobById($jobId)\n {\n $job = $this->entityManager->getRepository('MmoreramerinoGearmanBundle:QueueControl')->find($jobId);\n\n\n return $job;\n }", "public function searchJobByLocation($location)\n {\n return $this->jobLocationModel->where('location_id',$location)->with('jobs','category')->get();\n }", "public function getAndRemoveJobs()\n\t{\n\t\t//create QueryBuilder\n\t\t$queryBuilder = $this->entityManager->createQueryBuilder();\n\n\t\t//create query\n\t\t$queryBuilder->select(\"j\");\n\t\t$queryBuilder->from(\"yourCMDB:CmdbJob\", \"j\");\n\t\t$queryBuilder->andWhere(\"j.timestamp is null OR j.timestamp <= CURRENT_TIMESTAMP()\");\n\n\t\t//get results\n\t\t$query = $queryBuilder->getQuery();\n\t\t$jobs = $query->getResult();\n\n\t\t//delete the giveb jobs\n\t\tforeach($jobs as $job)\n\t\t{\n\t\t\t$this->entityManager->remove($job);\n\t\t}\n\t\t$this->entityManager->flush();\n\n\t\t//return jobs\n\t\treturn $jobs;\n\t}", "public function jobs()\n {\n $this->validateManagerType('dtc_queue.manager.job');\n $this->checkDtcGridBundle();\n $managerType = $this->container->getParameter('dtc_queue.manager.job');\n $rendererFactory = $this->container->get('dtc_grid.renderer.factory');\n $renderer = $rendererFactory->create('datatables');\n $gridSource = $this->container->get('dtc_queue.grid_source.jobs_waiting.'.('mongodb' === $managerType ? 'odm' : $managerType));\n $renderer->bind($gridSource);\n $params = $renderer->getParams();\n $this->addCssJs($params);\n\n $params['worker_methods'] = $this->container->get('dtc_queue.manager.job')->getWorkersAndMethods();\n $params['prompt_message'] = 'This will archive all non-running jobs';\n\n return $this->render('@DtcQueue/Queue/jobs.html.twig', $params);\n }", "public function getAllJobPostings()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobDAO($dbObj);\n return $this->DAO->getAllJobs();\n }", "public function getAppliedJobs()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobDAO($dbObj);\n $username = Session::get('currentUser');\n $this->DAO2 = new SecurityDAO($dbObj);\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getAppliedJobs($userID);\n }", "public function hasJobs()\n {\n if($this->numJobs() > 0)\n {\n return true;\n }\n return false;\n }", "public function getJobs() \n {\n $output = shell_exec('crontab -l');\n\n if(gettype($output) !== 'string')\n {\n self::$registry->error->reportError('Something does not work properly while working with crontab command!', __LINE__, __METHOD__, true);\n return 0;\n }\n \n return $this->stringToArray($output);\n }", "public function getAllMyJobPostings()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobDAO($dbObj);\n $this->DAO2 = new SecurityDAO($dbObj);\n $username = Session::get('currentUser');\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getMyPostedJobs($userID);\n }", "public function findByLabels(array $labels);", "public function jobs()\n {\n return $this->hasMany('App\\Job');\n }", "public function GetQueuedJobs()\n {\n $JOBS = $this->DB->GET('MUP.injector.jobs', ['status' => 'QUEUED', 'pmta' => $this->HOSTID, 'active' => '1', 'ORDER' => ['date' => 'ASC']], ['id', 'target', 'pool'], 100000);\n if (empty($JOBS)) {\n $this->ALERTS[] = FAIL.\" ~ <<< No Jobs to Inject...\";\n }else{\n if (isset($JOBS['id']))\n $JOBS = [$JOBS['id']=> $JOBS];\n foreach ($JOBS as $ID => $JOB) \n if (!isset($this->QueuedJobs[$JOB['pool']][$JOB['target']])) \n $this->QueuedJobs[$JOB['pool']][$JOB['target']] = ltrim($ID, '0');\n $this->Debug('QUEUED JOBS', $this->QueuedJobs);\n }\n }", "public function getNotAppliedJobs()\n {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobDAO($dbObj);\n $username = Session::get('currentUser');\n $this->DAO2 = new SecurityDAO($dbObj);\n $userID = $this->DAO2->getUserIDByUsername($username);\n return $this->DAO->getNotAppliedJobs($userID);\n }", "public function get_job_type_list()\n\t{\n\t\t$job_type = array(\n\t\t\t\t\t 'jt-1'=>'Part Time',\n\t 'jt-2'=>'Full Time',\n\t 'jt-3'=>'Internship'\n\t );\n\t\treturn $job_type;\n\t}", "public function getShortlistJob($input) {\n $jobprefrence = User::where('id', '=', access()->id())->OfJobPrefrence($input['id'])->get();\n if (!count($jobprefrence)) {\n $user = User::find(access()->id());\n $user->jobPrefrences()->attach($input['id']);\n return array('status' => 1, 'message' => 'Job successfully saved to your preferred list.');\n } else {\n return array('status' => 0, 'message' => 'Job already found in your preferred list.');\n }\n }", "public static function getLabels(): array;", "public function jobs()\n {\n return $this->hasMany(Job::class)\n ->with('type:id,name','country:id,name')\n ->withCount('applicants')\n ->latest();\n }", "public function jobs(Model $model): array\n {\n return [];\n }", "public function results()\n\t{\n\t\t// This function return entries\n\t\treturn $this->EE->job_search->results();\n\t}", "public function current()\n {\n return $this->job;\n }", "public function getLabels()\n {\n return isset($this->labels) ? $this->labels : null;\n }", "public function get()\n {\n $clientQueue = $this->client->queue($this->queueName);\n while (!isset($job)) {\n try {\n $job = $clientQueue->pull($this->getTimeout);\n } catch (JobNotAvailableException $e) {\n continue;\n }\n }\n return $job;\n }", "private function getAllowedJobs()\n {\n return [\n 'RetailcrmAbandonedCartsEvent',\n 'RetailcrmIcmlEvent',\n 'RetailcrmIcmlUpdateUrlEvent',\n 'RetailcrmSyncEvent',\n 'RetailcrmInventoriesEvent',\n 'RetailcrmExportEvent',\n 'RetailcrmUpdateSinceIdEvent',\n 'RetailcrmClearLogsEvent',\n ];\n }", "public function getJobId();", "public function whereStatus($status): JobCollection\n {\n\n return $this->filter(function (Job $job) use ($status) {\n return $job->getStatus() === $status;\n });\n\n }", "private function checkStatusOfSearchJob() {\n $response = $this->client->request('GET', \"search/jobs/{$this->jobId}\", ['http_errors' => false]);\n if ($response->getStatusCode() === 429) {\n return self::RATE_LIMITED;\n }\n $data = json_decode($response->getBody());\n $state = $data->state;\n switch ($state) {\n case \"NOT STARTED\" :\n return self::NOT_STARTED;\n case \"GATHERING RESULTS\";\n return self::IN_PROGRESS;\n case \"DONE GATHERING RESULTS\";\n return self::COMPLETE;\n default:\n return self::CANCELLED;\n }\n }", "function tripal_get_module_active_jobs ($modulename){\n $sql = \"SELECT * FROM {tripal_jobs} TJ \".\n \"WHERE TJ.end_time IS NULL and TJ.modulename = '%s' \";\n return db_fetch_object(db_query($sql,$modulename));\n\n}", "public static function getChildJobs($id) {\n $criteria = new CDbCriteria();\n $criteria->condition = 't.id = :id or t.id in (select project_job_id from project_job_parents where parent_id = :id)';\n $criteria->params = array(':id' => $id);\n return PRMProjectJob::model()->findAll($criteria);\n }" ]
[ "0.61493784", "0.60545725", "0.60545725", "0.60209215", "0.58782834", "0.58782834", "0.58547014", "0.5765212", "0.5752247", "0.57405794", "0.5590233", "0.5589747", "0.5586155", "0.55186546", "0.54829043", "0.5466492", "0.54618704", "0.5457525", "0.53978217", "0.5392978", "0.5364225", "0.5349878", "0.5343135", "0.5317245", "0.53080845", "0.53075624", "0.52648085", "0.5246766", "0.5224621", "0.5221423", "0.5213593", "0.5201462", "0.51415616", "0.51124656", "0.51090163", "0.51022273", "0.510045", "0.505678", "0.50511664", "0.502241", "0.50128883", "0.5012615", "0.5006769", "0.4995175", "0.49947575", "0.49909666", "0.49903813", "0.49878395", "0.49878395", "0.4969664", "0.49683478", "0.49653238", "0.49622396", "0.49344432", "0.49231416", "0.49092376", "0.49078968", "0.49040005", "0.49040005", "0.49040005", "0.4899467", "0.4888322", "0.48784778", "0.48690996", "0.4852645", "0.48502445", "0.48475158", "0.48471886", "0.48399282", "0.48342273", "0.4833603", "0.48279095", "0.48227686", "0.48160782", "0.48151872", "0.48151302", "0.47990134", "0.4782965", "0.47776255", "0.4768654", "0.47425506", "0.47376332", "0.47374666", "0.47361118", "0.4727168", "0.4726857", "0.47233665", "0.47231045", "0.47173443", "0.4714989", "0.47132677", "0.47091252", "0.4698764", "0.46982485", "0.46918857", "0.46917114", "0.46895513", "0.46889418", "0.467847", "0.467534" ]
0.58452094
7
Converts a string to UTF8 encoding.
public static function convertToUtf8($string) { if (!self::isUtf8($string)) { $string = self::convertEncoding($string, 'gbk', 'utf-8'); } return $string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function str_to_utf8( $string ) {\n\n // Check if mbstring is installed, if not, run old way\n if ( !function_exists( 'mb_convert_encoding' ) )\n return ( ( preg_match( '!!u', $string ) ) ? $string : utf8_encode( $string ) );\n\n // Convert encoding from XXX to UTF-8\n $string = mb_convert_encoding( $string, \"UTF-8\" );\n\n // Escape special characters\n htmlspecialchars( $string, ENT_QUOTES, 'UTF-8' );\n $string = html_entity_decode( $string );\n\n // Return modified - UTF-8 string\n return $string;\n\n }", "static public function stringToUtf8($string) {\n if ($GLOBALS['LANG']->charSet == '' || $GLOBALS['LANG']->charSet == 'iso-8859-1') {\n return utf8_encode($string);\n } else {\n return $string;\n }\n\t}", "public function encode_convert($string) {\r\n\t\treturn mb_convert_encoding(trim($string), \"UTF-8\", \"EUC-JP, UTF-8, ASCII, JIS, eucjp-win, sjis-win\");\r\n\t}", "function convert_to_utf8(string $str): string\n {\n return preg_replace_callback(\n '/\\\\\\\\u([0-9a-fA-F]{4})/',\n static function (array $match): string {\n return mb_convert_encoding(pack('H*', $match[1]), 'UTF-8', 'UCS-2BE');\n },\n $str\n );\n }", "public static function convertToUtf8(string $string): string\n {\n return mb_convert_encoding($string, 'UTF-8');\n }", "function utf8encode($string){\n\tif(function_exists('mb_convert_encoding')){\n\t\t return mb_convert_encoding($string, \"UTF-8\", mb_detect_encoding($string));\n\t}else{\n\t\treturn utf8_encode($string);\n\t}\n}", "public static function toUTF8($str) {\n\t\t\t$lst = 'UTF-8, ISO-8859-1';\n\t\t\t$cur = mb_detect_encoding($str, $lst);\n\t\t\treturn mb_convert_encoding($str, 'UTF-8', $cur);\n\t\t}", "private function _utf8convert( $string )\r\n\t{\r\n\t\t// Test the string to see if it isn't utf-8\r\n\t\tif ( $this->_utf8check( $string ) ) {\r\n\t\t\treturn $string;\r\n\t\t}\r\n\t\t\r\n\t\tif (! function_exists( 'mb_detect_encoding' ) ) {\r\n\t\t\t// @TODO: Log an error somehow\r\n\t\t\t$this->unicode = null;\r\n\t\t\treturn string;\r\n\t\t}\r\n\t\t\r\n\t\t$encoding\t=\tmb_detect_encoding( $string, 'auto', true );\r\n\t\tif (! $encoding ) {\r\n\t\t\t// @TODO: Log an error somehow\r\n\t\t\t$this->unicode = null;\r\n\t\t\treturn $string;\r\n\t\t}\r\n\t\t\r\n\t\tif (! function_exists( 'iconv' ) ) {\r\n\t\t\t// @TODO: Log an error somehow\r\n\t\t\t$this->unicode = null;\r\n\t\t\treturn $string;\r\n\t\t}\r\n\t\t\r\n\t\t$result\t=\ticonv( strtoupper( $encoding ), 'UTF-8//TRANSLIT', $string );\r\n\t\tif (! $result ) {\r\n\t\t\t// @TODO: Log an error somehow\r\n\t\t\t$this->unicode = null;\r\n\t\t\treturn $string;\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "function mk_utf8($string) {\n\t\treturn (is_utf8($string) ? $string : utf8_encode($string));\n\t}", "public static function encode(?string $string): string\n {\n if (!$string) return '';\n\n $fromEncoding = mb_detect_encoding($string);\n $toEncoding = 'UTF-8////IGNORE';\n\n return $convertedString = //@mb_convert_encoding($string, $toEncoding, $fromEncoding) ?:\n @iconv($fromEncoding, $toEncoding, $string);\n }", "function utf8($str)\n{\n if(mb_detect_encoding($str) == \"UTF-8\" && mb_check_encoding($str,\"UTF-8\")) return $str;\n else return utf8_encode($str);\n}", "protected function chars_convert($string)\r\n {\r\n if (function_exists('mb_convert_encoding'))\r\n {\r\n $out = mb_convert_encoding($string, mb_detect_encoding($string), \"UTF-8\"); \r\n }\r\n else\r\n {\r\n $out = $string;\r\n }\r\n \r\n return $out; \r\n }", "function makeUTF8($str,$encoding = \"\") {\n if (!empty($str)) {\n if (empty($encoding) && isUTF8($str))\n $encoding = \"UTF-8\";\n if (empty($encoding))\n $encoding = mb_detect_encoding($str,'UTF-8, ISO-8859-1');\n if (empty($encoding))\n $encoding = \"ISO-8859-1\"; // if charset can't be detected, default to ISO-8859-1\n return $encoding == \"UTF-8\" ? $str : @mb_convert_encoding($str,\"UTF-8\",$encoding);\n }\n }", "function makeUTF8($str,$encoding = \"\") {\n if ($str !== \"\") {\n if (empty($encoding) && isUTF8($str))\n $encoding = \"UTF-8\";\n if (empty($encoding))\n $encoding = mb_detect_encoding($str,'UTF-8, ISO-8859-1');\n if (empty($encoding))\n $encoding = \"ISO-8859-1\"; // if charset can't be detected, default to ISO-8859-1\n return $encoding == \"UTF-8\" ? $str : @mb_convert_encoding($str,\"UTF-8\",$encoding);\n }\n }", "function convert_to_utf8($str)\n{\n\t$old_charset = $_SESSION['old_charset'];\n\t\n\tif ($str === null || $str == '' || $old_charset == 'UTF-8')\n\t\treturn $str;\n\n\t$save = $str;\n\n\t// Replace literal entities (for non-UTF-8 compliant html_entity_encode)\n\tif (version_compare(PHP_VERSION, '5.0.0', '<') && $old_charset == 'ISO-8859-1' || $old_charset == 'ISO-8859-15')\n\t\t$str = html_entity_decode($str, ENT_QUOTES, $old_charset);\n\n\tif ($old_charset != 'UTF-8' && !seems_utf8($str))\n\t{\n\t\tif (function_exists('iconv'))\n\t\t\t$str = iconv($old_charset == 'ISO-8859-1' ? 'WINDOWS-1252' : $old_charset, 'UTF-8', $str);\n\t\telse if (function_exists('mb_convert_encoding'))\n\t\t\t$str = mb_convert_encoding($str, 'UTF-8', $old_charset == 'ISO-8859-1' ? 'WINDOWS-1252' : 'ISO-8859-1');\n\t\telse if ($old_charset == 'ISO-8859-1')\n\t\t\t$str = utf8_encode($str);\n\t}\n\n\t// Replace literal entities (for UTF-8 compliant html_entity_encode)\n\tif (version_compare(PHP_VERSION, '5.0.0', '>='))\n\t\t$str = html_entity_decode($str, ENT_QUOTES, 'UTF-8');\n\n\t// Replace numeric entities\n\t$str = preg_replace_callback('/&#([0-9]+);/', 'utf8_callback_1', $str);\n\t$str = preg_replace_callback('/&#x([a-f0-9]+);/i', 'utf8_callback_2', $str);\n\n\t// Remove \"bad\" characters\n\t$str = remove_bad_characters($str);\n\n\treturn $str;//($save != $str);\n}", "function encode($str)\n{\n\treturn mb_convert_encoding($str,'UTF-8');\n}", "public static function fixEncoding($in_str) { \r\r\n\t\t$cur_encoding = mb_detect_encoding($in_str) ; \r\r\n\t\tif($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\")) \r\r\n\t\t\treturn $in_str; \r\r\n\t\telse \r\r\n\t\t\treturn utf8_encode($in_str); \r\r\n\t}", "public function convertToCurrentEncoding($string)\n\t\t{\n\t\t\t$convertedString = $string;\n\t\t\tmb_convert_variables(_APP_ENCODING, mb_detect_encoding($string.'a', 'UTF-8, ISO-8859-1, EUC-JP, SJIS, GBK, ISO-8859-15, ASCII, JIS'), $convertedString);\n\t\t\treturn $convertedString;\n\t\t}", "public static function unicodeToIso ($string)\r\n\t{\r\n\t\t# Return the string without alteration if the multibyte extension is not present\r\n\t\tif (!function_exists ('mb_convert_encoding')) {return $string;}\r\n\t\t\r\n\t\t# Return the result\r\n\t\treturn mb_convert_encoding ($string, 'ISO-8859-1', mb_detect_encoding ($string, 'UTF-8, ISO-8859-1, ISO-8859-15', true));\r\n\t}", "function fixEncoding($in_str)\r\n\r\n{\r\n\r\n $cur_encoding = mb_detect_encoding($in_str) ;\r\n\r\n if($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\"))\r\n\r\n return $in_str;\r\n\r\n else\r\n\r\n return utf8_encode($in_str);\r\n\r\n}", "public static function utf8Sanitize($string)\r\n {\r\n Preconditions::checkIsString($string, '$string must be string');\r\n $out = @iconv(\"UTF-8\", \"UTF-8//IGNORE\", $string);\r\n if ($string != $out) {\r\n $out = \"Warning: String not shown for security reasons: \" .\r\n \"String contains invalid utf-8 charactes.\";\r\n }\r\n return $out;\r\n }", "public static function convertToUtf8($inputText)\n {\n return iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $inputText);\n }", "function fixEncoding($in_str) \r\n{ \r\n $cur_encoding = mb_detect_encoding($in_str) ; \r\n if($cur_encoding == \"UTF-8\" && mb_check_encoding($in_str,\"UTF-8\")) \r\n return $in_str; \r\n else \r\n return utf8_encode($in_str); \r\n}", "private function handle_encoding($string)\n {\n switch ($this->get_option('encode')) {\n case 'utf8':\n return $string;\n case 'iso88591':\n return utf8_encode($string);\n default:\n return $string;\n }\n }", "public static function convert2UTF8($string, $from_encode) {\n if (empty($string)) {\n return '';\n }\n if ($from_encode == self::ENCODE_UTF8) {\n return $string;\n }\n $from_encode = self::convertEncodingName($from_encode);\n return self::convertEncode($string, $from_encode, self::ENCODE_UTF8);\n }", "public function utf8_force($string){\r\n if (preg_match('%^(?:\r\n [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\r\n | [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\r\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\r\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\r\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\r\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\r\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\r\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\r\n )*$%xs', $string))\r\n return $string;\r\n else\r\n return iconv('CP1252', 'UTF-8', $string);\r\n }", "public static function to_utf8_string(string $str, bool $decode_html_entity_to_utf8 = false): string\n {\n if ($str === '') {\n return $str;\n }\n\n $max = \\strlen($str);\n $buf = '';\n\n for ($i = 0; $i < $max; ++$i) {\n $c1 = $str[$i];\n\n if ($c1 >= \"\\xC0\") { // should be converted to UTF8, if it's not UTF8 already\n\n if ($c1 <= \"\\xDF\") { // looks like 2 bytes UTF8\n\n $c2 = $i + 1 >= $max ? \"\\x00\" : $str[$i + 1];\n\n if ($c2 >= \"\\x80\" && $c2 <= \"\\xBF\") { // yeah, almost sure it's UTF8 already\n $buf .= $c1 . $c2;\n ++$i;\n } else { // not valid UTF8 - convert it\n $buf .= self::to_utf8_convert_helper($c1);\n }\n } elseif ($c1 >= \"\\xE0\" && $c1 <= \"\\xEF\") { // looks like 3 bytes UTF8\n\n $c2 = $i + 1 >= $max ? \"\\x00\" : $str[$i + 1];\n $c3 = $i + 2 >= $max ? \"\\x00\" : $str[$i + 2];\n\n if ($c2 >= \"\\x80\" && $c2 <= \"\\xBF\" && $c3 >= \"\\x80\" && $c3 <= \"\\xBF\") { // yeah, almost sure it's UTF8 already\n $buf .= $c1 . $c2 . $c3;\n $i += 2;\n } else { // not valid UTF8 - convert it\n $buf .= self::to_utf8_convert_helper($c1);\n }\n } elseif ($c1 >= \"\\xF0\" && $c1 <= \"\\xF7\") { // looks like 4 bytes UTF8\n\n $c2 = $i + 1 >= $max ? \"\\x00\" : $str[$i + 1];\n $c3 = $i + 2 >= $max ? \"\\x00\" : $str[$i + 2];\n $c4 = $i + 3 >= $max ? \"\\x00\" : $str[$i + 3];\n\n if ($c2 >= \"\\x80\" && $c2 <= \"\\xBF\" && $c3 >= \"\\x80\" && $c3 <= \"\\xBF\" && $c4 >= \"\\x80\" && $c4 <= \"\\xBF\") { // yeah, almost sure it's UTF8 already\n $buf .= $c1 . $c2 . $c3 . $c4;\n $i += 3;\n } else { // not valid UTF8 - convert it\n $buf .= self::to_utf8_convert_helper($c1);\n }\n } else { // doesn't look like UTF8, but should be converted\n\n $buf .= self::to_utf8_convert_helper($c1);\n }\n } elseif (($c1 & \"\\xC0\") === \"\\x80\") { // needs conversion\n\n $buf .= self::to_utf8_convert_helper($c1);\n } else { // it doesn't need conversion\n\n $buf .= $c1;\n }\n }\n\n // decode unicode escape sequences + unicode surrogate pairs\n $buf = \\preg_replace_callback(\n '/\\\\\\\\u([dD][89abAB][0-9a-fA-F]{2})\\\\\\\\u([dD][cdefCDEF][\\da-fA-F]{2})|\\\\\\\\u([0-9a-fA-F]{4})/',\n /**\n * @param array $matches\n *\n * @psalm-pure\n *\n * @return string\n */\n static function (array $matches): string {\n if (isset($matches[3])) {\n $cp = (int) \\hexdec($matches[3]);\n } else {\n // http://unicode.org/faq/utf_bom.html#utf16-4\n $cp = ((int) \\hexdec($matches[1]) << 10)\n + (int) \\hexdec($matches[2])\n + 0x10000\n - (0xD800 << 10)\n - 0xDC00;\n }\n\n // https://github.com/php/php-src/blob/php-7.3.2/ext/standard/html.c#L471\n //\n // php_utf32_utf8(unsigned char *buf, unsigned k)\n\n if ($cp < 0x80) {\n return (string) self::chr($cp);\n }\n\n if ($cp < 0xA0) {\n /** @noinspection UnnecessaryCastingInspection */\n return (string) self::chr(0xC0 | $cp >> 6) . (string) self::chr(0x80 | $cp & 0x3F);\n }\n\n return self::decimal_to_chr($cp);\n },\n $buf\n );\n\n if ($buf === null) {\n return '';\n }\n\n // decode UTF-8 codepoints\n if ($decode_html_entity_to_utf8) {\n $buf = self::html_entity_decode($buf);\n }\n\n return $buf;\n }", "public static function sanitizeUTF8($string)\n\t{\n\t\t$output = preg_replace('/[^\\x{0009}\\x{000a}\\x{000d}\\x{0020}-\\x{D7FF}\\x{E000}-\\x{FFFD}]+/u', '', $string);\n\t\tif (is_null($output))\n\t\t{\n\t\t\t$output = \"\";\n\t\t\tif (empty($string))\n\t\t\t{\n\t\t\t\treturn $output;\n\t\t\t}\n\n\t\t\t$length = strlen($string);\n\t\t\tfor ($i = 0; $i < $length; $i++)\n\t\t\t{\n\t\t\t\t$current = ord($string{$i});\n\t\t\t\tif (($current == 0x9) ||\n\t\t\t\t\t($current == 0xA) ||\n\t\t\t\t\t($current == 0xD) ||\n\n\t\t\t\t\t(($current >= 0x28) && ($current <= 0xD7FF)) ||\n\t\t\t\t\t(($current >= 0xE000) && ($current <= 0xFFFD)) ||\n\t\t\t\t\t(($current >= 0x10000) && ($current <= 0x10FFFF))\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$output .= chr($current);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$output .= \" \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $output;\n\t}", "private function corrigeInputEncoding($string)\n {\n if (!is_string($string)) {\n return $string;\n }\n $encodageSupporte = [];\n $encodageSupporte[] = \"UTF-8\";\n $encodageSupporte[] = \"CP1252\";\n $encodageSupporte[] = \"ISO-8859-15\";\n $encodageSupporte[] = \"ISO-8859-1\";\n $encodageSupporte[] = \"ASCII\";\n $encodageDetecte = mb_detect_encoding($string, $encodageSupporte, true);\n if ($encodageDetecte != $this->pdoCharset) {\n return mb_convert_encoding(\n $string,\n $this->pdoCharset,\n $encodageDetecte\n );\n }\n return $string;\n }", "public function utf8_Validate($string)\n {\n $output=$string;\n if (!preg_match('!!u', $string)) {\n $output = utf8_encode($string);\n }\n return $output;\n }", "public static function ensureUTF8($input)\n {\n $encoding = mb_detect_encoding($input, ['UTF-8', 'ISO-8859-1'], true);\n\n if ('ISO-8859-1' === $encoding) {\n return utf8_encode($input);\n }\n\n return $input;\n }", "public static function windows_1252_to_utf8($string)\n {\n }", "function & _wp_iso8859_2_to_utf8(&$string) {\n $decode=array(\n \"\\xA1\" => \"\\xC4\\x84\",\n \"\\xB1\" => \"\\xC4\\x85\",\n \"\\xC6\" => \"\\xC4\\x86\",\n \"\\xE6\" => \"\\xC4\\x87\",\n \"\\xCA\" => \"\\xC4\\x98\",\n \"\\xEA\" => \"\\xC4\\x99\",\n \"\\xA3\" => \"\\xC5\\x81\",\n \"\\xB3\" => \"\\xC5\\x82\",\n \"\\xD1\" => \"\\xC5\\x83\",\n \"\\xF1\" => \"\\xC5\\x84\",\n \"\\xD3\" => \"\\xC3\\x93\",\n \"\\xF3\" => \"\\xC3\\xB3\",\n \"\\xA6\" => \"\\xC5\\x9A\",\n \"\\xB6\" => \"\\xC5\\x9B\",\n \"\\xAC\" => \"\\xC5\\xB9\",\n \"\\xBC\" => \"\\xC5\\xBA\",\n \"\\xAF\" => \"\\xC5\\xBB\",\n \"\\xBF\" => \"\\xC5\\xBC\",\n );\n $string = strtr(\"$string\",$decode);\n return $string;\n }", "public static function convert($string, $inEncoding, $outEncoding) {}", "function seems_utf8($str)\n {\n }", "function convert_to_utf8($data, $encoding) {\n if (function_exists('iconv')) {\n $out = @iconv($encoding, 'utf-8', $data);\n }\n else if (function_exists('mb_convert_encoding')) {\n $out = @mb_convert_encoding($data, 'utf-8', $encoding);\n }\n else if (function_exists('recode_string')) {\n $out = @recode_string($encoding .'..utf-8', $data);\n }\n else {\n /* watchdog('php', t(\"Unsupported encoding '%s'. Please install iconv, GNU\nrecode or mbstring for PHP.\", array('%s' => $encoding)), WATCHDOG_ERROR); */\n return FALSE;\n }\n return $out;\n}", "protected final function _convertString($string, $encoding)\n {\n $target = $this->getOption(\"encoding\", ID3_Encoding::UTF8);\n switch ($target) {\n case ID3_Encoding::UTF16:\n $target = \"utf-16\";\n break;\n case ID3_Encoding::UTF16LE:\n $target = \"utf-16le\";\n break;\n case ID3_Encoding::UTF16BE:\n $target = \"utf-16be\";\n break;\n case ID3_Encoding::UTF8:\n $target = \"utf-8\";\n break;\n default:\n $target = \"iso-8859-1\";\n }\n\n if (strtolower($target) == strtolower($encoding))\n return $string;\n\n if (is_array($string))\n foreach ($string as $key => $value)\n $string[$key] = iconv($encoding, $target, $value);\n else\n $string = iconv($encoding, $target, $string);\n return $string;\n }", "function unicode_conv($originalString) {\n $replacedString = preg_replace(\"#\\\\\\\\u(\\w{4})#\", \"&#x$1;\", $originalString);\n $unicodeString = mb_convert_encoding($replacedString, 'ISO-8859-1', 'HTML-ENTITIES');\n return $unicodeString;\n}", "private static function normalize($string = '')\n {\n $string = mb_convert_encoding($string, 'UTF-8');\n $string = iconv('UTF-8-MAC', 'UTF-8', $string);\n\n return iconv('UTF-8-MAC', 'UTF-8', $string);\n }", "protected function _unicodeToUtf8($str)\n { \n $utf8 = '';\n \n foreach ($str as $unicode) {\n \n if ($unicode < 128) {\n \n $utf8 .= chr($unicode);\n \n } elseif ($unicode < 2048) {\n \n $utf8 .= chr(192 + ( ( $unicode - ( $unicode % 64 ) ) / 64 ));\n $utf8 .= chr(128 + ( $unicode % 64 ));\n \n } else {\n \n $utf8 .= chr( 224 + (( $unicode - ( $unicode % 4096 ) ) / 4096 ));\n $utf8 .= chr( 128 + (( ( $unicode % 4096 ) - ( $unicode % 64 ) ) / 64 ));\n $utf8 .= chr( 128 + ($unicode % 64 ));\n \n } // if\n \n } // foreach\n \n return $utf8;\n }", "protected function makeUTF8 ( $s )\n\t{\n\t\tif (function_exists('iconv'))\n\t\t{\n\t\t\tdo\n\t\t\t{\n\t\t\t\t$ok = true;\n\t\t\t\t$text = @iconv('UTF-8', 'UTF-8//TRANSLIT', $s);\n\t\t\t\tif (strlen($text) != strlen($s))\n\t\t\t\t{\n\t\t\t\t\t// Remove the offending character...\n\t\t\t\t\t$s = $text . '.' . substr($s, strlen($text) + 1);\n\t\t\t\t\t$ok = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (!$ok);\n\t\t}\n\t\treturn $s;\n\t}", "function FixString($string)\n{\n return mb_convert_encoding($string, \"UTF-8\", \"Windows-1252\");\n}", "function utf8decode($string){\n\tif(function_exists('mb_convert_encoding')){\n\t\t return mb_convert_encoding($string, \"iso-8859-1\", \"UTF-8\");\n\t}else{\n\t\treturn utf8_decode($string);\n\t}\n}", "function utf8_to_ascii($str) {\n\t\tif (!isset ($str))\n\t\t\treturn \"\";\n\n\t\tglobal $GLOBAL_ARRAY_TRANSLATE_UNICODE;\n\n\t\t$str = strtr($str, $GLOBAL_ARRAY_TRANSLATE_UNICODE);\n\t\treturn $str;\n\t}", "function convert($string, $to = 'UTF-8', $from = 'auto'){\n $result = false;\n if ($string != null && $to != null && is_string($to)) {\n $string = (string) $string;\n if (strpos($to, '//') !== false) {\n $split = explode('//', $to);\n $to = array_shift($split);\n }\n if (is_array($from)\n || (is_string($from) && strcasecmp($from, 'auto') === 0)) {\n $detect = $this->detectEncoding($string, $from);\n if ($detect !== false) {\n $from = $detect;\n }\n }\n if ($this->hasMBString) {\n $to = $this->getEncodingName($to, 'mbstring', $to);\n $from = $this->getEncodingName($from, 'mbstring', $from);\n $result = mb_convert_encoding($string, $to, $from);\n } else if ($this->hasIConv) {\n $to = $this->getEncodingName($to, 'iconv', $to);\n $to .= '//TRANSLIT//IGNORE';\n $from = $this->getEncodingName($from, 'iconv', $from);\n $result = @iconv($from, $to, $string);\n }\n if (!$result) {\n $to = $this->getEncodingName($to, null, $to);\n $from = $this->getEncodingName($from, null, $from);\n if (strcasecmp($to, $from) === 0) {\n $result = $string;\n } else {\n $result = false;\n }\n }\n }\n return $result;\n }", "protected function strip_non_utf8( $string ) {\n\t\tini_set( 'mbstring.substitute_character', 'none' );\n\n\t\treturn mb_convert_encoding( $string, 'UTF-8', 'UTF-8' );\n\t}", "function my_utf8_decode($string)\n{\nreturn strtr($string,\n \"???????¥µÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿ\",\n \"SOZsozYYuAAAAAAACEEEEIIIIDNOOOOOOUUUUYsaaaaaaaceeeeiiiionoooooouuuuyy\");\n}", "function utf8($x){\n\t#return is_string($x)?utf8_encode($x):$x;\n\treturn $x;\n}", "function get_encoded_string ($str) {\n setlocale(LC_ALL, 'fr_FR.UTF-8');\n return iconv('UTF-8', 'ASCII//TRANSLIT', $str);\n}", "function convertString($str)\n{\n\tif (!is_utf8($str))\n\t{\n\t\t$str = utf8_encode($str);\n\t}\n\n\t// clean up the html\n\t$str = cleanHTML($str);\n\n\t// return the url encoded string\n\treturn urlencode($str);\n}", "function charset_decode_utf_8 ($string) {\r\n\t /* avoid using 0xA0 (\\240) in ereg ranges. RH73 does not like that */\r\n\t if (! ereg(\"[\\200-\\237]\", $string) and ! ereg(\"[\\241-\\377]\", $string))\r\n\t return $string;\r\n\r\n\t // decode three byte unicode characters\r\n\t $string = preg_replace(\"/([\\340-\\357])([\\200-\\277])([\\200-\\277])/e\",\r\n\t \"'&#'.((ord('\\\\1')-224)*4096 + (ord('\\\\2')-128)*64 + (ord('\\\\3')-128)).';'\",\r\n\t $string);\r\n\r\n\t // decode two byte unicode characters\r\n\t $string = preg_replace(\"/([\\300-\\337])([\\200-\\277])/e\",\r\n\t \"'&#'.((ord('\\\\1')-192)*64+(ord('\\\\2')-128)).';'\",\r\n\t $string);\r\n\r\n\t return $string;\r\n\t}", "function win_utf8($s) {\n $utf = \"\";\n for ($i = 0; $i < strlen($s); $i++) {\n $donotrecode = false;\n $c = ord(substr($s, $i, 1));\n if ($c == 0xA8) {\n $res = 0xD081;\n } elseif ($c == 0xB8) {\n $res = 0xD191;\n } elseif ($c < 0xC0) {\n $donotrecode = true;\n } elseif ($c < 0xF0) {\n $res = $c + 0xCFD0;\n } else {\n $res = $c + 0xD090;\n }\n $c = ($donotrecode) ? chr($c) : (chr($res >> 8) . chr($res & 0xff));\n $utf .= $c;\n }\n return $utf;\n }", "public function convertEncoding($string, $current_encoding_type)\n {\n $converted_string = false;\n\n if (!$string) {\n return $string;\n }\n\n if ($current_encoding_type == $this->encoding) {\n return $string;\n }\n\n if (extension_loaded('mbstring')) {\n $converted_string = @mb_convert_encoding($string, $this->encoding, $current_encoding_type);\n } else {\n $converted_string = @iconv($current_encoding_type, $this->encoding . '//IGNORE', $string);\n }\n\n return $converted_string ?: $string;\n }", "function mb_to_unicode($string, $encoding = null)\n{\n if ($encoding) {\n $expanded = mb_convert_encoding($string, 'UTF-32BE', $encoding);\n } else {\n $expanded = mb_convert_encoding($string, 'UTF-32BE');\n }\n return unpack('N*', $expanded);\n}", "public static function utf8ToEntities($string)\n\t{\n\t\tif (!@preg_match(\"[\\200-\\237]\",$string) && !@preg_match(\"[\\241-\\377]\",$string))\n\t\t\treturn $string;\n\t\t$string = preg_replace(\"/[\\302-\\375]([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\340-\\375].([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\360-\\375]..([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\370-\\375]...([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\374-\\375]....([\\001-\\177])/\",\"&#65533;\\\\1\",$string);\n\t\t$string = preg_replace(\"/[\\300-\\301]./\", \"&#65533;\", $string);\n\t\t$string = preg_replace(\"/\\364[\\220-\\277]../\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\365-\\367].../\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\370-\\373]..../\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\374-\\375]...../\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\376-\\377]/\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\"/[\\302-\\364]{2,}/\",\"&#65533;\",$string);\n\t\t$string = preg_replace(\n\t\t\t\"/([\\360-\\364])([\\200-\\277])([\\200-\\277])([\\200-\\277])/e\",\n\t\t\t\"'&#'.((ord('\\\\1')&7)<<18 | (ord('\\\\2')&63)<<12 |\".\n\t\t\t\" (ord('\\\\3')&63)<<6 | (ord('\\\\4')&63)).';'\",\n\t\t$string);\n\t\t$string = preg_replace(\"/([\\340-\\357])([\\200-\\277])([\\200-\\277])/e\",\n\t\t\"'&#'.((ord('\\\\1')&15)<<12 | (ord('\\\\2')&63)<<6 | (ord('\\\\3')&63)).';'\",\n\t\t$string);\n\t\t$string = preg_replace(\"/([\\300-\\337])([\\200-\\277])/e\",\n\t\t\"'&#'.((ord('\\\\1')&31)<<6 | (ord('\\\\2')&63)).';'\",\n\t\t$string);\n\t\t$string = preg_replace(\"/[\\200-\\277]/\",\"&#65533;\",$string);\n\t\treturn $string;\n\t}", "function & _wp_utf8_to_8859_2(&$string) {\n $decode=array(\n \"\\xC4\\x84\"=>\"\\xA1\",\n \"\\xC4\\x85\"=>\"\\xB1\",\n \"\\xC4\\x86\"=>\"\\xC6\",\n \"\\xC4\\x87\"=>\"\\xE6\",\n \"\\xC4\\x98\"=>\"\\xCA\",\n \"\\xC4\\x99\"=>\"\\xEA\",\n \"\\xC5\\x81\"=>\"\\xA3\",\n \"\\xC5\\x82\"=>\"\\xB3\",\n \"\\xC5\\x83\"=>\"\\xD1\",\n \"\\xC5\\x84\"=>\"\\xF1\",\n \"\\xC3\\x93\"=>\"\\xD3\",\n \"\\xC3\\xB3\"=>\"\\xF3\",\n \"\\xC5\\x9A\"=>\"\\xA6\",\n \"\\xC5\\x9B\"=>\"\\xB6\",\n \"\\xC5\\xB9\"=>\"\\xAC\",\n \"\\xC5\\xBA\"=>\"\\xBC\",\n \"\\xC5\\xBB\"=>\"\\xAF\",\n \"\\xC5\\xBC\"=>\"\\xBF\"\n );\n\n $string = strtr(\"$string\",$decode);\n return $string;\n }", "protected static function utf8Htmlize($str)\n {\n if (!preg_match('//u', $str) && function_exists('iconv')) {\n set_error_handler('var_dump', 0);\n $charset = ini_get('default_charset');\n if ('UTF-8' === $charset || $str !== @iconv($charset, $charset, $str)) {\n $charset = 'CP1252';\n }\n restore_error_handler();\n\n $str = iconv($charset, 'UTF-8', $str);\n }\n\n return htmlspecialchars($str, ENT_QUOTES | (PHP_VERSION_ID >= 50400 ? ENT_SUBSTITUTE : 0), 'UTF-8');\n }", "function deutf8($str)\n{\n if(mb_detect_encoding($str) == \"UTF-8\" && mb_check_encoding($str,\"UTF-8\")) return utf8_decode($str);\n else return $str;\n}", "function utf8_convert_aix($string)\n{\n global $aixlocale_codepage_map, $aix_utf8_converters, $unicode_encoding;\n\n // Retrieve current locale setting\n $aix_locale = setlocale(LC_TIME, '0');\n\n if ($aix_locale === FALSE)\n {\n // Locale setting could not be retrieved; return string unchanged\n return $string;\n }\n\n if (!array_key_exists($aix_locale, $aixlocale_codepage_map))\n {\n // Default code page of locale could not be found; return string unchanged\n return $string;\n }\n\n $aix_codepage = $aixlocale_codepage_map[$aix_locale];\n\n if (!in_array($aix_codepage, $aix_utf8_converters, TRUE))\n {\n // No suitable UTF-8 converter was found for this code page; return string unchanged\n return $string;\n }\n\n // Convert string to UTF-8\n $aix_string = iconv($aix_codepage, 'UTF-8', $string);\n\n // Default to original string if conversion failed\n $string = ($aix_string === FALSE) ? $string : $aix_string;\n\n return $string;\n}", "public static function strToUtf($value)\r\n {\r\n if(empty($value) || is_null($value)){\r\n return null;\r\n }\r\n return iconv('WINDOWS-1251', 'UTF-8', $value);\r\n }", "protected function _encode($str = '') {\n\t\treturn iconv(\"UTF-8\",\"UTF-8//IGNORE\", html_entity_decode($str, ENT_COMPAT, 'utf-8'));\n\t}", "function p_enc($string) {\r\n $char_encoded = mb_convert_encoding($string, 'UTF-8', 'SJIS');\r\n return urlencode($char_encoded);\r\n}", "function utf8_encode($data)\n{\n}", "public function utf8toISO8859_1(Model $Model, $string)\n\t{\n\t\t$accented = array(\n\t\t\t'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ă', 'Ą',\n\t\t\t'Ç', 'Ć', 'Č', 'Œ',\n\t\t\t'Ď', 'Đ',\n\t\t\t'à', 'á', 'â', 'ã', 'ä', 'å', 'æ', 'ă', 'ą',\n\t\t\t'ç', 'ć', 'č', 'œ',\n\t\t\t'ď', 'đ',\n\t\t\t'È', 'É', 'Ê', 'Ë', 'Ę', 'Ě',\n\t\t\t'Ğ',\n\t\t\t'Ì', 'Í', 'Î', 'Ï', 'İ',\n\t\t\t'Ĺ', 'Ľ', 'Ł',\n\t\t\t'è', 'é', 'ê', 'ë', 'ę', 'ě',\n\t\t\t'ğ',\n\t\t\t'ì', 'í', 'î', 'ï', 'ı',\n\t\t\t'ĺ', 'ľ', 'ł',\n\t\t\t'Ñ', 'Ń', 'Ň',\n\t\t\t'Ò', 'Ó', 'Ô', 'Õ', 'Ö', 'Ø', 'Ő',\n\t\t\t'Ŕ', 'Ř',\n\t\t\t'Ś', 'Ş', 'Š',\n\t\t\t'ñ', 'ń', 'ň',\n\t\t\t'ò', 'ó', 'ô', 'ö', 'ø', 'ő',\n\t\t\t'ŕ', 'ř',\n\t\t\t'ś', 'ş', 'š',\n\t\t\t'Ţ', 'Ť',\n\t\t\t'Ù', 'Ú', 'Û', 'Ų', 'Ü', 'Ů', 'Ű',\n\t\t\t'Ý', 'ß',\n\t\t\t'Ź', 'Ż', 'Ž',\n\t\t\t'ţ', 'ť',\n\t\t\t'ù', 'ú', 'û', 'ų', 'ü', 'ů', 'ű',\n\t\t\t'ý', 'ÿ',\n\t\t\t'ź', 'ż', 'ž',\n\t\t\t'А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р',\n\t\t\t'а', 'б', 'в', 'г', 'д', 'е', 'ё', 'ж', 'з', 'и', 'й', 'к', 'л', 'м', 'н', 'о', 'р',\n\t\t\t'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я',\n\t\t\t'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я'\n\t\t\t);\n\n\t\t$replace = array(\n\t\t\t'A', 'A', 'A', 'A', 'A', 'A', 'AE', 'A', 'A',\n\t\t\t'C', 'C', 'C', 'CE',\n\t\t\t'D', 'D',\n\t\t\t'a', 'a', 'a', 'a', 'a', 'a', 'ae', 'a', 'a',\n\t\t\t'c', 'c', 'c', 'ce',\n\t\t\t'd', 'd',\n\t\t\t'E', 'E', 'E', 'E', 'E', 'E',\n\t\t\t'G',\n\t\t\t'I', 'I', 'I', 'I', 'I',\n\t\t\t'L', 'L', 'L',\n\t\t\t'e', 'e', 'e', 'e', 'e', 'e',\n\t\t\t'g',\n\t\t\t'i', 'i', 'i', 'i', 'i',\n\t\t\t'l', 'l', 'l',\n\t\t\t'N', 'N', 'N',\n\t\t\t'O', 'O', 'O', 'O', 'O', 'O', 'O',\n\t\t\t'R', 'R',\n\t\t\t'S', 'S', 'S',\n\t\t\t'n', 'n', 'n',\n\t\t\t'o', 'o', 'o', 'o', 'o', 'o',\n\t\t\t'r', 'r',\n\t\t\t's', 's', 's',\n\t\t\t'T', 'T',\n\t\t\t'U', 'U', 'U', 'U', 'U', 'U', 'U',\n\t\t\t'Y', 'Y',\n\t\t\t'Z', 'Z', 'Z',\n\t\t\t't', 't',\n\t\t\t'u', 'u', 'u', 'u', 'u', 'u', 'u',\n\t\t\t'y', 'y',\n\t\t\t'z', 'z', 'z',\n\t\t\t'A', 'B', 'B', 'r', 'A', 'E', 'E', 'X', '3', 'N', 'N', 'K', 'N', 'M', 'H', 'O', 'N', 'P',\n\t\t\t'a', 'b', 'b', 'r', 'a', 'e', 'e', 'x', '3', 'n', 'n', 'k', 'n', 'm', 'h', 'o', 'p',\n\t\t\t'C', 'T', 'Y', 'O', 'X', 'U', 'u', 'W', 'W', 'b', 'b', 'b', 'E', 'O', 'R',\n\t\t\t'c', 't', 'y', 'o', 'x', 'u', 'u', 'w', 'w', 'b', 'b', 'b', 'e', 'o', 'r'\n\t\t\t);\n\t\t$string = str_replace($accented, $replace, $string);\n\t\t$string = utf8_decode($string);\n\t\t\n\t\treturn $string;\n\t}", "public function encoding($str)\n {\n return mb_convert_encoding($str, \"GBK\", \"UTF-8\");\n }", "private static function detect_encoding($string)\n {\n $fallback = rcube::get_instance()->config->get('default_charset', 'ISO-8859-1'); // fallback to Latin-1\n\n return rcube_charset::detect($string, $fallback);\n }", "public function testConvertToUTF8nonUTF8(): void\n {\n $string = StringUtil::convertToUTF8(chr(0xBF));\n\n self::assertEquals(mb_convert_encoding(chr(0xBF), 'UTF-8', 'ISO-8859-1'), $string);\n }", "public static function hexToStr($string) {\n\n if (!self::hasHexPrefix($string)) {\n throw new \\Exception('String is missing Hex prefix \"0x\" : ' . $string);\n }\n $string = substr($string, strlen('0x'));\n $utf8 = '';\n\n\n $letters = str_split($string, 2);\n foreach ($letters as $letter) {\n $utf8 .= html_entity_decode(\"&#x$letter;\", ENT_QUOTES, 'UTF-8');\n }\n return $utf8;\n\n // Dosn't tackle Line 18\n // if ($string < 128) {\n // $utf = chr($string);\n // }\n // elseif ($string < 2048) {\n // $utf = chr(192 + (($string - ($string % 64)) / 64));\n // $utf .= chr(128 + ($string % 64));\n // }\n // else {\n // $utf = chr(224 + (($string - ($string % 4096)) / 4096));\n // $utf .= chr(128 + ((($string % 4096) - ($string % 64)) / 64));\n // $utf .= chr(128 + ($string % 64));\n //}\n\n // Can't handle Ö\n // $utf8 = hex2bin($string);\n\n // Can't handle Ö\n //$func_length = strlen($string);\n //for ($func_index = 0; $func_index < $func_length; ++$func_index) {\n // $utf8 .= chr(hexdec($string{$func_index} . $string{++$func_index}));\n //}\n\n // Destroys umlauts\n // for ($i=0; $i < strlen($string)-1; $i+=2){\n // $utf8 .= chr(hexdec($string[$i].$string[$i+1]));\n // }\n }", "private function resolveInputEncoding($string)\n {\n $encoding = null;\n\n if ($this->detect) {\n $encoding = mb_detect_encoding($string, null, true);\n }\n\n // Fall back to the internal encoding\n if (false === $encoding || null === $encoding) {\n $encoding = mb_internal_encoding();\n }\n\n if (false === $encoding || null === $encoding) {\n throw EncodingDetectionException::forString($string);\n }\n\n return $encoding;\n }", "function lang_encode_from_utf($strValue)\r\n{\r\n\tif(function_exists(\"iconv\"))\r\n\t\treturn iconv('UTF-8','Windows-1252',$strValue);\r\n\treturn $strValue;\r\n}", "protected function _encode($str = '') {\n\t\treturn iconv(\"UTF-8\",\"WINDOWS-1257\", html_entity_decode($str, ENT_COMPAT, 'utf-8'));\n//\t\treturn $str;\n\t}", "public static function utf16_to_utf8($str)\n {\n $len = strlen($str);\n $dec = '';\n\n for ($i = 0; $i < $len; $i += 2) {\n $c = ord($str[$i]) << 8 | ord($str[$i + 1]);\n if ($c >= 0x0001 && $c <= 0x007F) {\n $dec .= chr($c);\n }\n else if ($c > 0x07FF) {\n $dec .= chr(0xE0 | (($c >> 12) & 0x0F));\n $dec .= chr(0x80 | (($c >> 6) & 0x3F));\n $dec .= chr(0x80 | (($c >> 0) & 0x3F));\n }\n else {\n $dec .= chr(0xC0 | (($c >> 6) & 0x1F));\n $dec .= chr(0x80 | (($c >> 0) & 0x3F));\n }\n }\n\n return $dec;\n }", "public function convertEncoding( $string, $string_char_set, $destination_char_set='UTF-8' )\n\t{\n\t\t$string_char_set = strtolower($string_char_set);\n\t\t$t = $string;\n\t\t\n\t\tif ( is_numeric( $t ) )\n\t\t{\n\t\t\treturn $t;\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Did we pass a destination?\n\t\t//-----------------------------------------\n\t\t\n\t\t$destination_char_set = strtolower($destination_char_set);\n\t\t\n\t\t//-----------------------------------------\n\t\t// Not the same?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $destination_char_set == $string_char_set )\n\t\t{\n\t\t\treturn $string;\n\t\t}\n\t\t\n\t\tif( !$string_char_set )\n\t\t{\n\t\t\treturn $string;\n\t\t}\n\t\t\n\t\tif( !$t OR $t == '' )\n\t\t{\n\t\t\treturn $string;\n\t\t}\t\t\n\t\t\n\t\t//-----------------------------------------\n\t\t// Do the convert - internally..\n\t\t//-----------------------------------------\n\t\t\n\t\t$method\t= \"convertUsing_\" . $this->method;\n\t\t$text\t= $this->$method( $string, $string_char_set, $destination_char_set );\n\n\t\treturn $text ? $text : $t;\n\t}", "function encoding_8859_to_win1250($string) {\n $string = strtr($string, \n \"\\xA1\\xA6\\xAC\\xB1\\xB6\\xBC\",\n \"\\xA5\\x8C\\x8F\\xB9\\x9C\\x9F\"\n );\n return $string;\n }", "function str_conv($str)\n{\n\t$str = addslashes ($str);\n\treturn $str;\n}", "private function detect_encoding( $str ) {\r\n }", "protected function encode ($str = '') {\n\t\treturn $this->encodingConversion\n\t\t\t? iconv($this->systemEncoding, $this->responseEncoding, $str)\n\t\t\t: $str;\n\t}", "function convFromOutputCharset($str,$pagecodeto='UTF-8')\n\t{\n\t\tglobal $conf;\n\t\tif ($pagecodeto == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_decode($str);\n\t\tif ($pagecodeto == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_encode($str);\n\t\treturn $str;\n\t}", "private function _setUTFEncode($sStr)\n {\n return (mb_detect_encoding($sStr, 'UTF-8', true) === false) ? utf8_encode($sStr) : $sStr;\n }", "public static function fixPolishEncoding($string) {\n $string = trim(json_encode($string), '\"');\n $string = str_replace(array_keys(static::$_polishEncodingMap), static::$_polishEncodingMap, $string);\n return $string;\n }", "static public function utf8Encode($string, $len = 0) {\n $_unicode = '';\n $_values = array();\n $_nOctets = 1;\n $_unicodeLength = 0;\n $stringLength = strlen($string);\n\n for ($i = 0; $i < $stringLength; $i++) {\n $value = ord($string[$i]);\n\n if ($value < 128) {\n if ($len && ($_unicodeLength >= $len)) {\n break;\n }\n\n $_unicode .= chr($value);\n $_unicodeLength++;\n } else {\n if (count($_values) == 0) {\n $_nOctets = ($value < 224) ? 2 : 3;\n }\n\n $_values[] = $value;\n\n if ($len && ($_unicodeLength + ($_nOctets * 3)) > $len) {\n break;\n }\n\n if (count($_values) == $_nOctets) {\n if ($_nOctets == 3) {\n $_unicode .= '%' . dechex($_values[0]) . '%' . dechex($_values[1]) . '%' . dechex($_values[2]);\n $_unicodeLength += 9;\n } else {\n $_unicode .= '%' . dechex($_values[0]) . '%' . dechex($_values[1]);\n $_unicodeLength += 6;\n }\n\n $_values = array();\n $_nOctets = 1;\n }\n }\n }\n\n return $_unicode;\n }", "public static function convertEncoding($char) {\n return str::convert($char, 'UTF-16BE', 'UTF-8');\n }", "public static function mbConvertTo($string, $encodingTo = 'utf-8')\n {\n if (! extension_loaded('mbstring')) {\n return $string;\n }\n // try to fix bad encodings\n $encoding = mb_detect_encoding($string, array('utf-8', 'iso-8859-1', 'windows-1252', 'iso-8859-15'));\n if ($encoding !== FALSE) {\n $string = @mb_convert_encoding($string, $encodingTo, $encoding);\n }\n \n return $string;\n }", "function isUtf8($string) {\n if (function_exists(\"mb_check_encoding\") && is_callable(\"mb_check_encoding\")) {\n return mb_check_encoding($string, 'UTF8');\n }\n\n return preg_match('%^(?:\n [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\n | [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n )*$%xs', $string);\n\n }", "function encoding_win1250_to_8859($string) {\n $string = strtr($string,\n \"\\xA5\\x8C\\x8F\\xB9\\x9C\\x9F\",\n \"\\xA1\\xA6\\xAC\\xB1\\xB6\\xBC\"\n );\n return $string;\n }", "function _encode($text)\r\n\t{\r\n\t\t$source_encoding = mb_detect_encoding($text);\r\n\t\t$target_encoding = _get_codeset();\r\n\t\tif ($source_encoding != $target_encoding) {\r\n\t\t\treturn mb_convert_encoding($text, $target_encoding, $source_encoding);\r\n\t\t} else {\r\n\t\t\treturn $text;\r\n\t\t}\r\n\t}", "function utf8_clean($str)\n{\n return iconv('UTF-8', 'UTF-8//IGNORE', $str);\n}", "function atk_iconv($in_charset, $out_charset, $str)\n{\n\treturn atkString::iconv($in_charset,$out_charset,$str);\n}", "public function escape($string) {\n\t\treturn $this->_utf8ToHex($string);\n\t}", "private function convToOutputCharset($str,$pagecodefrom='UTF-8')\n\t{\n\t\tglobal $conf;\n\t\tif ($pagecodefrom == 'ISO-8859-1' && $conf->file->character_set_client == 'UTF-8') $str=utf8_encode($str);\n\t\tif ($pagecodefrom == 'UTF-8' && $conf->file->character_set_client == 'ISO-8859-1') $str=utf8_decode($str);\n\t\treturn $str;\n\t}", "public function remove_bad_utf8($str)\n {\n $str = str_replace('“', '&quot;', $str);\n $str = str_replace('”', '&quot;', $str);\n $str = str_replace('‘', '&#39;', $str);\n $str = str_replace('’', '&#39;', $str);\n $str = str_replace('&#8220;', '&quot;', $str);\n $str = str_replace('&#8221;', '&quot;', $str);\n \n /// convertimos a utf8\n ini_set('mbstring.substitute_character', \"none\");\n return mb_convert_encoding($str, 'UTF-8', 'auto');\n }", "function utf8_sanitize($str, &$errors = null) {\n if ($errors !== null) {\n $errors = array();\n }\n $utf8 = '';\n $bytesNeeded = 0;\n $bytesSeen = 0;\n $lowerBoundary = 0x80;\n $upperBoundary = 0xBF;\n $char = '';\n for ($pos = 0, $length = strlen($str); $pos < $length; $pos++) {\n $byte = ord($str[$pos]);\n if ($bytesNeeded == 0) {\n if ($byte >= 0x00 and $byte <= 0x7F) {\n $utf8 .= $str[$pos];\n } elseif ($byte >= 0xC2 and $byte <= 0xDF) {\n $bytesNeeded = 1;\n } elseif ($byte >= 0xE0 and $byte <= 0xEF) {\n if ($byte == 0xE0) {\n $lowerBoundary = 0xA0;\n }\n if ($byte == 0xED) {\n $upperBoundary = 0x9F;\n }\n $bytesNeeded = 2;\n } elseif ($byte >= 0xF0 and $byte <= 0xF4) {\n if ($byte == 0xF0) {\n $lowerBoundary = 0x90;\n }\n if ($byte == 0xF4) {\n $upperBoundary = 0x8F;\n }\n $bytesNeeded = 3;\n } else {\n $utf8 .= UTF8_REPLACEMENT_CHARACTER;\n if ($errors !== null) $errors[] = $pos;\n }\n $char = $str[$pos];\n } elseif ($byte < $lowerBoundary or $byte > $upperBoundary) {\n $char = '';\n $bytesNeeded = 0;\n $bytesSeen = 0;\n $lowerBoundary = 0x80;\n $upperBoundary = 0xBF;\n $utf8 .= UTF8_REPLACEMENT_CHARACTER;\n if ($errors !== null) $errors[] = $pos;\n $pos--;\n } else {\n $lowerBoundary = 0x80;\n $upperBoundary = 0xBF;\n $bytesSeen++;\n $char .= $str[$pos];\n if ($bytesSeen == $bytesNeeded) {\n $utf8 .= $char;\n $char = '';\n $bytesNeeded = 0;\n $bytesSeen = 0;\n }\n }\n }\n if ($bytesNeeded > 0) {\n $utf8 .= UTF8_REPLACEMENT_CHARACTER;\n if ($errors !== null) $errors[] = $length;\n }\n return $utf8;\n}", "public function convert($string, $charset) {\r\n return iconv($charset, $this->charset . '//TRANSLIT', $string);\r\n }", "function url_encode($string){\n return urlencode(utf8_encode($string));\n }", "public static function normalize($string): string {\n $old_locale = setlocale(LC_CTYPE, 0);\n setlocale(LC_CTYPE, 'en_US.utf8');\n $normalized = preg_replace('/\\s+/', ' ', trim($string ?? ''));\n $normalized = iconv('UTF-8', 'ASCII//TRANSLIT', $normalized);\n setlocale(LC_CTYPE, $old_locale);\n return $normalized;\n }", "public function testUtf8(): void\n {\n $value = mb_convert_encoding(\"\\xa0a\\xa0\", 'UTF-8', 'ISO-8859-1');\n self::assertSame('a', $this->filter->filter($value));\n }", "function rc_utf8_clean($input)\n{\n // handle input of type array\n if (is_array($input)) {\n foreach ($input as $idx => $val)\n $input[$idx] = rc_utf8_clean($val);\n return $input;\n }\n \n if (!is_string($input) || $input == '')\n return $input;\n\n // iconv/mbstring are much faster (especially with long strings)\n if (function_exists('mb_convert_encoding') && ($res = mb_convert_encoding($input, 'UTF-8', 'UTF-8')) !== false)\n return $res;\n\n if (function_exists('iconv') && ($res = @iconv('UTF-8', 'UTF-8//IGNORE', $input)) !== false)\n return $res;\n\n $regexp = '/^('.\n// '[\\x00-\\x7F]'. // UTF8-1\n '|[\\xC2-\\xDF][\\x80-\\xBF]'. // UTF8-2\n '|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|[\\xE1-\\xEC][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|\\xED[\\x80-\\x9F][\\x80-\\xBF]'. // UTF8-3\n '|[\\xEE-\\xEF][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-3\n '|\\xF0[\\x90-\\xBF][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-4\n '|[\\xF1-\\xF3][\\x80-\\xBF][\\x80-\\xBF][\\x80-\\xBF]'.// UTF8-4\n '|\\xF4[\\x80-\\x8F][\\x80-\\xBF][\\x80-\\xBF]'. // UTF8-4\n ')$/';\n \n $seq = '';\n $out = '';\n\n for ($i = 0, $len = strlen($input); $i < $len; $i++) {\n $chr = $input[$i];\n $ord = ord($chr);\n // 1-byte character\n if ($ord <= 0x7F) {\n if ($seq)\n $out .= preg_match($regexp, $seq) ? $seq : '';\n $seq = '';\n $out .= $chr;\n // first (or second) byte of multibyte sequence\n } else if ($ord >= 0xC0) {\n if (strlen($seq)>1) {\n\t$out .= preg_match($regexp, $seq) ? $seq : '';\n $seq = '';\n } else if ($seq && ord($seq) < 0xC0) {\n $seq = '';\n }\n $seq .= $chr;\n // next byte of multibyte sequence\n } else if ($seq) {\n $seq .= $chr;\n }\n }\n\n if ($seq)\n $out .= preg_match($regexp, $seq) ? $seq : '';\n\n return $out;\n}", "function _utf8_decode($string){\n\t$tmp = $string;\n\t$count = 0;\n\twhile (mb_detect_encoding($tmp)==\"UTF-8\"){\n \t$tmp = utf8_decode($tmp);\n \t$count++;\n \t}\n\tfor ($i = 0; $i < $count-1 ; $i++){\n\t $string = utf8_decode($string);\n\t}\n\treturn $string;\n}", "function isUtf8($string) {\n\tif (function_exists(\"mb_check_encoding\") && is_callable(\"mb_check_encoding\")) {\n\t\treturn mb_check_encoding($string, 'UTF8');\n\t}\n\treturn preg_match('%^(?:\n\t\t [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\n\t\t| [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n\t\t| \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n\t\t| [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n\t\t| \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n\t\t| \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n\t\t| [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n\t\t| \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n\t)*$%xs', $string);\n}", "function is_utf8($string) {\n\t// From http://w3.org/International/questions/qa-forms-utf-8.html\n\treturn preg_match('%^(?:\n\t\t[\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\n\t\t| [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n\t\t| \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n\t\t| [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n\t\t| \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n\t\t| \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n\t\t| [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n\t\t| \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n\t)*$%xs', $string);\n}" ]
[ "0.8146631", "0.80081826", "0.79574114", "0.79016495", "0.7899158", "0.780542", "0.7780386", "0.753577", "0.7434597", "0.7398449", "0.73904634", "0.73522455", "0.7295353", "0.7293232", "0.71783525", "0.7096265", "0.70929974", "0.70885664", "0.7074014", "0.70462614", "0.70314413", "0.70197976", "0.7016215", "0.700972", "0.6934039", "0.6924852", "0.6905829", "0.6860643", "0.68207985", "0.68043226", "0.6752762", "0.6734509", "0.672964", "0.67262113", "0.66922677", "0.66722816", "0.66220826", "0.66086006", "0.6607355", "0.65949845", "0.6525743", "0.6514592", "0.6508284", "0.64856946", "0.64508545", "0.6447148", "0.64288604", "0.6421696", "0.6414539", "0.6414117", "0.64043343", "0.63886636", "0.63770324", "0.6345844", "0.6329668", "0.63168037", "0.6302943", "0.62766904", "0.62576336", "0.6247197", "0.62365735", "0.6225424", "0.6196055", "0.6182048", "0.6156622", "0.6154169", "0.6147606", "0.6137088", "0.61316025", "0.61281914", "0.612452", "0.6103172", "0.6096214", "0.60369915", "0.60336196", "0.60291636", "0.6024701", "0.6018461", "0.6007093", "0.60052824", "0.5990793", "0.5985949", "0.5977779", "0.59660316", "0.59633064", "0.5951239", "0.59486604", "0.5946301", "0.5946203", "0.593951", "0.5939272", "0.59331226", "0.5913752", "0.5911996", "0.58993775", "0.58864385", "0.5884096", "0.5871019", "0.5867131", "0.58660346" ]
0.7721233
7
Testing Can CRUD //
public function test_canCreate_Returns_True_If_Personnel_Have_Access() { $check_returns_true = $this->authorization_service3->canCreate(1,1); $this->assertTrue($check_returns_true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAccess()\n {\n Backend::set($this->k_business);\n $o_edit_controller = new EditController();\n $o_edit_controller->checkGet();\n }", "public function testEditUser()\n {\n }", "public function testEditUser()\n {\n\n }", "public function test_todo()\n {\n $login=User::factory()->create();\n $this->actingAs($login);\n $task=Task::factory()->create();\n $this->assertDatabaseHas('Tasks',['description'=>$task->description,'user_id'=>$task->user_id]);\n \n }", "public function test_getById() {\n\n }", "public function testGetReplenishmentById()\n {\n }", "public function test_can_model(){\n $this->assertEquals(Category::class, $this->repository->model());\n }", "public function testShowingAdmin(){\n }", "public function testRead()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('GET', static::ROUTE . '/' . $model->id)\n ->seeStatusCode(JsonResponse::HTTP_OK) \n ->seeJson($model->toArray());\n }", "public function testQuarantineFindById()\n {\n\n }", "public function test_create_item() {}", "public function test_create_item() {}", "public function testUserCanCreated()\n {\n $user = factory(App\\UserMongo::create([\n \t'first_name' => 'agus',\n \t'last_name' => 'yusida',\n \t'email' => 'agusyusida@gmail.com',\n \t]));\n \t$this->seeInDatabase('users',[\n \t\t'first_name' => 'agus',\n \t'last_name' => 'yusida',\n \t'email' => 'agusyusida@gmail.com',\n \t\t]);\n }", "public function test_admin_data_admin()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Account', 'index']);\n $this->assertResponseCode(404);\n }", "public function testBackend()\n {\n $o_edit_controller = new EditController();\n $o_edit_controller->checkGet();\n }", "public function testORM()\r\n {\r\n\r\n }", "public function testGetBasic()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=rocket_orm', 'orm_username', 'orm_password');\r\n\t\t\t\r\n\t\t\t$user = User::load(1);\r\n\t\t\t\r\n\t\t\t$this->assertEquals($user->get('user_id'), '1');\r\n\t\t}", "public function testIntegrationEdit()\n {\n $userFaker = factory(Model::class)->create();\n $this->visit('user/' . $userFaker->slug . '/edit')\n ->see('Edit Account');\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'username' => $userFaker->username,\n 'email' => $userFaker->email\n ]);\n $this->assertViewHas('model');\n }", "public function testAllowEditing()\n {\n $this->assertFalse(LogEntry::create()->canEdit());\n }", "public function testCreateAction()\n {\n $res = $this->controller->createAction();\n $this->assertContains(\"Create\", $res->getBody());\n }", "public function testQuarantineFindOne()\n {\n\n }", "function user_can_added_to_DB_and_name_check() {\n $user = factory(User::class)->create();\n\n $this->assertEquals( !0, User::all()->count() );\n $this->seeInDatabase('users', ['name' => $user->name]);\n }", "public function test_create()\n\t{\n\t\tlist($id, $affected) = $this->model->create(array(\n\t\t\t'user_id' => '1',\n\t\t\t'role_id' => '1'\n\t\t));\n\n\t\t$this->assertSame(0, $id); // No primary key...\n\t\t$this->assertSame(1, $affected);\n\t}", "public function testQuarantineCreate()\n {\n\n }", "public function testEditTemplate()\n {\n\n }", "public function testAccessAdminCreatePage()\n {\n $user = factory(User::class)->create();\n $response = $this->actingAs($user)\n ->get(route('admin.project.create'));\n\n $response->assertSuccessful();\n\n }", "public function testUsersCanCreateAulas()\n {\n $response = $this->json('GET', 'aulas.index');\n $response\n ->assertStatus(201)\n ->assertExactJson([\n 'created' => true,\n ]);\n }", "public function testRutaCrear(){\n $response = $this->call('GET', 'administracion/usuarios/crear');\n $this->assertEquals(200, $response->status());\n }", "public function test_auth()\n\t{\n\t\t//$role = Role::create(['name' => 'user']);\n\t\t//$permission = Permission::create(['guard_name' => 'web', 'name' => 'edit_post']);\n\t\t//auth()->user()->givePermissionTo(\"edit.post\");\n\t\t//auth()->user()->assignRole(\"user\");\n\t\t//$role = Role::find(['name' => 'user'])->first;\n\t\t//$role->givePermissionTo('edit.post');\n\t\t\n\t\t\n\t\treturn \"test_auth\";\n\t}", "function testEditAction() {\n $authorInfoController = new AuthorinfoControllerForTest($this->request,$this->response);\n // guest not allowed to create/edit user object\n $this->test_user->role = \"guest\";\n $this->setUpGet(array('etd' => 'etd:1'));\n $this->assertFalse($authorInfoController->editAction()); // no pid = create new record\n // edit (still guest - not allowed)\n $this->setUpGet(array('pid' => 'bogus:1', 'etd' => 'etd:1'));\n $this->assertFalse($authorInfoController->editAction()); // edit existing record\n\n // allow to create new record \n $this->test_user->role = \"student with submission\";\n $this->resetGet();\n $this->setUpGet(array('etd' => 'etd:1'));\n $authorInfoController->editAction(); // no pid = create new record\n $view = $authorInfoController->view;\n $this->assertTrue(isset($view->title));\n $this->assertIsA($view->authorInfo, \"authorInfo\");\n // user should be a new, blank object\n $this->assertEqual(\"\", $view->authorInfo->label);\n $this->assertEqual(\"\", $view->authorInfo->pid);\n\n // allow to edit record\n $this->test_user->role = \"author\";\n $this->setUpGet(array('pid' => 'bogus:1', 'etd' => 'etd:1'));\n $authorInfoController->editAction(); // edit existing record\n $view = $authorInfoController->view;\n // pre-existing record\n $this->assertEqual(\"testuser:1\", $view->authorInfo->pid);\n }", "public function testAccessAdminEditPage()\n {\n $user = factory(User::class)->create();\n $project = factory(Project::class)->create();\n $response = $this->actingAs($user)\n ->get(route('admin.project.edit', [$project]));\n\n $response->assertSuccessful();\n\n }", "public function test_index_de_formulario() //VIEW CREATE FORMULARIO\n { \n $this ->withoutexceptionhandling();\n $this->get('/formulario')\n ->assertStatus(200)\n ->assertSee('registro nuevo');\n }", "public function testIndex()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('GET', static::ROUTE)\n ->seeStatusCode(JsonResponse::HTTP_OK);\n }", "public function user_can_gun()\n { \n $this->withoutExceptionHandling();\n $response = $this->post('/index',[\n 'name' => 'insert gun name',\n 'size' => '1',\n 'type' => 'insert gun tyjpe',\n 'price' => '1'\n ]);\n\n $gun = Gun::first();\n $response -> assertStatus(200);\n $This -> assertDatabaseHas ('index',[\n 'name' => $gun->name,\n 'size' => $gun->size,\n 'type' => $gun->type,\n 'price' => $gun->price,\n ]);\n\n }", "public function testEdit()\n {\n $response = $this->action('GET', '\\Modules\\Admin\\Http\\Controllers\\FaqCategoryController@edit', ['id' => '1']);\n $this->assertResponseStatus(200, $response->status());\n $this->assertInstanceOf('Illuminate\\Http\\JsonResponse', $response);\n }", "public function testUserListForAdmin()\n {\n $user = User::factory()->create();\n\n $response = $this->actingAs($user, 'api')\n ->getJson('/api/user');\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'data' => true,\n ]);\n }", "public function testGet()\n {\n $this->testAdd();\n }", "public function testResponse()\n {\n $this->post('Users',[\n 'id'=>'2',\n 'name'=>'tomal',\n 'email'=>'sazzad@gmail.com',\n\n ]);\n\n $this->assertDatabaseHas('users',['email'=>\"sazzad@gmail.com\"]);\n }", "public function testifReturnIsAdmin()\n { \n $admin=Database::findAdmin($this->db->getPdo(),\"bill\",\"gate\");\n $this->assertInstanceOf(Administrateur::class,$admin);\n }", "public function testDelete()\n {\n }", "public function test_getItemCategoryById() {\n\n }", "public function testCreate()\n {\n $model = $this->makeFactory();\n \n $this->json('POST', static::ROUTE, $model->toArray(), [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_CREATED) \n ->seeJson($model->toArray());\n }", "public function testCanViewABlogPost(){\n $this->withoutExceptionHandling();\n\n //1- Arrangement\n //create a blog post\n $post = Post::create([\n 'title' => 'A simple title',\n 'body' => 'A simply body'\n ]);\n\n //2- Action\n //visiting a route\n $resp = $this->get(\"/posts/{$post->id}\");\n\n //3- Assertion\n //assert status code 200 << means route and view working good\n $resp->assertStatus(200);\n\n //assert that we see post title\n $resp->assertSee($post->title);\n\n //assert that we see post body\n $resp->assertSee($post->body);\n\n //assert that we see post published date\n //.. toFormattedDateString() only needed in the older version of laravel\n //.. but i will still use it cuz it helps understanding unit test later:\n $resp->assertSee($post->created_at->toFormattedDateString());\n }", "public function testAddAnonymus()\n {\n \t$user = factory(User::class)->create()''\n \t$response = $this->get('add');\n \t$response->assertStatus(200);\n \n }", "public function testBasicTest()\n {\n $user=factory(\\App\\User::class)->create([\n 'name'=>'Duilio Palacios',\n ]);\n\n $this->actingAs($user,'api')\n ->visit('api/user')\n ->see('Duilio Palacios');\n }", "public function test_if_users_list_loads_with_data()\n {\n factory(User::class)->create([\n 'name'=>'Joel' \n ]);\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Joel'); \n }", "public function testAllowCreate()\n {\n $createFalse = LogEntry::create()->canCreate(null);\n $this->assertFalse($createFalse);\n $this->logInWithPermission('ADMIN');\n $createFalse = LogEntry::create()->canCreate();\n $this->assertFalse($createFalse);\n }", "public function testSeeCreateCateogryTest()\n {\n $response = $this->actingAs(\\App\\User::firstOrFail())->get('/categories/create');\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "function test_basic_example()\n {\n $user = factory(App\\Entities\\User::class)->create([\n 'name' => 'Valentin Plechuc',\n ]);\n\n $this->actingAs($user, 'api');\n\n $this->visit('/api/user')\n ->see('Valentin Plechuc');\n\n }", "public function testApiIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/api/comptes');\n\n $response->assertStatus(200)\n ->assertJson([\n\n 'comptes' => true,\n \n ]);\n }", "public function testSeeEditCateogryTest()\n {\n $category = \\App\\Category::firstOrFail();\n $response = $this->actingAs(\\App\\User::firstOrFail())->get('/categories/'.$category->slug.'/edit');\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function testInsertUser()\n {\n // Validate the request...\n\n $record = factory(\\App\\User::class)->make();\n\n\n $this->assertTrue($record->save());\n\n }", "public function test_example()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->post('/institution');\n $response->assertStatus(500);\n\n\n $response = $this->actingAs($user)->post('/bookings/getAvailable');\n $response->assertStatus(500);\n\n $response = $this->actingAs($user)->post('/bookings/createBooking');\n $response->assertStatus(500);\n\n $response = $this->actingAs($user)->post('/trackAndTrace');\n $response->assertStatus(500);\n\n $response = $this->actingAs($user)->post('/rooms/editseats');\n $response->assertStatus(302);\n\n $response = $this->actingAs($user)->post('/institution/create');\n $response->assertStatus(302);\n\n $response = $this->actingAs($user)->post('rooms/edit');\n $response->assertStatus(302);\n }", "public function testQuarantineDeleteById()\n {\n\n }", "public function testExample()\n {\n \t$response = $this->json('POST', '/users', ['name' => 'Sally']);\n $response\n ->assertStatus(200)\n ->assertJson([\n 'created' => true,\n ]);\n }", "public function testEdit()\n {\n $client = $this->createAuthorizedClient();\n $crawler = $client->request('GET', '/persona/1/edit');\n $form = $crawler->selectButton('Update')->form();\n $form['persona[Apellidos]'] = 'Testy';\n $crawler = $client->submit($form);\n $this->assertTrue($client->getResponse()->isRedirect());\n $crawler = $client->followRedirect();\n\n //edit teniendo en cuenta los datos de una persona\n $persona = self::$kernel->getContainer()->get('doctrine')->getRepository('App\\Entity\\Persona')->findOneBy(array(\n 'Nombre' => 'Celia',\n 'Apellidos' => 'Cruz',\n 'Cargo' => 'Boss',\n 'Correo' => 'celiaDead@gmail.com',\n 'Telefono' => '123456789',\n 'Local_id' => '1',\n 'Departamento' => '1',\n ));\n\n $personaID = $persona->getNumero_Empleado();\n $this->assertNotNull($personaID);\t//El cliente está insertado\n\n $crawler = $client->request('GET', '/persona/'.$personaID.'/edit');\n $form = $crawler->selectButton('Update')->form();\n $form['persona[Nombre]'] = 'Celia';\n $form['persona[Apellidos]'] = 'Cruz';\n $form['persona[Cargo]'] = 'Boss';\n $form['persona[Correo]'] = 'celiaDead@gmail.com';\n $form['persona[Telefono]'] = '123456665';\n $form['persona[Local_id]'] = '1';\n $form['persona[Departamento]'] = '1';\n\n $crawler = $client->submit($form);\n\n //verificacion de que se hayan cambiado los datos\n $personaVerificacion = self::$kernel->getContainer()->get('doctrine')->getRepository('App\\Entity\\Persona')->findOneBy(array(\n 'Nombre' => 'Celia',\n 'Apellidos' => 'Cruz',\n 'Cargo' => 'Boss',\n 'Correo' => 'celiaDead@gmail.com',\n 'Telefono' => '123456665',\n 'Local_id' => '1',\n 'Departamento' => '1',\n ));\n $this->assertNotNull($personaVerificacion);\n\n //persona que no existe\n $crawler = $client->request('GET', '/clientes/1246548788/edit');\n //no encuentra el archivo porque no existe\n $this->assertEquals(404, $client->getResponse()->getStatusCode()\n );\n }", "public function test_show()\n {\n $this->makeUser();\n\n $response = $this->get('/api/admin/tag/99');\n $response->assertStatus(404);\n\n // 创建一条tag记录\n Tag::insert([\n 'id' => 99,\n 'name' => 'tag2',\n 'parent_id' => 0,\n 'user_id' => $this->user->id,\n 'created_at' => time(),\n 'updated_at' => time()\n ]);\n\n $response = $this->get('/api/admin/tag/99');\n\n $response->assertStatus(200)\n ->assertJson([\n 'data' => [\n 'id' => 99\n ]\n ]);\n }", "function test_save()\n {\n\n //Arrange\n $id = null;\n $description = \"Wash the dog\";\n $test_task = new Task($description, $id);\n\n //Act\n $test_task->save();\n\n //Assert\n $result = Task::getAll();\n $this->assertEquals($test_task, $result[0]);\n\n }", "public function testEndPoint()\n {\n\n $user = Auth::loginUsingId(1);\n\n// $response = $this->actingAs($user)\n// ->get('dashboard/orders/create');\n $response = $this->get('dashboard/orders/create');\n\n $response->assertStatus(200);\n }", "public function testAllPermissions()\n {\n }", "public function testGetAuthorizationPermissions()\n {\n }", "public function testEditAuthenticated()\n {\n // cria um usuário\n $user = factory(User::class)->create([\n 'password' => bcrypt('123456'),\n ]);\n\n // cria um contato\n $contact = factory(Contact::class)->make();\n\n // salva um contato para o usuário\n $user->contacts()->save($contact);\n\n // tenta fazer o login\n $response = $this->post('/api/auth/login', [\n 'email' => $user->email,\n 'password' => '123456'\n ]);\n\n // verifica se foi gerado o token\n $response->assertJson([\n \"status\" => \"success\",\n ]);\n\n // pega token de resposta\n $token = $response->headers->get('Authorization');\n\n // tenta salvar o um contato\n $response = $this->withHeaders([\n 'Authorization' => \"Bearer $token\",\n ])->put('/api/v1/contacts/' . $contact->id, [\n 'id' => $contact->id,\n 'name' => 'Testando contatos',\n 'email' => $contact->email,\n 'telephone' => 123456789,\n ]);\n\n $response->assertStatus(200);\n }", "public function testExample()\n {\n $car = \\App\\Car::find(32);\n $delete= $car->delete();\n $this->assertTrue($delete);\n\n }", "public function testProfileFindById()\n {\n\n }", "public function testBaseUserACL() :void\n {\n $generator = Factory::create();\n\n $data = [\n \"params\" => [\n \"name\" => $generator->name\n ],\n \"options\" => [\n \"simplifiedParams\" => true\n ]\n ];\n\n /** Login with right password **/\n $response = $this->json('POST', '/auth/authenticate', ['email' => env('BASE_USER_EMAIL'), 'password' => env('BASE_USER_PASSWORD')]);\n $tokenResult = $response->decodeResponseJson();\n $response->assertResponseStatus(200);\n\n /** Free port acl **/\n $response = $this->json('GET', '/auth/me', [], ['HTTP_AUTHORIZATION'=>'Bearer ' . $tokenResult['token']]);\n $result = $response->decodeResponseJson();\n $this->assertEquals($result['email'], env('BASE_USER_EMAIL'));\n\n /** Posting artist as a admin **/\n $response = $this->json('POST', '/contexts/admin/artists', $data, ['HTTP_AUTHORIZATION'=>'Bearer ' . $tokenResult['token']]);\n $result = $response->decodeResponseJson();\n $response->assertResponseStatus(201);\n /** This means the records is to be inserted and admin has access **/\n //$this->assertEquals($result['message'], 'Transaction commit failed because the transaction has been marked for rollback only.');\n }", "public function testRole()\n {\n }", "public function testProfileCreate()\n {\n\n }", "public function testSeeCreatePostTest()\n {\n $response = $this->actingAs(\\App\\User::firstOrFail())->get('/posts/create');\n\n $response->assertStatus(200);\n $response->assertSeeText(config('app.name'));\n }", "public function testRentalInsertFormFrontEnd()\n {\n $this->authentication();\n $this->visit(route('rental.frontend.insert'));\n $this->seeStatusCode(200);\n $this->see('Verhuur aanvraag.');\n }", "public function testExample(){\n //create admin account\n $admin = factory(User::class)->create([\n 'id' => 999,\n 'name' => \"Sue\",\n 'email' => 'Sue@gmail.com',\n 'password' => Hash::make(\"secret\"),\n 'role' => 'admin'\n ]);\n\n //login with the admin account\n $login = $this->call('POST', 'api/auth/login',\n [\n 'email' => 'Sue@gmail.com',\n 'password' => 'secret',\n ]\n );\n $login->assertStatus(200);\n\n\n // return 'location not found' message if the location id doesn't exits in the database\n $response = $this->call('GET', 'api/locations/1');\n $response->assertStatus(404);\n\n\n // insert location details into database\n factory(Location::class)->create([\n 'id' => 1,\n 'address' => \"78-56 Victoria St, Carlton VIC 3053\",\n 'latitude' => -37.806717,\n 'longitude' => 144.965405,\n 'slot' => 5,\n 'current_car_num' => 2\n ]);\n\n\n // See location details\n $response = $this->call('GET', 'api/locations/1',\n $this->transformHeadersToServerVars([ 'Authorization' => $login->json(\"access_token\")])\n );\n $response->assertStatus(200);\n\n }", "public function testPostCreate()\n {\n $this->json('POST', '/api/post_create', ['title' => 'test1', 'description' => 'description1', 'login' => 'user1'])\n ->assertJson([\n 'post_id' => true\n ]);\n }", "public function testCreate()\n {\n\n $this->createDummyPermission(\"1\");\n $this->createDummyPermission(\"2\");\n\n $this->call('POST', '/api/role', array(\n 'action' => $this->createAction,\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc,\n 'permissionCount' => $this->testPermissionCount,\n 'permission0' => 1,\n 'permission1' => 2\n ));\n\n $this->assertDatabaseHas('roles', [\n 'id' => 1,\n 'name' => $this->testRoleName,\n 'description' => $this->testRoleDesc\n ]);\n\n $this->assertDatabaseHas('role_permission', [\n 'role_id' => 1,\n 'permission_id' => [1, 2]\n ]);\n }", "public function testExample()\n\t{\n\t\t$factory->define(App\\User::class, function (Faker\\Generator $faker)\n\t\t{\n\t\t// \treturn [\n\t\t// \t\t'email' => $faker->email,\n\t\t// \t\t'name' => ,\n\t\t// \t\t'gmail_token' => ,\n\t\t// \t\t'created_at' => ,\n\t\t// \t\t'track_email' => 'yes',\n\t\t// \t\t'timezone' => 'America/New_York',\n\t\t// \t\t'referer' => '',\n\n\t\t// \t\t'paid' => 'yes',\n\t\t// \t\t'belongs_to' => ,\n\n\t\t// \t\t//admin?\n\t\t// \t];\n\t\t// });\n\n\t\t// factory(App\\Customer::class, 5)->create();\n\t\t// factory(App\\Email::class, 5)->create();\n\t\t// factory(App\\Message::class, 5)->create();\n\t\t// factory(App\\User::class, 5)->create();\n\n\t\t//post tests\n\t\t// $this->call('POST', '/returnFields', ['name' => 'Taylor'])->assertResponseOk();\n\t\t// $this->call('POST', '/createTemplate', ['name' => 'Taylor'])->assertResponseOk();\n\t\t// $this->call('POST', '/makePreviews', ['name' => 'Taylor'])->assertResponseOk();\n\t\t// $this->call('POST', '/updatePreviews', ['name' => 'Taylor'])->assertResponseOk();\n\t\t// $this->call('POST', '/saveSettings', ['name' => 'Taylor'])->assertResponseOk();\n\t\t// $this->call('POST', '/upgrade', ['name' => 'Taylor'])->assertResponseOk();\n\t\t// $this->call('POST', '/createTeam', ['name' => 'Taylor'])->assertResponseOk();\n\t\t// $this->call('POST', '/useLicense', ['name' => 'Taylor'])->assertResponseOk();\n\t\t// $this->call('POST', '/saveTemplate', ['name' => 'Taylor'])->assertResponseOk();\n\t\t// $this->call('POST', '/copyTemplate', ['name' => 'Taylor'])->assertResponseOk();\n\t\t// $this->call('POST', '/sendFeedback', ['name' => 'Taylor'])->assertResponseOk();\n\t\t// $this->call('POST', '/revokeAccess', ['name' => 'Taylor'])->assertResponseOk();\n\t\t// $this->call('POST', '/updateSubscription/{direction}', ['name' => 'Taylor'])->assertResponseOk();\n\n\t\t//get tests\n\t\t// $this->visit('/archive/{id}')->assertResponseOk();\n\t\t// $this->visit('/dearchive/{id}')->assertResponseOk();\n\t\t// $this->visit('/hubify/{id}/{status}')->assertResponseOk();\n\t\t// $this->visit('/sendEmail/{email_id}/{message_id}')->assertResponseOk();\n\n\t}\n}", "public function testAddUser()\n {\n\n }", "public function testPutAuthorizationRoleUsersAdd()\n {\n }", "public function testIndex()\n {\n // $this->assertTrue(true);\n $response = $this->json('get','/api/todos');\n $this->seeJsonStructure($response, [\n '*' => [\n 'id', 'status', 'title', 'created_at', 'updated_at'\n ]\n ]);\n }", "public function test_admin_can_create_user()\n {\n // $this->withoutExceptionHandling();\n $this->actingAs($this->adminUser())\n ->post(route('users.store'), [\n 'name' => 'Faustino Vasquez'\n ])->assertRedirect('admin/users/faustino-vasquez/edit');\n }", "public function test_can_create_user() {\n\n $data = [\n 'name' => $this->faker->name,\n 'position' => $this->faker->randomElement(['Developer', 'FullStack', 'Manager']),\n 'department' => $this->faker->randomElement(['Backend', 'Frontend', 'Accounts', 'HR', 'Design']),\n 'active' => $this->faker->randomElement([1, 0]),\n ];\n\n $this->post(route('user.store'), $data)\n ->assertStatus(201)\n ->assertJson($data, false);\n }", "public function testAdminCreations() {\n $admins = Config::get('boilerplate.admins');\n foreach ($admins as $email => $pw) {\n $user = User::where('email', $email)->first();\n $this->assertNotNull($user);\n $this->assertTrue($user->isAdmin());\n }\n }", "public function testIntegrationCreate()\n {\n $this->visit('user/create')\n ->see('Create New Account');\n $this->assertResponseOk();\n $this->assertViewHas('model');\n }", "public function testControllerStoreBlog()\n {\n\n $first = factory(PostModel::class)->create(\n [\n 'title'=>'Post test 1 ',\n 'title'=>'firstPosttestContent'\n\n ]\n );\n $second = factory(PostModel::class)->Make( [\n 'title'=>'Post test 2',\n 'content'=>'SecontTestContent'\n\n ]);\n\n $this->blog = factory(PostModel::class)->Make( [\n 'title'=>'Post test 2',\n 'content'=>'SecontTestContent'\n\n ]);\n\n $response = $this->actingAs($this->blog->user)->json('POST','/blog',[\n\n 'title'=>'Post test 1 ',\n 'content'=>'firstPosttestContent'\n ]);\n\n $response->assertStatus(302);\n $response->assertRedirect('blog');\n\n }", "public function testIfIndexPageHasCreateButton()\n {\n $response = $this->get('/customers');\n\n $response->assertSeeText('Criar cliente');\n }", "public function test_user_can_create_post()\n {\n $this->signIn();\n $attributes = [\n 'title' => 'my title',\n 'description' => 'my description',\n 'notes' => 'my notes'\n ];\n\n $response = $this->post('/api/projects', $attributes)->assertStatus(201);\n\n $response->assertJson([\n 'data' => [\n 'type' => 'projects',\n 'attributes' => [\n 'title' => $attributes['title'],\n 'notes' => $attributes['notes'],\n 'description' => $attributes['description'],\n 'user_id' => auth()->id()\n ]\n ]\n ]);\n }", "public function test_users_create_authenticated_admin_shows_correct_view(){\n $this->signInAdmin();\n $response = $this->get(route('users.create'));\n $response->assertStatus(200);\n $response->assertViewIs('views.users.create');\n }", "public function testBasicTest()\n {\n Article::query()->forceDelete();\n\n $response = $this->json('POST', '/admin/articles', [\n 'title' => 'hahaha',\n 'body' => '1111',\n 'aaaa' => 1111,\n ]);\n\n dd($response);\n// $response->assertStatus(200);\n }", "public function testStore() {\n\n if ($this->skipBaseTests) $this->markTestSkipped('Skipping Base Tests');\n\n $item = $this->model->factory()->make();\n\n // Check create :: Create model\n $response = $this->postJson($this->baseUrl, $item->toArray(), ['FORCE_CONTENT_TYPE'=>'json'])\n ->assertStatus(200);\n\n // Check that the database contains the item created by the factory\n $this->assertDatabaseHas($this->table, $item->toArray());\n }", "public function test_admin_index()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/DscMember', 'index']);\n $this->assertResponseCode(404);\n }", "public function testCompleteScenario()\n {\n $client = static::createClient();\n\n // get access to list without authorization\n $crawler = $client->request('GET', '/todolist/');\n $crawler = $client->followRedirect();\n $this->assertContains('login', $client->getRequest()->getUri());\n\n $this->getLogin($client);\n\n // Create a new entry in the database\n $crawler = $client->request('GET', '/todolist/');\n $this->assertEquals(200, $client->getResponse()->getStatusCode(), \"Unexpected HTTP status code for GET /todolist/\");\n $link = $crawler->selectLink('Create a new list')->link();\n $crawler = $client->click($link);\n\n // Check create page without authorization\n $link = $this->checkLinkWithoutAuthorization($client);\n\n $crawler = $client->request('GET', $link);\n\n // create entity with empty name\n $form = $crawler->selectButton('Create')->form(array(\n 'todo_list[name]' => '',\n ));\n $client->submit($form);\n $this->assertContains('This value should not be blank.', $client->getResponse()->getContent());\n\n //create valid entity\n $form = $crawler->selectButton('Create')->form(array(\n 'todo_list[name]' => 'Test for TodoListController',\n ));\n $client->submit($form);\n $crawler = $client->followRedirect();\n $this->assertGreaterThan(0, $crawler->filter('h3:contains(\"Test for TodoListController\")')->count(), 'Fialed to find created element');\n\n // Edit the entity\n $crawler = $client->click($crawler->selectLink('Edit')->link());\n\n // Check edit page without authorization\n $link = $this->checkLinkWithoutAuthorization($client);\n\n $crawler = $client->request('GET', $link);\n\n //empty entity for edit\n $form = $crawler->selectButton('Edit')->form(array(\n 'todo_list[name]' => '',\n ));\n $client->submit($form);\n $this->assertContains('This value should not be blank.', $client->getResponse()->getContent());\n\n //valid entity\n $form = $crawler->selectButton('Edit')->form(array(\n 'todo_list[name]' => 'Edited Test for TodoListController',\n ));\n\n $client->submit($form);\n $crawler = $client->followRedirect();\n $this->assertGreaterThan(0, $crawler->filter('[value=\"Edited Test for TodoListController\"]')->count(), 'Failed to find edited element');\n\n // Delete the entity\n $client->submit($crawler->selectButton('Delete')->form());\n $crawler = $client->followRedirect();\n $this->assertNotRegExp('/Edited Test/', $client->getResponse()->getContent());\n }", "public function testIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/admin/comptes');\n\n $response->assertStatus(200)\n ->assertViewIs('layouts.admin');\n }", "public function setup() {\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t| BASIC CRUD INFORMATION\n\t\t|--------------------------------------------------------------------------\n\t\t*/\n $this->crud->setModel(\"App\\Models\\CoursEnLigne\");\n $this->crud->setRoute(\"admin/coursenligne\");\n $this->crud->setEntityNameStrings('cours en ligne', 'cours en ligne');\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t| COLUMNS AND FIELDS\n\t\t|--------------------------------------------------------------------------\n\t\t*/\n\t\t// ------ CRUD COLUMNS\n $this->crud->setColumns(['titre', ['label' => \"Nom du formateur\",\n \t\t 'type' => 'select',\n 'name' => 'formateur_id',\n \t\t 'entity' => 'formateur',\n \t\t 'attribute' => 'full_name',\n \t\t 'model' => \"App\\Models\\Formateur\"\n \t\t\t ]\n ]);\n\t\t// ------ CRUD FIELDS\n $this->crud->addField([\n\t\t\t'name' => 'titre',\n\t\t\t'label' => \"Titre*\"\n\t\t]);\n\t\t$this->crud->addField([ // SELECT\n 'label' => \"Formateur*\",\n 'type' => 'select2',\n 'name' => 'formateur_id',\n 'entity' => 'formateur',\n 'attribute' => 'full_name',\n 'model' => \"App\\Models\\Formateur\",\n ]);\n $this->crud->addField([\n\t\t\t'name' => 'texte',\n\t\t\t'label' => \"Texte\",\n\t\t\t'type' => 'wysiwyg'\n\t\t]);\n\t\t$this->crud->addField([ // date_picker\n\t\t 'name' => 'date',\n\t\t 'type' => 'date_picker',\n\t\t 'label' => 'Date',\n\t\t // optional:\n\t\t 'date_picker_options' => [\n\t\t 'todayBtn' => true,\n\t\t 'format' => 'dd-mm-yyyy',\n\t\t 'language' => 'fr'\n\t\t ],\n\t\t]);\n\n\t\t$this->crud->addField([ // Time\n \t\t 'name' => 'heure',\n \t\t'label' => 'Heure',\n \t\t'type' => 'time'\n\t\t]);\n\t\t$this->crud->addField([\n\t\t\t'name' => 'prix',\n\t\t\t'label' => \"Prix*\",\n\t\t\t'type' => 'number'\n\t\t]);\n\t\t$this->crud->addField([\n\t\t\t'name' => 'stock',\n\t\t\t'label' => \"En stock\",\n\t\t\t'type' => 'checkbox'\n\t\t]);\n\n }", "public function test_addItemCategory() {\n\n }", "public function testAdmin()\n {\n $admin=User::where('type','admin')->get();\n $count=$admin->count();\n $this->assertGreaterThan(0,$count);\n }", "public function testInsertPostReturnsOk()\n {\n //arrange\n $data = ['user_id'=>2994475,'title'=>'title98','description'=>'hola description','status'=>1];\n\n //act\n $response = $this->json('POST', '/api/tasks',$data);\n\n //assert\n $response->assertStatus(201);\n }", "public function testBasicTest()\n {\n $users = factory(\\App\\Models\\Suara::class, 1000)->make();\n\n foreach ($users as $key => $value) {\n $value->save();\n }\n $this->assertCount(6, $users);\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "public function testProjectProjectIDUsersGet()\n {\n }", "public function testActCreate()\n {\n $this->browse(function (Browser $browser) {\n $bill = Bill::factory()->create([\n 'contract_id' => $this->contract->id,\n 'requisite_id' => $this->requisite->id,\n 'tenant_id' => $this->tenant->id,\n ]);\n $service = $bill->services()->save(Service::factory()->make([\n 'name' => 'Rent',\n 'quantity' => '2',\n 'measure' => 'pc',\n 'price' => '1234'\n ]));\n\n $browser->loginAs($this->user)\n ->visit('/tenants/'.$this->tenant->id.'?tab=bills#tab')\n ->press('Создать')\n ->clickLink('Загрузить')\n ->assertPathIs($bill->act->document_url)\n ->assertSee('Акт');\n });\n }", "public function testInsertCategoryUsingPOST()\n {\n }", "public function testCrud() { \n $onFact = new onFact\\Api(ONFACT_TEST_KEY);\n $productgroup = array(\n 'Productgroup' => array( \n 'name' => 'Car parts', \n ) \n ); \n $id = $onFact->Productgroups->add($productgroup); \n $this->assertTrue(is_numeric($id));\n \n $productgroupApi = $onFact->Productgroups->view($id); \n $this->assertArrayContainsArray($productgroup, $productgroupApi);\n \n $updatedProductgroup = array(\n 'Productgroup' => array(\n 'name' => 'Car paint', \n )\n );\n $update = $onFact->Productgroups->update($id, $updatedProductgroup); \n $this->assertTrue($update);\n \n $productgroupApi = $onFact->Productgroups->view($id); \n $this->assertArrayContainsArray($updatedProductgroup, $productgroupApi);\n \n $delete = $onFact->Productgroups->delete($id);\n $this->assertTrue($delete);\n\n }", "public function testInsertUserTest()\n {\n\n\n $user = factory(User::class)->create(['name' => 'Test User']);\n $this->assertEquals($user->name, \"Test User\");\n\n\n }", "public function test_admin_data_admin_b()\n {\n $this->request('GET', ['pages/Account', 'index']);\n $this->assertResponseCode(404);\n }", "public function test_user_can_view_post_page()\n {\n $post = Post::create([\n 'title' => 'This is title',\n 'body' => 'This is body'\n ]);\n\n $res = $this->get(\"posts/$post->id\");\n\n $res->assertStatus(200);\n $res->assertSee($post->title);\n $res->assertSee($post->body);\n $res->assertSee($post->create_at);\n }" ]
[ "0.7137868", "0.71212", "0.7117349", "0.7077714", "0.690422", "0.68343675", "0.67957246", "0.6795696", "0.67854947", "0.6781867", "0.6751219", "0.6751219", "0.6726462", "0.6702086", "0.66825217", "0.66612995", "0.6660682", "0.66189855", "0.6607188", "0.660254", "0.66005147", "0.6587628", "0.6573054", "0.6571996", "0.656065", "0.65435064", "0.65137136", "0.6511625", "0.65113145", "0.6508724", "0.6471576", "0.64714366", "0.64648205", "0.6462358", "0.6446407", "0.6439002", "0.643292", "0.64321136", "0.6421753", "0.6402415", "0.6401415", "0.6398884", "0.6396233", "0.6391732", "0.63838357", "0.63791096", "0.636613", "0.63572943", "0.63535124", "0.63506544", "0.63451385", "0.63401175", "0.63399124", "0.6334149", "0.63340354", "0.6316721", "0.6314213", "0.631253", "0.630577", "0.62832844", "0.6281623", "0.62800896", "0.6276621", "0.6273875", "0.6266522", "0.62656593", "0.6264913", "0.6258006", "0.6257048", "0.6256401", "0.6253284", "0.62531364", "0.6252418", "0.6248787", "0.6246241", "0.62435865", "0.6236872", "0.62265456", "0.62244", "0.62238115", "0.6223023", "0.62216586", "0.62206054", "0.62171334", "0.62171125", "0.62165207", "0.62162495", "0.6216088", "0.6211121", "0.6210298", "0.620483", "0.62018853", "0.6196683", "0.61962205", "0.6194761", "0.6193547", "0.6191598", "0.61910635", "0.61876863", "0.6183482", "0.61814034" ]
0.0
-1
Testing Cannot CRUD //
public function test_canCreate_Returns_True_If_Personnel_Have_No_Access() { $check_returns_false = $this->authorization_service4->canCreate(2,2); $this->assertFalse($check_returns_false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testEditUser()\n {\n }", "public function testQuarantineFindById()\n {\n\n }", "public function testEditUser()\n {\n\n }", "function testNotFound()\n {\n \n /** Select **/\n $expected = [];\n $res = self::$objMysqlRepository->select(self::$table,[\"id_user\"=>1]);\n $this->assertEquals($expected,$res);\n\n /** Update **/\n $res = self::$objMysqlRepository->update(self::$table,[\"id_user\"=>4],[\"firstname\"=>\"aaa\",\"lastname\"=>\"bbb\"]);\n $this->assertSame(0,$res);\n \n /** delete **/\n $res = self::$objMysqlRepository->delete(self::$table,[\"email\"=>'rpower@abc1.com']);\n $this->assertEmpty($res); \n }", "public function testGetReplenishmentById()\n {\n }", "public function testQuarantineFindOne()\n {\n\n }", "public function test_admin_data_admin()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/Account', 'index']);\n $this->assertResponseCode(404);\n }", "public function testAllowEditing()\n {\n $this->assertFalse(LogEntry::create()->canEdit());\n }", "public function testAccess()\n {\n Backend::set($this->k_business);\n $o_edit_controller = new EditController();\n $o_edit_controller->checkGet();\n }", "public function test_getById() {\n\n }", "public function testDelete()\n {\n }", "public function testBackend()\n {\n $o_edit_controller = new EditController();\n $o_edit_controller->checkGet();\n }", "public function testDeleteUnauthorized()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [])\n ->seeStatusCode(JsonResponse::HTTP_UNAUTHORIZED);\n }", "public function testIndex()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('GET', static::ROUTE)\n ->seeStatusCode(JsonResponse::HTTP_OK);\n }", "public function testQuarantineCreate()\n {\n\n }", "public function test_index_de_formulario() //VIEW CREATE FORMULARIO\n { \n $this ->withoutexceptionhandling();\n $this->get('/formulario')\n ->assertStatus(200)\n ->assertSee('registro nuevo');\n }", "public function testQuarantineDeleteById()\n {\n\n }", "public function testDeletePet()\n {\n\n }", "public function testStatusInvalidId()\n {\n\n }", "public function testShowingAdmin(){\n }", "public function testUserCanNotEditACategory(): void\n {\n $items = Category::factory()->count(1)->create();\n\n Livewire::actingAs(User::factory()->create())\n ->test(CategoriesTable::class, ['items' => $items])\n ->emit('edit', $items[0]->id)\n ->set('editValues.name', 'Updated Category')\n ->emit('save')\n ->assertForbidden();\n\n $this->assertDatabaseHas(Category::class, [\n 'name' => $items[0]->name,\n ]);\n }", "public function testRead()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('GET', static::ROUTE . '/' . $model->id)\n ->seeStatusCode(JsonResponse::HTTP_OK) \n ->seeJson($model->toArray());\n }", "public function test_example()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->post('/institution');\n $response->assertStatus(500);\n\n\n $response = $this->actingAs($user)->post('/bookings/getAvailable');\n $response->assertStatus(500);\n\n $response = $this->actingAs($user)->post('/bookings/createBooking');\n $response->assertStatus(500);\n\n $response = $this->actingAs($user)->post('/trackAndTrace');\n $response->assertStatus(500);\n\n $response = $this->actingAs($user)->post('/rooms/editseats');\n $response->assertStatus(302);\n\n $response = $this->actingAs($user)->post('/institution/create');\n $response->assertStatus(302);\n\n $response = $this->actingAs($user)->post('rooms/edit');\n $response->assertStatus(302);\n }", "public function testBasicTest()\n {\n $test = new TestController();\n $result = $test->findById(100);\n $exptected = null;\n $this->assertEquals($exptected,$result);\n }", "public function test_create_item() {}", "public function test_create_item() {}", "public function testEditComplaintCommentsWithInvalidId(){\n $faker = Faker::create();\n $response = $this->json('PUT','/api/v1/comments',['complaint_comment_id' => 129,\n 'comment' => $faker->text]);\n $response\n ->assertStatus(404)\n ->assertJson([\n 'message' => 'Comment not found',\n ]); \n }", "public function test_users_edit_admin_returns_403(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 1 ]));\n $response->assertStatus(403);\n }", "public function test_admin_data_admin_b()\n {\n $this->request('GET', ['pages/Account', 'index']);\n $this->assertResponseCode(404);\n }", "function testEditAction() {\n $authorInfoController = new AuthorinfoControllerForTest($this->request,$this->response);\n // guest not allowed to create/edit user object\n $this->test_user->role = \"guest\";\n $this->setUpGet(array('etd' => 'etd:1'));\n $this->assertFalse($authorInfoController->editAction()); // no pid = create new record\n // edit (still guest - not allowed)\n $this->setUpGet(array('pid' => 'bogus:1', 'etd' => 'etd:1'));\n $this->assertFalse($authorInfoController->editAction()); // edit existing record\n\n // allow to create new record \n $this->test_user->role = \"student with submission\";\n $this->resetGet();\n $this->setUpGet(array('etd' => 'etd:1'));\n $authorInfoController->editAction(); // no pid = create new record\n $view = $authorInfoController->view;\n $this->assertTrue(isset($view->title));\n $this->assertIsA($view->authorInfo, \"authorInfo\");\n // user should be a new, blank object\n $this->assertEqual(\"\", $view->authorInfo->label);\n $this->assertEqual(\"\", $view->authorInfo->pid);\n\n // allow to edit record\n $this->test_user->role = \"author\";\n $this->setUpGet(array('pid' => 'bogus:1', 'etd' => 'etd:1'));\n $authorInfoController->editAction(); // edit existing record\n $view = $authorInfoController->view;\n // pre-existing record\n $this->assertEqual(\"testuser:1\", $view->authorInfo->pid);\n }", "public function testDeleteFail() {\n $this->delete('/api/author/100')\n ->seeJson(['message' => 'invalid request']);\n }", "public function testEditTemplate()\n {\n\n }", "public function testCreateUnauthorized()\n {\n $model = $this->makeFactory();\n\n $this->json('POST', static::ROUTE, $model->toArray(), [])\n ->seeStatusCode(JsonResponse::HTTP_UNAUTHORIZED);\n }", "public function test_getNotFound() {\n\t\t$this->testAction('/disease/index/1', array('method'=>'get'));\n\t}", "public function testPostAuthorizationDivisionObject()\n {\n }", "public function test_create()\n\t{\n\t\tlist($id, $affected) = $this->model->create(array(\n\t\t\t'user_id' => '1',\n\t\t\t'role_id' => '1'\n\t\t));\n\n\t\t$this->assertSame(0, $id); // No primary key...\n\t\t$this->assertSame(1, $affected);\n\t}", "public function testAllowCreate()\n {\n $createFalse = LogEntry::create()->canCreate(null);\n $this->assertFalse($createFalse);\n $this->logInWithPermission('ADMIN');\n $createFalse = LogEntry::create()->canCreate();\n $this->assertFalse($createFalse);\n }", "public function testDeleteUser()\n {\n\n }", "public function testDeleteUnsuccessfulReason()\n {\n }", "public function testDeleteUser()\n {\n }", "public function testDelete()\n {\n $model = $this->makeFactory();\n $model->save();\n\n $this->json('DELETE', static::ROUTE . '/' . $model->id, [], [\n 'Authorization' => 'Token ' . self::getToken()\n ])\n ->seeStatusCode(JsonResponse::HTTP_NO_CONTENT);\n }", "public function testVentasUserCantSeeCreateComprasPage()\n {\n $user = factory(User::class)->make();\n $role = Role::find(3);\n $user->roles->add($role);\n $response = $this->actingAs($user)->get('/pedidos/create');\n $response->assertStatus(302);\n }", "public function testBasicTest()\n {\n Article::query()->forceDelete();\n\n $response = $this->json('POST', '/admin/articles', [\n 'title' => 'hahaha',\n 'body' => '1111',\n 'aaaa' => 1111,\n ]);\n\n dd($response);\n// $response->assertStatus(200);\n }", "public function test_admin_index()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/DscMember', 'index']);\n $this->assertResponseCode(404);\n }", "public function test_todo()\n {\n $login=User::factory()->create();\n $this->actingAs($login);\n $task=Task::factory()->create();\n $this->assertDatabaseHas('Tasks',['description'=>$task->description,'user_id'=>$task->user_id]);\n \n }", "public function testNotCorrectAssignuser() \r\n {\r\n // expect_not($model->assignuser());\r\n // expect_that($model->getErrors('id'));\r\n // expect_that($model->getErrors('authorRole'));\r\n \r\n }", "public function test_index_without_data()\n {\n $this->makeUser('master');\n\n $response = $this->get('/api/admin/tag');\n\n $response->assertStatus(200);\n }", "public function testRutaCrear(){\n $response = $this->call('GET', 'administracion/usuarios/crear');\n $this->assertEquals(200, $response->status());\n }", "public function test_it_fails_if_the_user_is_not_authenticated()\n {\n $this->json('PATCH','api/cart/1')->assertStatus(401);\n\n }", "public function testRentalInsertFormFrontEnd()\n {\n $this->authentication();\n $this->visit(route('rental.frontend.insert'));\n $this->seeStatusCode(200);\n $this->see('Verhuur aanvraag.');\n }", "public function testPostAuthorizationDivisions()\n {\n }", "public function testGet()\n {\n $this->testAdd();\n }", "public function testGetDuplicateReplenishmentById()\n {\n }", "public function testUserCanNotDeleteCategory(): void\n {\n $items = Category::factory()->count(1)->create();\n\n Livewire::actingAs(User::factory()->create())\n ->test(CategoriesTable::class, ['items' => $items])\n ->emit('delete', $items[0]->id)\n ->assertForbidden();\n\n $this->assertModelExists($items[0]);\n }", "public function testProjectProjectIDUsersGet()\n {\n }", "public function testGetInvalidFieldName()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=rocket_orm', 'orm_username', 'orm_password');\r\n\t\t\t\r\n\t\t\t$user = User::load(1);\r\n\t\t\t\r\n\t\t\t$user->get('doesnotexistfieldname');\r\n\t\t}", "public function testGuestCantCreateTask()\n {\n $response = $this->get(route('tasks.create'));\n $response->assertRedirect('login');\n }", "public function testWebinarDelete()\n {\n }", "public function test_delete_item() {}", "public function test_delete_item() {}", "public function testSalvarEditarATOQuandoTudoOkRetornaRedirect() {\n $this->assertTrue(true);\n }", "public function testIndexFailNotAdmin()\n {\n $this->setUserSession();\n $this->get($this->indexUrl);\n $this->assertRedirect('/');\n }", "function user_can_added_to_DB_and_name_check() {\n $user = factory(User::class)->create();\n\n $this->assertEquals( !0, User::all()->count() );\n $this->seeInDatabase('users', ['name' => $user->name]);\n }", "public function testEdit()\n {\n $response = $this->action('GET', '\\Modules\\Admin\\Http\\Controllers\\FaqCategoryController@edit', ['id' => '1']);\n $this->assertResponseStatus(200, $response->status());\n $this->assertInstanceOf('Illuminate\\Http\\JsonResponse', $response);\n }", "public function testEdit()\n {\n $client = $this->createAuthorizedClient();\n $crawler = $client->request('GET', '/persona/1/edit');\n $form = $crawler->selectButton('Update')->form();\n $form['persona[Apellidos]'] = 'Testy';\n $crawler = $client->submit($form);\n $this->assertTrue($client->getResponse()->isRedirect());\n $crawler = $client->followRedirect();\n\n //edit teniendo en cuenta los datos de una persona\n $persona = self::$kernel->getContainer()->get('doctrine')->getRepository('App\\Entity\\Persona')->findOneBy(array(\n 'Nombre' => 'Celia',\n 'Apellidos' => 'Cruz',\n 'Cargo' => 'Boss',\n 'Correo' => 'celiaDead@gmail.com',\n 'Telefono' => '123456789',\n 'Local_id' => '1',\n 'Departamento' => '1',\n ));\n\n $personaID = $persona->getNumero_Empleado();\n $this->assertNotNull($personaID);\t//El cliente está insertado\n\n $crawler = $client->request('GET', '/persona/'.$personaID.'/edit');\n $form = $crawler->selectButton('Update')->form();\n $form['persona[Nombre]'] = 'Celia';\n $form['persona[Apellidos]'] = 'Cruz';\n $form['persona[Cargo]'] = 'Boss';\n $form['persona[Correo]'] = 'celiaDead@gmail.com';\n $form['persona[Telefono]'] = '123456665';\n $form['persona[Local_id]'] = '1';\n $form['persona[Departamento]'] = '1';\n\n $crawler = $client->submit($form);\n\n //verificacion de que se hayan cambiado los datos\n $personaVerificacion = self::$kernel->getContainer()->get('doctrine')->getRepository('App\\Entity\\Persona')->findOneBy(array(\n 'Nombre' => 'Celia',\n 'Apellidos' => 'Cruz',\n 'Cargo' => 'Boss',\n 'Correo' => 'celiaDead@gmail.com',\n 'Telefono' => '123456665',\n 'Local_id' => '1',\n 'Departamento' => '1',\n ));\n $this->assertNotNull($personaVerificacion);\n\n //persona que no existe\n $crawler = $client->request('GET', '/clientes/1246548788/edit');\n //no encuentra el archivo porque no existe\n $this->assertEquals(404, $client->getResponse()->getStatusCode()\n );\n }", "public function testguests_users_can_not_create_statuses()\n {\n\n $response = $this->post(route('statuses.store'), ['body' => 'Mi primer status']);\n\n\n $response->assertRedirect('login');\n\n }", "public function testIntegrationEdit()\n {\n $userFaker = factory(Model::class)->create();\n $this->visit('user/' . $userFaker->slug . '/edit')\n ->see('Edit Account');\n $this->assertResponseOk();\n $this->seeInDatabase('users', [\n 'username' => $userFaker->username,\n 'email' => $userFaker->email\n ]);\n $this->assertViewHas('model');\n }", "public function testEditTaskIfNotExistPage()\n {\n $this->client->request('GET', '/tasks/a/edit');\n\n $this->assertSame(404, $this->client->getResponse()->getStatusCode());\n }", "public function testCreateAction()\n {\n $res = $this->controller->createAction();\n $this->assertContains(\"Create\", $res->getBody());\n }", "public function test_admin_posisi()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/DscMember', 'posisi']);\n $this->assertResponseCode(404);\n }", "public function adminBasicTest()\n {\n $response = $this->get('admin');\n\n $response->assertStatus(401);\n }", "public function testProfileFindById()\n {\n\n }", "function testTestControllerShouldSaveTest()\n {\n \t$this->withoutMiddleware();\n\n \t$response = $this->call('post', 'tests');\n\n \t$this->assertEquals(302, $response->status());\n }", "public function testProfileDeleteById()\n {\n\n }", "public function test_edit_non_existent_wall_in_non_existent_activity() {\n $client = new Client($this->_app);\n $client->request('GET', '/999/edit/999');\n }", "public function testCreate()\n\t{\n\t\t$this->dispatchWithExpectedException(\"/comment/create\", 'Bootstrap_Service_Exception_Authorization');\n\t}", "public function test_users_edit_invalid_user_returns_404(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 'NaN']));\n $response->assertStatus(404);\n }", "public function testApiStore()\n {\n $user = User::find(1);\n\n \n $data = [\n 'num' => '2018',\n 'name' => 'compte22',\n 'nature' => 'caisse',\n 'solde_init' => '12032122' \n ];\n\n $response = $this->actingAs($user)->withoutMiddleware()->json('POST', '/api/comptes', $data);\n\n $response->assertStatus(200)\n ->assertJson([\n 'success' => true,\n 'compte' => true,\n ]);\n }", "public function testImproperApiMethod()\n {\n $this->testedDao->fetchImproperDataName();\n }", "public function testUnauthorized()\n {\n factory(User::class)->create(); \n $response = $this->json('GET', '/api/users/posts');\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n }", "public function testIfCreationIsCorrect(){ \n \n $this->assertEquals(-1, $this->status->getStatusId()); \n $this->assertEquals('default_status', $this->status->getStatusName());\n \n }", "public function testEditActionCanBeAccessed()\n {\n $this->dispatch('/venue/edit');\n $this->assertResponseStatusCode(200);\n }", "public function testIfIndexPageHasCreateButton()\n {\n $response = $this->get('/customers');\n\n $response->assertSeeText('Criar cliente');\n }", "public function testDeleteAuthorizationDivision()\n {\n }", "public function testDeleteTemplate()\n {\n\n }", "public function testEndPoint()\n {\n\n $user = Auth::loginUsingId(1);\n\n// $response = $this->actingAs($user)\n// ->get('dashboard/orders/create');\n $response = $this->get('dashboard/orders/create');\n\n $response->assertStatus(200);\n }", "public function testORM()\r\n {\r\n\r\n }", "public function test_users_edit_leader_returns_403(){\n $this->signInUser();\n $response = $this->get(route('users.edit', ['user'=> 2]));\n $response->assertStatus(403);\n }", "abstract public function testInvokeOnExistingModelWithBadTemplateIdent();", "public function testAdmin()\n {\n $admin=User::where('type','admin')->get();\n $count=$admin->count();\n $this->assertGreaterThan(0,$count);\n }", "public function testExample()\n {\n $car= Car::find(2);\n $car->delete();\n $this->assertDatabaseMissing('cars', [\n 'id' => 2,\n ]);\n }", "public function test_good_index_route()\n {\n //correct uri\n $response = $this->get('api/students');\n $response \n ->assertStatus(200)\n ->assertJson([['first_name'=> 'Chadwick'], ['first_name'=> 'Evelyn']]);\n }", "public function user_can_gun()\n { \n $this->withoutExceptionHandling();\n $response = $this->post('/index',[\n 'name' => 'insert gun name',\n 'size' => '1',\n 'type' => 'insert gun tyjpe',\n 'price' => '1'\n ]);\n\n $gun = Gun::first();\n $response -> assertStatus(200);\n $This -> assertDatabaseHas ('index',[\n 'name' => $gun->name,\n 'size' => $gun->size,\n 'type' => $gun->type,\n 'price' => $gun->price,\n ]);\n\n }", "public function testResponse()\n {\n $this->post('Users',[\n 'id'=>'2',\n 'name'=>'tomal',\n 'email'=>'sazzad@gmail.com',\n\n ]);\n\n $this->assertDatabaseHas('users',['email'=>\"sazzad@gmail.com\"]);\n }", "public function testInsertUser()\n {\n // Validate the request...\n\n $record = factory(\\App\\User::class)->make();\n\n\n $this->assertTrue($record->save());\n\n }", "public function testRentalInsertFormBackend()\n {\n $this->authentication();\n $this->visit(route('rental.backend'));\n $this->seeStatusCode(200);\n $this->see('Verhuring toevoegen.');\n }", "public function testApiIndex()\n {\n $user = User::find(1);\n\n $response = $this->actingAs($user)->get('/api/comptes');\n\n $response->assertStatus(200)\n ->assertJson([\n\n 'comptes' => true,\n \n ]);\n }", "public function testDeleteValidIdGetForAdmin() {\n\t\t$this->setExpectedException('MethodNotAllowedException');\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'method' => 'GET',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$this->testAction('/admin/logs/delete/1', $opt);\n\t}", "public function test_edit_company_nologin()\n {\n $company = $this->qComp();\n // Send a patch that would edit the post.\n $response = $this->patch(\"/companies/$company->id/\");\n // Expect a redirect as your not allowed without being logged in.\n $response->assertRedirect('/login');\n }", "public function testAddAnonymus()\n {\n \t$user = factory(User::class)->create()''\n \t$response = $this->get('add');\n \t$response->assertStatus(200);\n \n }", "public function testSellerEditFailed()\n {\n $this->demoUserLoginIn();\n $response = $this->call('GET', '/seller/999/edit');\n $this->assertEquals(404, $response->status());\n }" ]
[ "0.7095423", "0.70584065", "0.7051599", "0.69919", "0.69517154", "0.6895294", "0.68868", "0.68813246", "0.68752396", "0.6868414", "0.6769111", "0.67213875", "0.6693624", "0.6679708", "0.66734946", "0.66208005", "0.66160166", "0.6586901", "0.65852183", "0.6580851", "0.658025", "0.6538862", "0.651691", "0.65114766", "0.65051806", "0.65051806", "0.6500328", "0.64992654", "0.64897716", "0.64885765", "0.64852107", "0.64581215", "0.64579844", "0.6456943", "0.6454509", "0.64539117", "0.6452116", "0.6450063", "0.64491034", "0.6445726", "0.64392406", "0.64347416", "0.6433637", "0.6424756", "0.6424568", "0.64187557", "0.641587", "0.6414364", "0.64100176", "0.64088655", "0.6398215", "0.63885355", "0.63831484", "0.6377655", "0.63743424", "0.6373199", "0.6371445", "0.6368953", "0.6364164", "0.6364164", "0.6363862", "0.6349887", "0.6341759", "0.63395447", "0.63389814", "0.6337319", "0.6329107", "0.632891", "0.6327849", "0.6327503", "0.6324554", "0.63226587", "0.6321144", "0.63165", "0.63145334", "0.6313664", "0.6312593", "0.63114434", "0.63093656", "0.63080406", "0.6304142", "0.630229", "0.63002723", "0.6299643", "0.62966186", "0.6295569", "0.6295342", "0.6289461", "0.62892276", "0.6287633", "0.6285649", "0.62850356", "0.6284956", "0.6282447", "0.6281034", "0.6277923", "0.6274592", "0.627148", "0.6265375", "0.6265202", "0.62650776" ]
0.0
-1
Testing Existing Personnel //
public function testCanViewThrowsExceptionIfCannotFindRoleId() { $this->expectException(RoleNotFoundException::class); $check_can_view = $this->authorization_service2->canView(1, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetSiteMembershipForPerson()\n {\n }", "public function testListSiteMembershipsForPerson()\n {\n }", "public function testGetSiteMembershipRequestForPerson()\n {\n }", "public function testListSiteMembershipRequestsForPerson()\n {\n }", "public function testCreateSiteMembershipRequestForPerson()\n {\n }", "public function test_canCreate_Returns_True_If_Personnel_Have_Access() {\n\n\t\t$check_returns_true = $this->authorization_service3->canCreate(1,1);\n\n\t\t$this->assertTrue($check_returns_true);\n\t}", "public function test_canCreate_Returns_True_If_Personnel_Have_No_Access() {\n\n\t\t$check_returns_false = $this->authorization_service4->canCreate(2,2);\n\n\t\t$this->assertFalse($check_returns_false);\n\t}", "public function testGetPerson()\n {\n }", "public function testCreatePerson()\n {\n }", "public function add_personnel()\n\t{\n\t\t$data = array(\n\t\t\t'personnel_onames'=>ucwords(strtolower($this->input->post('personnel_onames'))),\n\t\t\t'personnel_fname'=>ucwords(strtolower($this->input->post('personnel_fname'))),\n\t\t\t'personnel_phone'=>$this->input->post('personnel_phone'),\n\t\t\t'personnel_password'=> md5($this->input->post('personnel_password'))\n\t\t);\n\t\t\n\t\tif($this->db->insert('personnel', $data))\n\t\t{\n\t\t\treturn $this->db->insert_id();\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function testListPeople()\n {\n }", "public function testDeleteSiteMembershipForPerson()\n {\n }", "public function testDeleteSiteMembershipRequestForPerson()\n {\n }", "public function test_1_1()\n {\n global $Address;\n\n $out = SetupTestData::hasmany_save_1();\n\n $address = $Address->create([\n 'line1' => 'line1_4',\n 'zipcode' => '44444',\n 'state' => 'MN'\n ]);\n\n $out['person']->add_to_addresses($address);\n\n $out['person']->save();\n\n\n // tests\n $this->assert($address->id !== NULL, 'New object id is set');\n\n $this->assert($out['person']->size_addresses() === 4, 'Has many has 4 objects');\n\n foreach ($out['person']->get_addresses() as $i => $address)\n {\n $this->assert($address->zipcode === str_repeat(($i+1).'', 5), 'Address zipcode correct');\n }\n }", "public function test_2_1()\n {\n global $Address;\n\n // setup\n $out = SetupTestData::hasmany_save_2();\n\n $address = $Address->create([\n 'line1' => 'line1_4',\n 'zipcode' => '44444',\n 'state' => 'MN'\n ]);\n\n $out['person']->add_to_addresses($address);\n\n $out['person']->save();\n\n\n // tests\n $this->assert($address->id !== NULL, 'New object id is set');\n\n $this->assert($out['person']->size_addresses() === 4, 'Has many has 4 objects');\n\n foreach ($out['person']->get_addresses() as $i => $address)\n {\n $this->assert($address->zipcode === str_repeat(($i+1).'', 5), 'Address zipcode correct');\n }\n }", "public function testAddNewPersonWithPersonList() {\n // Add an existing person.\n Profile::create([\n 'type' => 'person',\n 'field_name' => 'Existing person',\n 'field_email' => 'existing_person@example.com',\n 'uid' => $this->adminUser->id(),\n ])->save();\n\n $this->addProductToCart($this->product);\n $this->goToCheckout();\n $this->assertCheckoutProgressStep('Event registration');\n\n // Go to add registrant page.\n $this->clickLink('Add registrant');\n // Assert that one person is already shown.\n $this->assertSession()->pageTextContains('Existing person');\n $this->submitForm([], 'New person');\n\n // Assert that no new profile is created yet.\n $this->assertNull(Profile::load(2));\n\n // Now, create person.\n $this->submitForm([\n 'person[field_name][0][value]' => 'Person 1',\n 'person[field_email][0][value]' => 'person1@example.com',\n ], 'Save');\n\n // Assert that a new profile now exists.\n $person = Profile::load(2);\n $this->assertEquals('Person 1', $person->field_name->value);\n $this->assertEquals($this->adminUser->id(), $person->getOwnerId());\n\n // Continue checkout.\n $this->submitForm([], 'Continue');\n $this->assertSession()->pageTextContains('1 item');\n $this->processOrderInformation(FALSE);\n // Review.\n $this->assertCheckoutProgressStep('Review');\n $this->assertSession()->pageTextContains('Contact information');\n $this->assertSession()->pageTextContains('Billing information');\n $this->assertSession()->pageTextContains('Order Summary');\n $this->assertSession()->pageTextContains('Person 1');\n // Finalize order.\n $this->submitForm([], 'Complete checkout');\n $this->assertSession()->pageTextContains('Your order number is 1. You can view your order on your account page when logged in.');\n $this->assertSession()->pageTextContains('0 items');\n }", "public function testGetSiteMembership()\n {\n }", "public function test_dotorg_communication()\n {\n }", "public function testGetDuplicateReplenishmentById()\n {\n }", "public function testCreateSiteMembership()\n {\n }", "public function testNewPersonsOwnershipExistingCustomers() {\n $this->addProductToCart($this->product);\n $this->goToCheckout();\n $this->assertCheckoutProgressStep('Event registration');\n\n // Save first registrant.\n $this->clickLink('Add registrant');\n $this->submitForm([\n 'person[field_name][0][value]' => 'Person 1',\n 'person[field_email][0][value]' => 'person1@example.com',\n 'field_comments[0][value]' => 'No commments',\n ], 'Save');\n\n // Assert that this person profile is now owned by the current logged in\n // user.\n $person = Profile::load(1);\n // Assert that we are checking the expected person.\n $this->assertEquals('Person 1', $person->field_name->value);\n $this->assertEquals($this->adminUser->id(), $person->getOwnerId());\n }", "public function testGetDuplicateExternalShipmentById()\n {\n }", "public function testGetIdentityLinksForFamily()\n {\n }", "public function testProfilePrototypeFindByIdOwnedGroups()\n {\n\n }", "public function testProfilePrototypeExistsCommunityRoles()\n {\n\n }", "public function testProfilePrototypeFindByIdCommunityRoles()\n {\n\n }", "public function test_4_1()\n {\n global $Address;\n\n // setup\n $out = SetupTestData::hasmany_save_4();\n\n $address = $Address->create([\n 'line1' => 'line1_1',\n 'zipcode' => '11111',\n 'state' => 'MN'\n ]);\n\n $out['person']->add_to_addresses($address);\n\n $out['person']->save();\n\n\n // tests\n $this->assert($out['result'] !== NULL, 'Save successful');\n\n $this->assert($address->id !== NULL, 'New object id is set');\n\n $this->assert($out['person']->size_addresses() === 1, 'Has many has 1 objects');\n\n foreach ($out['person']->get_addresses() as $i => $address)\n {\n $this->assert($address->zipcode === str_repeat(($i+1).'', 5), 'Address zipcode correct');\n }\n }", "public function testProfilePrototypeLinkOwnedGroups()\n {\n\n }", "public function test_3_1()\n {\n global $Address;\n\n // setup\n $out = SetupTestData::hasmany_save_3();\n\n $address = $Address->create([\n 'line1' => 'line1_4',\n 'zipcode' => '44444',\n 'state' => 'MN'\n ]);\n\n $out['person']->add_to_addresses($address);\n\n $out['person']->save();\n\n\n // tests\n $this->assert($address->id !== NULL, 'New object id is set');\n\n $this->assert($out['person']->size_addresses() === 4, 'Has many has 4 objects');\n\n foreach ($out['person']->get_addresses() as $i => $address)\n {\n $this->assert($address->zipcode === str_repeat(($i+1).'', 5), 'Address zipcode correct');\n }\n }", "public function testParticipantsPost()\n {\n }", "public function testListSiteMemberships()\n {\n }", "public function testProfilePrototypeLinkCommunityRoles()\n {\n\n }", "public function testProfilePrototypeCreateOwnedGroups()\n {\n\n }", "public function testNewPersonChoosableNewCustomers() {\n $product2 = $this->createEventWithVariation($this->store);\n\n // Log out.\n $this->drupalLogout();\n\n // Add 2 products to the cart.\n $this->addProductToCart($this->product);\n $this->addProductToCart($product2);\n\n // Checkout as guest.\n $this->goToCheckout();\n $this->assertCheckoutProgressStep('Login');\n $this->submitForm([], 'Continue as Guest');\n $this->assertCheckoutProgressStep('Event registration');\n\n // Save first registrant.\n $this->clickLink('Add registrant');\n $this->submitForm([\n 'person[field_name][0][value]' => 'Person 1',\n 'person[field_email][0][value]' => 'person1@example.com',\n 'field_comments[0][value]' => 'Comment 1',\n ], 'Save');\n\n // Add registrant for second event.\n $this->clickLink('Add registrant', 1);\n $this->assertSession()->pageTextContains('Person 1');\n\n // Select person 1.\n $this->click('#edit-people-list .form-submit');\n $this->submitForm([\n 'field_comments[0][value]' => 'Comment 2',\n ], 'Save');\n $this->submitForm([], 'Continue');\n\n // Add order information.\n $this->assertSession()->pageTextContains('2 items');\n $this->processOrderInformation();\n\n // Review.\n $this->assertCheckoutProgressStep('Review');\n $this->assertSession()->pageTextContains('Contact information');\n $this->assertSession()->pageTextContains('Billing information');\n $this->assertSession()->pageTextContains('Order Summary');\n $this->assertSession()->pageTextContains('Person 1');\n // Finalize order.\n $this->submitForm([], 'Complete checkout');\n $this->assertSession()->pageTextContains('Your order number is 1. You can view your order on your account page when logged in.');\n $this->assertSession()->pageTextContains('0 items');\n\n // Assert registrants that were added to the order.\n $order = Order::load(1);\n $registrations = $this->container->get('commerce_rng.registration_data')->getOrderRegistrations($order);\n $registrant1 = $registrations[1]->getRegistrants()[1];\n $registrant2 = $registrations[2]->getRegistrants()[2];\n\n // Assert that persons of both registrants are exactly the same.\n $this->assertSame($registrant1->getIdentity(), $registrant2->getIdentity());\n\n // Assert that comments of registrant differ.\n $this->assertEquals('Comment 1', $registrant1->field_comments->value);\n $this->assertEquals('Comment 2', $registrant2->field_comments->value);\n }", "public function testProfilePrototypeCreateCommunityRoles()\n {\n\n }", "public function testGetDuplicatePackingPlanById()\n {\n }", "public function testProfilePrototypeFindByIdGroups()\n {\n\n }", "public function testGetRelatedBirthdaysFromPerson1()\n {\n $person = $this->session->load( \"RelationTestPerson\", 1 );\n $res = array (\n 1 => \n RelationTestBirthday::__set_state(array(\n 'person' => '1',\n 'birthday' => '327535201',\n )),\n );\n $this->assertEquals(\n $res,\n $this->session->getRelatedObjects( $person, \"RelationTestBirthday\" ),\n \"Related RelationTestPerson objects not fetched correctly.\"\n );\n }", "public function testProfilePrototypeExistsOwnedGroups()\n {\n\n }", "public function personnel()\n {\n return $this->belongsTo(\n User::class, \n 'assigned_to', \n 'id'\n );\n }", "public function testWebhookPartnerMap()\n {\n $this->assertObjectHasAttribute('partner_mapping', $this->webhook);\n $this->assertNotNull($this->webhook->getPartnerMap());\n $this->assertInstanceOf(\n \"AllPlayers\\Utilities\\PartnerMap\",\n $this->webhook->getPartnerMap()\n );\n }", "public function test_getDuplicateExternalShipmentById() {\n\n }", "public function testProfilePrototypeLinkGroups()\n {\n\n }", "public function testProfilePersonalInfo()\n {\n // Create a user with the username 'johndoe'\n $user = factory(User::class)->create(['username'=>'johndoe']);\n // Add a profile record to the user\n $profile = factory(Profile::class)->make(['country_id'=>4]);\n // Save the user\n $user->profile()->save($profile);\n // Goto the profile browse page\n $this->visit(route('profile.view', ['name'=>'johndoe']))\n ->see('seeInElement', '.country', DB::table('countries')->where('id', 4)->first()->full_name);\n }", "public function testGetReplenishmentById()\n {\n }", "public function testContractorWithNewOrganisation()\n {\n\t\t$faker = \\Faker\\Factory::create('en_GB');\n\t\t$faker->seed(10060); // Seed\n\t\t$company = array();\n\t\t$company['name'] = $faker->company;\n\t\t$company['phone'] = $faker->phoneNumber;\n\t\t$company['email'] = $faker->email;\n\t\t$company['website'] = $faker->url;\n\t\t$company['address'] = $faker->streetAddress;\n\t\t$company['postcode'] = $faker->postcode;\n\t\t$company['town'] = $faker->city;\n\n\t\t$faker->seed(10070); // Seed\n\t\t$contact = array();\n\t\t$contact['name'] = $faker->firstName;\n\t\t$contact['surname'] = $faker->lastName;\n\t\t$contact['email'] = $faker->email;\n\t\t$contact['landline'] = $faker->phoneNumber;\n\t\t$contact['mobile'] = $faker->phoneNumber;\n\n\t\t$faker->seed(10071); // Seed\n\t\t$areas = array();\n\t\t$areas[] = array('postcode' => $faker->postcode);\n\t\t$areas[] = array('postcode' => $faker->postcode);\n\t\t$areas[] = array('postcode' => $faker->postcode);\n\t\t$areas[] = array('postcode' => $faker->postcode);\n\n \t$this->loginAs('admin');\n\n\t\t$this->webDriver->wait(10,500)->until(\n\t\t \\WebDriverExpectedCondition::elementToBeClickable(\n\t\t \\WebDriverBy::id('btn-add-contact')\n\t\t )\n\t\t);\n\n\t\t// Click in btn-add-contact\n\t\t$btnAddContact = $this->webDriver->findElement(\\WebDriverBy::id('btn-add-contact'))->click();\n\n\t\t$this->webDriver->wait(100)->until(\n\t\t \\WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(\n\t\t \\WebDriverBy::id('choose_contact_type')\n\t\t )\n\t\t);\n\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('choose_contact_type'))->findElement(\\WebDriverBy::cssSelector(\"option[value='3']\"))->click();\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(\n\t\t \\WebDriverBy::id('btn-save-contractor')\n\t\t )\n\t\t);\n\n\t\t// Create organisation\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('a.btn:nth-child(2)'))->click();\n\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::elementToBeClickable(\n\t\t \\WebDriverBy::id('organisation_name')\n\t\t )\n\t\t);\n\n\t\tsleep(1);\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('organisation_type'))->findElement(\\WebDriverBy::cssSelector(\"option[value='2']\"))->click();\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('organisation_name'))->clear()->sendKeys($company['name']);\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('organisation_phone'))->clear()->sendKeys($company['phone']);\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('organisation_email'))->clear()->sendKeys($company['email']);\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('organisation_website'))->clear()->sendKeys($company['website']);\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('organisation_address'))->clear()->sendKeys($company['address']);\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('organisation_postcode'))->clear()->sendKeys($company['postcode']);\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('organisation_town'))->clear()->sendKeys($company['town']);\n\n\t\t// Save organisation\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('button.btn-success'))->click();\n\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::elementToBeClickable(\n\t\t \\WebDriverBy::id('contact_title')\n\t\t )\n\t\t);\n\n\t\tsleep(1);\n\n\t\t// Resto de campos\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('contact_title'))->findElement(\\WebDriverBy::cssSelector(\"option[value='2']\"))->click();\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('contact_name'))->sendKeys($contact['name']);\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('contact_surname'))->sendKeys($contact['surname']);\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('contact_email'))->sendKeys($contact['email']);\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('contact_landline'))->sendKeys($contact['landline']);\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('contact_mobile'))->sendKeys($contact['mobile']);\n\n\t\t$this->webDriver->findElement(\\WebDriverBy::xpath(\"//label[contains(text(),'General')]\"))->click();\n\t\t$this->webDriver->findElement(\\WebDriverBy::xpath(\"//label[contains(text(),'Electrician')]\"))->click();\n\t\t$this->webDriver->findElement(\\WebDriverBy::xpath(\"//label[contains(text(),'Decorator')]\"))->click();\n\t\t$this->webDriver->findElement(\\WebDriverBy::xpath(\"//input[@name='contact[require_certification]' and @value=0]\"))->click();\n\t\t$this->webDriver->findElement(\\WebDriverBy::xpath(\"//input[@name='contact[liability_insurance]' and @value=1]\"))->click();\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('contact_status'))->findElement(\\WebDriverBy::cssSelector(\"option[value='1']\"))->click();\n\n\t\t// Editar Areas\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('btn-start-edit-areas'))->click();\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(\n\t\t \\WebDriverBy::cssSelector('a.btn-success:nth-child(2)')\n\t\t )\n\t\t);\n\n\t\t// Area #1\n\t\tsleep(1); // wait for knockout\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('.area-distance > option:nth-child(2)'))->click();\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('.area-postcode'))->sendKeys($areas[0]['postcode']);\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('#area-1 > div:nth-child(2) > div:nth-child(1) > a:nth-child(2)'))->click();\n\n\t\t// Area #2\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('btn-new-area'))->click();\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(\n\t\t \\WebDriverBy::cssSelector('#area-2 > div:nth-child(2) > div:nth-child(1) > a:nth-child(2)')\n\t\t )\n\t\t);\n\t\tsleep(1); // wait for knockout\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('#area-2 > div:nth-child(1) > div:nth-child(4) > select:nth-child(1) > option:nth-child(3)'))->click();\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('#area-2 > div:nth-child(1) > div:nth-child(5) > input:nth-child(1)'))->sendKeys($areas[1]['postcode']);\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('#area-2 > div:nth-child(2) > div:nth-child(1) > a:nth-child(2)'))->click();\n\n\t\t// Area #3\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('btn-new-area'))->click();\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(\n\t\t \\WebDriverBy::cssSelector('#area-3 > div:nth-child(2) > div:nth-child(1) > a:nth-child(2)')\n\t\t )\n\t\t);\n\t\tsleep(1); // wait for knockout\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('#area-3 > div:nth-child(1) > div:nth-child(4) > select:nth-child(1) > option:nth-child(3)'))->click();\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('#area-3 > div:nth-child(1) > div:nth-child(5) > input:nth-child(1)'))->sendKeys($areas[2]['postcode']);\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('#area-3 > div:nth-child(2) > div:nth-child(1) > a:nth-child(2)'))->click();\n\n\t\t// Area #4\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('btn-new-area'))->click();\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(\n\t\t \\WebDriverBy::cssSelector('#area-4 > div:nth-child(2) > div:nth-child(1) > a:nth-child(2)')\n\t\t )\n\t\t);\n\t\tsleep(1); // wait for knockout\n\n\t\t// Stop edit areas\n\t\t$this->stopEditAreas();\n\n\t\t$message = $this->webDriver->findElement(\\WebDriverBy::cssSelector('#modal-message > div:nth-child(1) > div:nth-child(1) > div:nth-child(2)'));\n\t\t$this->assertContains('There are unsaved changes. Please, save all the areas before continue.', $message->getText());\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('modal-box-btn-close'))->click();\n\n\t\t$this->webDriver->wait(10,500)->until(\n\t\t \\WebDriverExpectedCondition::invisibilityOfElementLocated(\n\t\t \\WebDriverBy::id('modal-message')\n\t\t )\n\t\t);\n\n\t\t$this->webDriver->wait(10,500)->until(\n\t\t\t\\WebDriverExpectedCondition::elementToBeClickable(\n\t\t\t\\WebDriverBy::cssSelector('#area-4 > div:nth-child(2) > div:nth-child(1) > a:nth-child(1)')\n\t\t\t)\n\t\t);\n\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('#area-4 > div:nth-child(2) > div:nth-child(1) > a:nth-child(1)'))->click();\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('#btn-stop-edit-areas'))->click();\n\n\t\t$this->webDriver->wait(10)->until(\n\t\t\t\\WebDriverExpectedCondition::elementToBeClickable(\n\t\t\t\\WebDriverBy::id('btn-save-contractor')\n\t\t\t)\n\t\t);\n\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('btn-save-contractor'))->click();\n\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(\n\t\t \\WebDriverBy::id('btn-add-contact')\n\t\t )\n\t\t);\n\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(\n\t\t \\WebDriverBy::className('alert-success')\n\t\t )\n\t\t);\n\n\t\t$message = $this->webDriver->findElement(\\WebDriverBy::className('alert-success'));\n\n $this->assertContains('Congrats! The contact was created successfully', $message->getText());\n\n sleep(1); // reload table\n\n\t\t/**************************/\n /*** \tVerify record */\n /**************************/\n $this->assertContains($contact['name'], $this->webDriver->findElement(\\WebDriverBy::cssSelector(\"#table-javascript > tbody:nth-child(2) > tr:nth-child(13) > td:nth-child(2)\"))->getText());\n $this->assertContains($contact['surname'], $this->webDriver->findElement(\\WebDriverBy::cssSelector(\"#table-javascript > tbody:nth-child(2) > tr:nth-child(13) > td:nth-child(3)\"))->getText());\n\n\n // Verify show view\n $this->webDriver->findElement(\\WebDriverBy::cssSelector('#table-javascript > tbody:nth-child(2) > tr:nth-child(13) > td:nth-child(8) > div:nth-child(1) > a:nth-child(1)'))->click();\n\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::elementToBeClickable(\n\t\t \\WebDriverBy::cssSelector('div.pull-right:nth-child(1) > a:nth-child(1)')\n\t\t )\n\t\t);\n\n\t\t$this->assertContains($contact['email'], $this->webDriver->findElement(\\WebDriverBy::cssSelector(\"#contact-details-fieldset > div:nth-child(2) > div:nth-child(2)\"))->getText());\n\t\t$this->assertContains($company['address'], $this->webDriver->findElement(\\WebDriverBy::cssSelector(\"#address-fieldset > div:nth-child(2) > div:nth-child(2)\"))->getText());\n\t\t$this->assertContains('Unapproved', $this->webDriver->findElement(\\WebDriverBy::cssSelector(\"#administration-fieldset > div:nth-child(2) > div:nth-child(2)\"))->getText());\n\n\t\t$this->assertContains('General', $this->webDriver->findElement(\\WebDriverBy::cssSelector(\".form-horizontal > fieldset:nth-child(6) > div:nth-child(2)\"))->getText());\n\t\t$this->assertContains('Decorator', $this->webDriver->findElement(\\WebDriverBy::cssSelector(\".form-horizontal > fieldset:nth-child(6) > div:nth-child(2)\"))->getText());\n\t\t$this->assertContains('Electrician', $this->webDriver->findElement(\\WebDriverBy::cssSelector(\".form-horizontal > fieldset:nth-child(6) > div:nth-child(2)\"))->getText());\n\n\t\t// go to index\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('div.pull-right:nth-child(1) > a:nth-child(1)'))->click();\n\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::elementToBeClickable(\n\t\t \\WebDriverBy::cssSelector('#table-javascript > tbody:nth-child(2) > tr:nth-child(13) > td:nth-child(8) > div:nth-child(1) > a:nth-child(2)')\n\t\t )\n\t\t);\n\n\t\t// Verify edit view\n\t\t$this->webDriver->findElement(\\WebDriverBy::cssSelector('#table-javascript > tbody:nth-child(2) > tr:nth-child(13) > td:nth-child(8) > div:nth-child(1) > a:nth-child(2)'))->click();\n\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::elementToBeClickable(\n\t\t \\WebDriverBy::id('btn-save-contractor')\n\t\t )\n\t\t);\n\n\t\t// Change status\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('contact_status'))->findElement(\\WebDriverBy::cssSelector(\"option[value='2']\"))->click();\n\n\t\t// Save & verify\n\t\t$this->webDriver->findElement(\\WebDriverBy::id('btn-save-contractor'))->click();\n\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::elementToBeClickable(\n\t\t \\WebDriverBy::id('btn-add-contact')\n\t\t )\n\t\t);\n\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(\n\t\t \\WebDriverBy::className('alert-success')\n\t\t )\n\t\t);\n\n\t\t$message = $this->webDriver->findElement(\\WebDriverBy::className('alert-success'));\n\n $this->assertContains('Congrats! The contact was updated successfully', $message->getText());\n\n // Verify new status\n $this->assertContains('Pending Approval', $this->webDriver->findElement(\\WebDriverBy::cssSelector(\"#table-javascript > tbody:nth-child(2) > tr:nth-child(13) > td:nth-child(5)\"))->getText());\n\n // Click delete\n $this->webDriver->findElement(\\WebDriverBy::cssSelector(\"#table-javascript > tbody:nth-child(2) > tr:nth-child(13) > td:nth-child(8) > div:nth-child(1) > a:nth-child(3)\"))->click();\n\n\t\t$this->webDriver->wait(10,500)->until(\n\t\t \\WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(\n\t\t \\WebDriverBy::id('modal-message')\n\t\t )\n\t\t);\n\n\t\t$this->webDriver->wait(10,500)->until(\n\t\t \\WebDriverExpectedCondition::elementToBeClickable(\n\t\t \\WebDriverBy::id('btn-delete-contact')\n\t\t )\n\t\t);\n\n // Verify name in popup delete\n $this->assertContains(\"{$contact['name']} {$contact['surname']}\", $this->webDriver->findElement(\\WebDriverBy::cssSelector(\".text-center\"))->getText());\n\n // Delete record\n $this->webDriver->findElement(\\WebDriverBy::cssSelector(\"#btn-delete-contact\"))->click();\n\n\t\t$this->webDriver->wait(10)->until(\n\t\t \\WebDriverExpectedCondition::presenceOfAllElementsLocatedBy(\n\t\t \\WebDriverBy::cssSelector('.alert')\n\t\t )\n\t\t);\n\n\t\tsleep(1); // Wait popup is loaded\n\n\t\t$this->assertContains('Congrats! The contact was deleted successfully', $this->webDriver->findElement(\\WebDriverBy::cssSelector(\".alert\"))->getText());\n\n\t\tsleep(1); // wait table reload\n\n\t\t$elements = $this->webDriver->findElements(\\WebDriverBy::cssSelector(\"#table-javascript > tbody:nth-child(2) > tr:nth-child(13) > td:nth-child(1)\"));\n\n\t\t// Verify record doesn't exist in table.\n\t\t$this->assertCount(0, $elements);\n\n }", "public function testProfilePrototypeCreateGroups()\n {\n\n }", "public function testProfilePrototypeExistsGroups()\n {\n\n }", "public function testProfilePrototypeGetOwnedGroups()\n {\n\n }", "public function testProfileFind()\n {\n\n }", "public function testProfilePrototypeGetCommunityRoles()\n {\n\n }", "public function testUpdateSiteMembershipRequestForPerson()\n {\n }", "public function testExistingMember() {\n\t\t$this->Member->MailList->save(['address' => 'test2', 'domain_id' => '52f8928d-6588-4f6f-ab87-430ef6570d8e']);\n\t\t$mailListId = $this->Member->MailList->id;\n\n\t\t$member = [\n\t\t\t'Member' => [\n\t\t\t\t'name' => 'Test Guy',\n\t\t\t\t'email_address' => 'testguy@example.com'\n\t\t\t],\n\t\t\t'MailList' => ['MailList' => [$mailListId]]\n\t\t];\n\n\t\t$this->Member->save($member);\n\n\t\t//Should still only be two members\n\t\t$count = $this->Member->find('count');\n\t\t$this->assertEqual($count, 2);\n\n\t\t//But this member should have 2 lists\n\t\t$member = $this->Member->find('first', [\n\t\t\t'conditions' => ['email_address' => 'testguy@example.com'],\n\t\t\t'contain' => ['MailList']\n\t\t]);\n\t\t$this->assertCount(2, $member['MailList']);\n\t}", "public function testParticipantsMePut()\n {\n }", "public function testGetInvalidAdultUsername() : void {\n// grab an email that does not exist\n$profile = Adult::getAdultByAdultUsername($this->getPDO(), \"yourmom\");\n$this->assertNull($profile);\n}", "public function testProfileExistsHeadProfilesid()\n {\n\n }", "public function testProfilePrototypeFindByIdPosts()\n {\n\n }", "public function testProfilePrototypeCountCommunityRoles()\n {\n\n }", "public function testGetExternalShipmentById()\n {\n }", "public function testPeopleAttributesNew()\n {\n $randomId = self::$f1->randomId('person');\n $model = self::$f1->get('/v1/people/'.$randomId['person'].'/attributes/new.json');\n $this->assertEquals('200', $model['http_code']);\n $this->assertNotEmpty($model['body'], \"No Response Body\");\n return $model['body'];\n }", "public function testProfilePrototypeUpdateByIdOwnedGroups()\n {\n\n }", "public function testFindAddresses()\n {\n\n }", "public function testProjectProjectIDInviteGet()\n {\n }", "public function testProfileExistsGetProfilesidExists()\n {\n\n }", "public function testProjectAssignmentsLinkRelation()\n {\n }", "public function check_create_person_validation()\n {\n\n $person = [];\n $this->signInAsRelationshipsManager('api');\n $response = $this->json('POST','api/v1/person/', $person);\n $response->assertStatus(422)\n ->assertJson( [\n 'message' => 'The given data was invalid.',\n 'errors' => [\n 'givenName' => [\n 'The given name field is required.'\n ],\n \"surname1\" => [\n \"The surname1 field is required.\"\n ],\n \"identifier\" => [\n \"The identifier field is required.\"\n ],\n \"identifier_type\" => [\n \"The identifier type field is required.\"\n ]\n\n ]\n ]);\n }", "function createPersona()\n {\n return isset($this->source['persona']) && $this->source['persona'] ? $this->source['persona'] : null;\n }", "public function testProfilePrototypeCountOwnedGroups()\n {\n\n }", "public function test_getDuplicateReplenishmentProcessById() {\n\n }", "public function testNewPersonsOwnershipNewCustomers() {\n if (!class_exists('Drupal\\commerce_checkout\\Event\\CheckoutEvents') || !defined('Drupal\\commerce_checkout\\Event\\CheckoutEvents::COMPLETION_REGISTER')) {\n $this->markTestSkipped(\"This test requires Commerce 2.12.\");\n }\n\n // Enable the completion_register pane.\n /** @var \\Drupal\\commerce_checkout\\Entity\\CheckoutFlowInterface $checkout_flow */\n $checkout_flow = $this->container\n ->get('entity_type.manager')\n ->getStorage('commerce_checkout_flow')\n ->load('event');\n /** @var \\Drupal\\commerce_checkout\\Plugin\\Commerce\\CheckoutFlow\\CheckoutFlowInterface $checkout_flow_plugin */\n $checkout_flow_plugin = $checkout_flow->getPlugin();\n /** @var \\Drupal\\commerce_checkout\\Plugin\\Commerce\\CheckoutPane\\CompletionRegistration $pane */\n $pane = $checkout_flow_plugin->getPane('completion_register');\n $pane->setConfiguration([]);\n $pane->setStepId('complete');\n $checkout_flow_plugin_configuration = $checkout_flow_plugin->getConfiguration();\n $checkout_flow_plugin_configuration['panes']['completion_register'] = $pane->getConfiguration();\n $checkout_flow_plugin->setConfiguration($checkout_flow_plugin_configuration);\n $checkout_flow->save();\n\n $this->drupalLogout();\n $this->addProductToCart($this->product);\n $this->goToCheckout();\n\n // Checkout as guest.\n $this->assertCheckoutProgressStep('Login');\n $this->submitForm([], 'Continue as Guest');\n $this->assertCheckoutProgressStep('Event registration');\n\n // Add registrant.\n $this->clickLink('Add registrant');\n $this->submitForm([\n 'person[field_name][0][value]' => 'Person 1',\n 'person[field_email][0][value]' => 'person1@example.com',\n ], 'Save');\n $this->submitForm([], 'Continue');\n\n // Add order information.\n $this->assertSession()->pageTextContains('1 item');\n $this->processOrderInformation();\n\n // Review.\n $this->assertCheckoutProgressStep('Review');\n $this->assertSession()->pageTextContains('Contact information');\n $this->assertSession()->pageTextContains('Billing information');\n $this->assertSession()->pageTextContains('Order Summary');\n $this->assertSession()->pageTextContains('Person 1');\n // Finalize order.\n $this->submitForm([], 'Complete checkout');\n $this->assertSession()->pageTextContains('Your order number is 1. You can view your order on your account page when logged in.');\n $this->assertSession()->pageTextContains('0 items');\n\n // Assert that the completion_register checkout pane is shown.\n $this->assertSession()->pageTextContains('Create your account');\n // Register.\n $this->submitForm([\n 'completion_register[name]' => 'User name',\n 'completion_register[pass][pass1]' => 'pass',\n 'completion_register[pass][pass2]' => 'pass',\n ], 'Create account');\n // Assert that the account was created successfully.\n $this->assertSession()->pageTextContains('Registration successful. You are now logged in.');\n\n // Assert ownership created profile.\n $person = Profile::load(1);\n // Assert that we are checking the expected person.\n $this->assertEquals('Person 1', $person->field_name->value);\n $this->assertEquals(3, $person->getOwnerId());\n }", "public function testGetProfileWPPatientRel()\r\n {\r\n $url = \"http://127.0.0.1/app_test.php/profile/view/vision-jones\";\r\n\r\n $username = 'profileBucky@gmail.com';\r\n $password = 'password';\r\n\r\n $response = \\Httpful\\Request::get($url)->basicAuth($username, $password)->send();\r\n\r\n $this->assertEquals('success', $response->body->status);\r\n $this->assertEquals('Vision Jones', $response->body->data->user->name);\r\n $this->assertNotEquals(0, $response->body->data->user->isWellnessPro);\r\n\r\n $this->assertEquals(0, $response->body->data->relationships->isSupporter);\r\n $this->assertEquals(0, $response->body->data->relationships->isSupportee);\r\n $this->assertEquals(1, $response->body->data->relationships->isWellnessProRel);\r\n }", "public function test_it_can_list_people()\n {\n factory(Person::class)->create();\n\n $response = $this->getJson('api/v1/people', ['Authorization' => 'Bearer ' . $this->token]);\n\n $response\n ->assertOk()\n ->assertJsonStructure([\n '*' => [\n 'id', 'name', 'created_at', 'updated_at'\n ]\n ]);\n\n }", "public function testProfilePrototypeFindByIdQuarantines()\n {\n\n }", "public function test_admin_member_internship()\n {\n $this->request('POST', 'pages/Login',['username'=>'superadmin-samuel','password'=>'J6gDEXs1yUxB7ssa9QtDRsk=']);\n $this->request('GET', ['pages/DscMember', 'apprenticeship']);\n $this->assertResponseCode(404);\n }", "public function testGetNetworkMerakiAuthUsers()\n {\n }", "public function testSetPersonneAPrevenir() {\n\n $obj = new Employes();\n\n $obj->setPersonneAPrevenir(\"personneAPrevenir\");\n $this->assertEquals(\"personneAPrevenir\", $obj->getPersonneAPrevenir());\n }", "public function test_1_2()\n {\n global $Address;\n\n $out = SetupTestData::hasmany_save_1();\n\n $address = $out['person']->get_addresses()[1];\n\n $is_removed = $out['person']->remove_from_addresses($address);\n\n $out['person']->save();\n\n\n // tests\n $this->assert($is_removed, 'Removed OK');\n\n $this->assert($out['person']->size_addresses() === 2, 'Has many has 2 objects');\n\n $this->assert($address->person_addresses_back === NULL, 'Backlink of removed object is NULL');\n }", "public function testExistingIdentity() {\n\n $session = $this->getSampleProjectSession(true);\n\n $bug = $session->find('sample_Bug')->filterBy('bugId', 521152)->one();\n $project = $session->find('sample_Project')->filterBy('projectId', 12345)->one();\n $user = $session->find('sample_User')->filterBy('userId', '55566')->one();\n\n $this->assertTrue($bug->owner === $project->manager);\n $this->assertTrue($user === $bug->owner);\n $this->assertTrue($user === $project->manager);\n \n }", "public function testProfilePrototypeFindByIdReviews()\n {\n\n }", "public function testProfilePrototypeUpdateByIdCommunityRoles()\n {\n\n }", "public function newAction()\n {\n $entity = new PersonnelPersonnel();\n $form = $this->createCreateForm($entity);\n $formpers = $this->container->get('form.factory')->createBuilder(new NomenclatureSoussituationadministrativeType())->getForm();\n return $this->render('SiseCoreBundle:PersonnelPersonnel:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'formpers' => $formpers->createView(),\n ));\n }", "public function testMailingList() {\n\t}", "public function store(AddPersonnelRequest $request)\n {\n\n $request->validate([\n 'email' => 'required|string|email|max:255|unique:employees',\n 'password' => 'required|string|confirmed|min:8',\n ]);\n\n $request->addPersonnel();\n\n// Return temporaire\n\n return redirect()->route('employee.profiles');\n }", "public function retrieve_personnel()\n\t{\n\t\t$this->db->where('personnel_status = 1');\n\t\t$this->db->order_by('personnel_fname');\n\t\t$query = $this->db->get('personnel');\n\t\t\n\t\treturn $query;\n\t}", "public function testProjectProjectIDInviteeInviteIDGet()\n {\n }", "public function testAddReplenishmentAudit()\n {\n }", "public function test_4_2()\n {\n global $Address;\n\n // setup\n $out = SetupTestData::hasmany_save_4();\n\n $address = $Address->create([\n 'line1' => 'line1_1',\n 'zipcode' => '11111',\n 'state' => 'MN',\n 'id' => 666 // this is needed so the remove don't throw an exception\n ]);\n\n $is_removed = $out['person']->remove_from_addresses($address);\n\n $out['person']->save();\n\n\n // tests\n $this->assert(!$is_removed, 'Not removed');\n\n $this->assert($out['person']->size_addresses() === 0, 'Has many has 0 objects');\n }", "public function test_1_3()\n {\n $out = SetupTestData::hasmany_save_1();\n\n // get all items to avoid losing them when the clean() is executed over the collection\n $addresses = $out['person']->get_addresses()->all();\n\n $out['person']->clean_addresses();\n\n $out['person']->save();\n\n\n // tests\n $this->assert($out['person']->size_addresses() === 0, 'Has many has 0 objects');\n\n foreach ($addresses as $i => $address)\n {\n $this->assert($address->person_addresses_back === NULL, \"Backlink of item $i object is NULL\");\n }\n }", "public function testExists()\n {\n $this->assertFalse($this->insight->accounts->exists(12345));\n $this->insight->accounts->addTrial(12345);\n $this->assertTrue($this->insight->accounts->exists(12345));\n }", "public function testListMemberAccounts()\n {\n }", "public function testProfilePrototypeUpdateByIdGroups()\n {\n\n }", "public function testProfilePrototypeCreateReviews()\n {\n\n }", "public function test_2_3()\n {\n $out = SetupTestData::hasmany_save_2();\n\n // get all items to avoid losing them when the clean() is executed over the collection\n $addresses = $out['person']->get_addresses()->all();\n\n $out['person']->clean_addresses();\n\n $out['person']->save();\n\n\n // tests\n $this->assert($out['person']->size_addresses() === 0, 'Has many has 0 objects');\n\n foreach ($addresses as $i => $address)\n {\n $this->assert($address->person_addresses_back === NULL, \"Backlink of item $i object is NULL\");\n }\n }", "public function testProfilePrototypeGetGroups()\n {\n\n }", "public function testProjectsAssignTeam()\n {\n $project = factory(Project::class)->create();\n $response = $this->get('/project/team?id=' . $project->id);\n $response->assertStatus(200);\n }", "public function testProfileCheckIfUserExists()\n {\n\n }", "public function testGetValidBridgeByBridgeStaffId() {\n\n\t\t//count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"bridge\");\n\n\t\t// create a new Bridge and insert to into mySQL\n\t\t$bridge = new Bridge($this->VALID_BRIDGESTAFFID, $this->VALID_BRIDGENAME, $this->VALID_BRIDGEUSERNAME);\n\t\t$bridge->insert($this->getPDO());\n\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$results = Bridge::getBridgeByBridgeStaffId($this->getPDO(), $bridge->getBridgeStaffId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"bridge\"));\n\t\t$this->assertNotNull($results);\n\t\t$this->assertInstanceOf(\"Edu\\\\Cnm\\\\DdcAaaa\\\\Bridge\", $results);\n\n\t\t// grab the result from the array and validate it\n\n\t\t$this->assertEquals($results->getBridgeStaffId(), $this->VALID_BRIDGESTAFFID);\n\t\t$this->assertEquals($results->getBridgeName(), $this->VALID_BRIDGENAME);\n\t\t$this->assertEquals($results->getBridgeUserName(), $this->VALID_BRIDGEUSERNAME);\n\t}", "public function testSetEmailPied() {\n\n $obj = new Collaborateurs();\n\n $obj->setEmailPied(\"emailPied\");\n $this->assertEquals(\"emailPied\", $obj->getEmailPied());\n }", "public function testGetAllPistas()\n {\n $fakePista = factory(Pista::class,1)->create([\n 'id' => 4545\n ]);\n $pistas = Pista::getAllPistas();\n foreach ($pistas as $pista) {\n if($pista->id == 4545){\n $this->assertTrue($pista->id == $fakePista[0]->id);\n }\n }\n\n }", "public function setUp()\n {\n parent::setUp();\n\n if (is_null(Individual::first())) {\n factory(Individual::class)->create();\n factory(Individual::class, 'disqualified_without_meeting')->create();\n factory(Individual::class, 'disqualified_after_meeting')->create();\n factory(Individual::class, 'accept_meeting')->create();\n factory(Individual::class, 'jpb')->create();\n factory(Individual::class, 'inactive')->create();\n factory(Individual::class, 'active')->create();\n }\n\n if (is_null($this->individual)) {\n $this->individual = Individual::first();\n }\n\n if (is_null($this->accept_meeting_individual)) {\n $this->accept_meeting_individual = Individual::where('client_status_id', 3)->first();\n }\n\n if (is_null($this->non_accept_meeting_individuals)) {\n $this->non_accept_meeting_individuals = Individual::whereNotIn('client_status_id', [3])->get();\n }\n\n if (is_null($this->faker)) {\n $this->faker = Faker\\Factory::create();\n }\n }", "public function testGetPackingPlanById()\n {\n }" ]
[ "0.6768919", "0.6751776", "0.6695058", "0.6479803", "0.64630854", "0.64140356", "0.6150615", "0.60229486", "0.60082996", "0.6003067", "0.59998333", "0.5930241", "0.5923818", "0.5673526", "0.56708753", "0.5657327", "0.5637778", "0.5610929", "0.56055284", "0.5581423", "0.55742174", "0.5572558", "0.5568645", "0.55527514", "0.5506291", "0.5502135", "0.54963195", "0.5494632", "0.5492003", "0.5491224", "0.5481722", "0.546664", "0.5463394", "0.5461495", "0.54253787", "0.54118025", "0.53986657", "0.53845996", "0.5380387", "0.5377813", "0.5375104", "0.53665835", "0.5343055", "0.5313289", "0.53090966", "0.53056496", "0.530361", "0.52556884", "0.5235607", "0.5230117", "0.5199738", "0.5191374", "0.5190807", "0.5181216", "0.5164565", "0.5164237", "0.51617754", "0.5161324", "0.51528746", "0.5139845", "0.51373196", "0.51133484", "0.5109385", "0.51089895", "0.5106627", "0.5102099", "0.51007175", "0.5094805", "0.5092881", "0.50916827", "0.5088214", "0.5075893", "0.507572", "0.50738025", "0.5072683", "0.5072639", "0.50662076", "0.50638974", "0.50625944", "0.506058", "0.5057992", "0.50552905", "0.504771", "0.50399154", "0.5038612", "0.5027637", "0.50217456", "0.50197065", "0.50186396", "0.5016144", "0.5013466", "0.501253", "0.5006303", "0.5005094", "0.50029165", "0.5001111", "0.49957916", "0.49927568", "0.4985877", "0.49847302", "0.49840215" ]
0.0
-1
TODO: Implement getStatus() method.
public function getLastStatus() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getStatus();", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus() {}", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function getStatus();", "public function get_status()\n {\n }", "public function get_status()\n {\n }", "abstract public function GetStatus();", "public function getStatus()\n {\n }", "function getStatus() ;", "function getStatus() ;", "function getStatus() ;", "public function GetStatus()\n\t{\n\t\t// Demnach ist der Status in IPS der einzige der vorliegt.\t\t\n\t}", "function getStatus()\n {\n return $this->status;\n }", "function getStatus() {\n return $this->status;\n }", "function getStatus() \n {\n return $this->instance->getStatus();\n }", "public function status();", "public function status();", "function get_status() {\n return $this->status;\n }", "public function getStatus(){\n\t\treturn $this->status;\n\t}", "function getStatus() {\n\t\treturn $this->_Status;\n\t}", "public function getJobStatus()\n {\n }", "public function get_status(){\n return $this->status;\n }", "function getStatus();", "public function getStatus(): int;", "public function getStatus(): int;", "public function status(): int;", "public function getStatus() {\n return $this->status;\n }", "public function getStatus() {\n return $this->status;\n }", "public function getStatus()\n\t{\n\t\treturn $this->status; \n\n\t}", "public function get_status() {\n return $this->_status;\n }", "protected function status()\n {\n }", "public function getStatus()\r\n {\r\n return $this->status;\r\n }", "public function getStatus()\r\n {\r\n return $this->status;\r\n }", "public function getStatus() \n\t{\n\t\treturn $this->status;\n\t}", "public function getStatus() \n\t{\n\t\treturn $this->status;\n\t}", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->_status;\n }", "public function getStatus()\n {\n return $this->_status;\n }", "public function getStatus()\n {\n return $this->_status;\n }", "protected function getSelfStatus() {}", "protected function getSelfStatus() {}", "public function getStatus()\n {\n return $this->_Status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }", "public function getStatus()\n {\n return $this->status;\n }" ]
[ "0.8379284", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.8238092", "0.82377774", "0.82377774", "0.82377774", "0.82377774", "0.8096049", "0.8096049", "0.8096049", "0.8096049", "0.8096049", "0.8096049", "0.8096049", "0.8096049", "0.8096049", "0.8096049", "0.8026897", "0.8026897", "0.7997962", "0.7997801", "0.78300077", "0.78300077", "0.78294957", "0.77233917", "0.76811785", "0.7671946", "0.76032853", "0.75490546", "0.75490546", "0.75352347", "0.7521132", "0.75181603", "0.74746895", "0.7471026", "0.74563", "0.7425344", "0.7425344", "0.7409337", "0.7406947", "0.7406947", "0.7372255", "0.73509693", "0.73494875", "0.7294694", "0.7294694", "0.72260374", "0.72260374", "0.7219726", "0.7219726", "0.721367", "0.721367", "0.721367", "0.72057563", "0.7202262", "0.71923596", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329", "0.7178329" ]
0.72410893
61
TODO: Implement getMsgStatusByMSGID() method.
public function getMsgStatusByMSGID($msgid) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStatus($message_id);", "public function status(string $msgId)\n {\n $options = [\n 'msg_id' => $msgId,\n ];\n var_dump($options);\n var_dump(\"2222\");\n return $this->httpPostJson('cgi-bin/message/mass/get', $options);\n }", "public function getMessageStatus()\n {\n return $this->messageStatus;\n }", "public function Status_ID($msgid) {\n\t$msgid=mysqli_real_escape_string($this->db,$msgid);\n\t$query=mysqli_query($this->db,\"SELECT msg_id FROM messages M, users U WHERE M.uid_fk=U.uid and M.msg_id='$msgid' AND U.status='1'\");\n\tif(mysqli_num_rows($query)>0) {\n\t $row=mysqli_fetch_array($query,MYSQLI_ASSOC);\n\t return $row['msg_id'];\n\t} else {\n\t return false;\n\t}\n}", "public function getStatusMessage();", "function messageStatus($ids)\n {\n\n if (!is_array($ids)) {\n $ids = array($ids);\n }\n\n $ids = implode(',', $ids);\n\n $url = sprintf('cmd=message_status&ids=%s',\n urlencode($ids));\n\n $response = $this->_callURL($url);\n\n if (is_a($response, 'PEAR_Error')) {\n return PEAR::raiseError(sprintf(_(\"Send failed.\")));\n }\n\n $result = array();\n\n if (!array_key_exists('error_code', $response)) {\n\n if (count(explode(',', $ids)) == 1) {\n\n $result[$ids] = array(\n 0 => 1,\n 1 => $response[$ids]\n );\n } else {\n foreach ($response as $id => $message) {\n $result[$id] = array(1, $message);\n }\n }\n } else {\n\n if (count(explode(',', $ids)) == 1) {\n\n $result[$to] = array(\n 0 => 0,\n 1 => $response['error_message']\n );\n } else {\n foreach (explode(',', $ids) as $id) {\n $result[$id] = array(0, $response['error_message']);\n }\n }\n }\n\n return $result;\n }", "function getMessage($msg_id) {\n\t\tif (!$msg_id) {\n\t\t\treturn false;\n\t\t}\n\t\treturn db_query_params ('SELECT * FROM artifact_message_user_vw WHERE id=$1',\n\t\t\tarray($msg_id));\n\t}", "public function getStatusMessage()\r\n\t{\r\n\t\treturn $this->m_message;\r\n\t}", "public function getStatusCodeMsg(): string\r\n {\r\n return $this->_statusCodeMsg;\r\n }", "function getStatusMessage() \r\n\t{\r\n\t\treturn $this->replyString;\r\n\t}", "function Stats($msg=\"\"){\n if($this->state!=\"TRANSACTION\")\n $this->AddError(\"connection is not in TRANSACTION state\");\n\t if (!isset($result)) $result='';\n if ($msg == \"\") :\n $this->POP3Command(\"STAT\", $result);\n else :\n $this->POP3Command(\"LIST $msg\", $result);\n endif;\n $p = explode(\" \", $result);\n $stat[\"message\"] = $p[1];\n $stat[\"size\"] = $p[2];\n return $stat;\n }", "public function get_msgnum()\n {\t\t\n return $this->msgnum;\n }", "abstract public function getFullMessage($msgNo);", "private function getMsg($code){\n\t\t\t$msg = $this->msgcode[$code]['message'];\n\t\t\t$status = $this->msgcode[$code]['status'];\n\t\t\tif ($msg && $status !== NULL) return array($msg, $status);\n\t\t\telse return array($this->msgcode['000']['message'], $this->msgcode['000']['status']);\n\t\t}", "public function getStatus() {\n\t\t$status = $this->status;\n\t\tif(!empty($this->messages)) {\n\t\t\tforeach($this->messages as $idx => $message) {\n\t\t\t\tif($message->getStatus() > $status) {\n\t\t\t\t\t$status = $message->getStatus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $status;\n\t}", "public function doUpdateMessageStatus($id)\n {\n $status = Message::updateMessageStatus($id);\n\n return ucfirst($status);\n }", "public function readableStatus()\n {\n $status = $this->status;\n $match = [\n\n 'message_ok' => \"En attente d'envoi\",\n 'message_issues' => \"Le message contient des erreurs\",\n 'sent' => \"Le message a été envoyé\",\n 'sending' => \"En cours d'envoi…\"\n ];\n\n return isset($match[$status]) ? $match[$status] : $status;\n }", "public function getStatus($markStatusesRead = true, $maxNumberOfStatuses = 100, $messageIds = null)\n {\n $request = array(\n 'GetMessageStatusRequest' => array(\n 'markStatusesRead' => $markStatusesRead,\n 'maxNumberOfStatuses' => $maxNumberOfStatuses\n )\n ); \n \n if ($messageIds) {\n $messageIds = is_array($messageIds) ? $messageIds : array($messageIds);\n foreach ($messageIds as $messageId) {\n $request['GetMessageStatusRequest']['messageIds']['messageId'][] = $messageId;\n }\n }\n\n try { \n $soap_client = $this->getSoapClient();\n $response = $soap_client->__soapCall('GetMessageStatus', $request);\n\n } catch (SoapFault $sf) {\n\n throw new ClientException($this->soapFaultToString($sf)); \n \n } catch (InteleonSoapClientException $e) {\n\n throw new ClientException($e->getMessage()); \n }\n\n $result = array();\n\n if (isset($response->messageStatus) === false) {\n return $result;\n }\n\n foreach ($response->messageStatus as $messageStatus) {\n $result[] = array(\n 'statusCode' => $messageStatus->statusCode,\n 'statusText' => $messageStatus->statusText,\n 'id' => $messageStatus->id,\n 'sender' => $messageStatus->sender,\n 'recipient' => $messageStatus->recipient,\n 'time' => $messageStatus->time,\n 'billingStatus' => $messageStatus->billingStatus,\n 'NumberOfMessages' => $messageStatus->attributes->attribute[0]->value->integer,\n 'NumberOfCharacters' => $messageStatus->attributes->attribute[1]->value->integer\n );\n }\n\n return $result;\n }", "function check_message_status($messageId){\n global $platform;\n try {\n $endpoint = \"/restapi/v1.0/account/~/extension/~/message-store/\".$messageId;\n $resp = $platform->get($endpoint);\n $jsonObj = $resp->json();\n print(\"Message status: \" . $jsonObj->messageStatus . PHP_EOL);\n if ($jsonObj->messageStatus == \"Queued\"){\n sleep(2);\n check_message_status($jsonObj->id);\n }\n } catch (\\RingCentral\\SDK\\Http\\ApiException $e) {\n exit(\"Error message: \" . $e->message . PHP_EOL);\n }\n}", "function ppmess_change_commun_status($message_id, $post_id, $logged_user){\n\t\n\tglobal $wpdb;\n\t\n\t$status = 0; // when sent_to = 0 message is read, if sent_to != 0 message is not read\n\t\n\treturn $wpdb->query(\n\t\t$wpdb->prepare(\"UPDATE {$wpdb->prefix}private_messages SET sent_to = %d WHERE (post_id = %d AND message_id = %d AND message_parent = 0 AND sent_to = %d) \n\t\t\tOR (post_id = %d AND message_parent = %d AND receiver_id = %d) \", $status, $post_id, $message_id, $logged_user, $post_id, $message_id, $logged_user )\n\t);\n}", "public function getStatusMessage()\n {\n return $this->status_message;\n }", "private function getStatusMessage(){\n\t\t$status = array(\n\t\t\t\t100 => 'Continue', \n\t\t\t\t101 => 'Switching Protocols', \n\t\t\t\t200 => 'OK',\n\t\t\t\t201 => 'Created', \n\t\t\t\t202 => 'Accepted', \n\t\t\t\t203 => 'Non-Authoritative Information', \n\t\t\t\t204 => 'No Content', \n\t\t\t\t205 => 'Reset Content', \n\t\t\t\t206 => 'Partial Content', \n\t\t\t\t300 => 'Multiple Choices', \n\t\t\t\t301 => 'Moved Permanently', \n\t\t\t\t302 => 'Found', \n\t\t\t\t303 => 'See Other', \n\t\t\t\t304 => 'Not Modified', \n\t\t\t\t305 => 'Use Proxy', \n\t\t\t\t306 => '(Unused)', \n\t\t\t\t307 => 'Temporary Redirect', \n\t\t\t\t400 => 'Bad Request', \n\t\t\t\t401 => 'Unauthorized', \n\t\t\t\t402 => 'Payment Required', \n\t\t\t\t403 => 'Forbidden', \n\t\t\t\t404 => 'Not Found', \n\t\t\t\t405 => 'Method Not Allowed', \n\t\t\t\t406 => 'Not Acceptable', \n\t\t\t\t407 => 'Proxy Authentication Required', \n\t\t\t\t408 => 'Request Timeout', \n\t\t\t\t409 => 'Conflict', \n\t\t\t\t410 => 'Gone', \n\t\t\t\t411 => 'Length Required', \n\t\t\t\t412 => 'Precondition Failed', \n\t\t\t\t413 => 'Request Entity Too Large', \n\t\t\t\t414 => 'Request-URI Too Long', \n\t\t\t\t415 => 'Unsupported Media Type', \n\t\t\t\t416 => 'Requested Range Not Satisfiable', \n\t\t\t\t417 => 'Expectation Failed', \n\t\t\t\t500 => 'Internal Server Error', \n\t\t\t\t501 => 'Not Implemented', \n\t\t\t\t502 => 'Bad Gateway', \n\t\t\t\t503 => 'Service Unavailable', \n\t\t\t\t504 => 'Gateway Timeout', \n\t\t\t\t505 => 'HTTP Version Not Supported');\n\t\treturn ($status[$this->_code]) ? $status[$this->_code] : $status[500];\n\t}", "public function get_status_message() {\n\n\t\treturn $this->get_status_info()->message;\n\t}", "public function getStatusMessage()\n {\n return $this->statusMessage;\n }", "public function status( &$numMessages, &$sizeMessages )\r\n {\r\n if ( $this->state != self::STATE_TRANSACTION )\r\n {\r\n throw new ezcMailTransportException( \"Can't call status() on the POP3 transport when not successfully logged in.\" );\r\n }\r\n\r\n $this->connection->sendData( \"STAT\" );\r\n $response = $this->connection->getLine();\r\n if ( $this->isPositiveResponse( $response ) )\r\n {\r\n // get the single response line from the server\r\n list( $dummy, $numMessages, $sizeMessages ) = explode( ' ', $response );\r\n $numMessages = (int)$numMessages;\r\n $sizeMessages = (int)$sizeMessages;\r\n }\r\n else\r\n {\r\n throw new ezcMailTransportException( \"The POP3 server did not respond with a status message: {$response}.\" );\r\n }\r\n }", "private function getMsg()\n {\n return $this->msg;\n }", "public static function getReceivedStatus(){\n\t\treturn self::getStatus( 'received' );\n\t}", "function _getStatusMessage(){\n $status = array(\n 200 => 'Ok' ,\n 201 => 'Created' ,\n 202 => 'deleted' ,\n 204 => 'No Content' ,\n 400 => 'Bad Request',\n 404 => 'Not Found' ,\n 405 => 'Not Allowed' ,\n 406 => 'Not Acceptable',\n\n );\n return ($status[$this->CodeHTTP] ? $status[$this->CodeHTTP] : $status[500]);\n }", "public function getMessage($id) {\n\t\tif (!array_key_exists($id, $this -> messages)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this -> messages[$id];\n\t}", "public function getMessage() {\n return $this->getStatus();\n }", "public function Msghandle(){\n\n\t\t\t$this->message = $this->msglog = $this->asciilog = $this->status = NULL;\n\t\t\t$this->showclassnames = TRUE;\n\n\t\t\t$this->msgcode = array(\n\t\t\t\t\t\t\t\t\t\t\"000\" => array(\"message\" => \"Message code not found\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"001\" => array(\"message\" => \"Connection resource is not set\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"002\" => array(\"message\" => \"Missing parameters\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"003\" => array(\"message\" => \"Statement is not valid\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"004\" => array(\"message\" => \"Email address already taken\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"005\" => array(\"message\" => \"No row affected\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"006\" => array(\"message\" => \"Password not found\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"007\" => array(\"message\" => \"User data not found\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"008\" => array(\"message\" => \"Username doesn't exist\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"009\" => array(\"message\" => \"Wrong password\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"010\" => array(\"message\" => \"URL format is not valid\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"011\" => array(\"message\" => \"No URL specified\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"012\" => array(\"message\" => \"BabelNet connection failed\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"013\" => array(\"message\" => \"Method is not valid\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"014\" => array(\"message\" => \"Parameters are not valid\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"015\" => array(\"message\" => \"Conflictual settings\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"016\" => array(\"message\" => \"Required attribute not found\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"017\" => array(\"message\" => \"Microsoft Translator auth token not valid\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"018\" => array(\"message\" => \"A parameter is an array\", \"status\" => \"Error\"),\n\t\t\t\t\t\t\t\t\t\t\"019\" => array(\"message\" => \"A parameter is not an array\", \"status\" => \"Error\"),\n\n\t\t\t\t\t\t\t\t\t\t\"998\" => array(\"message\" => \"Operation successful\", \"status\" => \"Notice\"),\n\t\t\t\t\t\t\t\t\t\t\"999\" => array(\"message\" => \"Class instanced successfully\", \"status\" => \"Notice\"),\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t\t$this->log(\"999\", __METHOD__);\n\t\t}", "public function get($ID){\n\t\tsql('DELETE FROM messages WHERE from_status=\"0\" AND to_status=\"0\"');\n\t\tsql('DELETE FROM messages WHERE fromID = \"\" or toID = \"\"');\n\t\t\n\t\t$ID = ($ID) ? $ID : $_SESSION['user'] ;\n\t\t\n\t\t$messages = sql('SELECT ' . $this->select . '\n\t\t\t\t\t\t\t\t \t\t FROM ' . $this->from . '\n\t\t\t\t\t\t\t\t \t\t WHERE a.toID LIKE \"%'.$_SESSION['user'].'%\"\n\t\t\t\t\t\t\t\t \t\t AND a.to_status!=\"0\"\n\t\t\t\t\t\t\t\t \t\t AND a.fromID = b.code\n\t\t\t\t\t\t\t\t \t\t ORDER BY a.date DESC '.$this->limit );\n\t\t\n\t\treturn $messages;\n\t\t\n\t}", "abstract public function get_message();", "public function setStatusCodeMsg($msg)\r\n {\r\n $this->_statusCodeMsg = $msg;\r\n }", "function statusMessage()\n {\n }", "public function status() {\n\t\t$obj->number = $this->status_code;\n\t\t$obj->msg = $this->status_msg;\n\t\treturn $obj;\n\t}", "public function getStateMessage();", "public function get_msg() {\r\n return $this->msg;\r\n }", "public function loadMessage($msgId, $setOpen = true)\n {\n\n $db = $this->getDb();\n $user = $this->getUser();\n\n $sql = <<<SQL\n\nselect\n msg.rowid as msg_id,\n msg.title,\n msg.message,\n msg.priority,\n msg.m_time_created,\n msg.id_sender_status,\n msg.confidential,\n task.deadline as task_deadline,\n task.progress as task_progress,\n task.status as task_status,\n task.flag_urgent as task_urgent,\n task.rowid as task_id,\n appoint.timestamp_start as appoint_start,\n appoint.timestamp_end as appoint_end,\n appoint.flag_all_day as appoint_all_day,\n appoint.id_category as appoint_category,\n appoint.rowid as appoint_id,\n appoint.location_text as appoint_location,\n receiver.status as receiver_status,\n receiver.rowid as receiver_id,\n receiver.flag_participation_required,\n receiver.flag_action_required,\n receiver.flag_editable,\n sender.fullname as sender_name,\n sender.core_person_rowid as sender_pid,\n sender.buiz_role_user_rowid as sender_id,\n receiver_name.fullname as receiver_name\n\nFROM\n buiz_message msg\n\nJOIN\n\tbuiz_message_receiver receiver\n\t\tON receiver.id_message = msg.rowid\n\nLEFT JOIN\n\tbuiz_task task\n\t\tON task.id_message = msg.rowid\n\nLEFT JOIN\n\tbuiz_appointment appoint\n\t\tON appoint.id_message = msg.rowid\n\nJOIN\n view_person_role sender\n ON sender.buiz_role_user_rowid = msg.id_sender\n\nJOIN\n view_person_role receiver_name\n ON receiver_name.buiz_role_user_rowid = receiver.vid\n\nWHERE\n msg.rowid = {$msgId};\n\nSQL;\n\n\n $node = $db->select($sql)->get();\n\n if ($node) {\n\n // auf open setzen wenn noch closed\n if ($setOpen && EMessageStatus::OPEN > $node['receiver_status'] ) {\n $db->update(\"UPDATE buiz_message_receiver set status =\".EMessageStatus::OPEN.\" WHERE rowid = \".$node['receiver_id'] );\n $node['receiver_status'] = EMessageStatus::OPEN;\n }\n\n $this->messageNode = new TDataObject($node);\n\n }\n\n if (!$this->messageNode)\n throw new DataNotExists_Exception('The requested message not exists.');\n\n $this->loadMessageAspects($msgId);\n\n return $this->messageNode;\n\n }", "function _show_forum_new_msgs_status ($forum_info = array()) {\n\t\t// Forum is read-only\n\t\tif ($forum_info['status'] == 'r') {\n\t\t\t$forum_status = 2;\n\t\t} else {\n\t\t\t// No new messages by default\n\t\t\t$forum_status = 0;\n\t\t\t// Try to find read messages\n\t\t\tif (module('forum')->SETTINGS['USE_READ_MESSAGES'] && !module('forum')->_get_forum_read($forum_info)) {\n\t\t\t\t$forum_status = 1;\n\t\t\t}\n\t\t}\n\t\t$replace = array(\n\t\t\t'img_src'\t\t=> WEB_PATH. tpl()->TPL_PATH. module('forum')->FORUM_STATUSES[$forum_status][0],\n\t\t\t'status_title'\t=> t(module('forum')->FORUM_STATUSES[$forum_status][1]),\n\t\t\t'status_id'\t\t=> intval($forum_status),\n\t\t);\n\t\treturn tpl()->parse('forum'.'/view_home_status_icon', $replace);\n\t}", "function sms_get_status($sms_id)\r\n\t{\r\n\t\tglobal $sms_accountno, $sms_pwd;\r\n\r\n\t\t$status_url = \"https://api.accessyou.com/sms/receivestatus.php?\";\r\n\t\t$status_url .= \"accountno=\".urlencode($sms_accountno);\r\n\t\t$status_url .= \"&pwd=\".urlencode($sms_pwd);\r\n\t\t$status_url .= \"&id=\".urlencode($sms_id);\r\n\r\n\t\t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $status_url);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\r\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\r\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 20);\r\n\r\n\t\t$result = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\tif (!preg_match(\"/DELIVERED|UNDELIVERED|UNKNOWN|FAILED|REJECTED|nostatus/i\", $result)) {\r\n\t\t\t$result = \"Error: \" . $result;\r\n\t\t}\r\n\t\treturn $result;\r\n\t}", "public function getMsg()\n {\n return $this->Msg;\n }", "public function getMsgId()\n {\n return $this->msg_id;\n }", "public function getMsg()\n {\n return $this->msg;\n }", "public function getMsg()\n {\n return $this->msg;\n }", "public function getMessageId() {\n return $this->message_id;\n }", "public function hasMsg(){\n return $this->_has(18);\n }", "protected function getMsg( $msgId )\n\t{\n\t\t$msgText = wfMsgExt( $msgId );\n\t\t\n\t\tif ( wfEmptyMsg( $msgId, $msgText ))\n\t\t\treturn null;\n\t\t\t\n\t\treturn $msgText;\t\t\t\n\t}", "function message($message) {\n\t\t\t\t\t\t$GLOBALS['statusmsg'] = \"RX-OK|\";\n\n\t\t\t\t\t\t //**Store the received message to a global variable\n\t\t\t\t\t\t$GLOBALS['rcv_message'] = $message->payload; \n\t\t\t\t}", "function getAllMessages(){\r\n /*for testing purposes only, replace with request to db\r\n return array(\r\n array('messageId' => 1, 'title' => 'Indice', 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan aliquet tellus, semper euismod urna finibus placerat. Vestibulum hendrerit tellus.', 'status' => 'Active'),\r\n array('messageId' => 2, 'title' => 'Annonce', 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan aliquet tellus, semper euismod urna finibus placerat. Vestibulum hendrerit tellus.', 'status' =>'Inactive'),\r\n array('id' => 3, 'title' => 'Météo', 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan aliquet tellus, semper euismod urna finibus placerat. Vestibulum hendrerit tellus.', 'status' =>'Active'),\r\n array('id' => 4, 'title' => 'Nouvel indice', 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan aliquet tellus, semper euismod urna finibus placerat. Vestibulum hendrerit tellus.', 'status' =>'Active'),\r\n array('id' => 5, 'title' => 'Fin du jeu', 'text' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan aliquet tellus, semper euismod urna finibus placerat. Vestibulum hendrerit tellus.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan aliquet tellus, semper euismod urna finibus placerat. Vestibulum hendrerit tellus.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan aliquet tellus, semper euismod urna finibus placerat. Vestibulum hendrerit tellus.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed accumsan aliquet tellus, semper euismod urna finibus placerat. Vestibulum hendrerit tellus.', 'status' =>'Inactive')\r\n );*/\r\n //$GLOBALS['link'] = connect();\r\n $res = mysqli_query($GLOBALS['link'], 'select `id`, `title`, `text`, `status` from messages;');\r\n\r\n return fetch_result($res);\r\n}", "function get($msg_index) {\n if (isset($this->inbox[$msg_index])) \n {\n return $this->inbox[$msg_index];\n }else\n {\n return false;\n }\n }", "public function get_message($msg_type=false) \n {\n $sess_msg= Session::instance()->get(\"hana_message\", array());\n if(!empty($sess_msg)) $this->message=$sess_msg;\n \n if($msg_type)\n {\n return $this->message[$msg_type];\n }\n else\n {\n return $this->message;\n }\n }", "public function getMessageId() {\n\treturn ($this->messageId);\n}", "public function checkMessage(){\r\n \t\t// checking message\r\n \t\t$message_id = $this->_request->getParam(\"message_id\");\r\n \t\t// check id param for project\r\n \t\tif(!is_numeric($message_id)){\r\n \t\t\t$this->_helper->FlashMessenger(array('error' => 'This FloBox message is not found, are you trying to hack us? :D '));\r\n \t\t\t$this->_redirect('/member/error/');\r\n \t\t}\r\n \t\t \r\n \t\ttry{\r\n \t\t\treturn $this->facadeFlobox->findOneMessage($this->_member_id,$message_id);\r\n \t\t}catch(\\Exception $e){\r\n \t\t\t$this->_helper->FlashMessenger(array('error' => $e->getMessage()));\r\n \t\t\t$this->_redirect('/member/error/');\r\n \t\t}\r\n \t}", "function get_message($id_message)\n\t{\n\t\t$this->ci->db->select('*');\n\t\t$this->ci->db->where('am_id', $id_message);\n\t\t$query = $this->ci->db->get('auth_message');\n\t\tif($query->num_rows() != 0)\n\t\t{\n\t\t\t$data = $query->row()->am_message;\n\t\t\treturn $data;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "public function getMessageId()\n {\n }", "function statusMessagesOn()\n\t{\n\t\t$this->bStatusMessages = true;\n\t}", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "public function getMessages();", "function getStatus() \r\n\t{\r\n\t\treturn $this->reply;\r\n\t}", "abstract public function GetStatus();", "private function GetPendingStatus($WH_ID)\n\t{\n\t\t\n $record = $this->SQL->GetRecord(array(\n 'table' => $GLOBALS['TABLE_instructor_profile_pending'],\n 'keys' => '*',\n 'where' => \"wh_id='$WH_ID' AND active=1\",\n ));\n if ($this->Show_Query) echo \"<br /><br />LAST QUERY = \" . $this->SQL->Db_Last_Query;\n \n if ($record) {\n $this->status_pending\t= $record['status_pending'];\n $this->status_rejected \t= $record['status_rejected'];\n }\n\t}", "function toggleMessageStatus($messageId){\r\n //$GLOBALS['link'] = connect();\r\n mysqli_query($GLOBALS['link'], 'update messages set `status`=NOT(`status`) where `id`='. $messageId .';') or die(mysqli_error($GLOBALS['link']));\r\n\r\n return mysqli_affected_rows($GLOBALS['link']);\r\n}", "function getStatusMessage(){\n\t\tif($this->_StatusMessage){ return $this->_StatusMessage; }\n\n\t\t//cerpano z\n\t\t//http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html\n\t\t$status = array(\n\t\t\t// Successful 2xx\n\t\t\t\"200\" => \"OK\",\n\t\t\t\"201\" => \"Created\",\n\t\t\t\"202\" => \"Accepted\",\n\t\t\t\"203\" => \"Non-Authoritative Information\",\n\t\t\t\"204\" => \"No Content\",\n\t\t\t\"205\" => \"Reset Content\",\n\t\t\t\"206\" => \"Partial Content\",\n\t\t\t// Redirection 3xx\n\t\t\t\"300\" => \"Multiple Choices\",\n\t\t\t\"301\" => \"Moved Permanently\",\n\t\t\t\"302\" => \"Found\",\n\t\t\t\"303\" => \"See Other\",\n\t\t\t\"304\" => \"Not Modified\",\n\t\t\t\"305\" => \"Use Proxy\",\n\t\t\t// (306 Unused)\n\t\t\t\"307\" => \"Temporary Redirect\",\n\t\t\t// Client Error 4xx\n\t\t\t\"400\" => \"Bad Request\",\n\t\t\t\"401\" => \"Unauthorized\",\n\t\t\t\"402\" => \"Payment Required\",\n\t\t\t\"403\" => \"Forbidden\",\n\t\t\t\"404\" => \"Not Found\",\n\t\t\t\"405\" => \"Method Not Allowed\",\n\t\t\t\"406\" => \"Not Acceptable\",\n\t\t\t\"407\" => \"Proxy Authentication Required\",\n\t\t\t\"408\" => \"Request Timeout\",\n\t\t\t\"409\" => \"Conflict\",\n\t\t\t\"410\" => \"Gone\",\n\t\t\t\"411\" => \"Length Required\",\n\t\t\t\"412\" => \"Precondition Failed\",\n\t\t\t\"413\" => \"Request Entity Too Large\",\n\t\t\t\"414\" => \"Request-URI Too Long\",\n\t\t\t\"415\" => \"Unsupported Media Type\",\n\t\t\t\"416\" => \"Requested Range Not Satisfiable\",\n\t\t\t\"417\" => \"Expectation Failed\",\n\t\t\t\"418\" => \"I'm a teapot\",\n\t\t\t// Server Error 5xx\n\t\t\t\"500\" => \"Internal Server Error\",\n\t\t\t\"501\" => \"Not Implemented\",\n\t\t\t\"502\" => \"Bad Gateway\",\n\t\t\t\"503\" => \"Service Unavailable\",\n\t\t\t\"504\" => \"Gateway Timeout\",\n\t\t\t\"505\" => \"HTTP Version Not Supported\",\n\t\t\t\"506\" => \"Variant Also Negotiates\",\n\t\t\t\"507\" => \"Insufficient Storage\",\n\t\t);\n\t\treturn isset($status[\"$this->_StatusCode\"]) ? $status[\"$this->_StatusCode\"] : \"Unknown\";\n\t}", "public function Messages_Get($ID)\n\t{\n\t\t$Data = $this -> HTTPRequest($this -> APIURL.'Messages:Get/ID:'.(int)$ID);\n\t\treturn $this -> ParseResponse($Data);\n\t}", "public function setMessageSeen($msg_id)\n {\n $query = \"UPDATE message_to_advertiser SET is_seen = 'y' WHERE $msg_id\";\n return $this->getQueryResult($query, $this->getConnection());\n }", "public static function getStatusMessage()\n {\n switch(self::status())\n {\n case 'PLEXCEL_NO_CREDS':\n return \"no creds\";\n break;\n case 'PLEXCEL_PRINCIPAL_UNKNOW':\n return \"principal unknow\";\n break;\n case 'PLEXCEL_LOGON_FAILED':\n return \"logon failed\";\n break;\n default:\n return \"error :\".self::status();\n }\n }", "public function getStateMessage(/* ... */)\n {\n return $this->_stateMessage;\n }", "public function getMessageInfo($messageId);", "public function iN_UpdateMessageNotificationStatus($userID) {\n\t\t$userID = mysqli_real_escape_string($this->db, $userID);\n\t\tif ($this->iN_CheckUserExist($userID) == 1) {\n\t\t\tmysqli_query($this->db, \"UPDATE i_users SET message_notification_read_status = '0' WHERE iuid = '$userID'\") or die(mysqli_error($this->db));\n\t\t}\n\t}", "function ppmess_change_commun_status_2($logged_user, $author_id, $post_id){\n\tglobal $wpdb;\n\t\n\t$status = 0; // when sent_to = 0 message is read, if sent_to != 0 message is not read\n\t\n\treturn $wpdb->query(\n\t\t$wpdb->prepare(\"UPDATE {$wpdb->prefix}private_messages SET sent_to = %d WHERE ( post_id = %d AND ((receiver_id = %d AND sender_id = %d) \n\t\t\tOR (receiver_id = %d AND sender_id = %d)) AND message_parent = 0 AND sent_to = %d )\", \n\t\t\t\t$status, $post_id, $logged_user, $author_id, $author_id, $logged_user, $logged_user)\n\t);\n}", "public function statusMessage(): string;", "public function testGetValidMessagebyMessageId(){\n\t\t//create a new message\n\t\t$newMessage =new message (null, $this->VALID_MESSAGE_ID, $this->VALID_LISTING_Id, $this->VALID_ORG_ID, $this->VALID_MESSAGE_ID, $this->VALID_MESSAGE_TEXT);\n\t\t$newMessage->insert($this->getPDO());\n\n\t\t//grab the data from guzzle\n\t\t$response = $this->guzzle->get('http://bootcamp-coders.cnm.edu/~bread-basket/public_html/php/api/message/' . $newMessage-getMessage());\n\t\t$this->assertSame($response->getStatusCode(),200);\n\t\t$body = $response->getBody();\n\t\t$alertLevel = json_decode ($body);\n\t\t$this->assertSame(200, $alertLevel->status);\n\t}", "public function getMessages() {}", "public function getMessages() {}", "public function actionMakeMsgRead()\n {\n CommonUtility::startProfiling();\n try\n {\n Yii::app()->clientScript->scriptMap['jquery.js'] = false;\n Yii::app()->clientScript->scriptMap['jquery.min.js'] = false;\n Yii::app()->clientScript->scriptMap['jquery.yiiactiveform.js'] = false;\n $msgId = $_POST[Globals::FLD_NAME_MSG_ID];\n $userId = $_POST[Globals::FLD_NAME_USER_ID];\n $inboxUser = InboxUser::model()->findByAttributes(array(Globals::FLD_NAME_MSG_ID => $msgId , Globals::FLD_NAME_USER_ID => $userId ));\n $inboxUser->{Globals::FLD_NAME_IS_READ} = Globals::DEFAULT_VAL_MSG_IS_READ;\n if(!$inboxUser->save())\n { \n throw new Exception(\"Unexpected error !!! setmessage to unread..\");\n }\n echo $error = CJSON::encode(array(\n 'status'=>'success',\n \n ));\n }\n catch(Exception $e)\n { \n //catch exception\n $msg = $e->getMessage();\n CommonUtility::catchErrorMsg( $msg );\n }\n CommonUtility::endProfiling();\n }", "function loadMessage($id) {\n $sql = \"SELECT log_id, log_time, log_msgtype, log_msgno,\n log_msg_short, log_msg_long,\n log_msg_uri, log_msg_script,\n log_msg_from_ip, log_msg_referer, log_msg_cookies,\n log_version_papaya, log_version_project,\n user_id, username\n FROM %s\n WHERE log_id = %d\";\n if ($res = $this->databaseQueryFmt($sql, array($this->table, $id))) {\n if ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $this->messageList[$row['log_id']] = $row;\n return TRUE;\n }\n }\n return FALSE;\n\n }", "function ppmess_delete_commun($message_id, $post_id, $user_logged){\n\t\n\tglobal $wpdb;\t\n\t\n\t// default state: npr. for user_id = 1 and user_id = 2 \"_1_2\" OR \"_2_1\"\n\t$new_status = '__'; // deaktiviranje aktivnosti diskusije za trenutnog korisnika\n\t$search_status = '_' . $user_logged; // trenutni status u bazi ( pocetan vrednost je \"_NUMBER\" - znaci da je diskusija aktuelna za korisnika user_NUMBER )\n\t\t\t\t\t\t\t\t\t\t// ako nema broja NUMBER u koloni show_status diskusija za korisnika NUMBER vise nije aktivna\n\t$new_sent_to = 0;\t\t\t\t\t\t\t\t\t\n\t// get current status for desired communicatiion\n\t$query = \"SELECT show_status FROM {$wpdb->prefix}private_messages WHERE message_id = $message_id AND post_id = $post_id AND message_parent = 0 AND (receiver_id = $user_logged OR sender_id = $user_logged)\";\n\t$current_status = $wpdb->get_results( $query, ARRAY_A );\n\t\n\tif( $wpdb->num_rows == 1 ){\n\t\tforeach($current_status as $status){\n\t\t\t$new_value = str_replace($search_status, $new_status, $status['show_status']); \n\t\t}\n\t}else{\n\t\treturn FALSE;\n\t}\n\t\n\treturn $wpdb->query(\n\t\t$wpdb->prepare(\"UPDATE {$wpdb->prefix}private_messages SET show_status = %s, sent_to = %d WHERE (message_id = %d AND post_id = %d AND message_parent = 0\n\t\t\tAND (receiver_id = %d OR sender_id = %d)) OR (post_id = %d AND message_parent = %d AND (receiver_id = %d OR sender_id = %d))\", \n\t\t\t$new_value, $new_sent_to, $message_id, $post_id, $user_logged, $user_logged, $post_id, $message_id, $user_logged, $user_logged)\n\t);\t\n}", "function onGetStatus($mynumber, $from, $requested, $id, $time, $data) {\n\tglobal $DBH;\n\t$number = explode(\"@\", $from)[0];\n\t$privacy_enabled = ($time == null ? true : false);\n\n\tif(!$privacy_enabled) {\n\t\t$latest_statusmsg = $DBH->prepare('SELECT 1 FROM statusmessage_history WHERE \"number\"=:number AND \"changed_at\" = to_timestamp(:time)');\n\t\t$latest_statusmsg -> execute(array(':number' => $number,\n\t\t\t\t\t\t\t\t\t\t ':time' => (string)$time));\n\n\t\tif($latest_statusmsg -> rowCount() == 0) {\n\t\t\t// Update database\n\t\t $insert = $DBH->prepare('INSERT INTO statusmessage_history (\n\t\t\t \t\t\t\"number\", status, changed_at)\n\t\t\t \t\t\t\t\t\t VALUES (:number, :status, to_timestamp(:time));');\n\t\t\t$insert->execute(array(':status' => $data,\n\t\t\t\t\t\t\t\t ':number' => $number,\n\t\t\t\t\t\t\t\t ':time' => (string)$time));\n\t\t\techo ' -[status-msg] Inserted new status message for '.$number.' ('.htmlentities($data).').'.\"\\n\";\n\t\t}\n\t}\n\n\t// Update privacy\n\t$privacy_status = $DBH->prepare('SELECT \"statusmessage_privacy\" FROM accounts WHERE \"id\"=:number');\n\t$privacy_status -> execute(array(':number' => $number));\n\t$row = $privacy_status -> fetch();\n\tif($privacy_enabled != (boolean)$row['statusmessage_privacy']) {\n\t\t$update = $DBH->prepare('UPDATE accounts\n\t\t\t\t\t\t\t\tSET \"statusmessage_privacy\" = :privacy WHERE \"id\" = :number;');\n\t\t$update->execute(array(':number' => $number, ':privacy' => (int)$privacy_enabled));\n\t\tif($privacy_enabled) {\n\t\t\techo ' -[status-msg] '.$number.' has the statusmessage privacy option ENABLED! '.\"\\n\";\n\t\t} else {\n\t\t\techo ' -[status-msg] '.$number.' has the statusmessage privacy option DISABLED! '.\"\\n\";\n\t\t}\n\t}\n\n\n}", "protected function get_user_message_id() {\n\n\t\t$codes = array(\n\t\t\t'22' => 'card_number_invalid',\n\t\t\t'25' => 'card_expiry_invalid',\n\t\t\t'08' => 'csc_mismatch',\n\t\t\t'44' => 'avs_mismatch',\n\t\t\t'F1' => 'avs_mismatch',\n\t\t\t'F2' => 'card_declined',\n\t\t\t'201' => 'card_number_invalid',\n\t\t\t'302' => 'insufficient_funds',\n\t\t\t'303' => 'card_declined',\n\t\t\t'304' => 'card_number_type_invalid',\n\t\t\t'401' => 'card_declined',\n\t\t\t'402' => 'card_declined',\n\t\t\t'501' => 'card_declined',\n\t\t\t'502' => 'decline',\n\t\t\t'503' => 'csc_mismatch',\n\t\t\t'505' => 'decline',\n\t\t\t'508' => 'decline',\n\t\t\t'509' => 'insufficient_funds',\n\t\t\t'510' => 'insufficient_funds',\n\t\t\t'521' => 'insufficient_funds',\n\t\t\t'522' => 'card_expired',\n\t\t\t'530' => 'card_declined',\n\t\t\t'531' => 'csc_mismatch',\n\t\t\t'750' => 'bank_aba_invalid',\n\t\t\t'751' => 'bank_aba_invalid',\n\t\t\t'787' => 'decline',\n\t\t\t'811' => 'csc_mismatch',\n\t\t\t'903' => 'card_expiry_invalid',\n\t\t);\n\n\t\treturn isset( $codes[ $this->get_status_code() ] ) ? $codes[ $this->get_status_code() ] : 'error';\n\t}", "public function getMessageCode()\n {\n }", "function ostGetOtherStatus( $statusID ){\r\n\r\n\t/* @var $dbHandler DataBase */\r\n\t$dbHandler = Core::getdbHandler();\r\n\r\n\t$sql = '\r\n\t\tSELECT * FROM ?#ORDER_STATUSES_TABLE\r\n\t\tWHERE statusID<>? AND statusID<>?\r\n\t';\r\n\t$Result = $dbHandler->query($sql);\r\n\tif( $_Row = db_fetch_row($q) ){\r\n\r\n\t\tLanguagesManager::ml_fillFields(ORDER_STATUSES_TABLE, $_Row);\r\n\t\t_correctOrderStatusName( $_Row );\r\n\t\treturn $_Row;\r\n\t}else return false;\r\n}", "public function getMessageId();", "public function getMessageId();", "public function getMessageId();", "public function getMessageId();", "public function getMessageCode()\n {\n return $this->messageCode;\n }", "function mail_move_msg($msg,$tofolder) {\n\t\t$tofolder = $this->fix_prefix($tofolder,1);\n\t\tif($this->mail_protocol == \"imap\") {\n\n\t\t\tif($tofolder != $msg[\"folder\"]) {\n\t\t\t\t/* check the message id to make sure that the messages still in the server */\n\t\t\t\tif($this->_current_folder != $msg[\"folder\"])\n\t\t\t\t\t$boxinfo = $this->mail_select_box($msg[\"folder\"]);\n\t\t\n\t\t\t\t$this->mail_send_command(\"FETCH \".$msg[\"id\"].\":\".$msg[\"id\"].\" BODY.PEEK[HEADER.FIELDS (Message-Id)]\".$this->CRLF);\n\t\t\t\t$buffer = chop($this->mail_get_line());\n\t\n\t\t\t\t/* if any problem with the server, stop the function */\n\t\t\t\tif(preg_match(\"/^(\".$this->_sid.\" (NO|BAD))/i\",$buffer)) { $this->mail_error_msg = $buffer; return 0; }\n\t\n\t\t\t\twhile(!preg_match(\"/^(\".$this->_sid.\" OK)/i\",$buffer)) {\n\t\t\t\t\t/* we need only the message id yet */\n\t\n\t\t\t\t\tif(preg_match(\"/message-id: (.*)/i\",$buffer,$regs))\n\t\t\t\t\t\t$current_id = preg_replace(\"/<(.*)>/\",\"\\\\1\",$regs[1]);\n\t\n\t\t\t\t\t$buffer = chop($this->mail_get_line());\n\t\t\t\t}\n\n\t\t\t\t/* compare the old and the new message id, if different, stop*/\n\t\t\t\tif(base64_encode($current_id) != base64_encode($msg[\"message-id\"])) {\n\t\t\t\t\t$this->mail_error_msg = $error_retrieving;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\t$tofolder = $this->fix_prefix($tofolder,1);\n\t\t\t\t\n\t\t\t\t$this->mail_send_command(\"COPY \".$msg[\"id\"].\":\".$msg[\"id\"].\" \\\"$tofolder\\\"\".$this->CRLF);\n\t\t\t\t$buffer = $this->mail_get_line();\n\n\t\t\t\t/* if any problem with the server, stop the function */\n\t\t\t\tif(!preg_match(\"/^(\".$this->_sid.\" OK)/i\",$buffer)) { $this->mail_error_msg = $buffer; return 0; }\n\n\t\t\t\tif(file_exists($msg[\"localname\"])) {\n\t\t\t\t\t$currentname = $msg[\"localname\"];\n\t\t\t\t\t$basename = basename($currentname);\n\t\t\t\t\t$newfilename = $this->user_folder.\"$tofolder/$basename\";\n\t\t\t\t\tcopy($currentname,$newfilename);\n\t\t\t\t\tunlink($currentname);\n\t\t\t\t}\n\t\t\t\t$this->mail_set_flag($msg,\"\\\\DELETED\",\"+\");\n\t\t\t\t$this->_require_expunge = true;\n\t\t\t}\n\n\t\t\treturn 1;\n\n\t\t} else {\n\n\t\t\tif($tofolder != $this->_sysmap[\"inbox\"] && $tofolder != $msg[\"folder\"]) {\n\t\t\t\t/* now we are working with POP3 */\n\t\t\t\t/* check the message id to make sure that the messages still in the server */\n\t\t\t\tif($msg[\"folder\"] == $this->_sysmap[\"inbox\"]) {\n\t\n\t\t\t\t\t$this->mail_send_command(\"TOP \".$msg[\"id\"].\" 0\".$this->CRLF);\n\t\t\t\t\t$buffer = $this->mail_get_line();\n\t\t\n\t\t\t\t\t/* if any problem with the server, stop the function */\n\t\t\t\t\tif(!preg_match(\"/^(\\+OK)/\",$buffer)) { $this->mail_error_msg = $buffer; return 0; }\n\t\t\n\t\t\t\t\tunset($header);\n\t\t\n\t\t\t\t\twhile (!feof($this->mail_connection)) {\n\t\t\t\t\t\t$buffer = $this->mail_get_line();\n\t\t\t\t\t\tif(trim($buffer) == \".\") break;\n\t\t\t\t\t\t$header .= $buffer;\n\t\t\t\t\t}\n\t\t\t\t\t$mail_info = $this->get_mail_info($header);\n\t\t\n\t\t\n\t\t\t\t\t/* compare the old and the new message id, if different, stop*/\n\t\t\t\t\tif(base64_encode($mail_info[\"message-id\"]) != base64_encode($msg[\"message-id\"])) {\n\t\t\t\t\t\t$this->mail_error_msg = $error_retrieving;\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!file_exists($msg[\"localname\"])) {\n\t\t\t\t\t\tif(!$this->mail_retr_msg($msg,0)) \n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t$this->mail_set_flag($msg,\"\\\\SEEN\",\"-\");\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->mail_send_command(\"DELE \".$msg[\"id\"].$this->CRLF);\n\t\t\t\t\t$buffer = $this->mail_get_line();\n\n\t\t\t\t\tif(!preg_match(\"/^(\\+OK)/\",$buffer)) { \n\t\t\t\t\t\t$this->mail_error_msg = $buffer; \n\t\t\t\t\t\treturn 0; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(file_exists($msg[\"localname\"])) {\n\t\t\t\t\t$currentname = $msg[\"localname\"];\n\t\t\t\t\t$basename = basename($currentname);\n\t\t\t\t\t$newfilename = $this->user_folder.\"$tofolder/$basename\";\n\t\t\t\t\tcopy($currentname,$newfilename);\n\t\t\t\t\tunlink($currentname);\n\t\t\t\t}\n\t\t\t} else \n\t\t\t\treturn 0;\n\t\t\t\n\t\t}\n\t\treturn 1;\n\t}", "public function actionMakeMsgUnread()\n {\n CommonUtility::startProfiling();\n try\n {\n Yii::app()->clientScript->scriptMap['jquery.js'] = false;\n Yii::app()->clientScript->scriptMap['jquery.min.js'] = false;\n Yii::app()->clientScript->scriptMap['jquery.yiiactiveform.js'] = false;\n $msgId = $_POST[Globals::FLD_NAME_MSG_ID];\n $userId = $_POST[Globals::FLD_NAME_USER_ID];\n \n $inboxUser = InboxUser::model()->findByAttributes(array(Globals::FLD_NAME_MSG_ID => $msgId , Globals::FLD_NAME_USER_ID => $userId ));\n $inboxUser->{Globals::FLD_NAME_IS_READ} = Globals::DEFAULT_VAL_MSG_IS_NOT_READ;\n if(!$inboxUser->save())\n { \n throw new Exception(\"Unexpected error !!! setmessage to unread..\");\n }\n echo $error = CJSON::encode(array(\n 'status'=>'success',\n \n ));\n }\n catch(Exception $e)\n { \n //catch exception\n $msg = $e->getMessage();\n CommonUtility::catchErrorMsg( $msg );\n }\n CommonUtility::endProfiling();\n }", "public function getIdMessage() \n\t{\n\t\treturn $this->idMessage;\n\t}", "function getMsgReceived($account, $profile_id='%%', $conv_id='%%', $msg_id='%%', $template='%%', $watson_msg='%%', $watson_try='%%', $is_read='%%'){\n\t\tglobal $db;\n\t\t$profile_id = empty($profile_id)?'%%':$profile_id;\n\t\t$conv_id = empty($conv_id)?'%%':$conv_id;\n\t\t$msg_id = empty($msg_id)?'%%':$msg_id;\n\t\t$template = empty($template)?'%%':$template;\n\t\t$watson_msg = getType($watson_msg)!='boolean'?'%%':intval($watson_msg);\n\t\t$watson_try = getType($watson_try)!='boolean'?'%%':intval($watson_try);\n\t\t$is_read = getType($is_read)!='boolean'?'%%':intval($is_read);\n\n\t\t$statement = $db->prepare('SELECT * FROM msg_conversation WHERE by_bot=0 AND profile_id LIKE :profile_id AND conv_id LIKE :conv_id AND msg_id LIKE :msg_id AND template_msg LIKE :template AND watson_msg LIKE :watson_msg AND watson_try LIKE :watson_try AND is_read LIKE :is_read AND accountID=:account ORDER BY date');\n\t\t$statement->execute(array(':profile_id'=>$profile_id, ':conv_id'=>$conv_id, ':msg_id'=>$msg_id, ':template'=>$template, ':watson_msg'=>$watson_msg, ':watson_try'=>$watson_try, ':is_read'=>$is_read, ':account'=>$account));\n\t\treturn $statement->rowCount()==0?null:$statement->fetchAll(PDO::FETCH_ASSOC);\n\t}", "public function getHttpStatusMessage() {\n\t}", "abstract public function getMsgError();", "private function _getStatusCodeMessage($status = 100)\n {\n return (isset($this->codes[$status])) ? $this->codes[$status] : '';\n }", "public function getIdMessage()\n {\n return $this->idMessage;\n }" ]
[ "0.7625756", "0.70659006", "0.6991421", "0.681895", "0.673134", "0.639874", "0.6263489", "0.62102044", "0.607951", "0.6073092", "0.6046357", "0.6016508", "0.6011807", "0.60105884", "0.6003367", "0.59765834", "0.59706825", "0.5963977", "0.5945867", "0.59445965", "0.59393036", "0.59222883", "0.5877346", "0.5833522", "0.5816147", "0.5767163", "0.5755507", "0.5730118", "0.5719084", "0.570718", "0.5702368", "0.5690621", "0.5689899", "0.5679614", "0.56701654", "0.5659442", "0.5648167", "0.5641626", "0.5641367", "0.5613456", "0.5610186", "0.5608858", "0.5608761", "0.5606829", "0.5606829", "0.55901325", "0.5587373", "0.5585179", "0.5583115", "0.5580427", "0.55790263", "0.5571512", "0.55624473", "0.5560286", "0.55280054", "0.5526808", "0.55257565", "0.55246204", "0.55246204", "0.55246204", "0.55246204", "0.55246204", "0.55246204", "0.55246204", "0.5522319", "0.55216223", "0.5519384", "0.5507477", "0.5504202", "0.5502517", "0.5499865", "0.54932904", "0.54899645", "0.5478901", "0.5462627", "0.5459865", "0.5456352", "0.5442362", "0.5440268", "0.5440268", "0.5439888", "0.5426573", "0.54210037", "0.54100853", "0.54092485", "0.5407299", "0.54029804", "0.5397895", "0.5397895", "0.5397895", "0.5397895", "0.53977495", "0.538397", "0.5380765", "0.53762174", "0.53652894", "0.53644055", "0.5362126", "0.53494316", "0.5344914" ]
0.8129333
0
Finds the Kaohao model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = Kaohao::findOne($id)) !== null) { return $model; } throw new NotFoundHttpException('The requested page does not exist.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function find($primary_key, $model);", "private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}", "public function findModel($clz, $key);", "public function find($model, $id);", "public function getModelByPrimaryKey($action = null, $keyValue = null)\n {\n $keyName = $this->model->getKeyName();\n\n if ($keyValue == '_') {\n if ($this->request()->has(\"data.primaryKey.{$keyName}\")) {\n $keyValue = $this->request()->input(\"data.primaryKey.{$keyName}\");\n } elseif ($this->request()->has(\"data.old.{$keyName}\")) {\n $keyValue = $this->request()->input(\"data.old.{$keyName}\");\n } elseif ($this->request()->has('data.items')) {\n $items = $this->request()->input('data.items');\n if (Arr::has($items, $keyName)) {\n $keyValue = Arr::get($items, $keyName);\n } else {\n $first = Arr::first($items);\n if (Arr::has($first, $keyName)) {\n $keyValue = Arr::get($first, $keyName);\n }\n }\n }\n }\n\n $data = [$keyName => $keyValue];\n\n $r = $this->validateData($data, null, 'primaryKey', $action, [$keyName => ['includeUniqueRules' => false]]);\n if ($r !== true) {\n return $r;\n }\n\n $modelClass = get_class($this->model);\n if ($model = $modelClass::find($data[$keyName])) {\n return $model;\n }\n\n return CrudJsonResponse::error(CrudHttpErrors::TARGET_DATA_MODEL_NOT_FOUND, null, [\n 'action' => 'primaryKey',\n 'parent_action' => $action,\n 'target' => $data,\n ]);\n }", "protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = KhoSanPham::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Kamar::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function find($pk)\r\n {\r\n $row = $this->getTable()->find($pk);\r\n if(!$row){\r\n return false;\r\n }\r\n $sampleModel = new SampleModel();\r\n $this->_map($sampleModel, $row);\r\n return $sampleModel;\r\n }", "protected function findModel($id)\n {\n if (($model = Klien::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n\t\tif (($model = EntEmpleados::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t\t}\n\t}", "public function loadModel($id)\r\n\t{\r\n\t\t$model=Klient::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "public function returnFindByPK($id);", "protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = StoreKasir::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n\t{\n\t\t$model=Korzet::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'A keresett tartalom nem található.');\n\t\treturn $model;\n\t}", "public function loadModel($id) {\n $model = MissionCarers::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('texts', 'FLASH_ERROR_404_THE_REQUESTED_PAGE_DOES_NOT_EXIST'));\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = TKaryawan::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = PoinKebaikan::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "function find($id)\n{\n\t$model = $this->newModel(null);\n\treturn $model->find($id);\n}", "protected function findModel($id)\n {\n if (($model = Buku::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n {\n $model = Kupons::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = Picture::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, \\Yii::t('The requested object does not exist or has been already deleted.'));\n }\n }", "public function loadModel($id)\r\n\t{\r\n\t\t$model=KqxsBac::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "public function findById(string $modelId): ?Model;", "public function loadModel($id)\n\t{\n\t\t$model=Kzone::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Kus::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=RequestFuel::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,Yii::t('rdt','The requested page does not exist.'));\n\t\treturn $model;\n\t}", "public function find(int $id): ?Model;", "public function find(int $id): ?Model;", "protected function findModel($key)\n {\n if (($model = NotificationsTemplate::find()->andWhere(['key'=>$key])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n\t\tif (($model = Menu::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t}\n\t\t\n\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t}", "public function loadModel($id){\n\t\t\n\t\t$model=XhTitle::model()->findByPk($id);\n\t\t\n\t\tif($model===null)\n\t\t\t\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t\n\t\treturn $model;\n\t\n\t}", "protected function findModel($id)\n {\n if (($model = Offer::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Kareer::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = PostKey::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "private function _findModel($id)\n {\n $modelClass = $this->_getModelClass();\n\n if (($model = $modelClass::findOne($id)) === null) {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n\n return $model;\n }", "public function show($pk)\n {\n return $this->model->findOrFail($pk);\n }", "public function findById() {\n // TODO: Implement findById() method.\n }", "public function loadModel($id)\n\t{\n\t\t$model=Pooja::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = DaftarSmk::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Kart::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Nursinghomes::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n {\n $model = IdeaHeap::model()->findByPk($id);\n\n if ($model === null)\n throw new CHttpException(404);\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Ios::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id) {\n if (($model = Stakeholder::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Contain::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = Bonification::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = RealEstateMaster::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Apple::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = LabKit::findOne($id)) != null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Prefix::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = HasilKonsultasi::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Fenhong::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($name, $id) {\n\t\t$model = $name::model()->findByPk($id);\n\t\tif ($model === null)\n\t\t\tthrow new CHttpException(404, 'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Jadwal::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Cluster::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=eBayTargetAndTrack::model()->findByPk($id, \"company_id=:company_id\" ,array(':company_id' => Yii::app()->session['user']->company_id));\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Topik::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = SecurityEntities::findOne($id)) !== null) \n {\n return $model;\n } else \n {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\r\n {\r\n if (($model = Apresentacao::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected\n\tfunction findModel(\n\t\t$id\n\t) {\n\t\tif ( ( $model = Building::findOne( $id ) ) !== null ) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException( 'The requested page does not exist.' );\n\t\t}\n\t}", "public function find($id){\n return $this->model->query()->findOrFail($id);\n }", "public function loadModel($id)\n {\n $model=Seat::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Repository::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n \tif (($model = QOrder::findOne($id)) !== null) {\n \t\treturn $model;\n \t} else {\n \t\tthrow new NotFoundHttpException('The requested page does not exist.');\n \t}\n }", "protected function findModel($id)\n {\n if (($model = PaidEmployment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }", "protected function findModel($id)\r\n {\r\n if (($model = Usertable::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected function findModel($id)\n {\n if (($model = CompPrep::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n\t{\n\t\tif (($model = Operation::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id){\r\r\n\r\r\n\t $model=OrdenConsumo::model()->findByPk($id);\r\r\n\r\r\n\t if($model===null)\r\r\n\t throw new CHttpException(404,'The requested page does not exist.');\r\r\n\t return $model;\r\r\n\r\r\n\t}", "protected function findModel($id)\n\t{\n\t\tif (($model = Route::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t}\n\t}", "public function loadModel($id)\n {\n $model = $this->getModel()->findByPk($id);\n if($model === null)\n throw new CHttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n\n return $model;\n }", "public function loadModel($id)\n\t{\n\t\t$model=Knowledgecatalogue::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n\t\t{\n\t\t\tif (($model = PhoneRecord::findOne($id)) !== null) {\n\t\t\t\treturn $model;\n\t\t\t}\n\t\t\t\n\t\t\tthrow new NotFoundHttpException(Yii::t('app', 'Запрашиваемая страница не существует.'));\n\t\t}", "public function findPk($pk)\r\n {\r\n $pkColumns = $this->getObject()->getTable()->getIdentifierColumnNames();\r\n if(($count = count($pkColumns)) > 1)\r\n {\r\n // composite primary key\r\n if(!is_array($pk))\r\n {\r\n throw new Exception(sprintf('Class %s has a composite primary key and expects %s parameters to retrieve a record by pk', $this->class, join(', ', $pkColumns)));\r\n } \r\n else if (is_array($count[0]))\r\n {\r\n // array of arrays\r\n // sorry the finder can't do that on objects with composte primary keys\r\n throw new Exception('Impossible to find a list of Pks on an objects with composite primary keys');\r\n }\r\n for ($i=0; $i < $count; $i++)\r\n { \r\n $this->addCondition('and', $pkColumns[$i], '=', $pk[$i]);\r\n }\r\n return $this->findOne();\r\n }\r\n else\r\n {\r\n // simple primary kay\r\n if(is_array($pk))\r\n {\r\n $this->addCondition('and', $pkColumns[0], ' IN ', $pk);\r\n return $this->find();\r\n }\r\n else\r\n {\r\n $this->addCondition('and', $pkColumns[0], '=', $pk);\r\n return $this->findOne();\r\n }\r\n }\r\n }", "public function loadModel($id)\n\t{\n\t\t$model=Coordocs::model()->findByPk($id+0);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Document::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('Страница не существует.');\n }", "protected function findModel($id)\n {\n if (($model = SkepPenetapanBcf15::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n\n\n if (($model = page::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Amphur::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "private function findModel($id)\n {\n return Pekerjaan::findOne($id);\n }", "public function loadModel($id)\n\t{\n\t\t$model=Recargas::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Docingresados::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'El enlace o direccion solicitado no existe');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=AutoChores::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Orcamento::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Major::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = EnglishKb::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));\n }", "public function loadModel($id)\n\t{\n\t\t$model=TDespachoCabecera::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if(Yii::$app->session->get('Rules')['comp_id'] ==1){\n if (($model = Customer::findOne(['id' => $id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }else{\n\n \n if (($model = Customer::findOne(['id' => $id,'comp_id' => Yii::$app->session->get('Rules')['comp_id']])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Ncr::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Gl2010idid::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Campanha::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n\t{\n\t\t$model=ARTICULOS::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function find($id):Default_Model_Model{\n\n\n\t\t$result=$this->getDbTable()->find($id);\n\n\t\t//echo \"id=>$id\";\n\n\t\tif(0 == count($result)) return false;\n\n\t\t$row = $result->current();\n\t\t$object = $this->getModel($row->toArray ());\n\n\t\treturn $object;\n\n\t}" ]
[ "0.76797307", "0.7318244", "0.6913207", "0.6856757", "0.6825714", "0.6704856", "0.66969955", "0.66491276", "0.66455096", "0.66373557", "0.6635491", "0.6633922", "0.66005933", "0.6583299", "0.6582251", "0.65821195", "0.65627253", "0.65517807", "0.65364426", "0.651544", "0.64973783", "0.6487217", "0.648619", "0.64811707", "0.64801246", "0.64728165", "0.6471741", "0.64659053", "0.6463511", "0.64634085", "0.64578384", "0.6447205", "0.64390343", "0.64390343", "0.6429627", "0.642958", "0.64279485", "0.64261687", "0.6420203", "0.6413438", "0.6412893", "0.6411457", "0.64098847", "0.6403564", "0.63999665", "0.6396834", "0.63961554", "0.63944465", "0.6378183", "0.6375483", "0.6375436", "0.6365887", "0.6360844", "0.63597643", "0.63505524", "0.6350456", "0.63499737", "0.6344857", "0.63409483", "0.6337979", "0.6337969", "0.63367915", "0.633515", "0.6334141", "0.633383", "0.63297373", "0.6329102", "0.6327685", "0.632685", "0.63263005", "0.63262945", "0.63220125", "0.6321486", "0.632062", "0.6319359", "0.6315992", "0.63108397", "0.6310261", "0.6307707", "0.6307391", "0.630608", "0.63028353", "0.62988466", "0.62974185", "0.6297219", "0.62969226", "0.6296648", "0.6294197", "0.6292945", "0.62928426", "0.6286777", "0.6285381", "0.6283414", "0.6282671", "0.62823206", "0.6281611", "0.62807506", "0.6280731", "0.6277658", "0.6273532" ]
0.67788404
5
public methods Creates new entity.
public function create() { $entityClassName = $this->getEntityClassName(); return $entityClassName::create($this, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createEntity();", "public function create(Entity $entity);", "function create($entity);", "public function create($entity);", "abstract protected function createEntityInstance();", "private function createEntity()\n {\n $this->entity = $this->container->make($this->entity());\n }", "public function createEntity($entityName = null);", "public function createEntity($name);", "abstract protected function getNewEntityInstance();", "public function createEntity($data = array());", "abstract protected function createEntities();", "public function create()\n {\n $invoice = new InvoiceEntity();\n $invoice->setNumber('019101910191091')\n ->setValue(100.90)\n ->setUrl('http://domain.com')\n ->setIssuanceDate('2017-09-15')\n ->setKey('POL9898AS');\n\n $tracking = new TrackingEntity();\n $tracking->setOrderId('00001010101AA')\n ->setStatus('in_route')\n ->setCode('BR800OPR5')\n ->setInvoice($invoice);\n\n $this->dm->persist($tracking);\n $this->dm->flush();\n }", "public function create(array $entity)\n {\n \n }", "public function createEntity()\n {\n $createdCompany = new Company();\n $createdCompany->setTitle('Test Company')\n ->setIco('11025848744')\n ->setDic('1258745968444')\n ->setStreet('Cesta 125')\n ->setZip('021478')\n ->setCity('Bratislava')\n ->setCountry('Slovenska Republika');\n\n $this->em->persist($createdCompany);\n $this->em->flush();\n\n return $createdCompany;\n }", "public function createAction()\n {\n $type = $this->params('type');\n $instance = $this->getInstanceManager()->getInstanceFromRequest();\n $query = $this->params()->fromQuery();\n $entity = $this->getEntityManager()->createEntity(\n $type,\n $query,\n $instance\n );\n $this->getEntityManager()->flush();\n\n $data = ['entity' => $entity, 'data' => $query];\n $response = $this->getEventManager()->trigger('create.postFlush', $this, $data);\n return $this->checkResponse($response);\n }", "protected function createEntity($data) {\n\n if(!empty($this->model_class)) {\n \n $this->createModelInstance($data);\n\n } else {\n \n $this->entity = $data;\n\n }\n \n }", "protected function createEntity()\n {\n return new $this->entityClass();\n }", "function create(IContract $entity);", "abstract public function createTemplateEntity();", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create() {\n //\n }", "public function createEntity() {\r\n\t\t$entity = $this->getAnnotation('entity');\r\n\t\tif($entity) {\r\n\t\t\treturn new $entity;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function create()\n {\n //\n\t\t\n }", "public function create()\n {\n \n //\n }", "public function create()\n {\n //\n \n }", "public function create() {\r\n //\r\n }", "public function create(){}", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create() {\n //\n }", "public function create()\n {\n //\n \n }", "public function create()\n {\n //\n \n }", "public function create()\n {\n //\n \n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }", "public function create()\r\n {\r\n //\r\n }" ]
[ "0.8894088", "0.82188594", "0.81235164", "0.80868316", "0.7920729", "0.7805106", "0.77431285", "0.75380355", "0.748992", "0.7476557", "0.7321029", "0.72979015", "0.71060014", "0.71041805", "0.7089774", "0.70742494", "0.70637393", "0.7059642", "0.7044398", "0.7036717", "0.7036717", "0.7036717", "0.7036717", "0.70309144", "0.70297784", "0.69863194", "0.69807124", "0.69687617", "0.6957389", "0.69526124", "0.69344467", "0.692724", "0.692724", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.69231737", "0.6914833", "0.6914833", "0.6914833", "0.6913309", "0.6913309", "0.6913309", "0.6913309", "0.6913309" ]
0.7280097
12
Creates collection for entire repository.
public function listAll() { $collectionClassName = $this->getInstanceCollectionClassName(); return $collectionClassName::create($this, $this->getTable()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createCollection()\n {\n return $this->_setUpNewNode(\n new Collection()\n );\n }", "protected function createCollection()\n {\n $model = $this->getModel();\n return $model->asCollection();\n }", "public function createCollection($name) {}", "private function createCollection()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }", "public function createCollection($data = array());", "public function createCollection(CollectionCreateStruct $collectionCreateStruct, Block $block, string $collectionIdentifier): Collection;", "protected function _prepareCollection()\n {\n $collection = $this->collectionFactory->create();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public function createCollection()\n\t{\n\t\t/** @var $collection \\Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection */\n\t\t$collection = $this->productCollectionFactory->create();\n\t\t$collection->setVisibility($this->catalogProductVisibility->getVisibleInCatalogIds());\n\n\t\t$collection = $this->_addProductAttributesAndPrices($collection)\n\t\t\t->addStoreFilter()\n\t\t\t->setPageSize($this->getPageSize())\n\t\t\t->setCurPage($this->getRequest()->getParam(self::PAGE_VAR_NAME, 1));\n\n\t\t$conditions = $this->getConditions();\n\t\t$conditions->collectValidatedAttributes($collection);\n\t\t$this->sqlBuilder->attachConditionToCollection($collection, $conditions);\n\n\t\treturn $collection;\n\t}", "static function collection()\n {\n return new Collection();\n }", "public function collection(Collection $collection);", "public function create()\n {\n return view('AdminPanel.Collection.AddCollection');\n }", "protected function createEmptyCollection(): Collection\n {\n /** @var Collection<TEntity> $emptyCollection */\n $emptyCollection = new Collection($this->db);\n return $emptyCollection;\n }", "public function createCollection()\n\t{\n\t\t$tag = $this->tag;\n\n\t\tif ($this->hasPaginator) {\n\t\t\t$tag = $this->tag->getCollection();\n\t\t}\n\n\t\t$this->tagCollection = new Collection(\n\t\t\t$tag, \n\t\t\tnew TagTransformer\n\t\t);\n\n\t\treturn $this;\n\t}", "protected function createCollection( $path )\n {\n // Create collection\n $this->content[$path] = array();\n\n // Add collection to parent node\n $this->content[dirname( $path )][] = $path;\n\n // Set initial metadata for collection\n $this->props[$path] = $this->initializeProperties( $path, true );\n }", "public function createCollection()\n\t{\n\t\t$ticket = $this->ticket;\n\n\t\tif ($this->hasPaginator) {\n\t\t\t$ticket = $this->ticket->getCollection();\n\t\t}\n\n\t\t$this->ticketCollection = new Collection(\n\t\t\t$ticket, \n\t\t\tnew TicketTransformer\n\t\t);\n\n\t\treturn $this;\n\t}", "public function collection() {\n \t$db = $this->db;\n\t\t$sql = $this->sql();\n\t\t$rows = $db::execute($sql);\n\t\t$model = $this->model;\n\t\treturn new \\Collection($model::arrayFactoryFromRows($rows));\n\t}", "private function create_collection() {\n\n\t\treturn new MapCollection();\n\t}", "private static function collections()\n {\n $files = ['JSON', 'Collection'];\n $folder = static::$root.'Collections'.'/';\n\n self::call($files, $folder);\n }", "public function run()\n {\n foreach (\\App\\Collection::all() as $collection) {\n factory(App\\Series::class)->create([\n 'collection_id' => $collection->id,\n 'reference' => 'RW33',\n 'name' => 'Records of the Preservation and Digital Preservation Department',\n 'description' => '\t\nThe series contains digital records created in the Preservation area of The National Archives functional electronic file plan used between 2003 and 2008; the records would have been predominantly created by the various Preservation and Digital Preservation departments. This function concerns the devising and promulgating of pro-active and preventative strategies for the preservation of both government and non-public archival records. This involves managing the integrity and usability of all records, traditional and digital, in The National Archives. It includes developing internal and external preservation strategies and systems, researching physical and chemical properties of materials, and applying conservation techniques.'\n ]);\n }\n }", "protected function _getCollection()\n\t{\n\t\t//Check collection\n\t\tif($this->_collection)\n\t\t\treturn $this->_collection;\n\n\t\t//Get collection\n\t\t$this->_collection = new \\Framework\\Database\\Drivers\\Mongo\\CDatabaseModelCollection($this, $this->execute());\n\t\treturn $this->_collection;\n\t}", "public function run()\n {\n $faker = Faker\\Factory::create();\n $languages = Language::GetLanguagesIso()->toArray();\n\n\t\t$photos = Photo::get();\n\n $types = Type::get();\n\n factory(Collection::class, 20)->create()->each(function($collections) use ($languages,$photos,$faker,$types){\n\n\t\t\t//idiomas\n\t foreach ($languages as $id => $iso) {\n\t \t$title =$faker->sentence;\n\t $collections->updateTranslationByIso($iso,[\n\t \t'title' => $title,\n 'subtitle' => $faker->sentence,\n\t 'slug' => Collection::generateUniqueSlug($title),\n\t\t\t\t\t 'excerpt' => $faker->sentence,\n\t\t\t\t\t 'content' => $faker->realText\n\t ]);\n\t }\n\n\t\t\t// imagenes\n if (!$photos->isEmpty()) {\n if (rand(0,9) < 7) {\n $collections->associateImage($photos->random(1), [\n 'use' => \"thumbnail\" ,\n 'order' => null,\n 'class' => null\n ]);\n }\n }\n\n\t\t\t// types\n $collections->types()->sync( getRandomElements($types));\n });\n }", "protected function makeData()\n {\n $Collection = new Collection();\n for($i = 0; $i < 35; $i++){\n $Collection->push([\n 'name' => $this->Faker->name,\n 'email' => $this->Faker->email,\n 'birthday' => $this->Faker->date,\n 'phone_number' => $this->Faker->phoneNumber,\n 'bio' => $this->Faker->text,\n ]);\n }\n\n return $Collection;\n }", "public function setCollection()\n {\n $cl = $this->nameCollection;\n $this->collection = self::$database->$cl;\n }", "public function newCollection(array $models = []);", "public function __construct()\n {\n $this->_collection = new Collection();\n }", "public function createCollection($collectionName, array $options = [])\n {\n if (! isset($options['typeMap'])) {\n $options['typeMap'] = $this->typeMap;\n }\n\n $server = select_server($this->manager, $options);\n\n if (! isset($options['writeConcern']) && server_supports_feature($server, self::$wireVersionForWritableCommandWriteConcern) && ! is_in_transaction($options)) {\n $options['writeConcern'] = $this->writeConcern;\n }\n\n $operation = new CreateCollection($this->databaseName, $collectionName, $options);\n\n return $operation->execute($server);\n }", "protected function _createCollection()\n {\n return Mage::getModel('wishlist/item')->getCollection()\n ->setWebsiteId($this->_getCustomer()->getWebsiteId())\n ->setCustomerGroupId($this->_getCustomer()->getGroupId());\n }", "private function buildCollection(): void\n {\n //todo 這邊可以在sql裡面處理,但因為時程的關係,先用這種方法處理\n $userId = auth()->user()->id;\n $this->collection->map(function ($item) use ($userId) {\n $item->isAuthor = ($item->user_id == $userId);\n $item->user_id = null;\n });\n }", "private function createCollection()\n {\n try\n {\n $request = $_POST;\n\n global $cbcollection;\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n else \n $uid = userid();\n\n //check if video id provided\n if( !isset($request['collection_name']) || $request['collection_name']==\"\" )\n throw_error_msg(\"Collection Name not provided\");\n\n if( !isset($request['collection_description']) || $request['collection_description']==\"\" )\n throw_error_msg(\"Collection Description not provided\");\n\n if( !isset($request['collection_tags']) || $request['collection_tags']==\"\" )\n $request['tags'] = 'sample_tag';\n\n if( !isset($request['category']) || $request['category']==\"\" ) {\n throw_error_msg(\"Collection category not provided\");\n } else {\n $request['category'] = array($request['category']);\n }\n\n if( !isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"Collection type not provided\");\n\n if( !isset($request['broadcast']) || $request['broadcast']==\"\" )\n $request['broadcast'] = 'public';\n\n if( !isset($request['allow_comments']) || $request['allow_comments']==\"\" )\n $request['allow_comments'] = 'yes';\n\n if( !isset($request['public_upload']) || $request['public_upload']==\"\" )\n $request['public_upload'] = 'no';\n\n $toclean = array('collection_name','collection_description');\n foreach ($toclean as $key => $item) {\n $request[$item] = mysql_clean($request[$item]);\n }\n\n $status = $cbcollection->create_collection($request);\n # pex($status,true);\n if( $status )\n {\n $newdata = $cbcollection->get_collection($status);\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => \"Collection has been created successfully :P \", \"data\" => $newdata);\n $this->response($this->json($data));\n }\n else\n {\n throw_error_msg(\"Something went wrong trying to create collection\"); \n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "static protected function _createMongoCollection($config)\n {\n if(!isset($config['server'])){\n $server = \"mongodb://localhost:27017\";\n } else {\n $server = $config['server'];\n }\n if(!isset($config['options']) || !is_array($config['options'])){\n $options = array();\n } else {\n $options = $config['options'];\n }\n $mongo = new MongoDb($server, $options);\n return $mongo->selectDB($config['database'])\n ->selectCollection($config['collection']);\n }", "public function __construct(){\r\n\t\t$this->collection = new Collection();\r\n\t}", "public function testCreateCollection()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "protected function generateCollections()\n {\n if ( ! is_null($this->collections) ) {\n foreach ( $this->collections as $collection ) {\n $this->iterateCollection($collection);\n }\n }\n }", "abstract function newRepoInstance($mongoDb, $collection, $persistable = null);", "public function collection(ContentCollection $collection = null);", "public function create($data){ throw new \\Exception('You must define at least one collection!'); }", "public function createMigrationCollection()\n {\n $this->validate();\n\n if (true !== $this->migrationCollectionCreated) {\n $collection = $this->getCollection();\n $collection->createIndex(['v' => -1], ['name' => 'version', 'unique' => true]);\n $this->migrationCollectionCreated = true;\n }\n\n return true;\n }", "protected function _prepareCollection()\n {\n /** @var $collection ChazkiExpressCollection */\n $collection = $this->_collectionFactory->create();\n $collection->setWebsiteFilter($this->getWebsiteId());\n\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public function collectionBuilder()\n {\n $emptyRobofile = new \\Robo\\Tasks;\n return CollectionBuilder::create($this->getContainer(), $emptyRobofile);\n }", "abstract public static function create(Relation $query): Collection;", "protected function entityCreate(Array $data){\n // TODO: deal with errors\n // insert new items\n $inserted = $this->resourceService()->create($data);\n if(isset($inserted['message'])){\n \\Log::error(\"Error \".$inserted['status_code'].\": \".$inserted['message']);\n }\n // return item\n return new LaravelCollection($inserted['data']);\n }", "public function getCollection();", "public function getCollection();", "public function getCollection();", "public function getCollection();", "public function test_comicEntityIsCreated_collections_setCollections()\n {\n $sut = $this->getSUT();\n $collections = $sut->getCollections();\n $expected = [\n ComicSummary::create(\n 'http://collectionResourceURINumber1',\n 'collection name number 1'\n ),\n ComicSummary::create(\n 'http://collectionResourceURINumber2',\n 'collection name number 2'\n ),\n ];\n\n $this->assertEquals($expected, $collections);\n }", "public function run()\n {\n $faker = Faker::create();\n foreach (range(1, 10) as $index) {\n DB::table('collections')->insert([\n 'name' => $faker->word(),\n 'is_featured' => $faker->numberBetween(0, 1),\n 'image' => \"https://picsum.photos/id/{$faker->numberBetween(600, 700)}/600/600\"\n ]);\n }\n }", "private function createCollectionIfNotExists(string $name): void\n {\n if (is_null($this->collections)) {\n $this->collections = array_map(function ($collection) {\n return $collection['name'];\n }, $this->searcher->listCollections());\n }\n\n // Create the index if it's not in the list\n if (!in_array($name, $this->collections)) {\n $this->logger->info('Creating collection ' . $name);\n $this->searcher->createCollection($name);\n $this->collections[] = $name;\n }\n }", "public function run()\n {\n foreach (\\App\\Collection::all() as $collection) {\n $series = factory(App\\Series::class)->create(['collection_id' => $collection->id]);\n }\n }", "public function collection()\n {\n $name = \"$this->db.$this->name.$this->gridFS\";\n if( ! isset(self::$collections[$name]))\n {\n $selectMethod = ($this->gridFS ? 'getGridFS' : 'selectCollection');\n self::$collections[$name] = $this->db()->db()->$selectMethod($this->name);\n }\n return self::$collections[$name];\n }", "public function getCollection() ;", "public function factory($collection)\n {\n if ($collection instanceof Collection) {\n $collectionName = $collection->getName();\n } else {\n $collectionName = $collection;\n }\n\n if (!isset($this->collections[$collectionName])) {\n if (!($collection instanceof Collection)) {\n $collection = Norm::createCollection(array(\n 'name' => $collection,\n 'connection' => $this,\n ));\n\n $this->applyHook('norm.after.factory', $collection);\n }\n\n $this->collections[$collectionName] = $collection;\n }\n\n return $this->collections[$collectionName];\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $collection->setOrder('ID','DESC');\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "protected function _prepareCollection()\n {\n $collection = $this->_createCollection()->addCustomerIdFilter($this->_getCustomer()->getId())\n ->resetSortOrder()\n ->addDaysInWishlist()\n ->addStoreData();\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "private static function dataCollection()\n {\n $files = ['DataCollection'];\n $folder = static::$root.'Objects'.'/';\n\n self::call($files, $folder);\n }", "public static function getCollection()\n\t{\n\t\treturn static::getDb()->getFileCollection(static::collectionName());\n\t}", "public static function collection()\n {\n $jsoLoader = new JsonLoader(new ISO3166CountryFactory());\n\n return new Collection($jsoLoader->load(__DIR__.'/../data/iso3166.json'));\n }", "protected function newCollection(array $data)\n {\n return new Collection($data);\n }", "protected function getExportCollection()\n {\n // crea connessione mongodb\n $connectionString = 'mongodb://' . \n $this->mongoParam['username'] . ':' . $this->mongoParam['password'] . '@' .\n $this->mongoParam['server'] . '/' . $this->mongoParam['db'];\n $connection = new MongoClient($connectionString);\n // apre la collection\n $collection = $connection->selectCollection($this->mongoParam['db'], ChunkExportHandler::EXPORT_COLLECTION);\n \n return $collection;\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getResourceModel($this->_getCollectionClass());\n $this->setCollection($collection);\n\n return parent::_prepareCollection();\n }", "public function buildCollection(): void\n {\n foreach ($this->pages as $Page) {\n $this->routes[] = $Page->route();\n }\n foreach ($this->pages as $Page) {\n try {\n $this->store($Page);\n } catch (\\Exception $error) {\n throw new \\Exception($error);\n }\n }\n }", "public function run()\n {\n factory(App\\Category::class, 10)->create()->each(function ($u) {\n $u->products()->saveMany(factory(App\\Product::class, 3)->make());\n });\n }", "public function getNewCollection(string $typeName, string $schema): OCICollection\n {\n return oci_new_collection($this->dbh, $typeName, $schema);\n }", "public function __construct()\n {\n $this->items = new Collection;\n }", "public function __construct()\n {\n $this->items = new Collection;\n }", "public function getCollection()\r\n\t{\r\n\t\treturn $this\r\n\t\t\t->getDbConnection()\r\n\t\t\t->selectDatabase()\r\n\t\t\t->getGridFS([\r\n\t\t\t\t'bucketName' => $this->collectionPrefix()\r\n\t\t\t]);\r\n\t}", "public function getCollection()\n {\n $collection = trim(str_replace('\\\\', '_', $this->collection), '_');\n return $this->$collection()\n ->setDatabase($this->database)\n ->setTable($this->table)\n ->setModel($this->model)\n ->set($this->getRows());\n }", "public function create()\n {\n return $this->repository->create($this->repository->all());\n }", "function createorconnecttoCollection(string $collectionName) {\n $this->rekognition->createCollection([\n 'CollectionId' => $collectionName\n ]);\n return true;\n }", "public function store(Request $request)\n {\n $data = $request->all();\n\n $create = CrudEvolution::create($request->all()); \n $items = DB::collection('crudevolutions')->get();\n return $items;\n }", "public function createCollection(array $data = [])\n {\n return ItemCollection::factory($data);\n }", "public function run()\n {\n factory(Category::class,10)->create()\n ->each(function($category)\n {\n $category->book()->saveMany(factory(Book::class, 10)\n ->create(['category_id' => $category->id]));\n });\n }", "protected function _prepareCollection()\n {\n $collection = Mage::getModel('lavi_news/news')->getResourceCollection();\n\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "public function entities(): Collection;", "public function store(): AdminCollection\n {\n return new AdminCollection($this->adminRepository->store());\n }", "protected function buildColection() \n {\n $content_id = $this->getContentId();\n $origin_content_id = $this->getOriginContentId();\n $project_id = $this->getProjectId();\n $storeId = $this->getStoreId();\n \n try {\n $contentCollection = Mage::getModel('connector/content')->getCollection();\n $contentCollection->addFieldToFilter('filename', array('neq' => ''))\n ->addFieldToFilter('percent', array('lt' => '100'));\n\n if($content_id) { // identity field\n $contentCollection->addIndentifyToFilter($content_id);\n } elseif($origin_content_id && $project_id && $storeId) {\n $contentCollection->addUniqueByParams($origin_content_id, $project_id, $storeId);\n } else { // get all none updated records\n $contentCollection->setPageSize(500)\n ->setCurPage(1);\n }\n \n $contentCollection->joinAdditionalDetails();\n \n return $contentCollection;\n } catch (Exception $ex) {\n Mage::helper('connector')->log($ex->getMessage(), Zend_log::ERR);\n return false;\n }\n \n \n }", "public function all(): \\app\\domain\\interfaces\\EntityCollection {\n $collection = new \\app\\domain\\interfaces\\EntityCollection;\n \n return $collection;\n }", "public function run()\n {\n factory(App\\Category::class, 200)->create()->each(function($cat){\n $cat->barangs()->saveMany(factory(App\\Barang::class, 10)->make());\n });\n }", "public function test_create__with_collection()\n {\n\n $testee = new ElementFactory();\n\n $spec = [\n 'attributes' => [\n 'type' => 'collection',\n 'name' => 'test',\n ],\n 'elements' => [\n [\n 'attributes' => [\n 'type' => 'text',\n 'name' => 'my-text'\n ]\n ]\n ]\n ];\n\n $element = $testee->create($spec);\n static::assertInstanceOf(CollectionElementInterface::class, $element);\n\n $elements = $element->elements();\n static::assertNotEmpty($elements);\n static::assertInstanceOf(ElementInterface::class, reset($elements));\n }", "public function run()\n {\n factory(Stores::class, 10)->create()\n ->each(function ($store) {\n $store->address()->saveMany(factory(Addresses::class,2)->make());\n $store->store_top_main_image()->saveMany(factory(StoreTopMainImages::class,2)->make());\n // photo category\n\n factory(PhotoCategories::class, 3)->create()\n ->each(function ($category){\n $category->photo()->saveMany(factory(Photos::class,9)->make());\n });\n\n \n\n });\n }", "public function executeFull()\n {\n $this->smartCollectionsHelper->createSmartCollections();\n }", "public function run()\n {\n // factory(\\App\\Category::class,5)->create();\n// factory(\\App\\Product::class,100)->create();\n// factory(\\App\\ProductImage::class,200)->create();\n\n//Se crean 5 categorias\n $categories = factory(\\App\\Category::class,5)->create();\n $categories->each(function ($category)\n {\n //Por cada categoria se crean 20 productos\n $products = factory(\\App\\Product::class,20)->make();\n $category->products()->saveMany($products);\n\n //Por cada producto se crean 5 imagenes \n $products->each(function ($p)\n {\n $images = factory(\\App\\ProductImage::class,5)->make();\n $p->images()->saveMany($images);\n\n });\n });\n }", "public function run()\n {\n factory(Item::class, 10)->create()->each(function ($item) {\n $item->categories()->save(factory(App\\Models\\Category::class)->make());\n });\n }", "protected function _prepareCollection()\n\t{\n\t\t$collection = Mage::getResourceModel($this->_getCollectionClass());\n\t\t$this->setCollection($collection);\n\t\t \n\t\treturn parent::_prepareCollection();\n\t}", "protected function createMongoCollectionMock()\n {\n return m::mock(\\MongoDB\\Collection::class);\n }", "public function newCollection(array $models = []): Collection\n {\n return new Collection($models);\n }", "public function all(): Collection\n {\n }", "protected function _getCollection()\n {\n if (!$this->_collection) {\n $websiteId = $this->_storeManager->getWebsite()->getId();\n $this->_collection = $this->_historyFactory->create()\n ->addCustomerFilter($this->currentCustomer->getCustomerId())\n ->addWebsiteFilter($websiteId)\n ->setExpiryConfig($this->_rewardData->getExpiryConfig())\n ->addExpirationDate($websiteId)\n ->skipExpiredDuplicates()\n ->setDefaultOrder();\n }\n return $this->_collection;\n }", "protected function createCollection($website, $pageNumber)\n {\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->organismes = new ArrayCollection();\n $this->reponses = new ArrayCollection();\n $this->tags = new ArrayCollection(); \n $this->categories = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n }", "public function loadAll(): PostCollection\n {\n return new PostCollection(...FakeDataForToy::singleton()->getPostEntities());\n }", "function ting_ting_collection_create($empty, $data = NULL, $conf = FALSE) {\n $context = new ctools_context('ting_collection');\n $context->plugin = 'ting_collection';\n\n if ($empty) {\n return $context;\n }\n\n if ($conf) {\n $collection_id = is_array($data) && isset($data['object_id']) ? $data['object_id'] : (is_object($data) ? $data->id : 0);\n\n module_load_include('client.inc', 'ting');\n $data = ting_get_collection_by_id($collection_id, TRUE);\n }\n\n if (!empty($data)) {\n $context->data = $data;\n $context->title = t('@title by @author', array('@title' => $data->title, '@author' => $data->creators_string));\n $context->argument = $collection_id;\n\n return $context;\n }\n}", "function main(){\r\n $collection = readOSCollection();\r\n print(count($collection) .\"\\n\\n\");\r\n buildOSCollection($collection);\r\n\r\n //writeOSCollectionToDB($collection);\r\n buildOSAlignments($collection);\r\n}", "function addMongo() {\n\n\n\t\tfor($i=0,$l=count($this->data);$i<$l;$i++) {\n\t\t\t$data = $this->data[$i];\n\t\t\t\n\t\t\t//$col->remove(array(\"martfilter\" => $data[\"code\"]));\n\n\n\t\t\tupload2s3gz(\"imf/\".$data[\"code\"], json_encode($data));\n\t\t\t/*try {\n\t\t\t\t$col->insert($data);\n\t\t\t} catch(Exception $e) {\n\t\t\t\t$col->insert(array(\n\t\t\t\t\"martfilter\" => $data[\"code\"],\n\t\t\t\t\"name\" => $data[\"name\"],\n\t\t\t\t\"message\" => $e->getMessage(),\n\t\t\t\t\"data\" => array()\n\t\t\t\t));\n\t\t\t}*/\n\n\t\t}\n\t}", "public function definition()\n {\n if (is_null($this->collections))\n $this->collections = collect();\n $customer = Customer::all()->random();\n $rooms = Room::all();\n $startDate = $endDate = $roomID = null;\n do {\n $startDate = new Carbon($this->faker->dateTimeBetween(\"2020-01-01\", \"2021-12-31\"));\n $startDate->setHour(0);\n $startDate->setMinute(0);\n $startDate->setSecond(0);\n $days = $this->faker->numberBetween(0, 15);\n $endDate = $startDate->copy()->addDays($days);\n $roomID = $rooms->random()->id;\n $collections = $this->collections->filter(function ($reservation) use ($roomID, $startDate, $endDate) {\n return $reservation[\"room_id\"] == $roomID &&\n ($reservation[\"start_date\"] <= $startDate && $reservation[\"end_date\"] >= $startDate ||\n $reservation[\"start_date\"] <= $endDate && $reservation[\"end_date\"] >= $endDate ||\n $reservation[\"start_date\"] >= $startDate && $reservation[\"end_date\"] <= $endDate);\n });\n $count = $collections->count();\n } while ($count > 0);\n $today = Carbon::today();\n $this->collections->push([\"room_id\" => $roomID, \"start_date\" => $startDate, \"end_date\" => $endDate]);\n return [\n \"customer_id\" => $customer,\n \"room_id\" => $roomID,\n \"start_date\" => $startDate,\n \"end_date\" => $endDate,\n \"check_in\" => ($startDate < $today) ? $startDate : null,\n \"check_out\" => ($endDate < $today) ? $endDate : null,\n \"created_at\" => $startDate,\n ];\n }", "public function createCollectionFromArray($data)\n {\n $data['hidden'] = (bool) ArrayUtils::get($data, 'hidden');\n $data['single'] = (bool) ArrayUtils::get($data, 'single');\n $data['managed'] = (bool) ArrayUtils::get($data, 'managed');\n\n return new Collection($data);\n }", "public function __construct() {\n $this->disciplinas = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->tendencias = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->institucionalEstrategias = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->ofertas = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->estrategiaCampos = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->eventos = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n $this->encuestas = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n }", "public function collections()\n {\n return $this->morphToMany(Collection::class, 'collectionable');\n }", "static function wrap($collection)\n {\n return new Collection($collection);\n }", "public function newCollection(array $models = [])\n {\n return new Collection($models);\n }", "public function newCollection(array $models = [])\n {\n return new Collection($models);\n }" ]
[ "0.71131474", "0.70522183", "0.6830116", "0.66548276", "0.65879786", "0.6352937", "0.6263505", "0.623647", "0.6150254", "0.6047592", "0.60369515", "0.59982055", "0.59933424", "0.5991414", "0.5984081", "0.5969143", "0.5950309", "0.5940698", "0.59229934", "0.5901497", "0.58709216", "0.5856696", "0.5852558", "0.5848017", "0.58244145", "0.5810684", "0.5809853", "0.58023834", "0.58021444", "0.5794749", "0.5788863", "0.5786783", "0.5768828", "0.57551384", "0.57517225", "0.5739368", "0.57268155", "0.57208484", "0.5716551", "0.57025486", "0.5700635", "0.56994873", "0.56994873", "0.56994873", "0.56994873", "0.56696296", "0.5651072", "0.5634493", "0.5632791", "0.5632211", "0.5627427", "0.5591221", "0.5589626", "0.55749196", "0.55416286", "0.5536406", "0.55338365", "0.5517844", "0.55159074", "0.5515881", "0.55025333", "0.5494412", "0.5471693", "0.5469172", "0.5469172", "0.54399294", "0.5439577", "0.54381776", "0.5436655", "0.5435503", "0.5434739", "0.5424851", "0.54087096", "0.5407937", "0.53953046", "0.5391949", "0.5388622", "0.537612", "0.5356225", "0.5343058", "0.5335674", "0.5335263", "0.5334533", "0.53317225", "0.5321532", "0.53211737", "0.53165764", "0.5309314", "0.5306854", "0.5304758", "0.5300406", "0.5300065", "0.5287414", "0.52828646", "0.52808523", "0.5272396", "0.5261129", "0.5259237", "0.52575624", "0.5256502", "0.5256502" ]
0.0
-1
Loads entity from storage.
public function get($key) { if ($key == null) { return null; } $row = $this->getTable()->get($key); if ($row == null) { return null; } $entityClassName = $this->getEntityClassName(); return $entityClassName::create($this, $row); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getEntityFromStorage() {\n $entity_type = $this->store->get('entity_type');\n $entity_id = $this->store->get('entity_id');\n\n /** @var \\Drupal\\Core\\Entity\\EntityInterface $entity */\n $entity = $this->entityTypeManager()->getStorage($entity_type)\n ->load($entity_id);\n\n return $entity;\n }", "public function load() : Persistable;", "public function load()\n {\n $data = $this->storage->load();\n $this->collection->load($data);\n\n $this->refresh();\n }", "public function load($persistenceIdentifier);", "public abstract function load();", "public function load() { }", "public function load()\n {\n $raw = $this->_getBackend()->load($this->_id);\n return unserialize($raw);\n }", "abstract public function load();", "abstract public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load() : Persistable\n {\n try {\n $data = $this->filesystem->read($this->path);\n } catch (FilesystemException $e) {\n throw new RuntimeException(\"Error reading data from {$this->path}.\");\n }\n\n $encoding = new Encoding($data);\n\n if ($encoding->bytes() === 0) {\n throw new RuntimeException(\"File at {$this->path} does not contain any data.\");\n }\n\n return $this->serializer->unserialize($encoding);\n }", "public function postLoad($entity);", "public function load($id) {\n\t\t$this->logger->debug('[EntityManager]Loading Entity with id '.$id);\n\t\treturn $this->getRepository()\n\t\t->find($id);\n\t}", "private final function loadObjectFromDb()\n {\n # TODO: would be far preferable to use the objectsFromDestinations() code, possibly by refactoring into another shareable function. this is needed because otherwise we're in object A and OrmClass->load() is generating object B, instead of populating object A\n # TODO:NOTE01\n # TODO: must use $this->setLoadedFromDb() per class\n throw new Exception('TODO');\n }", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "protected function _load()\n\t{\n\t\t$_file = $this->_storagePath . DIRECTORY_SEPARATOR . $this->_fileName;\n\n\t\tif ( is_file( $_file ) && file_exists( $_file ) && is_readable( $_file ) )\n\t\t{\n\t\t\tif ( false !== ( $_data = Utility\\Storage::defrost( file_get_contents( $_file ) ) ) )\n\t\t\t{\n\t\t\t\t//\tIf it wasn't frozen, a JSON string may be returned\n\t\t\t\tif ( is_string( $_data ) && false !== json_decode( $_data ) )\n\t\t\t\t{\n\t\t\t\t\t$_data = json_decode( $_data, true );\n\t\t\t\t}\n\n\t\t\t\t$this->merge( $_data );\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function convertStorageToEntity($in);", "protected function load() {\n $values = $this->getStorage()->fetch($this->getId());\n\n if ($values === false) {\n return false;\n }\n\n // metadata\n $metadata = $values[self::METADATA_NAMESPACE];\n $this->first_trace = $metadata['first_trace'];\n $this->last_trace = $metadata['last_trace'];\n $this->regeneration_trace = $metadata['regeneration_trace'];\n $this->requests_counter = $metadata['requests_count'];\n $this->fingerprint = $metadata['fingerprint'];\n\n // values\n $this->values = $values;\n\n return true;\n }", "public function testPersistLoad()\n {\n// $this->configSetter->configEntityIfNeed($this->category);\n//\n// $path = realpath(__DIR__ . '/fixtures/');\n// $path2 = $path.'/source.jpg';\n// copy($path.'/image.jpeg' , $path2);\n// $file = new File($path2);\n// $this->category->setTitle('')->getImage()->setFile($file);\n// $this->_em->persist($this->category);\n// $this->_em->flush();\n// $this->_em->clear();\n// $id = $this->category->getId();\n//\n// $this->assertTrue(is_file($this->category->getImage()->getOriginFullFileName()));\n// unset($this->category);\n// $this->assertFalse(isset($this->category));\n//\n// $this->category = $this->_em->find('Rid\\Bundle\\ImageBundle\\Tests\\Entities\\Category', $id);\n// $this->assertInstanceOf('Rid\\Bundle\\ImageBundle\\Model\\RidImage', $this->category->getImage());\n// $this->assertInstanceOf('Rid\\Bundle\\ImageBundle\\Model\\RidFile', $this->category->getRidFile());\n// $this->assertInstanceOf('Rid\\Bundle\\ImageBundle\\Services\\Config', $this->category->getRidFile()->getConfig());\n }", "public function loadById($id);", "public function loadById($id);", "public function load(){\n\t\tif (is_file($this->_filename) && is_readable($this->_filename)){\n\t\t\t$this->_storage = require($this->_filename);\n\t\t\t$this->_dataAvailable = true;\n\t\t}\n\t}", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load(): void;", "public function load(): void;", "abstract protected function loadData(ObjectManager $em);", "public function load()\r\n\t{\r\n\t\t$entities = $this->query($this->entity, $this->relation)->getResults($this->relation);\r\n\t\t\r\n\t\t$this->loaded = true;\r\n\r\n\t\treturn $entities;\r\n\t}", "public function load(): void\n {\n $list = $this->localCache->getObject($this->key);\n $value = $this->resultExtractor->extractObjectFromList($list, $this->targetType);\n $this->resultObject->setValue($this->property, $value);\n }", "public function convertEntityToStorage($in);", "abstract function load(Model $model);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function loadStorage($file){\n\t\tif (file_exists($file)) {\n\t\t\t$this->user = unserialize(file_get_contents($file));\n\t\t}\n\t}", "public function load() {\n $response = Gallery3_Helper::request(\"get\", $this->url, $this->token);\n $this->data = $response;\n $this->original_entity = isset($response->entity) ? (array)$response->entity : null;\n return $this;\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function DoctrineLoad()\n {\n // and call __load method\n }", "public function restore(EntityInterface $entity) {\n $entity = $this->load($entity->id());\n }", "public static function postLoad(EntityStorageInterface $storage, array &$entities);", "public function readFromModel($entity);", "public function load(StorageItem $storageItem) : bool\n {\n return true;\n }", "public function load()\n {\n return $this->loadData();\n }", "public static function load(int $id);", "public function load()\n {\n $this\n ->objectManager\n ->createQuery('DELETE FROM ' . Member::class)\n ->execute()\n ;\n Fixtures::load(\n __DIR__ . '/../../fixtures/members.yml',\n $this->objectManager\n );\n }", "public function testLoad()\n {\n $this->rlpMapper->save($this->content1, '/products/news/content1-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $result = $this->rlpMapper->loadByResourceLocator('/products/news/content1-news', 'default', 'de');\n $this->assertEquals($this->content1->getIdentifier(), $result);\n }", "public function load() {\n if (($content = $this->getContents()) !== false)\n return unserialize($content);\n else\n return null;\n }", "function load() {\n\t\tglobal $mysql;\n //if(!$this->exists()) return;\n \t$id \t\t= $mysql->escape($this->id);\n \t$tablename \t= $this->class_name();\n \t$this->data = $mysql->executeSql(\"SELECT * FROM \".$tablename.\" WHERE id=$id;\");\n \t$this->id\t= $this->data['id'];\n \tunset($this->data['id']);\n }", "public function load(){return $this->fetch();}", "protected function loadFromCache() {}", "private function loadItems()\n {\n if ($this->items === null) {\n $this->items = $this->storage->load();\n }\n }", "public function load($id)\n {\n return parent::get($this->getResourceName().'/'.$id)->{$this->getEntityName()};\n }", "public function __load();", "public function load($relation);", "public static function loadById(?int $id);", "public function load( &$object );", "public function getEntity()\n {\n if (empty($this->_data['entity'])) {\n Mage::throwException(Mage::helper('storelocator')->__('Entity is unknown'));\n }\n\n return $this->_data['entity'];\n }" ]
[ "0.7410929", "0.7058673", "0.68563324", "0.64644235", "0.6369238", "0.63207024", "0.62677115", "0.62655187", "0.62655187", "0.6196828", "0.6196828", "0.6196828", "0.6196828", "0.6196828", "0.6196828", "0.6196828", "0.6196828", "0.6196828", "0.6196828", "0.6196828", "0.6196828", "0.6196828", "0.6163933", "0.6157024", "0.61220086", "0.6097502", "0.6087326", "0.6087326", "0.6087326", "0.6087326", "0.6011762", "0.59856665", "0.59746367", "0.5950186", "0.59281534", "0.59281534", "0.59279305", "0.5915376", "0.59128034", "0.59128034", "0.59128034", "0.59127903", "0.5884934", "0.5884934", "0.5882599", "0.58794135", "0.585895", "0.58546627", "0.5841624", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.5829848", "0.58070403", "0.5804482", "0.5773965", "0.5773965", "0.57632345", "0.57575595", "0.57101876", "0.564434", "0.5623929", "0.56130725", "0.5598414", "0.55977374", "0.55899453", "0.55625284", "0.5554238", "0.55530393", "0.5550392", "0.5541435", "0.55379504", "0.5536781", "0.5527434", "0.5521712", "0.5512839", "0.55126035" ]
0.0
-1
Loads entity matching $condition.
public function findOne(array $condition) { $row = $this->getTable()->where($condition)->fetch(); if ($row == null) { return null; } $entityClassName = $this->getEntityClassName(); return $entityClassName::create($this, $row); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function load (mixed $tableOrClass, mixed $condition) : mixed {\n\n }", "public function find($condition)\n {\n if(!is_array($condition))\n {\n $condition = array($this->getKeyField() => $condition);\n }\n $model = $this->getStorage()->fetchRow($condition);\n if(!$model->isLoaded())\n {\n return null;\n }\n return $model;\n }", "abstract protected function loadModel(array $conditions);", "public static function findOne($condition);", "public function getByCondition($condition, $limit = 10)\n {\n $condition = article_condition($condition);\n\n if (! $condition) throw new NonExistentConditionException;\n\n return $this->articlesRepo->byCondition($condition['id'], $limit);\n }", "public function getBywhere($condition)\n {\n return $this->productRepository->getBywhere($condition);\n }", "public function load($entity) \n {\n if ($this->cacheKnow($entity)) {\n $where = $this->cacheWhereIs($entity);\n return (bool) @include_once $where;\n }\n return false;\n }", "public static function findOne($condition)\n {\n if (filter_var($condition, FILTER_VALIDATE_INT) === false)\n throw new NotFoundHttpException();\n\n return parent::findOne($condition); // TODO: Change the autogenerated stub\n }", "protected function _loadOne($criteria = null, $query_part = null) {\n $this->_is_first_save = false;\n $q = Q::create($this->_structure['table'])->one();\n if ($criteria) {\n\n if (!is_array($criteria) && !is_object($criteria)) {\n $criteria = array( $this->getStructure('table') . '.' . $this->_structure->getPrimaryField() => $criteria);\n } elseif (is_array($criteria)) {\n $new_criteria = array();\n foreach($criteria as $c_key=>$c_value) {\n $new_criteria[ $this->getStructure('table') . '.' . $c_key] = $c_value;\n }\n unset($criteria);\n $criteria = $new_criteria;\n unset($new_criteria);\n }\n\n $q->andWhere($criteria);\n $this->_load_criteria = $criteria;\n } else {\n $criteria = new C();\n }\n\n if ($this->getAbilitiesStructure('mlt')) {\n $query_part = $this->_loaded_abilities['Mlt']->updateLoadQueryPart($query_part);\n }\n\n if ($query_part) {\n $q->merge($query_part);\n }\n /**\n * Security check\n */\n $secured = $this->getMethodSecurity('load');\n if ($secured) {\n $secured['full_access'] = false;\n try {\n slACL::requireRight(strtolower($this->_model_name) . '_load');\n $secured['full_access'] = true;\n } catch (slACLUnaccreditedException $e) {\n throw new $e($e->getMessage());\n }\n }\n if (($data = $q->exec())) {\n $this->setOriginalData($data);\n if ($secured && !$secured['full_access']) {\n if ($secured['process'] == 'custom') {\n $method = isset($secured['method']) ? $secured['method'] : 'hasSecuredMethodAccess';\n if (!$this->$method('load')) {\n throw new slACLUnaccreditedException(strtolower($this->_model_name) . '_load');\n } else {\n slACL::requireObjectRight($this->_model_name, $this->getID(), 'load');\n }\n }\n }\n $this->_postLoad();\n return $this;\n } else {\n return null;\n }\n\n\n }", "public static function findOneOrException($condition)\n\t{\n\t\tif ( ($model = static::findOne($condition)) !== null )\n\t\t{\n\t\t\treturn $model;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new NotFoundHttpException(Yii::t('yii', 'Page not found.'));\n\t\t}\n\t}", "public static function findOneOrException($condition)\n\t{\n\t\tif ( ($model = static::findOne($condition)) !== null )\n\t\t{\n\t\t\treturn $model;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new NotFoundHttpException(Yii::t('yii', 'Page not found.'));\n\t\t}\n\t}", "protected function getCondition($condition)\n {\n }", "public function load($id) {\n\t\t$this->logger->debug('[EntityManager]Loading Entity with id '.$id);\n\t\treturn $this->getRepository()\n\t\t->find($id);\n\t}", "function load($conditions = null) {\n\t\t\treturn $this->reload($conditions);\n\t\t}", "public function load($id)\n {\n $this->_checkRecordInstance();\n $result = $this->_entity->getTable()->find($id);\n if ($result) {\n $this->_entity = $result;\n return $this;\n } else {\n return false;\n }\n }", "public function postLoad($entity);", "public static function findOne($condition)\n {\n return static::find()->one($condition);\n }", "public function findWhere($condition)\n {\n $this->where($condition)->first();\n\n return $this;\n }", "public function fetch( $condition = null, $params = null )\n {\n\n if(!$params)\n $params = new TFlowFlag();\n\n $this->sourceSize = null;\n $db = $this->getDb();\n\n if( !$this->criteria )\n {\n $criteria = $db->orm->newCriteria();\n }\n else\n {\n $criteria = $this->criteria;\n }\n\n if( !$criteria->cols )\n {\n $this->setCols( $criteria );\n }\n\n $this->setTables( $criteria );\n $this->appendConditions( $criteria, $condition, $params );\n $this->checkLimitAndOrder( $criteria, $params );\n\n\n // Run Query und save the result\n $this->result = $db->orm->select( $criteria );\n $this->calcQuery = $criteria->count('count(project_task.'.Db::PK.') as '.Db::Q_SIZE);\n\n }", "public function loadModel()\n {\n if ($this->_model === null) {\n if (isset($_GET['id'])) {\n if (Yii::app()->user->isGuest)\n //$condition='status='.Post::STATUS_PUBLISHED.' OR status='.Post::STATUS_ARCHIVED;\n $condition = '';\n else\n $condition = '';\n $this->_model = Object::model()->with(array('author','files'))->findByPk($_GET['id']);\n }\n if ($this->_model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $this->_model;\n }", "public static function findOne($condition)\n {\n $object = Server::$container->make(get_called_class(), [get_called_class()]);\n $conn = self::getMongoReadConn($object);\n $collection = $conn->selectCollection($object->getDBName(), $object->getCollectionName());\n if (isset($condition[\"_id\"])) {\n if (!is_object($condition[\"_id\"])) {\n $condition[\"_id\"] = new ObjectID($condition[\"_id\"]);\n }\n }\n // var_dump($conn);\n $res = $collection->findOne($condition);\n // var_dump($res);\n return $object;\n }", "public function findByConditions(array $condition)\n {\n return self::findOne($condition);\n }", "public function loadLast($whereCondition = \"\") {\r\n if ($this->object->loadRule()) {\r\n\r\n\r\n\r\n if (empty($whereCondition)) {\r\n $whereCondition .= $this->getConditions();\r\n }\r\n\r\n\r\n $crud = $this->myCRUD();\r\n $crud->loadLastObject($whereCondition, $this->object);\r\n return $this;\r\n } else {\r\n return false;\r\n }\r\n }", "public static function findOne($condition) {\n $table = static::$table;\n $one = Base::getInstance()->query(\"SELECT * FROM {$table} WHERE {$condition} LIMIT 1\");\n if ($one !== false) {\n return $one->fetchObject();\n } \n return false;\n }", "public function find($entity_id);", "public function loadAssociative($whereCondition, $loadObjectAtributes = false, $order = 'id DESC') {\r\n if ($this->object->loadRule()) {\r\n\r\n\r\n\r\n if (empty($whereCondition)) {\r\n $whereCondition .= $this->getConditions();\r\n }\r\n\r\n if (empty($order)) {\r\n $order = $this->getOrders();\r\n }\r\n\r\n $crud = $this->myCRUD();\r\n return $crud->loadAssociative($whereCondition, $loadObjectAtributes, $order);\r\n } else {\r\n return false;\r\n }\r\n }", "public function setCondition($condition);", "public function findEntity($id);", "abstract function load(Model $model);", "public function getBy(array $where): ?IEntity;", "public function loadById($id);", "public function loadById($id);", "public function fetch($conditions = array(),$options=array()) {\n\t\tif(is_numeric($conditions)) { $conditions = array('id' => $conditions); }\n\t\t$conditions = $this->prepare($conditions);\n\t\treturn $this->load($conditions,$options);\n\t}", "public function load()\r\n\t{\r\n\t\t$entities = $this->query($this->entity, $this->relation)->getResults($this->relation);\r\n\t\t\r\n\t\t$this->loaded = true;\r\n\r\n\t\treturn $entities;\r\n\t}", "function load($criteria=NULL,$order=NULL,$offset=0) {\n\t\tif (method_exists($this,'beforeLoad') && !$this->beforeLoad())\n\t\t\treturn;\n\t\tif (!is_null($offset) && $offset>-1) {\n\t\t\t$this->offset=NULL;\n\t\t\tif ($m2=$this->findOne($criteria,$order,1,$offset)) {\n\t\t\t\t// Hydrate M2\n\t\t\t\tforeach ($m2->object as $key=>$val)\n\t\t\t\t\t$this->object[$key]=$val;\n\t\t\t\tlist($this->criteria,$this->order,$this->offset)=\n\t\t\t\t\tarray($criteria,$order,$offset);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t$this->reset();\n\t\tif (method_exists($this,'afterLoad'))\n\t\t\t$this->afterLoad();\n\t}", "function loadBy($aCond, $nLangId=0)\n {\n $nLangId = $nLangId? $nLangId: LANGUAGEID;\n $sSql = 'SELECT '.$this->_joinFields($this->aFields).', a.fname, a.email, a2.fname seller'.\n ', a2.email seller_email, c.code currency, c.sign, i2.name image, i.name seller_image, pd1.phrase shop_title, ss.time_from, ss.time_to, s.time_shift shop_time_shift'.\n ' FROM '.$this->sTable.' AS '.$this->sAlias.\n ' LEFT JOIN account a USING(account_id)'.\n ' LEFT JOIN account a2 ON a2.account_id=p.seller_id'.\n ' LEFT JOIN image i ON i.image_id=a2.image_id'.\n ' LEFT JOIN image i2 ON i2.image_id=a.image_id'.\n ' LEFT JOIN currency c ON c.currency_id='.$this->sAlias.'.currency_id '.\n ' LEFT JOIN shop_slot ss ON ss.shop_slot_id=p.shop_slot_id'.\n ' LEFT JOIN shop s ON s.shop_id=ss.shop_id'.\n ' LEFT JOIN phrase p1 ON p1.object_id=s.shop_id AND p1.object_type_id=4 AND p1.object_field=\"title\" '.\n ' LEFT JOIN phrase_det pd1 ON pd1.phrase_id=p1.phrase_id AND pd1.language_id='.$nLangId.' '.\n ' WHERE '.$this->_parseCond($aCond, $this->aFields);\n $this->aData = $this->oDb->getRow($sSql);\n return sizeof($this->aData);\n }", "function load() {\n\t\tglobal $mysql;\n //if(!$this->exists()) return;\n \t$id \t\t= $mysql->escape($this->id);\n \t$tablename \t= $this->class_name();\n \t$this->data = $mysql->executeSql(\"SELECT * FROM \".$tablename.\" WHERE id=$id;\");\n \t$this->id\t= $this->data['id'];\n \tunset($this->data['id']);\n }", "abstract protected function getEntity();", "public function load($id)\n {\n return parent::get($this->getResourceName().'/'.$id)->{$this->getEntityName()};\n }", "private function loadEntity($entityName) {\n $filename = \"model/\" . $entityName . \".php\";\n\n // on teste l'existence du fichier\n if (file_exists($filename)) {\n // on l'inclut s'il existe\n /** @todo vérifier s'il faut un include_once **/\n require($filename);\n\n return true;\n }\n return false;\n }", "public function execute($condition) {\r\n \r\n }", "public function readFromModel($entity);", "private function getEntity($id) {\n // when the request uses the internal id the given id starts with an underscore\n if(substr($id, 0, 1) == '_') {\n // get entity via _internal_id\n return Entity::findOrFail(substr($id, 1));\n } else {\n // get entity via GIS id\n return Entity::where('id', $id)->firstOrFail();\n }\n }", "public function filterTextEntity(GetFilterConditionEvent $event)\n {\n $qb = $event->getQueryBuilder();\n $values = $event->getValues();\n if (!is_null($values['value'])){\n $qb\n ->where('a.id = :id')\n ->setParameter('id', $values['value']->getId())\n ->getQuery()\n ->getResult()\n ;\n }\n \n }", "public static function load($id) {\n global $DB;\n\n if ($id) {\n $useand = $DB->get_field('ddtaquiz_condition', 'useand', array('id' => $id), MUST_EXIST);\n\n $parts = $DB->get_records('ddtaquiz_condition_part', array('conditionid' => $id));\n $partobjs = array_map(function($part) {\n return new condition_part($part->id, $part->type, $part->on_qinstance, $part->grade);\n },\n array_values($parts));\n } else {\n $partobjs = array();\n $useand = true;\n }\n return new condition($id, $partobjs, $useand);\n }", "public function __doLoad()\n {\n $strSQL = $this->getSelectSql();\n $_SESSION[\"logger\"]->info(\"__doLoad: \" . $strSQL);\n\n $result = $this->query($strSQL);\n $_SESSION[\"logger\"]->info(\"Results: \" . $this->rowCount($result));\n if ($result && $this->rowCount($result) > 0) {\n $this->exists = true;\n $this->dxHashToClass($this->torecord($result));\n } else {\n $this->exists = false;\n }\n }", "public function load($id)\n {\n\n // instancia instruo de SELECT\n $sql = new TSqlSelect();\n $sql->setEntity($this->getEntity());\n $sql->addColumn('*');\n\n\n // cria critrio de seleo baseado no ID\n $criteria = new TCriteria();\n $criteria->add(new TFilter('id', '=', $id));\n // define o critrio de seleo de dados\n $sql->setCriteria($criteria);\n // inicia transao\n if ($conn = TTransaction::get()) {\n\n // cria mensagem de log e executa a consulta\n TTransaction::log($sql->getInstruction());\n $result = $conn->Query($sql->getInstruction());\n\n // se retornou algum dado\n if ($result) {\n// echo $sql->getInstruction();\n\n // retorna os dados em forma de objeto\n $object = $result->fetchObject(get_class($this));\n\n }\n\n return $object;\n } else {\n // se no tiver transao, retorna uma exceo\n throw new \\Exception('No h transao ativa !!');\n }\n }", "public function load($relation);", "public function load($where = NULL, $limit = NULL)\n\t{\n\t\t$meta = $this->meta();\n\t\t\n\t\t// Apply the limit\n\t\tif (is_int($where) || is_string($where))\n\t\t{\n\t\t\t$this->where($meta->primary_key, '=', $where);\n\t\t\t$limit = 1;\n\t\t}\n\t\t// Simple where clause\n\t\telse if (is_array($where))\n\t\t{\n\t\t\tforeach($where as $column => $value)\n\t\t\t{\n\t\t\t\t$this->where($column, '=', $value);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Anything to load with?\n\t\tif ($meta->load_with)\n\t\t{\n\t\t\t$this->with($meta->load_with);\n\t\t}\n\n\t\t// Set the working query\n\t\t$query = $this->build(Database::SELECT);\n\t\t$query->from($meta->table);\n\t\t\n\t\t// limit() is overloaded so that if the second argument exists \n\t\t// the call will override what's passed here for $limit. This allows us\n\t\t// to set a limit before load and have it load single rows directly into the object\n\t\tif (isset($this->_db_applied['limit'][1]) && $this->_db_applied['limit'][0] == 1)\n\t\t{\n\t\t\t$limit = 1;\n\t\t}\n\t\t\n\t\t// Apply the limit if we can\n\t\tif ($limit !== NULL)\n\t\t{\n\t\t\t$query->limit($limit);\n\t\t}\n\t\t\n\t\t// We can load directly into the model\n\t\tif ($limit === 1)\n\t\t{\n\t\t\t$result = $query->execute($meta->db);\n\t\t\t\n\t\t\t// Ensure we have something\n\t\t\tif (count($result))\n\t\t\t{\n\t\t\t\t// Insert the original values\n\t\t\t\t$this->set($result[0], TRUE, TRUE);\n\t\t\t\t\n\t\t\t\t// We're good!\n\t\t\t\t$this->_loaded = $this->_saved = TRUE;\n\t\t\t\t$this->_changed = array();\n\t\t\t}\n\n\t\t\treturn $this->end();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Apply sorting options\n\t\t\tforeach($meta->sorting as $column => $direction)\n\t\t\t{\n\t\t\t\t$query->order_by($this->alias($column), $direction);\n\t\t\t}\n\t\t\t\n\t\t\treturn $query->as_object(get_class($this))->execute($meta->db);\n\t\t}\n\t}", "public function retrieve($entityName, $id);", "public function execute() {\n $this->query->filter($this->filter);\n $data = $this->query->execute();\n $results = $data['results'];\n\n if (!$results) {\n return;\n }\n\n return entity_load($this->EntityType, array_keys($results));\n }", "public function DoctrineLoad()\n {\n // and call __load method\n }", "public static function cachedFindOneByPk($condition, $cacheTtl = 86400)\n {\n return self::cachedFind(\n $condition,\n static::class . ':pk:' . ActiveRecordCacheTags::serializeCondition($condition),\n ActiveRecordCacheTags::getObjectTag(static::class, $condition),\n function ($condition) {\n return static::findByCondition($condition)->one();\n },\n $cacheTtl\n );\n }", "public static function findOne($condition)\n\t{\n\t\t//if no array is specified and value is not numeric, check canonical\n\t\tif (!is_array($condition) && !is_numeric($condition)) {\n\t\t\t$condition = ['canonical'=>$condition];\n\t\t}\n\n\t\treturn parent::findOne($condition);\n\t}", "public function _load()\n {\n $query = new Query(\n \"SELECT *\n FROM `\" . Leder::TABLE . \"`\n WHERE `arrangement_fra` = '#fra'\n AND `arrangement_til` = '#til'\",\n [\n 'fra' => $this->getArrangementFraId(),\n 'til' => $this->getArrangementTilId()\n ]\n );\n\n $res = $query->getResults();\n while( $row = Query::fetch($res) ) {\n $this->add(\n Leder::loadFromDatabaseRow( $row )\n );\n }\n }", "private final function loadObjectFromDb()\n {\n # TODO: would be far preferable to use the objectsFromDestinations() code, possibly by refactoring into another shareable function. this is needed because otherwise we're in object A and OrmClass->load() is generating object B, instead of populating object A\n # TODO:NOTE01\n # TODO: must use $this->setLoadedFromDb() per class\n throw new Exception('TODO');\n }", "public function loadModel($criteria)\n\t{\n\t\t$model=Pet::model()->find($criteria);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function getEntity($name);", "public function addCondition($condition);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "public function load($id);", "function LoadRow() {\r\n\t\tglobal $conn, $Security, $filesystem;\r\n\t\t$sFilter = $filesystem->KeyFilter();\r\n\r\n\t\t// Call Row Selecting event\r\n\t\t$filesystem->Row_Selecting($sFilter);\r\n\r\n\t\t// Load sql based on filter\r\n\t\t$filesystem->CurrentFilter = $sFilter;\r\n\t\t$sSql = $filesystem->SQL();\r\n\t\tif ($rs = $conn->Execute($sSql)) {\r\n\t\t\tif ($rs->EOF) {\r\n\t\t\t\t$LoadRow = FALSE;\r\n\t\t\t} else {\r\n\t\t\t\t$LoadRow = TRUE;\r\n\t\t\t\t$rs->MoveFirst();\r\n\t\t\t\t$this->LoadRowValues($rs); // Load row values\r\n\r\n\t\t\t\t// Call Row Selected event\r\n\t\t\t\t$filesystem->Row_Selected($rs);\r\n\t\t\t}\r\n\t\t\t$rs->Close();\r\n\t\t} else {\r\n\t\t\t$LoadRow = FALSE;\r\n\t\t}\r\n\t\treturn $LoadRow;\r\n\t}", "function loadModules($field = null, $condition = \"\"){ \r\n if($field == null){\r\n $field = \"a.id, a.title, a.alias, a.cdate, a.mdate, a.ordering, a.position, a.menu, a.module, a.description, a.status + 2*(b.status - 1) as status, a.params\";\r\n }\r\n \r\n $command = $this->_db->createCommand()->select($field)\r\n ->from(TBL_MODULES . \" as a\")\r\n ->leftjoin(TBL_EXTENSIONS . \" as b\", \" a.module = b.folder\");\r\n if($conditions != null) $command->where($conditions);\r\n $items = $command->queryAll();\r\n return $items;\r\n }", "private function load(ValueObject $valueObject)\n {\n $query = new LocationQuery();\n $query->filter = new Query\\Criterion\\ContentId($valueObject->id);\n\n $res = $this->getApiRepository()->getSearchService()->findLocations($query);\n\n if(count($res->searchHits) != 1) {\n // todo mark error\n return;\n }\n\n $hitValue = $res->searchHits[0]->valueObject;\n $this->getApiRepository()->getContentService()->loadContent($hitValue->contentInfo->id);\n }", "function _load()\n\t{\n\t\tif($this->primary_key)\n\t\t{\n\t\t\t$row = $this->db->get_where($this->table_name, array(\n\t\t\t\t$this->primary_key => $this->{$this->primary_key},\n\t\t\t))->result();\n\t\t\t\n\t\t\tif(count($row))\n\t\t\t\t$this->load_db_values($row[0]);\n\t\t}\n\t}", "public function selectWhere( string $condition = '' ) {\n $query = 'SELECT `id` AS id, `path` AS path FROM `illustration`' . $condition . ';'; \n return $this->executeQuery( $query );\n }", "public function getEntity();", "public function getEntity();", "public function getEntity();", "public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t{ \n //$command = Yii::app()->db->createCommand('SELECT * FROM tbl_user');\n // следующая строка НЕ добавит WHERE к SQL\n //$command->where('id=:id', array(':id'=>$id));\n\n \n\t\t\t\tif(Yii::app()->user->isGuest)\n\t\t\t\t\t$condition='status='.Post::STATUS_PUBLISHED.' OR status='.Post::STATUS_ARCHIVED;\n\t\t\t\telse\n\t\t\t\t\t$condition='';\n\t\t\t\t$this->_model=Post::model()->findByPk($_GET['id'], $condition);\n \n \n \n\t\t\t} \n \n\t\t}\n\t\treturn $this->_model;\n\t}", "public function loadModel($id)\n\t{\n\n\t\t$criteria=new CDbCriteria;\n\t\t$criteria->compare('id',(int)$id);\n\t\t\n\t\tif (Yii::app()->user->name != \"admin\") {\n\t\t\t$criteria->addInCondition('company_id',sUser::model()->getGroupArray());\n\t\t}\n\n\t\t$model=gSelection::model()->find($criteria);\n\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function fetch(): ?IEntity;", "private function loadOrder()\n {\n $brqOrderId = $this->getOrderIncrementId();\n\n //Check if the order can receive further status updates\n $this->order->loadByIncrementId((string) $brqOrderId);\n\n if (!$this->order->getId()) {\n $this->logging->addDebug('Order could not be loaded by brq_invoicenumber or brq_ordernumber');\n // try to get order by transaction id on payment.\n $this->order = $this->getOrderByTransactionKey();\n }\n }", "function loadByEmail( $email )\n {\n \t// calling constructSearchCondition ensures that quotes are added to the email address\n \t$condition = $this->constructSearchCondition( \"person_email\", \"=\", $email );\n\n\t// will return whether this row manager was successfully loaded according to the condition\n\treturn $this->loadByCondition( $condition );\n }" ]
[ "0.6330537", "0.61860967", "0.6008003", "0.5955637", "0.5862287", "0.58115077", "0.5687883", "0.56541544", "0.5620009", "0.5501468", "0.5501468", "0.54287124", "0.53933203", "0.53331125", "0.5320602", "0.531984", "0.5284055", "0.52788043", "0.52201957", "0.51958525", "0.51707125", "0.51673985", "0.51543874", "0.51534605", "0.51390433", "0.5112977", "0.5111402", "0.50866", "0.50669855", "0.5035051", "0.50108564", "0.50108564", "0.4995195", "0.49656647", "0.4964189", "0.4960497", "0.4911832", "0.49052244", "0.48827848", "0.4878807", "0.48670918", "0.48594907", "0.48580888", "0.48575062", "0.48516864", "0.48466772", "0.48414683", "0.48403797", "0.48355633", "0.48262325", "0.48200193", "0.48087066", "0.4807226", "0.48027602", "0.48002636", "0.47969905", "0.47925252", "0.47774145", "0.4770307", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.47701654", "0.4770075", "0.47694278", "0.4766515", "0.47645944", "0.47625223", "0.476178", "0.476178", "0.476178", "0.4753198", "0.4753044", "0.47470224", "0.47429216", "0.4733129" ]
0.5759243
6
Loads collection from database matching $condition.
public function findMany(array $condition) { $selection = $this->getTable()->where($condition); $collectionClassName = $this->getInstanceCollectionClassName(); return $collectionClassName::create($this, $selection); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find($condition)\n {\n if(!is_array($condition))\n {\n $condition = array($this->getKeyField() => $condition);\n }\n $model = $this->getStorage()->fetchRow($condition);\n if(!$model->isLoaded())\n {\n return null;\n }\n return $model;\n }", "public static function findOne($condition)\n {\n $object = Server::$container->make(get_called_class(), [get_called_class()]);\n $conn = self::getMongoReadConn($object);\n $collection = $conn->selectCollection($object->getDBName(), $object->getCollectionName());\n if (isset($condition[\"_id\"])) {\n if (!is_object($condition[\"_id\"])) {\n $condition[\"_id\"] = new ObjectID($condition[\"_id\"]);\n }\n }\n // var_dump($conn);\n $res = $collection->findOne($condition);\n // var_dump($res);\n return $object;\n }", "public function load (mixed $tableOrClass, mixed $condition) : mixed {\n\n }", "public static function findOne($condition);", "public function loadCollection($collectionId, int $status): Collection;", "public function get_available_category($collection = '', $condition = array()) {\n\t\t\n\t\tif(!is_array($condition)){\n\t\t\t$condition = (array)$condition;\n\t\t\t$condition = array_unique(array_filter($condition));\n\t\t}\n\t\t\n $data = array();\n $k = 0;\n foreach ($condition as $key => $value) {\n $data[$k] = MongoID($value);\n $k++;\n }\n $this->mongo_db->select(array('name', 'image', 'vehicle_type', 'icon_normal', 'icon_active','icon_car_image','name_languages'));\n $this->mongo_db->where_in('_id', $data);\n\t\t$this->mongo_db->where(array('status' => 'Active'));\n $res = $this->mongo_db->get($collection);\n return $res;\n }", "abstract protected function loadModel(array $conditions);", "public function fetchCollection($criteria = null);", "public function load($collection = null);", "public function fetch($conditions = array(),$options=array()) {\n\t\tif(is_numeric($conditions)) { $conditions = array('id' => $conditions); }\n\t\t$conditions = $this->prepare($conditions);\n\t\treturn $this->load($conditions,$options);\n\t}", "public function loadCollectionQuery(Collection $collection): Query;", "public function findByConditions(array $condition)\n {\n return self::findOne($condition);\n }", "public function getBywhere($condition)\n {\n return $this->productRepository->getBywhere($condition);\n }", "function load($conditions = null) {\n\t\t\treturn $this->reload($conditions);\n\t\t}", "public function findWhere($condition)\n {\n $this->where($condition)->first();\n\n return $this;\n }", "public function _load()\n {\n $query = new Query(\n \"SELECT *\n FROM `\" . Leder::TABLE . \"`\n WHERE `arrangement_fra` = '#fra'\n AND `arrangement_til` = '#til'\",\n [\n 'fra' => $this->getArrangementFraId(),\n 'til' => $this->getArrangementTilId()\n ]\n );\n\n $res = $query->getResults();\n while( $row = Query::fetch($res) ) {\n $this->add(\n Leder::loadFromDatabaseRow( $row )\n );\n }\n }", "public function loadArrayList($whereCondition = \"\", $order = \"\", $limit = \"\", $groupBy=\"\") {\r\n if ($this->object->loadRule()) {\r\n if (empty($whereCondition)) {\r\n $whereCondition .= $this->getConditions();\r\n }\r\n\r\n if (empty($order)) {\r\n $order = $this->getOrders();\r\n }\r\n\r\n if (empty($limit)) {\r\n $limit = $this->getLimits();\r\n }\r\n\r\n if (empty($groupBy)) {\r\n $groupBy = $this->groupBy;\r\n }\r\n\r\n\r\n $crud = $this->myCRUD();\r\n return $crud->loadLightArray($whereCondition, $order, $limit, false, $this->__loadObjectsAttributes, false, $groupBy);\r\n } else {\r\n return false;\r\n }\r\n }", "function _load()\n\t{\n\t\tif($this->primary_key)\n\t\t{\n\t\t\t$row = $this->db->get_where($this->table_name, array(\n\t\t\t\t$this->primary_key => $this->{$this->primary_key},\n\t\t\t))->result();\n\t\t\t\n\t\t\tif(count($row))\n\t\t\t\t$this->load_db_values($row[0]);\n\t\t}\n\t}", "private function loadMatchedCollection()\n {\n $this->matchedCollection = collect();\n\n foreach ($this->baseCollection as $key => $item)\n {\n\n $found = true;\n foreach ($this->associativePivots as $basePivot => $mergePivot)\n {\n if(!$this->mergeCollection->whereIn($mergePivot,$item->$basePivot)->first())\n {\n $found = false;\n continue 2;\n }\n }\n\n if($found){\n $this->matchedCollection->push($item);\n }\n\n }\n }", "public function __doLoad()\n {\n $strSQL = $this->getSelectSql();\n $_SESSION[\"logger\"]->info(\"__doLoad: \" . $strSQL);\n\n $result = $this->query($strSQL);\n $_SESSION[\"logger\"]->info(\"Results: \" . $this->rowCount($result));\n if ($result && $this->rowCount($result) > 0) {\n $this->exists = true;\n $this->dxHashToClass($this->torecord($result));\n } else {\n $this->exists = false;\n }\n }", "public function __construct(Enumerable $collection, $condition)\n {\n $this->condition = $condition;\n $this->collection = $collection;\n }", "public function getByCondition($condition, $limit = 10)\n {\n $condition = article_condition($condition);\n\n if (! $condition) throw new NonExistentConditionException;\n\n return $this->articlesRepo->byCondition($condition['id'], $limit);\n }", "public static function findOne($condition)\n {\n return static::find()->one($condition);\n }", "public static function findOne($condition) {\n $table = static::$table;\n $one = Base::getInstance()->query(\"SELECT * FROM {$table} WHERE {$condition} LIMIT 1\");\n if ($one !== false) {\n return $one->fetchObject();\n } \n return false;\n }", "public function findWhere($condition){\n // create an empty array\n $arrayOfActiveRows = [];\n // select all data from the specified condition\n $dataArray = $this->database->selectStarFromWhere($this->name, $condition);\n // foreach data found in this array, we creat active row and store in variable $activeRow and \n // we push into this \n foreach ($dataArray as $data) {\n $activeRow = $this->CreateActiveRowFrom($data);\n array_push($arrayOfActiveRows, $activeRow);\n }\n return $arrayOfActiveRows;\n }", "private function load() {\n\n $db = Database::getInstance(); \n\t $con = $db->getConnection();\n \n $query = \"SELECT * FROM Products ORDER by ID DESC\";\n \n if ($result = $con->query($query)) {\n \t/* fetch object array */\n \t while ($prod = $result->fetch_object(\"Product\")) {\n\t\t\t \tarray_push($this->products, $prod);\n \t}\n \t/* free result set */\n \t$result->close();\n }\n\t}", "private function load() {\r\n\t\t$sql_statement = 'SELECT no.contract_id, no.termination_date FROM '. TBL_NOTICE .' AS no WHERE no.notice_id = '. (int) $this->notice_id;\r\n\t\t$query = db_query($sql_statement);\r\n\r\n\t\tif(db_num_results($query) == 1) {\r\n\t\t\t$data = db_fetch_array($query);\r\n\t\t\t\t\r\n\t\t\t$this->contract_id = $data['contract_id'];\r\n\t\t\t$this->termination_date = $data['termination_date'];\r\n\t\t}\r\n\t}", "protected function _loadOne($criteria = null, $query_part = null) {\n $this->_is_first_save = false;\n $q = Q::create($this->_structure['table'])->one();\n if ($criteria) {\n\n if (!is_array($criteria) && !is_object($criteria)) {\n $criteria = array( $this->getStructure('table') . '.' . $this->_structure->getPrimaryField() => $criteria);\n } elseif (is_array($criteria)) {\n $new_criteria = array();\n foreach($criteria as $c_key=>$c_value) {\n $new_criteria[ $this->getStructure('table') . '.' . $c_key] = $c_value;\n }\n unset($criteria);\n $criteria = $new_criteria;\n unset($new_criteria);\n }\n\n $q->andWhere($criteria);\n $this->_load_criteria = $criteria;\n } else {\n $criteria = new C();\n }\n\n if ($this->getAbilitiesStructure('mlt')) {\n $query_part = $this->_loaded_abilities['Mlt']->updateLoadQueryPart($query_part);\n }\n\n if ($query_part) {\n $q->merge($query_part);\n }\n /**\n * Security check\n */\n $secured = $this->getMethodSecurity('load');\n if ($secured) {\n $secured['full_access'] = false;\n try {\n slACL::requireRight(strtolower($this->_model_name) . '_load');\n $secured['full_access'] = true;\n } catch (slACLUnaccreditedException $e) {\n throw new $e($e->getMessage());\n }\n }\n if (($data = $q->exec())) {\n $this->setOriginalData($data);\n if ($secured && !$secured['full_access']) {\n if ($secured['process'] == 'custom') {\n $method = isset($secured['method']) ? $secured['method'] : 'hasSecuredMethodAccess';\n if (!$this->$method('load')) {\n throw new slACLUnaccreditedException(strtolower($this->_model_name) . '_load');\n } else {\n slACL::requireObjectRight($this->_model_name, $this->getID(), 'load');\n }\n }\n }\n $this->_postLoad();\n return $this;\n } else {\n return null;\n }\n\n\n }", "public function from($collection)\n {\n return $this->connection->getCollection($collection);\n }", "public function Select($Condition)\r\n {\r\n global $db;\r\n \r\n if ($Condition == \"\") {\r\n $Sql = \"SELECT * FROM \".$this->TableName;\r\n }\r\n else {\r\n $Sql = \"SELECT * FROM \".$this->TableName.\" \".$Condition;\r\n }\r\n \r\n try{\r\n $query = $db->prepare($Sql);\r\n $query->execute();\r\n if($query->rowCount()>0){\r\n $result['err'] = false;\r\n $result['rows'] = $query->fetchAll(PDO::FETCH_ASSOC);\r\n } else {\r\n $result['err'] = true;\r\n $result['msg'] = \"No Records Available\";\r\n }\r\n }catch(PDOException $e){\r\n $result['err'] = true;\r\n $result['msg'] = $e->getMessage();\r\n }\r\n\r\n return $result;\r\n }", "public function loadLast($whereCondition = \"\") {\r\n if ($this->object->loadRule()) {\r\n\r\n\r\n\r\n if (empty($whereCondition)) {\r\n $whereCondition .= $this->getConditions();\r\n }\r\n\r\n\r\n $crud = $this->myCRUD();\r\n $crud->loadLastObject($whereCondition, $this->object);\r\n return $this;\r\n } else {\r\n return false;\r\n }\r\n }", "public static function fetchList(array $cond=array(), $limit = null, $sortBy = null, $asObject = true)\n { \n $list = eZPersistentObject::fetchObjectList( \n self::definition(), null, $cond, $sortBy, $limit, $asObject \n );\n return $list;\n }", "public function fetch( $condition = null, $params = null )\n {\n\n if(!$params)\n $params = new TFlowFlag();\n\n $this->sourceSize = null;\n $db = $this->getDb();\n\n if( !$this->criteria )\n {\n $criteria = $db->orm->newCriteria();\n }\n else\n {\n $criteria = $this->criteria;\n }\n\n if( !$criteria->cols )\n {\n $this->setCols( $criteria );\n }\n\n $this->setTables( $criteria );\n $this->appendConditions( $criteria, $condition, $params );\n $this->checkLimitAndOrder( $criteria, $params );\n\n\n // Run Query und save the result\n $this->result = $db->orm->select( $criteria );\n $this->calcQuery = $criteria->count('count(project_task.'.Db::PK.') as '.Db::Q_SIZE);\n\n }", "public function load(Collection $records);", "public static function where($condition, $proyection = null){\n $objects = array();\n \n foreach (ObjectRetriever::retrieveWhere(get_called_class(), $condition, $proyection) as $data){\n $objects[] = ObjectBuilder::build(get_called_class(), $data);\n }\n \n return $objects;\n }", "protected function _getCollection()\n\t{\n\t\t//Check collection\n\t\tif($this->_collection)\n\t\t\treturn $this->_collection;\n\n\t\t//Get collection\n\t\t$this->_collection = new \\Framework\\Database\\Drivers\\Mongo\\CDatabaseModelCollection($this, $this->execute());\n\t\treturn $this->_collection;\n\t}", "public static function arrayFromDb ($condition = NULL) {\n\n # Build the query to get all the users\n $q = 'SELECT * \n FROM shows';\n\n if (isset($condition))\n $q = $q.\" \".$condition;\n \n # Execute the query to get all the shows.\n $rows = DB::instance(DB_NAME)->select_rows($q);\n\n $shows = array();\n\n foreach ($rows as $row) {\n $show = new Show();\n $show->populateFromDb($row);\n $shows[] = $show;\n }\n \n return $shows; \n }", "private function loadUnMatchedCollection()\n {\n $this->unMatchedCollection = collect();\n\n foreach ($this->mergeCollection as $key => $item)\n {\n\n foreach ($this->associativePivots as $basePivot => $mergePivot)\n {\n if(!$this->baseCollection->whereIn($basePivot,$item->$mergePivot)->first())\n {\n $this->unMatchedCollection->push($item);\n continue 2;\n }\n }\n\n\n }\n\n }", "public function load()\n {\n $data = $this->storage->load();\n $this->collection->load($data);\n\n $this->refresh();\n }", "public function collection() {\n \t$db = $this->db;\n\t\t$sql = $this->sql();\n\t\t$rows = $db::execute($sql);\n\t\t$model = $this->model;\n\t\treturn new \\Collection($model::arrayFactoryFromRows($rows));\n\t}", "public function findBy(array $where): ICollection;", "public function load()\n {\n // Execute the query, add query to any thrown exceptions\n try\n {\n $this->_cursor = $this->collection()->find($this->_query, $this->_fields);\n }\n catch(MongoCursorException $e) {\n throw new MongoCursorException(\"{$e->getMessage()}: {$this->inspect()}\", $e->getCode());\n }\n catch(MongoException $e) {\n throw new MongoException(\"{$e->getMessage()}: {$this->inspect()}\", $e->getCode());\n }\n\n // Add cursor options\n foreach($this->_options as $key => $value)\n {\n if($value === NULL) $this->_cursor->$key();\n else $this->_cursor->$key($value);\n }\n\n return $this;\n }", "public function get_available_vehicles($condition = array()) {\n $data = array();\n $k = 0;\n foreach ($condition as $key => $value) {\n $data[$k] = MongoID($value);\n $k++;\n }\n \n $this->mongo_db->select(array('vehicle_type'));\n $this->mongo_db->where(array('status' => 'Active'));\n $this->mongo_db->where_in('_id', $data);\n $res = $this->mongo_db->get(VEHICLES);\n return $res;\n }", "function findByCondition($condition = array()){\n $mBlog = M('artical');\n $count = $mBlog->field(\"a.*,u.nickname\")\n ->alias(\"a\")\n ->join(\"LEFT JOIN db_user u on u.id = a.u_id\")\n ->order('a.addtime desc')\n ->where($condition)\n ->count();\n $page = new \\Think\\Page($count,2);\n $show = $page->show();\n $data = $mBlog->field(\"a.*,u.nickname\")\n ->alias(\"a\")\n ->join(\"LEFT JOIN db_user u on u.id = a.u_id\")\n ->order('a.addtime desc')\n ->where($condition)\n ->limit($page->firstRow.','.$page->listRows)->select();\n return array(\n 'show' => $show,\n 'data' => $data\n );\n }", "function load($criteria=NULL,$order=NULL,$offset=0) {\n\t\tif (method_exists($this,'beforeLoad') && !$this->beforeLoad())\n\t\t\treturn;\n\t\tif (!is_null($offset) && $offset>-1) {\n\t\t\t$this->offset=NULL;\n\t\t\tif ($m2=$this->findOne($criteria,$order,1,$offset)) {\n\t\t\t\t// Hydrate M2\n\t\t\t\tforeach ($m2->object as $key=>$val)\n\t\t\t\t\t$this->object[$key]=$val;\n\t\t\t\tlist($this->criteria,$this->order,$this->offset)=\n\t\t\t\t\tarray($criteria,$order,$offset);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t$this->reset();\n\t\tif (method_exists($this,'afterLoad'))\n\t\t\t$this->afterLoad();\n\t}", "public function testLoadWithCollection() {\n\t\t$options = $this->_loadOptions;\n\t\t$posts = Fixture::load('models/Posts', $options);\n\t\t$this->_testLoad($posts);\n\t}", "public function findCollectionById($id);", "public function load($where = NULL, $limit = NULL)\n\t{\n\t\t$meta = $this->meta();\n\t\t\n\t\t// Apply the limit\n\t\tif (is_int($where) || is_string($where))\n\t\t{\n\t\t\t$this->where($meta->primary_key, '=', $where);\n\t\t\t$limit = 1;\n\t\t}\n\t\t// Simple where clause\n\t\telse if (is_array($where))\n\t\t{\n\t\t\tforeach($where as $column => $value)\n\t\t\t{\n\t\t\t\t$this->where($column, '=', $value);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Anything to load with?\n\t\tif ($meta->load_with)\n\t\t{\n\t\t\t$this->with($meta->load_with);\n\t\t}\n\n\t\t// Set the working query\n\t\t$query = $this->build(Database::SELECT);\n\t\t$query->from($meta->table);\n\t\t\n\t\t// limit() is overloaded so that if the second argument exists \n\t\t// the call will override what's passed here for $limit. This allows us\n\t\t// to set a limit before load and have it load single rows directly into the object\n\t\tif (isset($this->_db_applied['limit'][1]) && $this->_db_applied['limit'][0] == 1)\n\t\t{\n\t\t\t$limit = 1;\n\t\t}\n\t\t\n\t\t// Apply the limit if we can\n\t\tif ($limit !== NULL)\n\t\t{\n\t\t\t$query->limit($limit);\n\t\t}\n\t\t\n\t\t// We can load directly into the model\n\t\tif ($limit === 1)\n\t\t{\n\t\t\t$result = $query->execute($meta->db);\n\t\t\t\n\t\t\t// Ensure we have something\n\t\t\tif (count($result))\n\t\t\t{\n\t\t\t\t// Insert the original values\n\t\t\t\t$this->set($result[0], TRUE, TRUE);\n\t\t\t\t\n\t\t\t\t// We're good!\n\t\t\t\t$this->_loaded = $this->_saved = TRUE;\n\t\t\t\t$this->_changed = array();\n\t\t\t}\n\n\t\t\treturn $this->end();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Apply sorting options\n\t\t\tforeach($meta->sorting as $column => $direction)\n\t\t\t{\n\t\t\t\t$query->order_by($this->alias($column), $direction);\n\t\t\t}\n\t\t\t\n\t\t\treturn $query->as_object(get_class($this))->execute($meta->db);\n\t\t}\n\t}", "public function testLoadWithCustomCollection() {\n\t\t$options = $this->_loadOptions;\n\t\t$options['collection'] = 'lithium\\util\\Collection';\n\t\t$posts = Fixture::load('models/Posts', $options);\n\t\t$this->_testLoad($posts);\n\t}", "public function load()\n\t{\n\t\tif ( !is_array( $this->_id ) )\n\t\t\tthrow new \\RuntimeException( 'item does not exist (anymore)' );\n\n\t\tif ( !is_array( $this->_record ) )\n\t\t{\n\t\t\tstatic::updateSchema( $this->_source );\n\n\t\t\t$query = $this->_source->createQuery( static::set() );\n\n\t\t\tforeach ( $this->_id as $name => $value )\n\t\t\t\t$query->addCondition( $this->_source->quoteName( $name ) . '=?', true, $value );\n\n\t\t\t$matches = $query->limit( 2 )->execute();\n\n\t\t\tif ( $matches->count() !== 1 )\n\t\t\t\tthrow new datasource_exception( $this->_source, 'item missing in datasource' );\n\n\t\t\t$this->_record = $matches->row();\n\t\t}\n\n\t\treturn $this->_record;\n\t}", "public function findOne(array $condition)\n {\n $row = $this->getTable()->where($condition)->fetch();\n if ($row == null) {\n return null;\n }\n\n $entityClassName = $this->getEntityClassName();\n return $entityClassName::create($this, $row);\n }", "abstract protected function collectionLoader();", "public function load()\n {\n if (!$this->loaded) {\n $searchData = [];\n foreach (persistableCollection::getInstance($this->resourceName)->getPrimaryFields() as $fieldName) {\n $searchData[$fieldName] = $this->$fieldName;\n }\n $result = persistableCollection::getInstance($this->resourceName)->loadObject($searchData);\n $this->persisted = true;\n $this->loaded = true;\n return $result;\n }\n return $this;\n }", "public function load($id){\n\n /*\n * select from the database\n */\n $query = $this->db->get_where($this::DB_TABLE, array($this::DB_TABLE_PK => $id));\n\n /**\n * Populate to an object\n */\n if(!empty($query->row())){\n $this->populate($query->row());\n return true;\n } else {\n return false;\n }\n }", "protected function _prepareCollection()\n {\n $currentCampaign = Mage::getSingleton('adminhtml/session')->getCurrentCampaign();\n $collection = Mage::getModel('campaign/bannerslider')->getCollection();\n $collection->getSelect()\n ->joinLeft(array('campaign'=>$collection->getTable('campaign/campaign')),\n 'main_table.campaign_id = campaign.campaign_id', '')\n ->columns(array('campaign_name'=>'IF(main_table.campaign_id = \"'.$currentCampaign->getId().'\", \"Current\", campaign.name)'))\n ->group('main_table.bannerslider_id');\n $filter = Mage::registry('banner_reloaded_ids');\n if(!isset($filter)){//if reset no filter\n $selected_id = $this->_selectedId();\n if(!empty($selected_id)){\n $collection->addFieldToFilter('bannerslider_id', array('in'=>$selected_id));\n }\n }\n $this->setCollection($collection);\n return parent::_prepareCollection();\n }", "function load() {\n\t\tglobal $mysql;\n //if(!$this->exists()) return;\n \t$id \t\t= $mysql->escape($this->id);\n \t$tablename \t= $this->class_name();\n \t$this->data = $mysql->executeSql(\"SELECT * FROM \".$tablename.\" WHERE id=$id;\");\n \t$this->id\t= $this->data['id'];\n \tunset($this->data['id']);\n }", "public function selectWhere( string $condition = '' ) {\n $query = 'SELECT `id` AS id, `path` AS path FROM `illustration`' . $condition . ';'; \n return $this->executeQuery( $query );\n }", "public function loadCollection(PersistentCollection $collection)\n {\n $this->getDocumentPersister(get_class($collection->getOwner()))->loadCollection($collection);\n }", "public function querySelect($sql, $fields = NULL, $fetchMode = NULL) : Collection;", "function load() {\n\t\t$return = false;\n\t\t$values = array();\n\n\t\t$query = '\n\t\t\tSELECT movieID, UserID, CountryID, broadCastDate, createdDate\n\t\t\t FROM '.system::getConfig()->getDatabase('mofilm_content').'.movieBroadcast';\n\n\t\t$where = array();\n\t\tif ( $this->_MovieID !== 0 ) {\n\t\t\t$where[] = ' movieID = :MovieID ';\n\t\t\t$values[':MovieID'] = $this->getMovieID();\n\t\t}\n\t\tif ( $this->_CountryID !== 0 ) {\n\t\t\t$where[] = ' CountryID = :CountryID ';\n\t\t\t$values[':CountryID'] = $this->getCountryID();\n\t\t}\n\n\t\tif ( count($where) == 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$query .= ' WHERE '.implode(' AND ', $where);\n\n\t\t$oStmt = dbManager::getInstance()->prepare($query);\n\n\t\t$this->reset();\n\t\tif ( $oStmt->execute($values) ) {\n\t\t\t$row = $oStmt->fetch();\n\t\t\tif ( $row !== false && is_array($row) ) {\n\t\t\t\t$this->loadFromArray($row);\n\t\t\t\t$oStmt->closeCursor();\n\t\t\t\t$return = true;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public function loadFromDB()\n {\n }", "public static function arrayFromDb ($condition = NULL) {\n\n # Build the query to get all the users\n $q = 'SELECT * \n FROM venues\n ORDER BY name';\n\n if (isset($condition))\n $q = $q.\" \".$condition;\n \n # Execute the query to get all the venues.\n $venue_rows = DB::instance(DB_NAME)->select_rows($q);\n\n $venues = array();\n\n foreach ($venue_rows as $venue_row) {\n $venue = new Venue();\n $venue->populateFromDb($venue_row);\n $venues[] = $venue;\n }\n \n return $venues; \n }", "function load() {\n\t\t$return = false;\n\t\t$values = array();\n\n\t\t$query = '\n\t\t\tSELECT ID, coverImageID, trackID, status, rank, createDate\n\t\t\t FROM '.system::getConfig()->getDatabase('momusic_content').'.handpickedMusic';\n\n\t\t$where = array();\n\t\tif ( $this->_ID !== 0 ) {\n\t\t\t$where[] = ' ID = :ID ';\n\t\t\t$values[':ID'] = $this->getID();\n\t\t}\n\n\t\tif ( count($where) == 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$query .= ' WHERE '.implode(' AND ', $where);\n\n\t\t$oStmt = dbManager::getInstance()->prepare($query);\n\n\t\t$this->reset();\n\t\tif ( $oStmt->execute($values) ) {\n\t\t\t$row = $oStmt->fetch();\n\t\t\tif ( $row !== false && is_array($row) ) {\n\t\t\t\t$this->loadFromArray($row);\n\t\t\t\t$oStmt->closeCursor();\n\t\t\t\t$return = true;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "private function doLoad($RecordSet)\n\t{\n\t\t$NewsCollection = new NewsCollection();\n\t\t\n\t\tforeach ($RecordSet as $Row)\n\t\t{\n\t\t\t$NewsCollection->add(new News($Row['Id'],$Row['Content'],$Row['Date'],$Row['CreatorId']));\n\t\t}\n\t\treturn $NewsCollection;\n\t}", "public function Select($cond)\r\n\t\r\n {\r\n\t\tglobal $db;\r\n if($cond==\"\")\r\n {\r\n $sql = \"SELECT * FROM \".$this->TableName;\r\n } else\r\n {\t\r\n\t\t \t\r\n\t\t $sql = \"SELECT * FROM \". $this->TableName.\" \".$cond;\r\n }\r\n try{\r\n $query = $db->prepare($sql);\r\n $query->execute();\r\n $arr['rows'] = $query->fetchAll(PDO::FETCH_ASSOC);\r\n $arr['err'] = false;\r\n } catch(PDOException $e){\r\n $arr['err'] = true;\r\n $arr['msg'] = $e->getMessage(); \r\n } \r\n return $arr;\r\n }", "public function where($where)\n {\n $where = LambdaUtils::toConditionCallable($where);\n $collection = $this->newInstance();\n foreach($this as $record)\n {\n if(call_user_func($where, $record))\n {\n $collection->add($record);\n }\n }\n return $collection;\n }", "abstract public function query($collection, array $criteria = null);", "function load() {\n\t\t$return = false;\n\t\t$query = 'SELECT * FROM '.system::getConfig()->getDatabase('mofilm_content').'.movieAssets';\n\t\t\n\t\t$where = array();\n\t\tif ( $this->_ID !== 0 ) {\n\t\t\t$where[] = ' ID = :ID ';\n\t\t}\n\t\t\t\t\t\t\n\t\tif ( count($where) == 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$query .= ' WHERE '.implode(' AND ', $where);\n\n\t\ttry {\n\t\t\t$oStmt = dbManager::getInstance()->prepare($query);\n\t\t\tif ( $this->_ID !== 0 ) {\n\t\t\t\t$oStmt->bindValue(':ID', $this->_ID);\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t$this->reset();\n\t\t\tif ( $oStmt->execute() ) {\n\t\t\t\t$row = $oStmt->fetch();\n\t\t\t\tif ( $row !== false && is_array($row) ) {\n\t\t\t\t\t$this->loadFromArray($row);\n\t\t\t\t\t$oStmt->closeCursor();\n\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\tsystemLog::error($e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t\treturn $return;\n\t}", "public function loadAssociative($whereCondition, $loadObjectAtributes = false, $order = 'id DESC') {\r\n if ($this->object->loadRule()) {\r\n\r\n\r\n\r\n if (empty($whereCondition)) {\r\n $whereCondition .= $this->getConditions();\r\n }\r\n\r\n if (empty($order)) {\r\n $order = $this->getOrders();\r\n }\r\n\r\n $crud = $this->myCRUD();\r\n return $crud->loadAssociative($whereCondition, $loadObjectAtributes, $order);\r\n } else {\r\n return false;\r\n }\r\n }", "public function testLoading(Container $container): void\n\t{\n\t\t$storm = $container->getByType(Connection::class);\n\t\t$from = [self::STOCK_TABLE];\n\t\t\n\t\t// 1. foreach testings\n\t\t$collection = $storm->rows($from)->setWhere('uuid', 'AAPL');\n\t\t\n\t\tfor ($j = 0; $j !== 2; $j++) {\n\t\t\t$i = 0;\n\t\t\tAssert::equal(false, $collection->isLoaded());\n\t\t\t\n\t\t\tforeach ($collection as $index => $stock) {\n\t\t\t\tAssert::equal(0, (int) $index);\n\t\t\t\tAssert::equal('AAPL', $stock->uuid);\n\t\t\t\tAssert::equal('Apple Inc.', $stock->name);\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\tAssert::equal(true, $collection->isLoaded());\n\t\t\tAssert::equal(true, $i > 0);\n\t\t\t\n\t\t\t$collection->clear();\n\t\t}\n\t\t\n\t\t// 2. Manual loading\n\t\t$collection = $storm->rows($from);\n\t\tAssert::equal(false, $collection->isLoaded());\n\t\t$collection->load();\n\t\tAssert::equal(true, $collection->isLoaded());\n\t\t/** @var \\Countable $collection */\n\t\tAssert::equal(true, \\count($collection) > 0);\n\t\t$collection->load();\n\t}", "private function load()\r\n {\r\n $this->dbFields = MySQL::fetchRecord(MySQL::executeQuery('SELECT * FROM training_slideshow WHERE ts_id='.(int)$this->id),MySQL::fmAssoc);\r\n }", "function find_by_sql($sql) {\n\t\t\treturn $this->find_all($sql);\n\t\t}", "function loadBy($aCond, $nLangId=0)\n {\n $nLangId = $nLangId? $nLangId: LANGUAGEID;\n $sSql = 'SELECT '.$this->_joinFields($this->aFields).', a.fname, a.email, a2.fname seller'.\n ', a2.email seller_email, c.code currency, c.sign, i2.name image, i.name seller_image, pd1.phrase shop_title, ss.time_from, ss.time_to, s.time_shift shop_time_shift'.\n ' FROM '.$this->sTable.' AS '.$this->sAlias.\n ' LEFT JOIN account a USING(account_id)'.\n ' LEFT JOIN account a2 ON a2.account_id=p.seller_id'.\n ' LEFT JOIN image i ON i.image_id=a2.image_id'.\n ' LEFT JOIN image i2 ON i2.image_id=a.image_id'.\n ' LEFT JOIN currency c ON c.currency_id='.$this->sAlias.'.currency_id '.\n ' LEFT JOIN shop_slot ss ON ss.shop_slot_id=p.shop_slot_id'.\n ' LEFT JOIN shop s ON s.shop_id=ss.shop_id'.\n ' LEFT JOIN phrase p1 ON p1.object_id=s.shop_id AND p1.object_type_id=4 AND p1.object_field=\"title\" '.\n ' LEFT JOIN phrase_det pd1 ON pd1.phrase_id=p1.phrase_id AND pd1.language_id='.$nLangId.' '.\n ' WHERE '.$this->_parseCond($aCond, $this->aFields);\n $this->aData = $this->oDb->getRow($sSql);\n return sizeof($this->aData);\n }", "protected abstract function getCriteriaDao();", "public function from($collection) {\n if ($collection) {\n $this->collection = $this->connection->getCollection($collection);\n }\n\n return parent::from($collection);\n }", "public function addCondition($condition);", "protected function findAll($collection, $condition = [], $fields = [])\n {\n $cursor = $collection->find($condition, $fields);\n $result = [];\n foreach ($cursor as $data) {\n $result[] = $data;\n }\n\n return $result;\n }", "function loadFromDatabase(){\n global $DB;\n $resource = $DB->config->get();\n $list = array();\n while($row = $DB->fetchAssoc($resource))\n {\n if(!isset($this->sections[$row['section']])) $this->sections[$row['section']] = new ConfigSection($row['section']);\n $this->sections[$row['section']]->registerFromDatabase($row);\n }\n }", "function load() {\n\t\t$return = false;\n\t\t$query = 'SELECT * FROM '.system::getConfig()->getDatabase('mofilm_content').'.terms';\n\t\t\n\t\t$where = array();\n\t\tif ( $this->_ID !== 0 ) {\n\t\t\t$where[] = ' ID = :ID ';\n\t\t}\n\t\t\t\t\t\t\n\t\tif ( count($where) == 0 ) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$query .= ' WHERE '.implode(' AND ', $where);\n\n\t\ttry {\n\t\t\t$oStmt = dbManager::getInstance()->prepare($query);\n\t\t\tif ( $this->_ID !== 0 ) {\n\t\t\t\t$oStmt->bindValue(':ID', $this->_ID);\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t$this->reset();\n\t\t\tif ( $oStmt->execute() ) {\n\t\t\t\t$row = $oStmt->fetch();\n\t\t\t\tif ( $row !== false && is_array($row) ) {\n\t\t\t\t\t$this->loadFromArray($row);\n\t\t\t\t\t$oStmt->closeCursor();\n\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\tsystemLog::error($e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t\treturn $return;\n\t}", "public function fetchAllBatches($condition){\n \t global $sessionHandler;\n \t$query =\"SELECT\t\tDISTINCT b.batchId,b.batchName\n \t\t\tFROM\t`batch` b , `class` c\n \t\t\tWHERE\tc.batchId = b.batchId\n \t\t\tAND\tb.instituteId = c.instituteId\n \t\t\tAND\tb.instituteId = '\".$sessionHandler->getSessionVariable('InstituteId').\"'\n \t\t\t$condition\n \t\t\tORDER BY b.batchName ASC\n \t\";\n \t\n \treturn SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n }", "public function fetchClases($condition = ''){\n \t$query =\"SELECT\t\tDISTINCT c.classId,c.className\n \t\t\tFROM\t`class` c\n \t\t\t\t$condition\n \t\tORDER BY c.className Asc\";\n \t\t\n \treturn SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\t\n }", "function fetchContestRecords($condition = \"\",$order = \"contest_id\")\n\t{\n\t\t$arrlist = array();\n\t\t$i = 0;\n\t\n\t\t$sQuery = \"SELECT contest_id,client_id,contest_title,domain,winner_announce_date FROM \".DB_PREFIX.\"contest WHERE 1 = 1 AND contest_status='1' \" . $condition . \" ORDER BY \".$order;\n\t\t\n\t\t$rs = $this->runquery($sQuery);\n\t\t\n\t\treturn $rs;\n\t}", "function load() {\n\t\t$return = false;\n\t\t$values = array();\n\n\t\t$query = '\n\t\t\tSELECT ID, EventID, SourceID, UserID, hasEvent\n\t\t\t FROM '.system::getConfig()->getDatabase('mofilm_content').'.userSourcePermissions';\n\n\t\t$where = array();\n\t\tif ( $this->_ID !== 0 ) {\n\t\t\t$where[] = ' ID = :ID ';\n\t\t\t$values[':ID'] = $this->getID();\n\t\t}\n\n\t\tif ( count($where) == 0 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$query .= ' WHERE '.implode(' AND ', $where);\n\n\t\t$oStmt = dbManager::getInstance()->prepare($query);\n\n\t\t$this->reset();\n\t\tif ( $oStmt->execute($values) ) {\n\t\t\t$row = $oStmt->fetch();\n\t\t\tif ( $row !== false && is_array($row) ) {\n\t\t\t\t$this->loadFromArray($row);\n\t\t\t\t$oStmt->closeCursor();\n\t\t\t\t$return = true;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public function testPrepareLoad_FullArrayWhere()\n {\n \t$qs = $this->conn->prepare('SELECT * FROM test');\n $this->assertEquals(array(3, 'three', 'another row', 'PASSIVE', 'id'=>3, 'key'=>'three', 'title'=>'another row', 'status'=>'PASSIVE'), $qs->load(array('`key`'=>'three'), DB::FETCH_FULLARRAY));\n }", "private function filterCollectionByQuoteAttribute($collection, $attribute, array $condition)\n {\n $originalCollection = clone $collection;\n $quoteCollection = $this->quoteCollectionFactory->create();\n $quoteIds = $originalCollection->getColumnValues('quote_id');\n if ($quoteIds) {\n $quoteCollection->addFieldToFilter('entity_id', ['in' => $quoteIds])\n ->addFieldToFilter($attribute, $condition);\n //no need for empty check - because should include the null result, it should work like exclusion filter!\n $collection->addFieldToFilter('quote_id', ['in' => $quoteCollection->getAllIds()]);\n }\n\n return $collection;\n }", "public function find($whereCondition = \"\", $order = \"\", $limit = \"\", $associativeArray = true, $loadObjectAtributes = true, $groupBy=\"\") {\r\n\r\n if ($this->object->loadRule()) {\r\n\r\n\r\n\r\n if (empty($whereCondition)) {\r\n $whereCondition .= $this->getConditions();\r\n }\r\n\r\n if (empty($order)) {\r\n $order = $this->getOrders();\r\n }\r\n\r\n if (empty($limit)) {\r\n $limit = $this->getLimits();\r\n }\r\n\r\n if (empty($groupBy)) {\r\n $groupBy = $this->groupBy;\r\n }\r\n\r\n\r\n if ($this->__loadObjectsAttributes == false) {\r\n $loadObjectAtributes = $this->__loadObjectsAttributes;\r\n }\r\n\r\n $crud = $this->myCRUD();\r\n return $crud->loadLightArray($whereCondition, $order, $limit, $associativeArray, $loadObjectAtributes, false, $groupBy);\r\n } else {\r\n return false;\r\n }\r\n }", "public function where(string $condition): SQL\n {\n $this->condition[] = $condition;\n return $this;\n }", "public function testLoadBy()\n {\n $a = [\n 'user' => [\n 1 => ['id' => 1, 'name' => 'John'],\n 2 => ['id' => 2, 'name' => 'Peter'],\n 3 => ['id' => 3, 'name' => 'Joe'],\n ],\n ];\n $this->setDB($a);\n\n $u = (new Model($this->db, 'user'))->addFields(['name']);\n\n $u->loadBy('name', 'John');\n $this->assertEquals([], $u->conditions); // should be no conditions\n $this->assertFalse($u->getField('name')->system); // should not set field as system\n $this->assertNull($u->getField('name')->default); // should not set field default value\n\n $u->tryLoadBy('name', 'John');\n $this->assertEquals([], $u->conditions); // should be no conditions\n $this->assertFalse($u->getField('name')->system); // should not set field as system\n $this->assertNull($u->getField('name')->default); // should not set field default value\n }", "function load(){\n $sql = 'SELECT * FROM worlds where id=?';\n $w = $this->app['db']->fetchAssoc($sql, array($this->id));\n if(!$w){ \n return false;\n }\n $this->name = $w['name'];\n $this->world = $w['world_json'];\n return true;\n }", "public function load()\r\n\t{\r\n\t\t$entities = $this->query($this->entity, $this->relation)->getResults($this->relation);\r\n\t\t\r\n\t\t$this->loaded = true;\r\n\r\n\t\treturn $entities;\r\n\t}", "public function where($condition)\n {\n //@TODO: implement possibility to accept key/value pairs array and quote/escape values\n $this->appendWhereString($condition);\n return $this;\n }", "function reload($conditions = null) {\n\t\t\tif(is_null($conditions)) {\n\t\t\t\t$conditions = $this->get_primary_key_conditions();\n\t\t\t}\n\t\t\t$object = $this->find($conditions);\n\t\t\tif(is_object($object)) {\n\t\t\t\tforeach($object as $key => $value) {\n\t\t\t\t\t$this->$key = $value;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function setCondition($condition);", "public function load() {\n\t\t\t$this->arList = array(); \n\t\t\t\n\t\t\t$oDB = new database(); \n\t\t\t\n\t\t\t$strSQL = \"select g.* from tblGroups g \";\n\t\t\tforeach ($this->arJoin as $strJoin) $strSQL .= $strJoin; \n\t\t\tif (count($this->arWhere)>0) $strSQL .= \" where \" . implode(\" and \", $this->arWhere); \n\t\t\t$this->arOrder[] = \"g.naam\"; \n\t\t\t$strSQL .= \" order by \" . implode(\",\", $this->arOrder); \n\t\t\t$oDB->sql($strSQL); \n\t\t\t$oDB->execute(); \n\t\t\twhile ($oDB->nextRecord()) {\n\t\t\t\t$oGroep = new group(); \n\t\t\t\t$oGroep->id($oDB->get(\"id\")); \n\t\t\t\t$oGroep->naam($oDB->get(\"naam\")); \n\t\t\t\t$oGroep->info($oDB->get(\"info\")); \n\t\t\t\t$oGroep->admin($oDB->get(\"admin\")); \n\t\t\t\t$oGroep->website($oDB->get(\"website\")); \n\t\t\t\t$this->arList[] = $oGroep; \n\t\t\t}\t\n\t\t}", "private final function loadObjectFromDb()\n {\n # TODO: would be far preferable to use the objectsFromDestinations() code, possibly by refactoring into another shareable function. this is needed because otherwise we're in object A and OrmClass->load() is generating object B, instead of populating object A\n # TODO:NOTE01\n # TODO: must use $this->setLoadedFromDb() per class\n throw new Exception('TODO');\n }", "private function loadCollection($tableName)\n {\n return DB::table($tableName)->get();\n }", "public function loadSet(Filter $filter = null){\n\t\t$mode = QueryBuilder::QUERYSELECT;\n\t\t$query = new QueryBuilder($mode);\n\t\t\t\t\n\t\t$query->setTable($this->table);\t\n\t\t\n\t\tif($filter) {\n\t\t\t$query->setCondition($filter);\n\t\t}\n\t\t\n\t\t$query_str = $query->parse();\t\t\n\t\t//$this->firephp = FirePHP::getInstance(true);\n\t\t//$this->firephp->info($query_str);\n\n\t\t//print $query_str;\n\t\t\n\t\t$this->wrapper = ObjFactory::getObject(Constants::dbtype);\n\t\t$result = $this->wrapper->query($query_str,DBConn::getInstance());\n\t\t\t\t\n\t\tif($this->wrapper->getNumrows() == 0){\n\t\t\treturn false;\n\t\t} else {\n\t\t\twhile($row = $this->wrapper->fetch_assoc_row()){\n\t\t\t\t$item = new $this->dataClass;\n\t\t\t\t$item->mapRow($row);\n\t\t\t\t$output[] = $item;\n\t\t\t}\n\t\t\t//$this->firephp->info($output);\n\t\t\treturn $output;\n\t\t}\n\t}", "function load() {\n $statement = $this->db->prepare('SELECT * FROM favs WHERE id = :id');\n $statement->execute(array(':id' => $this->get('id')));\n $data = $statement->fetch(PDO::FETCH_ASSOC);\n $this->setMultiple($data);\n }", "public function one($condition = null)\n\t{\n parent::setFetchMode($this->fetchMode);\n $this->addCondition($condition, true);\n\t\t$this->fields = $this->queryRow();\n \n if(!empty($this->fields) && (!empty($this->related) || !empty($this->afterFind)))\n {\n $this->applyMethods('related');\n $this->applyMethods('afterFind');\n }\n \n return $this->fields;\n\t}", "public function findUser($condition)\n {\n return $this->createUserQuery()->where($condition);\n }" ]
[ "0.57210517", "0.56922704", "0.5691084", "0.56790066", "0.55747086", "0.55327123", "0.5511437", "0.5477265", "0.5448327", "0.54200876", "0.5348354", "0.5317316", "0.53077555", "0.52874106", "0.5286501", "0.528025", "0.5269855", "0.5205735", "0.5188458", "0.51633877", "0.51414776", "0.51381606", "0.50963753", "0.5073881", "0.503471", "0.50308126", "0.5021904", "0.49940053", "0.49639726", "0.49624738", "0.49394473", "0.49156764", "0.49126166", "0.48942146", "0.4888251", "0.48700833", "0.4858203", "0.48561144", "0.48495942", "0.48367104", "0.48353112", "0.48295617", "0.4828294", "0.48229444", "0.48206154", "0.48068064", "0.47969303", "0.47939005", "0.47917405", "0.4788101", "0.4779816", "0.47797456", "0.47782096", "0.47760823", "0.4759618", "0.4758134", "0.47508684", "0.4748847", "0.47435442", "0.47377574", "0.4732475", "0.47281927", "0.47228646", "0.4713832", "0.47091797", "0.4698736", "0.46946424", "0.46921715", "0.46515375", "0.46506533", "0.4640185", "0.46376625", "0.46317002", "0.46283835", "0.4618997", "0.46185124", "0.4609002", "0.46005583", "0.45953408", "0.45905533", "0.45879492", "0.4582377", "0.4575717", "0.45747894", "0.4572891", "0.4563202", "0.4563193", "0.45599622", "0.45596042", "0.45559397", "0.45533794", "0.45493597", "0.45449853", "0.45342726", "0.45243877", "0.45229357", "0.4517254", "0.4514756", "0.4512834", "0.45093822" ]
0.5729831
0
Deletes row by its primary value.
public function delete($key) { $this->getTable()->wherePrimary($key)->delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteRowByPrimaryKey()\n {\n if (!$this->getId())\n throw new Exception('Primary Key does not contain a value');\n return $this->getMapper()->getDbTable()->delete('id = '.$this->getId());\n }", "public function deleteRowByPrimaryKey()\n {\n if (!$this->getId())\n throw new Exception('Primary Key does not contain a value');\n return $this->getMapper()->getDbTable()->delete('id = '.$this->getId());\n }", "public function deleteRow($row);", "public function deleteRowByPrimaryKey()\n {\n if ($this->getTipoId() === null) {\n throw new \\Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()->getDbTable()->delete(\n 'tipoId = ' .\n $this->getMapper()->getDbTable()->getAdapter()->quote($this->getTipoId())\n );\n }", "public function deleteRowByPrimaryKey()\n {\n if ($this->getId() === null) {\n throw new Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()\n ->getDbTable()\n ->delete('id = ' .\n $this->getMapper()\n ->getDbTable()\n ->getAdapter()\n ->quote($this->getId()));\n }", "public function deleteRowByPrimaryKey()\n {\n if ($this->getId() === null) {\n $this->_logger->log('The value for Id cannot be null in deleteRowByPrimaryKey for ' . get_class($this), \\Zend_Log::ERR);\n throw new \\Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()->getDbTable()->delete(\n 'id = ' .\n $this->getMapper()->getDbTable()->getAdapter()->quote($this->getId())\n );\n }", "public function deleteRowByPrimaryKey()\n {\n if ($this->getId() === null) {\n $this->_logger->log('The value for Id cannot be null in deleteRowByPrimaryKey for ' . get_class($this), \\Zend_Log::ERR);\n throw new \\Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()->getDbTable()->delete(\n 'id = ' .\n $this->getMapper()->getDbTable()->getAdapter()->quote($this->getId())\n );\n }", "public function deleteRowByPrimaryKey()\n {\n if ($this->getCuboId() === null) {\n $this->_logger->log('The value for CuboId cannot be null in deleteRowByPrimaryKey for ' . get_class($this), \\Zend_Log::ERR);\n throw new \\Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()->getDbTable()->delete(\n 'cuboId = ' .\n $this->getMapper()->getDbTable()->getAdapter()->quote($this->getCuboId())\n );\n }", "public function delete($primaryKeyValue) {\n return $this->_dataHandler->delete($this->_table, $this->getPrimaryKeyCondition($primaryKeyValue));\n }", "public function delete($primary=NULL)\n {\n $primaryName = $this->primaryName;\n $primary = ($primary) ? $primary : $this->$primaryName;\n $stmt = $this->Adapter->prepare(\"DELETE FROM $this->table WHERE $this->primaryName=:id\");\n return $stmt->execute(['id' => $primary]);\n }", "public function delete($primaryKey, $shardByValue=FALSE) {\n\t\t\tif($this->shardBy && $shardByValue===FALSE)\n\t\t\t\tthrow new SERIA_Exception('Unable to delete this row, since you have not specified the \"'.$this->shardBy.'\" column as parameter two.');\n\t\t\t$sql = 'DELETE FROM '.$this->table.' WHERE `'.$this->primaryKey.'`=:sdbdatakey';\n\t\t\t$res = SERIA_Base::db()->exec($sql, array('sdbdatakey' => $primaryKey));\n\t\t\t$this->_cacheClean();\n\t\t\treturn $res;\n\t\t}", "public function hard_delete(){\n\t\tif($this->data[$this->primary_key]){\n\t\t\treturn $this->db\n\t\t\t\t->where($this->primary_key, $this->data[$this->primary_key])\n\t\t\t\t->delete($this->table);\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function deleteRowByPrimaryKey()\n {\n if ($this->getMensajeId() === null) {\n throw new \\Exception('Primary Key does not contain a value');\n }\n\n return $this->getMapper()->getDbTable()->delete(\n 'mensajeId = ' .\n $this->getMapper()->getDbTable()->getAdapter()->quote($this->getMensajeId())\n );\n }", "public final function delete() {\n\t\t$sql = \"\n\tDELETE FROM\n\t\t\" . $this->table . \"\n\tWHERE\n\t\t\" . $this->primaryField . \" = ?\n\t;\";\n\n\t\t$db = new MySQL();\n\t\t$statement = $db->prepare($sql);\n\t\t$status = $statement->execute(array($this->{$this->primaryField}));\n\t\t$statement = NULL;\n\n\t\treturn $status;\n\t}", "public function delete() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query = $this->connection->query(\"DELETE FROM {$this->table} WHERE \".self::$primaryKey[$this->table].\"='{$this->originalData[self::$primaryKey[$this->table]]}'\");\n\t\t\t$query = $this->connection->query(\"ALTER TABLE $this->table AUTO_INCREMENT = 1\");\n\t\t\t$this->originalData = array();\n\t\t}\t\n\t\telse \n\t\t\tthrow new Exception('You are trying to delete an inexistent row');\n\t}", "public function deleteRow()\n {\n $sql = 'DELETE FROM productos\n WHERE id_producto = ?';\n $params = array($this->id);\n return Database::executeRow($sql, $params);\n }", "public function delete() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"DELETE FROM \".$this->getTableName();\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "public function delete()\n {\n $class = strtolower(get_called_class());\n $table = self::$_table_name != null ? self::$_table_name : $class . 's';\n\n $pdo = PDOS::getInstance();\n\n $whereClause = '';\n foreach (static::$_primary_keys as $pk)\n $whereClause .= $pk . ' = :' . $pk . ' AND ';\n $whereClause = substr($whereClause, 0, -4);\n $sql = 'DELETE FROM ' . $table . ' WHERE ' . $whereClause;\n $query = $pdo->prepare($sql);\n $attributes = $this->getAttributes(new \\ReflectionClass($this));\n foreach ($attributes as $k => $v)\n {\n if (in_array($k, static::$_primary_keys))\n $query->bindValue(':' . $k, $v);\n }\n $query->execute();\n }", "function delete($table, $pk, $column = 'id')\n\t{\n\t\tif($statement = $this->query(\"DELETE FROM `$table` WHERE `$column` = ?\", $pk))\n\t\t{\n\t\t\treturn $statement->rowCount();\n\t\t}\n\t}", "public function delete() {\r\n\r\n $retVal = false;\r\n\r\n $table = static::getDbTable();\r\n $map = static::getDbMap();\r\n $primaryKey = static::getDbPrimaryKey();\r\n if ($this->$primaryKey) {\r\n $query = 'DELETE FROM `' . $table . '` WHERE `' . $map[$primaryKey] . '` = :id';\r\n $params = array( ':id' => $this->$primaryKey );\r\n $retVal = Db::Query($query, $params);\r\n }\r\n\r\n return $retVal;\r\n\r\n }", "public function deleteValid($primary) {\t\n\t\tif(!empty($primary)){\n\t\t\tif(is_array($this -> _primary)){\n\t\t\t\t$primaryKey = current($this -> _primary);\n\t\t\t} else {\n\t\t\t\t$primaryKey = $this -> _primary;\n\t\t\t}\n\t\t\t$primary = is_numeric($primary) ? (float) $primary : $this -> quote($primary);\n\t\t\t$row = $this -> fetchRow($primaryKey . \"=\" . $primary);\n\t\t\t\n\t\t\tif(!is_null($row)){\n\t\t\t\treturn $row -> delete();\n\t\t\t} \n\t\t} \n\t\treturn false;\n\t\t\n\t}", "public static function deleteData($row){\n\n\t\t$result = DB::delete($row['table'])->where('id', $row['id'])->execute();\n\t\treturn 1;\n\n\t}", "public function delete($primaryKey = 'id')\n\t{\n\t\t$table = $this->getGateway()->getPrimaryTable();\n\t\t\n\t\t$id \t= $this->id; \n\t\t$where \t= $table->getAdapter()->quoteInto($primaryKey. ' = ?', $id);\n\t\t\n\t\tif ($table->delete($where)) {\n\t\t\t//clean object data\n\t\t\t$this->_data = array();\n\t\t\treturn true; \n\t\t}else {\n\t\t\treturn false; \n\t\t}\n\t}", "public function delete_row($id) { \n $database = new Database();\t\n $sql = NULL;\n $sql .= \"DELETE FROM \" . TABLE_NAME . \" WHERE \" . PRIMARY_KEY . \" = \" . $id; \t\t\n $database->query($sql); \t \n $database->execute();\n $this->move_along(); // move to database class? \n }", "function del($fp_rowId)\n {\n foreach ((array)$fp_rowId as $k => $id) {\n $this->db->or_where('id', $id);\n }\n $this->db->from($this->table);\n $this->db->delete($this->table);\n //dump($this->db->last_query());\n return true;\n }", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "function deleteRow($pairId)\r\n\r\n{\r\n global $dbh;\r\n\r\n $select = \"DELETE from flashcard WHERE pairId=:pairId\";\r\n\r\n // prepare statement\r\n $statement = $dbh->prepare($select);\r\n\r\n // bind parameters\r\n $statement->bindValue(':pairId', $pairId);\r\n\r\n // execute statement\r\n $success = $statement->execute();\r\n\r\n return $success;\r\n}", "function deleteRowByColumnValue($table_name, $column_name, $column_value)\n {\n $sql = sprintf(\n \"DELETE FROM %s WHERE %s=\\\"%s\\\"\",\n $table_name, $column_name,\n SQLite3::escapeString($column_value));\n $this->exec($sql);\n }", "function delete($val){\n $del = $this -> query(\"DELETE FROM {$this ->table} WHERE {$this -> pk} = '{$val}'\");\n return ($del)?true:false;\n }", "public function delete_row( $where ) {\n\t\t\t$wpdadb = WPDADB::get_db_connection( $this->schema_name );\n\t\t\treturn $wpdadb->delete( $this->table_name, $where );\n\t\t}", "public function deleteBy(string $column, $value)\r\n {\r\n return $this->conn->exec(\"DELETE FROM $this->table WHERE $column = $value\");\r\n }", "public static function deleteByPk($primary_key)\n {\n $sql = \"\n DELETE\n FROM \".static::getTable().\"\n WHERE \";\n\n // build query and add values from all primary key columns\n $condition = static::buildConditionByPk($primary_key);\n $stmt = self::createStatement($sql.$condition['sql']);\n foreach ($condition['params'] as $key => $value) {\n $stmt->assignGuessType($key, $value);\n }\n\n return $stmt->affected();\n }", "public function deleteByPk($primaryKey) {\n $query = $this->db->getQuery(true);\n\n $conditions = array($this->quoteName($this->primaryKeyColumn) . ' = ' . (is_numeric($primaryKey) ? $primaryKey : $this->quote($primaryKey)));\n\n $query->delete($this->quoteName($this->tableName));\n $query->where($conditions);\n\n $this->db->setQuery($query);\n\n return $this->db->execute();\n }", "public function delete()\n\t{\n\t\tif( !isset($this->attributes[static::$primaryKey]) || $this->attributes[static::$primaryKey] <= 0 )\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn DataBase::delete(\"DELETE FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $this->attributes[static::$primaryKey]);\n\t}", "public function delete() {\n global $db;\n $this->_predelete();\n $result = $db->query(\"DELETE FROM \".$this->table.\" WHERE \".$this->id_field.\"=?\", array($this->{$this->id_field}));\n $this->_postdelete($result);\n return $result;\n }", "public function delete_by($key, $value){\n \n if (empty($key)) {\n return FALSE;\n }\n \n $this->db->where(htmlentities($key), htmlentities($value))->delete($this->table_name);\n }", "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "public function deleteRow($table)\r\n\t\t{\r\n\r\n\t\t\tif($this->_where != \"\" and $this->_where != 'false'){\r\n\t\t\t\t$sqlDelete = \"DELETE FROM `{$this->_prefix}{$table}`\" . $this->_where;\t\t\t\t\r\n\t\t\t}\r\n\t\t\telse echo \"Error: Please provide a where clause when trying to delete a row\";\r\n\r\n\t\t\t$this->_query = $this->_prepare($sqlDelete);\r\n\t\t\t$eStatus = $this->_execute($this->_query);\r\n\t\t\t$this->_errors($this->_query);\r\n\t\t\t$this->close();\r\n\r\n\t\t\treturn $eStatus;\r\n\t\t}", "function deleteRow($table, $where) {\n return mysql_query(sprintf('DELETE FROM %s WHERE %s', $table, $where));\n }", "public function deleteRow($id)\r\n\t{\r\n\t\t// Build SQL\r\n\t\t$sql = \"DELETE FROM `\".$this->name.\"` WHERE `\".$this->primaryKey.\"` = :id\";\r\n\t\t\r\n\t\t$params = array('id' => $id);\r\n\t\r\n\t\t// Execute\r\n\t\t$result = $this->db->runQuery($sql, $params);\r\n\t\t\r\n\t\treturn $this->db->getAffectedRows();\r\n\t}", "public function delete($where = array()) {\n\n $where = array(self::PRI_INDEX => $where);\n \n $this->db->delete(self::TABLE_NAME, $where);\n return $this->db->affected_rows();\n }", "public function delete() {\n\t\ttry {\n\t\t\tif($this->_state == self::STATE_UNCHANGED) {\n\t\t\t\t$sql = 'DELETE FROM ' . self::sanitize($this->_table->getProperty('name')) . ' WHERE ' . self::sanitize($this->_key_primary->name) . ' = ' . self::sanitize($this->_data[$this->_key_primary->name]);\n\t\t\t\t\\Bedrock\\Common\\Logger::info('Deleting record with query: ' . $sql); echo $sql;\n\t\t\t\t$this->_connection->exec($sql);\n\t\t\t}\n\t\t\telseif($this->_state == self::STATE_CHANGED) {\n\t\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('Unsaved changes found, cannot delete record.');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('Record not found in database.');\n\t\t\t}\n\t\t}\n\t\tcatch(\\PDOException $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('A database error was encountered, the record could not be deleted.');\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('The record could not be deleted.');\n\t\t}\n\t}", "public function deleteRow($index)\n {\n unset($this->data[$index]);\n }", "public static function Delete($key) {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$primary = $model->index('primary');\r\n\t\tif (is_null($primary)) {\r\n\t\t\tthrow new Exception(\"The schema for {$cls} does not identify a primary key\");\r\n\t\t}\r\n\t\tif (is_array($key)) {\r\n\t\t\tforeach ($primary['fields'] as $field) {\r\n\t\t\t\tif (!isset($key[$field])) {\r\n\t\t\t\t\tthrow new Exception(\"No value provided for the {$field} field in the primary key\");\r\n\t\t\t\t}\r\n\t\t\t\t$model->query()->where(\"{$field} = ?\", $key[$field]);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (count($primary['fields']) > 1) {\r\n\t\t\t\tthrow new Exception(\"The schema for {$cls} has more than one field in its primary key\");\r\n\t\t\t}\r\n\t\t\t$model->where(\"{$primary['fields'][0]} = ?\", $key);\r\n\t\t}\r\n\t\t$src = Dbi_Source::GetModelSource($model);\r\n\t\t$src->delete($model);\r\n\t}", "function deleteRow($table, $compare_column, $id) {\n $mysql = new my_mysql();\n $query = \"DELETE FROM $table WHERE $compare_column='$id';\";\n $mysql->transactionQuery($query);\n}", "function delete( $id )\n\t{\n\t\t// where clause\n\t\t$this->db->where( $this->primary_key, $id );\n\n\t\t// delete the record\n\t\treturn $this->db->delete( $this->table_name );\n\t\t// print_r($this->db->last_query());die;\n \t}", "public function delete($id, $primary_key = 'id')\r\n {\r\n $this->type = 'delete';\r\n\r\n return $this->delete_where(array($primary_key => $id));\r\n }", "function delete($options = array())\n\t{\n\t\t$required = array($this->primary_key);\n\t\tif ( ! $this->_required($required, $options))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$this->db->where($this->primary_key, $options[$this->primary_key]);\n\t\treturn $this->db->delete($this->primary_table);\n\t}", "public function Delete_row_from_key($key_row)\n {\n $this->connection->RunQuery(\"DELETE FROM tbl_estado_domiciliarios WHERE ID_ESTADO_DOMICILIARIOS = $key_row\");\n }", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "public function delete($where = array()) {\n // if (!is_array()) {\n // $where = array(self::PRI_INDEX => $where);\n // }\n $this->db->delete(self::TABLE_NAME, $where);\n return $this->db->affected_rows();\n }", "public function delete()\n\t{\n\t\tif ($this->data['id'])\n\t\t{\n\t\t\treturn $this->db->delete($this->table_name, array('id' => $this->data['id']));\n\t\t}\n\t}", "public function delete($pk = null)\n {\n \t$k = $this->_tbl_key;\n \n \t// Implement JObservableInterface: Pre-processing by observers\n \t$this->_observers->update('onBeforeDelete', array($pk, $k));\n \n \t$pk = (is_null($pk)) ? $this->$k : $pk;\n \n \t// If no primary key is given, return false.\n \tif ($pk === null)\n \t{\n \t\tthrow new UnexpectedValueException('Null primary key not allowed.');\n \t}\n \n \t// If tracking assets, remove the asset first.\n \tif ($this->_trackAssets)\n \t{\n \n \t\t// Get and the asset name.\n \t\t$savedK = $this->$k;\n \n \t\t$this->$k = $pk;\n \t\t$name = $this->_getAssetName();\n \t\t$asset = self::getInstance('Asset');\n \n \t\tif ($asset->loadByName($name))\n \t\t{\n \n \t\t\tif (!$asset->delete())\n \t\t\t{\n \t\t\t\t\t\n \t\t\t\t$this->setError($asset->getError());\n \t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$this->setError($asset->getError());\n \t\t\t//no assset? let it go\n \t\t\t//return false;\n \t\t}\n \n \t\t$this->$k = $savedK;\n \t}\n \n \t// Delete the row by primary key.\n \t$query = $this->_db->getQuery(true)\n \t->delete($this->_tbl)\n \t->where($this->_tbl_key . ' = ' . $this->_db->quote($pk));\n \t$this->_db->setQuery($query);\n \n \t// Check for a database error.\n \t$this->_db->execute();\n \n \t// Implement JObservableInterface: Post-processing by observers\n \t$this->_observers->update('onAfterDelete', array($pk));\n \t\n \t$dispatcher = JEventDispatcher::getInstance();\n \tJPluginHelper::importPlugin('finder');\n \t$res = $dispatcher->trigger('onFinderAfterDelete', array('com_mymuse.product', $this, $isNew));\n\n \n \treturn true;\n }", "public function deleteRow($id)\n {\n if ($id === self::ID_SUMMARY_ROW) {\n $this->summaryRow = null;\n return;\n }\n if (!isset($this->rows[$id])) {\n throw new Exception(\"Trying to delete unknown row with idkey = $id\");\n }\n unset($this->rows[$id]);\n }", "public function delete() {\n\t\t\tif (!$this->isKnown()) { return FALSE; }\n\t\t\t$this->preDelete();\n\t\t\t$query = sprintf('DELETE FROM %s WHERE `%s` = :key', static::$_table, static::$_key);\n\t\t\ttry {\n\t\t\t\t$statement = $this->myDB->getPDO()->prepare($query);\n\t\t\t\t$params[':key'] = $this->getData(static::$_key);\n\t\t\t\t$result = $statement->execute($params);\n\t\t\t} catch (\\PDOException $t) {\n\t\t\t\t$result = FALSE;\n\t\t\t}\n\t\t\tif (!$result) {\n\t\t\t\t$this->lastError = $statement->errorInfo();\n\t\t\t}\n\t\t\t$this->postDelete($result);\n\t\t\treturn $result;\n\t\t}", "public function delete() {\n\t\t\t$query = \"DELETE FROM $this->table_name WHERE id=?\";\n\n\t\t\t// prepare biatch\n\t\t\t$stmt = $this->conn->prepare($query);\n\n\t\t\t// bind id biatch\n\t\t\t$stmt->bindParam(1, $this->id);\n\n\t\t\t// execute query\n\t\t\tif ($stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function delete()\n {\n if ($this->GET('sure')) {\n $function = basename($this->table->tablename()) . \"_onRowDelete\";\n if (function_exists($function)) {\n $function($this->table->data($this->GET('id')), &$this->table);\n }\n\n $this->table->delete($this->GET('id'));\n $this->table->write();\n $this->browse();\n return;\n }\n $this->displayHead();\n echo 'Do you really want to<br>delete row \\'' . $this->GET('id') . '\\'?<p>';\n echo '<a class=\"danger\" href=\"' . $this->SELF . '?method=delete&table=' . $this->table->tablename() . '&id=' . $this->GET('id') . '&sure=1\">Yes</a> | ';\n echo '<a href=\"' . $this->SELF . '?method=browse&table=' . $this->table->tablename() . '\">No</a>';\n }", "public function deleteRecord()\n { \n $sql = \"DELETE FROM Cubans WHERE Id = :Id\";\n $statement = $this->connect->prepare($sql);\n $statement->bindValue(':Id', $this->id);\n $statement->execute();\n }", "function delete($table, $idField, $idValue) {\n $this->connect();\n $sql = 'DELETE FROM ' . $table . ' WHERE ' . $idField . '=' . (int) $idValue . ';';\n return mysqli_query($this->_conn, $sql);\n }", "public function delete($id){\n\t\t$tableName = $this->tableName();\n\t\t$primaryKey = $this->getPrimaryKey();\n\t\t$statement = $this->db->prepare('DELETE FROM ' . $tableName . ' WHERE ' . $primaryKey . ' =:' . $primaryKey . ' LIMIT 1');\n\t\t$this->binder($statement, ':' . $primaryKey, $id);\n\t\tif($statement->execute()){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function findByPrimaryKeyAndRemove($primary_key)\n {\n return DB::table(static::$schema)\n ->delete()\n ->where(static::getPrimaryKey(), $primary_key)\n ->fulfil();\n }", "function delete($id) {\n return $this->db->deleteParameters(self::TABLA, array('id' => $id));\n }", "function Delete(){\n return $this->DeleteBy([\"ID_AVAL = \".$this->idAval]);\n }", "public function destroy(phpDataMapper_Model_Row $row)\n\t{\n\t\t$where = $this->getPrimaryKeyField() . \" = '\" . $this->getPrimaryKey($row) . \"'\";\n\t\t$sql = \"DELETE FROM \" . $this->table . \" WHERE \" . $where;\n\t\t\n\t\t// Add query to log\n\t\t$this->logQuery($sql);\n\t\t\n\t\t$this->adapter->exec($sql);\n\t\treturn true;\n\t}", "public function delete($datos_){\n $id=$datos_->getId();\n\n try {\n $sql =\"DELETE FROM `datos_` WHERE `id`='$id'\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "public function delete_by()\n\t{\n\t\t$where = func_get_args();\n\t\t$this->_set_where($where);\n\n\t\t$where = $this->trigger('before_delete', $where);\n\n\t\tif($this->soft_delete)\n\t\t{\n\t\t\t$result = $this->db->update($this->_table, array($this->soft_delete_key => TRUE));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->delete($this->_table);\n\t\t}\n\n\t\t$this->trigger('after_delete', $result);\n\n\t\treturn $result;\n\t}", "public function deleteById(int $rowId)\r\n {\r\n $this->showHeaderNotFound();\r\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function action_delete_entry(): int {\n\t\treturn (int) ( new CRUD( $this->table->get_table_definition() ) )->delete_oldest_item();\n\t}", "public function deleteRowPrepare(RowInterface $row) : DeleteInterface\n {\n $this->events->beforeDelete($this, $row);\n\n $delete = $this->delete();\n foreach ($this->getPrimaryKey() as $primaryCol) {\n $delete->where(\"{$primaryCol} = ?\", $row->$primaryCol);\n }\n\n $this->events->modifyDelete($this, $row, $delete);\n return $delete;\n }", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "function delete_by($attribute, $value) {\n\t\t$sql = \"\n\t\t\tDELETE FROM\n\t\t\t\t\\\"{$this->schema}\\\".\\\"{$this->tableName}\\\"\n\t\t\tWHERE\n\t\t\t\t\\\"{$attribute}\\\" = '{$value}'\n\t\t\";\n\t\t$this->debug->show('delete_by sql: ' . $sql, false);\n\t\t$query = pg_query($this->database->dbConn, $sql);\n\t\treturn $query;\n\t}", "function row_delete()\n\t{\n\t $this->db->where('id', $id);\n\t $this->db->delete('testimonials'); \n\t}", "public function delete($table_name, $col, $val)\n\t{\n\t\t$query = \"DELETE FROM $table_name WHERE $col = ? \";\n\t\ttry\n\t\t{\n\t\t\t$stmt = $this->pdo->prepare($query);\n\t\t\t$stmt->bindValue(1, $val);\n\t\t\treturn $stmt->execute();\n\t\t}\n\t\tcatch(PDOException $e) { echo \"Database Error.\"; exit; }\n\t}", "public function delete($cpu){\n $id=$cpu->getId();\n\n try {\n $sql =\"DELETE FROM `cpu` WHERE `id`='$id'\";\n return $this->insertarConsulta($sql);\n } catch (SQLException $e) {\n throw new Exception('Primary key is null');\n }\n }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "function delete($rowid='')\n {\n \tif (empty($rowid)) $rowid=$this->id;\n\n $sql = \"DELETE FROM \".MAIN_DB_PREFIX.\"adherent_type WHERE rowid = \".$rowid;\n\n $resql=$this->db->query($sql);\n if ($resql)\n {\n if ($this->db->affected_rows($resql))\n {\n return 1;\n }\n else\n\t\t\t{\n return 0;\n }\n }\n else\n {\n print \"Err : \".$this->db->error();\n return 0;\n }\n }", "function delete($primary){\n $this->primary=$primary;\n //\n //create the delete\n $update= new delete($this, $primary);\n //\n //Execute the the insert\n $update->query($this->entity->get_parent());\n }", "public function delete()\n\t{\n\t\t$sql = 'DELETE FROM ' . $this->sql_table . '\n\t\t\tWHERE ' . $this->sql_id_field . ' = ' . $this->{$this->sql_id_field};\n\t\t$this->db->sql_query($sql);\n\n\t\t// Unset the sql indentifier field\n\t\tunset($this->{$this->sql_id_field});\n\n\t\treturn $this->db->sql_affectedrows();\n\t}", "public function delete($params=''){\n\t\t$this->_connect();\n\t\tif($this->_schema){\n\t\t\t$table = $this->_schema.'.'.$this->_source;\n\t\t} else {\n\t\t\t$table = $this->_source;\n\t\t}\n\t\t$conditions = '';\n\t\tif(is_array($params)){\n\t\t\t$numberArguments = func_num_args();\n\t\t\t$params = Utils::getParams(func_get_args(), $numberArguments);\n\t\t\tif(isset($params['conditions'])){\n\t\t\t\t$conditions = $params['conditions'];\n\t\t\t}\n\t\t} else {\n\t\t\t$primaryKeys = $this->_getPrimaryKeyAttributes();\n\t\t\tif(is_numeric($params)){\n\t\t\t\tif(count($primaryKeys)==1){\n\t\t\t\t\t$conditions = $primaryKeys[0].\" = '\".$params.\"'\";\n\t\t\t\t} else {\n\t\t\t\t\tthrow new ActiveRecordException('Número de parámetros insuficientes para realizar el borrado');\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\tif($params){\n\t\t\t\t\t$conditions = $params;\n\t\t\t\t} else {\n\t\t\t\t\tif(count($primaryKeys)==1){\n\t\t\t\t\t\t$primaryKeyValue = $this->readAttribute($primaryKeys[0]);\n\t\t\t\t\t\t$conditions = $primaryKeys[0].\" = '\".$primaryKeyValue.\"'\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$conditions = array();\n\t\t\t\t\t\tforeach($primaryKeys as $primaryKey){\n\t\t\t\t\t\t\t$primaryKeyValue = $this->readAttribute($primaryKey);\n\t\t\t\t\t\t\t$conditions[] = $primaryKey.\" = '\".$primaryKeyValue.\"'\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$conditions = join(' AND ', $conditions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->_callEvent('beforeDelete')===false){\n\t\t\treturn false;\n\t\t}\n\t\t$success = $this->_db->delete($table, $conditions);\n\t\t$this->_operationMade = self::OP_DELETE;\n\t\tif($success==true){\n\t\t\t$this->_callEvent('afterDelete');\n\t\t}\n\t\treturn $success;\n\t}", "public function delete(int $id): void\r\n{\r\n \r\n\r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n}", "function delete($parametro){\n try{\n $stmte = $this->pdo->prepare(\"DELETE FROM tb_ingrediente WHERE igr_pk_id = :parametro\");\n $stmte->bindParam(\":parametro\", $parametro, PDO::PARAM_INT);\n $stmte->execute();\n return 1;\n }\n catch(PDOException $e){\n echo $e->getMessage();\n return -1;\n }\n }", "public function deleteRow($id)\n\t{\n \t\treturn $this->findAll('kategoria')->where('id_kat', $id)->fetch()->delete();\n\t}", "public final function delete($pk=null)\n {\n // When pk is set\n if (isset($pk))\n {\n // Do we have a definition like filter and paramerter to process?\n if (is_array($pk))\n $this->processQueryDefinition($pk);\n // Or is it a primary key value?\n else\n {\n $this->filter = $this->pk . '={int:pk}';\n $this->param = array('pk' => $pk);\n }\n }\n\n // Do we have to prepare a filter statement\n $filter = $this->filter ? ' WHERE ' . $this->filter : '';\n\n // Build sql string\n $sql = \"DELETE FROM {db_prefix}{$this->tbl}{$filter}\";\n\n // Running delete\n $this->db->query($sql, $this->param);\n\n // Reset filter and parameter\n $this->resetFilter();\n $this->resetParameter();\n }", "public function delete($rowid)\n {\n $this->db->where('id',$rowid);\n $this->db->delete('goods');\n }", "function delete_record($table, $arg, $column_id)\n{\n $ci = & get_instance();\n $db_debug = $ci->db->db_debug;\n $ci->db->db_debug = FALSE;\n $ci->db->where([$column_id => $arg]);\n $ci->db->delete($table);\n if ($ci->db->affected_rows() > 0) {\n return TRUE;\n } else {\n return FALSE;\n }\n $ci->db->db_debug = $db_debug;\n}", "public function delete(&$pks)\n\t{\n\t\tif (empty($pks))\n\t\t{\n\t\t\tthrow new RuntimeException('No record selected', 404);\n\t\t}\n\n\t\t$query = $db->getQuery(true);\n\n\t\t$query->delete($tableName);\n\n\t\tif (!is_array($pks))\n\t\t{\n\t\t\t$query->where($key . ' = ' . $pk);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$pksImploded = implode(',', $pks);\n\t\t\t$query->where($key . ' IN (' . $pk . ')');\n\n\t\t}\n\n\t\t$db->setQuery($query);\n\n\t\t$result = $db->execute();\n\n\t\tif ($result && $db->getAffectedRows())\n\t\t{\n\t\t\t$this->getApplication()->setHeader('status', '204 Deleted');\n\t\t}\n\t\telseif ($result)\n\t\t{\n\t\t\tthrow new RuntimeException('Record Not Found', 404);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new RuntimeException('Delete failed', 500);\n\t\t}\n\t}", "public function delete(int $id): void{\r\n \r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n\r\n\r\n}", "function my_delete_record( $table_name , $field_key , $data_id){\r\n\tglobal $connection;\t\r\n\t\r\n\t$query = \"DELETE FROM `\".$table_name.\"` WHERE `\".$field_key .\"` = \". $data_id ;\r\n\t$result = my_query( $query );\r\n\t\r\n\treturn $connection->affected_rows ;\r\n}", "public function delete()\n {\n $table = self::getTable();\n $connection = new DataBaseConnection();\n $parameters = ['id' => $this->id];\n return $connection->delete($table, $parameters);\n }", "public function delete(){\n global $wpdb;\n $table_name = $wpdb->prefix.static::$_table;\n return $wpdb->delete($table_name,[$this->getPk()=>$this->getPkValue()]);\n }", "public function delete() \n\t{\n\t\tif ($this->id) {\n\t\t\t$this->query->fields(\"id\")->compareTo($this->id);\n\t\t\treturn $this->query->delete();\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "function deleteRow($delProdCode) {\n \n $length = count($_SESSION['cortTable']);\n \n for($i=0;$i<$length;$i++){\n \n if ($_SESSION['cortTable'][$i]['prodCode'] == $delProdCode){\n \n $_SESSION['cortTable'][$i]['deleted'] = 1;\n }\n }\n }", "public function delete() {\n\t\tif ($this->wpdb->query(\"DELETE FROM $this->table WHERE \" . $this->buildWhere(array_intersect_key($this->toArray(TRUE), array_flip($this->primary))))) {\n\t\t\treturn $this;\n\t\t} elseif ($this->wpdb->last_error) {\n\t\t\tthrow new Exception($this->wpdb->last_error);\n\t\t}\n\t}", "public function deleteFromDatabase(PDO $db) {\n\t\t$stmt=self::prepareStatement($db,self::SQL_DELETE_PK);\n\t\t$stmt->bindValue(1,$this->getId());\n\t\t$affected=$stmt->execute();\n\t\tif (false===$affected) {\n\t\t\t$stmt->closeCursor();\n\t\t\tthrow new Exception($stmt->errorCode() . ':' . var_export($stmt->errorInfo(), true), 0);\n\t\t}\n\t\t$stmt->closeCursor();\n\t\treturn $affected;\n\t}", "public function deleteRow($postArray,$editId,$tableName)\n{\n $retString='';\n \n $retString=$this->deletePreProcessing($postArray,$editId);\n \n $sql=\"delete from $tableName where id=$editId\";\n \n $ret=$this->updateTableData($sql,false);\n \n}", "function delete($tabla,$campo,$criterio){\n\treturn $GLOBALS['cn']->query('DELETE FROM '.$tabla.' WHERE '.$campo.'=\"'.$criterio.'\"');\n}", "function delete($tabla,$campo,$criterio){\n\treturn $GLOBALS['cn']->query('DELETE FROM '.$tabla.' WHERE '.$campo.'=\"'.$criterio.'\"');\n}", "public function deleteByPrimaryKeys(stubObject $entity);", "public function delete()\r\n {\r\n $this->sql = 'DELETE FROM ' . $this->table .' '.$this->alias. ' '. $this->sql;\r\n $query = R::exec($this->sql, $this->params);\r\n $this->sql = null;\r\n $this->params = [];\r\n return $query;\r\n }" ]
[ "0.78132737", "0.78132737", "0.7692293", "0.7674818", "0.76267326", "0.7626553", "0.7626553", "0.74181277", "0.7290904", "0.7238237", "0.70737433", "0.7067845", "0.70655566", "0.70165706", "0.6999292", "0.6982408", "0.6867629", "0.68368226", "0.68040717", "0.67106265", "0.66799164", "0.66674805", "0.66511416", "0.66393197", "0.66359323", "0.6603192", "0.658569", "0.65655506", "0.6556873", "0.65132105", "0.64994425", "0.6491631", "0.64896226", "0.6477596", "0.64256376", "0.6420854", "0.6360433", "0.633665", "0.63324654", "0.632722", "0.6321993", "0.6317769", "0.63080716", "0.62616813", "0.6255524", "0.62534356", "0.62503886", "0.6243957", "0.6232039", "0.62238973", "0.6215239", "0.6192401", "0.6179114", "0.617696", "0.61747295", "0.61725616", "0.6141978", "0.6140347", "0.61362815", "0.6132285", "0.6129842", "0.6128493", "0.6127764", "0.61111796", "0.6073129", "0.60565424", "0.605563", "0.6050892", "0.6019173", "0.6013077", "0.6009246", "0.6000063", "0.5999591", "0.5994189", "0.5986719", "0.59790355", "0.5978404", "0.5974802", "0.5973627", "0.5970206", "0.5966434", "0.5963852", "0.59638184", "0.5960868", "0.59606946", "0.59596837", "0.5957281", "0.59561926", "0.59530455", "0.5949542", "0.59468514", "0.5928036", "0.59218365", "0.5919499", "0.5913296", "0.59101826", "0.5907596", "0.5907596", "0.59005105", "0.588906" ]
0.6587256
26
Verifies that the specified condition is not null. The assertion fails if the condition is null.
public function assertIsNull($value, $message='Unexpected null value: %s', $exception='Asserts') { if (is_null($value)) { $value = 'NULL'; $this->throwException($exception, $message, $value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static function unittest_nestedConditions () {\n PhlintTest::assertNoIssues('\n $foo = null;\n if (is_null($foo))\n if (true === true)\n if ($foo) {}\n ');\n }", "protected function assertConditionsMet(): void\n {\n $this->assertThat(null, new ExpectationsMet());\n }", "public function testWhenNoConditionIsSet()\n {\n $this->assertFalse($this->class->has_condition());\n }", "public function check($condition)\n\t{\n\t}", "public function is(Condition $condition) {\n $this->failed || Assertions::verify(function() use($condition) {\n if ($condition->matches($this->value)) {\n return null;\n } else {\n $this->failed= true;\n return new AssertionFailedError('Failed to verify that '.$condition->describe($this->value, true));\n }\n });\n return $this;\n }", "public function testNullThrows()\n {\n $argument = [null];\n\n $this->expectException(AssertionException::class);\n\n $this->callStatic(Assert::class, $argument);\n }", "private function validateComparison(FilterInterface $condition, $segmentName)\n {\n if ($condition instanceof Truth)\n {\n throw new RuntimeException('The segment ' . $segmentName . ' is not a default node, but has an \"always true\" condition.');\n }\n $contextKey = $condition->getContextKey();\n if (!strlen($contextKey))\n {\n throw new RuntimeException('The segment ' . $segmentName . ' has an empty or invalid context key.');\n }\n }", "public function isNot(Condition $condition) {\n $this->failed || Assertions::verify(function() use($condition) {\n if ($condition->matches($this->value)) {\n $this->failed= true;\n return new AssertionFailedError('Failed to verify that '.$condition->describe($this->value, false));\n } else {\n return null;\n }\n });\n return $this;\n }", "public static function assert_true($condition, $message, $file, $line)\n {\n if(!$condition)\n self::err('assert_true_failed', $message, null, $file, __FUNCTION__, __CLASS__, $line, ERR_ACTION_SYSMSG, false);\n }", "protected function assert($condition, $message)\n {\n $driver = $this->getMink()->getSession()->getDriver();\n if (!$condition) {\n throw new ExpectationException($message, $driver);\n }\n\n }", "public function testNullThrows()\n {\n $argument = [null, null];\n\n $this->expectException(AssertionException::class);\n\n $this->callStatic(Assert::class, $argument);\n }", "public function assertTrue($condition, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertTrue', func_get_args()));\n }", "public function assertTrue($condition, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertTrue', func_get_args()));\n }", "function assertLogical($condition, $error)\n{\n if (!$condition) {\n throw new \\LogicException($error);\n }\n}", "public function it_can_identify_valid_values()\n {\n $this->assertTrue(Testee::isValid(self::TEST_NULL_VALUE));\n }", "function assert($assertion, $description = null): bool {}", "public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)\n {\n return true;\n }", "public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null)\n {\n return true;\n }", "public function assertNotTrue($condition, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertNotTrue', func_get_args()));\n }", "public function assertNotTrue($condition, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertNotTrue', func_get_args()));\n }", "function assertNotNull($value, $message = '%s should not be NULL') {\n return $this->assert(\n new NotIdenticalExpectation(null),\n $value,\n $message\n );\n }", "public function hasCondition();", "function assertArgument($condition, $error)\n{\n if (!$condition) {\n throw new \\InvalidArgumentException($error);\n }\n}", "public function testValidateNull(): void\n {\n $this->assertTrue($this->validate(null));\n }", "public function testHandle2()\n{\n\n // Traversed conditions\n // if (is_null($job)) == true (line 34)\n\n $actual = $this->retryCommand->handle();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testHandle1()\n{\n\n // Traversed conditions\n // if (is_null($job)) == false (line 34)\n\n $actual = $this->retryCommand->handle();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "protected function assertPermission($condition)\n {\n if (! $condition) {\n throw new PermissionDeniedException;\n }\n }", "#[@test]\n public function doesMatch_should_work_with_null() {\n $this->sut->setArguments(array(null, null));\n\n $this->assertTrue($this->sut->doesMatchArgs(array(null, null)));\n }", "public function testConditionClause()\n {\n $condition = $this->getConnection()\n ->condition()\n (\"WHERE blog_id = :id\");\n return $this->assertEquals($condition, \"WHERE blog_id = :id\");\n }", "public function testGet_attribution1()\n{\n\n // Traversed conditions\n // if ($this->label !== \\null) == true (line 120)\n\n $actual = $this->simplePie_Copyright->get_attribution();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function assert ($condition, $msg, $http_code=null) {\r\n if (!$condition) $this->abort($msg ? $msg : 'Web service failed', $http_code) ;\r\n }", "public function testValidate4()\n{\n\n // Traversed conditions\n // if (empty($name) && !is_numeric($name)) == true (line 373)\n\n $actual = $this->setCookie->validate();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function assertValid()\n {\n }", "public function isNotNull();", "private function checkCondition(array $condition)\n {\n return true;\n }", "public function testGet_attribution0()\n{\n\n // Traversed conditions\n // if ($this->label !== \\null) == false (line 120)\n\n $actual = $this->simplePie_Copyright->get_attribution();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testConditionEvaluation() {\n $entity = $this->prophesizeEntity(ContentEntityInterface::class);\n $entity->hasField('existing-field')->willReturn(TRUE)\n ->shouldBeCalledTimes(1);\n $entity->hasField('non-existing-field')->willReturn(FALSE)\n ->shouldBeCalledTimes(1);\n\n $this->condition->setContextValue('entity', $entity->reveal());\n\n // Test with an existing field.\n $this->condition->setContextValue('field', 'existing-field');\n $this->assertTrue($this->condition->evaluate());\n\n // Test with a non-existing field.\n $this->condition->setContextValue('field', 'non-existing-field');\n $this->assertFalse($this->condition->evaluate());\n }", "public function it_can_validate()\n {\n $object = new Testee(self::TEST_NULL_VALUE);\n $this->assertEquals(self::TEST_NULL_VALUE, $object->validate(self::TEST_NULL_VALUE));\n }", "public function testWhereNotEqualsNull()\n {\n $query = (new WhereBuilder($this->mockConnection))->where('field', '!=', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is not',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n\n $query = (new WhereBuilder($this->mockConnection))->where('field', '<>', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is not',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "public function testIsNull() {\n\t\t$result = _::isNull(null);\n\t\t$this->assertTrue($result);\n\n\t\t// test that false is not null\n\t\t$result = _::isNull(false);\n\t\t$this->assertFalse($result);\n\t}", "public function isSetCondition()\n {\n return !is_null($this->_fields['Condition']['FieldValue']);\n }", "public function assertNotFalse($condition, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertNotFalse', func_get_args()));\n }", "public function assertNotFalse($condition, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertNotFalse', func_get_args()));\n }", "protected final function AssertNull( $value, $strict = true )\n {\n $this->observer->OnAssert();\n\n if( $strict )\n {\n $result = ( $value === null );\n }\n else\n {\n $result = ( $value == null );\n }\n\n Core::Assert( $result, var_export( $value, true ) . ' is not null' );\n }", "public function testGet_url1()\n{\n\n // Traversed conditions\n // if ($this->url !== \\null) == true (line 103)\n\n $actual = $this->simplePie_Copyright->get_url();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testGet_url0()\n{\n\n // Traversed conditions\n // if ($this->url !== \\null) == false (line 103)\n\n $actual = $this->simplePie_Copyright->get_url();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "function assertNull($value, $message = '%s should be NULL') {\n return $this->assert(\n new IdenticalExpectation(null),\n $value,\n $message\n );\n }", "public function testEmptyChain() {\n $result = $this->policy->check($this->request);\n $this->assertSame(NULL, $result);\n }", "public function testNullEqualsFalseWhenAllowNullIsFalse()\n {\n $arguments = [null];\n\n $return = $this->call(BooleanValidation::create()->setAllowNull(false), $arguments);\n\n $this->assertEquals(false, $return);\n }", "public function isValidCondition(RuleCondition $condition)\n {\n $condition->setSourceValue($this->get($condition->getEntityField()));\n return $condition->isValid();\n }", "public function testconstructSQLClauseNullValues()\n {\n $_SESSION['behat']['GenesisSqlExtension']['keywords'] = [];\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];\n\n // Prepare / Mock\n $glue = ' AND ';\n $columns = [\n 'firstname' => 'null',\n 'lastname' => '!null',\n 'postcode' => '!NULL',\n 'address' => 'NULL'\n ];\n\n // Execute\n $result = $this->testObject->constructSQLClause($glue, $columns);\n\n $expected = \"firstname is null AND lastname is not null AND postcode is not NULL AND address is NULL\";\n\n // Assert Result\n $this->assertEquals($expected, $result);\n }", "function CheckCondition()\n\t{\n\t\treturn true;\n\t}", "public function testHasErrors0()\n{\n\n $actual = $this->collecting->hasErrors();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function assertFalse($condition, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertFalse', func_get_args()));\n }", "public function assertFalse($condition, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertFalse', func_get_args()));\n }", "public function testOrderCriteriaIsNotEmpty()\n {\n $orderCriteria = $this->criteriaCreator->getOrderCriteria($this->getMockedRequestQueryData());\n\n $this->assertNotNull($orderCriteria);\n\n }", "public function checkNotNull($value)\n {\n return new AssertionResult(\n !is_null($value),\n '{name} must not be null'\n );\n }", "public function testWhereEqualsNull()\n {\n $query = (new WhereBuilder($this->mockConnection))->where('field', '=', null);\n $array = $query->toArray();\n\n $this->assertInstanceOf(WhereBuilder::class, $query);\n $this->assertEquals([\n 'where' => [\n [\n 'column' => 'field',\n 'operator' => 'is',\n 'value' => 'NULL',\n 'boolean' => 'and',\n ]\n ]\n ], $array);\n }", "public function testNullRuleChain() {\n $rule = $this->createMock('Drupal\\Core\\PageCache\\RequestPolicyInterface');\n $rule->expects($this->once())\n ->method('check')\n ->with($this->request)\n ->will($this->returnValue(NULL));\n\n $this->policy->addPolicy($rule);\n\n $result = $this->policy->check($this->request);\n $this->assertSame(NULL, $result);\n }", "public function isValid($conditionId, $context)\n {\n // For now always valid, checking all surveys and possible questions could slow things down\n $result = true;\n\n return $result;\n }", "public function testNullValueIsEvaluatedAsFalse()\n {\n $this->assertFalse(EmailValidator::validate(null));\n }", "public function testMissingParameterAddCheckNull() {\n $this->pingdom->addCheck(null);\n }", "public function test__toString1()\n{\n\n // Traversed conditions\n // if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) == false (line 88)\n\n $actual = $this->setCookie->__toString();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "protected final function AssertNotNull( $value, $strict = true )\n {\n $this->observer->OnAssert();\n\n if( $strict )\n {\n $result = ( $value !== null );\n }\n else\n {\n $result = ( $value != null );\n }\n\n Core::Assert( $result, var_export( $value, true ) . ' is null' );\n }", "public function testAssertion() \r\n {\r\n $this->assertEquals(true, true);\r\n }", "public function testIsNullBlank()\n {\n $this->assertTrue(StringUtils::isBlank(null));\n }", "function ensure($condition, $error_message) {\n if (!$condition) {\n $e = new Exception($error_message);\n throw $e;\n }\n}", "function _checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id = 0)\n\t{\n\t\treturn true;\n\t}", "public function testIsAvailableWithNullOrder()\n {\n $orderId = 123;\n\n /** @var CaseInterface|\\PHPUnit_Framework_MockObject_MockObject $case */\n $case = $this->getMockBuilder(CaseInterface::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $case->expects($this->once())\n ->method('getGuaranteeDisposition')\n ->willReturn(CaseEntity::GUARANTEE_APPROVED);\n\n $this->caseManagement->expects($this->once())\n ->method('getByOrderId')\n ->with($orderId)\n ->willReturn($case);\n\n $this->orderRepository->expects($this->once())\n ->method('get')\n ->with($orderId)\n ->willThrowException(new NoSuchEntityException());\n\n $this->assertFalse($this->cancelGuaranteeAbility->isAvailable($orderId));\n }", "protected function validCondition($condition)\n {\n $allowedConditions = ['AND', 'OR'];\n\n return in_array($condition, $allowedConditions);\n }", "public function isValidCondition(DiscountCondition $condition)\n {\n switch($condition->getSourceField()) {\n case 'group':\n $condition->setSourceValue($this->getGroup());\n break;\n case 'billing_state':\n $condition->setSourceValue($this->getBillingState());\n break;\n case 'shipping_state':\n $condition->setSourceValue($this->getShippingState());\n break;\n default:\n //no-op\n break;\n }\n\n return $condition->isValid();\n }", "static function isNull()\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::isNull', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function testIsAvailableWithNullCase()\n {\n $orderId = 123;\n\n $this->caseManagement->expects($this->once())\n ->method('getByOrderId')\n ->with($orderId)\n ->willReturn(null);\n\n $this->assertFalse($this->cancelGuaranteeAbility->isAvailable($orderId));\n }", "public function testFailWhenUnitOfWorkIsNotAValidObject(): void\n {\n $constraint = new DoctrineUnitOfWorkEmpty();\n\n $this->expectException(AssertionFailedError::class);\n $this->expectExceptionMessage('Supplied object is not a valid UnitOfWork instance.');\n\n $constraint->evaluate(new stdClass());\n }", "public function assertValid() : void\n {\n }", "public function assertValid() : void\n {\n }", "public function test_callback_returns_false_when_not_optional_and_input_null() {\n\t\t$optional = false;\n\t\t$params = ['is_string'];\n\n\t\t$result = self::$validator->validate( null, $optional, $params );\n\t\t$this->assertFalse( $result );\n\t}", "public function test_callback_returns_true_when_optional_and_input_null() {\n\t\t$optional = true;\n\t\t$params = ['is_string'];\n\n\t\t$result = self::$validator->validate( null, $optional, $params );\n\t\t$this->assertTrue( $result );\n\t}", "public function assertNotNull($actual, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertNotNull', func_get_args()));\n }", "public function assertNotNull($actual, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertNotNull', func_get_args()));\n }", "public function it_always_returns_null()\n {\n $object = new Testee(self::TEST_NULL_VALUE);\n $this->assertEquals(null, $object->getValue());\n }", "function assert($assertion, $description = NULL)\n{\n}", "function testBasicAssertions()\n\t{\n\t\t$this->assertTrue( true );\n\t\t$this->assertFalse( false );\n\t}", "static function assertNotNull($actual, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertNotNull', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "private function validateComposite(FilterInterface $condition, $segmentName)\n {\n $conditionType = $this->getConditionType($condition);\n if ($conditionType === 'composite')\n {\n $children = $condition->getItems();\n if (!count($children))\n {\n throw new RuntimeException('The segment ' . $segmentName . ' has a composite condition but no children');\n }\n for ($i = 0, $len = count($children); $i < $len; ++$i)\n {\n $this->validateComposite($children[$i], $segmentName);\n }\n }\n else\n {\n $this->validateComparison($condition, $segmentName);\n }\n }", "public function checkCondition()\n {\n $conditionClass = $this->getConditionClass();\n $conditionMethod = $this->getConditionMethod();\n\n if (empty($conditionClass) || empty($conditionMethod))\n {\n return true;\n }\n else\n {\n return call_user_func(array($conditionClass, $conditionMethod), $this);\n }\n }", "public function hasCondition()\n\t{\n\t\treturn count($this->values) > 0;\n\t}", "public function testGatherMiddleware1()\n{\n\n // Traversed conditions\n // if (!is_null($this->computedMiddleware)) == true (line 750)\n\n $actual = $this->route->gatherMiddleware();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function isValidComparisonExpectations() {}", "public function assertSatisfiedBy($subject)\n {\n if(!$this->isSatisfiedBy($subject)) {\n $this->assertionFailed($subject);\n }\n }", "public function hasCondition()\n {\n return ! empty($this->conditions);\n }", "public static function isNotNull()\n {\n return self::logicalNot(self::isNull());\n }", "public function test__toString2()\n{\n\n // Traversed conditions\n // if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) == true (line 88)\n // if ($k === 'Expires') == false (line 89)\n\n $actual = $this->setCookie->__toString();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testWhenConditionIsSetCorrectly()\n {\n $this->class->set_condition(\"'TopicA' in topics && 'TopicB' in topics\");\n\n $this->assertTrue($this->class->has_condition());\n }", "public function exists($condition = null)\n {\n $this->addCondition($condition, false);\n return $this->select(static::primaryKey())->queryScalar() !== false;\n }", "public function testGatherMiddleware0()\n{\n\n // Traversed conditions\n // if (!is_null($this->computedMiddleware)) == false (line 750)\n\n $actual = $this->route->gatherMiddleware();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function test__toString3()\n{\n\n // Traversed conditions\n // if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) == true (line 88)\n // if ($k === 'Expires') == true (line 89)\n\n $actual = $this->setCookie->__toString();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function test_if_a_member_has_less_than_18_years_old_and_does_not_has_a_guarantor()\n {\n $this->assertEquals(null, $this->useCase->execute(15, 0, false));\n }", "public function testRegonLocal0()\n{\n\n // Traversed conditions\n // for (...) == false (line 65)\n // for (...) == false (line 69)\n // if ($checksum == 10) == false (line 73)\n\n $actual = $this->company->regonLocal();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function testInvalidFurCondition(){\n\t\t\t$furVars =[\n\t\t\t\t'name' => 'White Dresser',\n\t\t\t\t'description' => 'Nice Dresser',\n\t\t\t\t'price' => '900.12',\n\t\t\t\t'categoryId' => '5',\n\t\t\t\t'fur_condition' => ''\n\t\t\t];\n\t\t\t$properTest = saveFuncFurniture($furVars);\n\t\t\t$this->assertFalse($properTest);\n\t\t}" ]
[ "0.6321695", "0.61957353", "0.61014396", "0.5891267", "0.5870567", "0.58580095", "0.5771239", "0.57516587", "0.56984204", "0.56826603", "0.56670177", "0.56427836", "0.56427836", "0.5578369", "0.5575976", "0.5552035", "0.542101", "0.542101", "0.54190695", "0.54190695", "0.5396375", "0.53865504", "0.535191", "0.53321123", "0.53268105", "0.53244567", "0.53042185", "0.53037244", "0.52994454", "0.5286043", "0.5281127", "0.5268574", "0.5262874", "0.5259221", "0.52575475", "0.5242924", "0.5224756", "0.5210754", "0.5192965", "0.5179347", "0.5177734", "0.51660365", "0.51660365", "0.5148388", "0.5144482", "0.51360005", "0.5110801", "0.510893", "0.51034886", "0.509847", "0.5070015", "0.5060373", "0.5056813", "0.50507367", "0.50507367", "0.5039989", "0.5028755", "0.50252545", "0.50041026", "0.4999412", "0.49853224", "0.49641263", "0.49574363", "0.49557865", "0.495245", "0.4942856", "0.48998675", "0.48935157", "0.48927668", "0.48832133", "0.48711765", "0.48449916", "0.48381037", "0.48243147", "0.4816167", "0.4816167", "0.48042092", "0.4799228", "0.4791466", "0.4791466", "0.47673357", "0.47625843", "0.47571114", "0.47498912", "0.47481197", "0.47476918", "0.47474086", "0.47447744", "0.47414833", "0.47397923", "0.47394794", "0.47359264", "0.47319603", "0.47185716", "0.4714964", "0.4709127", "0.47025186", "0.47008622", "0.46935114", "0.466465" ]
0.49239025
66
Make this functionality better.
public function giveRole($title) { $role = Role::where('title', $title)->first(); if(!$role) { return false; } $userRoles = $this->userRoles(); if($userRoles->where('role_id', $role->id)->first()) { return true; } return $this->userRoles()->create([ 'role_id' => $role->id, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "protected function __init__() { }", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "final private function __construct(){\r\r\n\t}", "private function __() {\n }", "protected final function __construct() {}", "protected function init() {return;}", "final private function __construct() {}", "final private function __construct() {}", "protected function __construct(){}", "protected function __construct(){}", "protected function __construct(){}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct () {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private function __construct()\t{}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "final private function __construct() {\n\t\t\t}", "public function __init(){}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function __construct() {\n\t\t\n\t}", "protected function __construct() {\n\t\t\n\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct() {\n \n }", "private function __construct() {\n \n }", "private function __construct() {\n \n }", "private function __construct() {\r\n\t\t\r\n\t}", "protected function _response() {}", "protected function __construct() {\r\r\n // contain shared code in its constructor\r\r\n parent::__construct();\t\r\r\n\t}", "protected function _request() {}", "private function __construct () {}", "protected function init()\n\t{\n\t\t\n\t}", "protected function preProcess() {}", "protected function __construct() {\n // contain shared code in its constructor\n parent::__construct();\n }", "final private function __construct()\n {\n }", "protected function collectInformation() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.60854626", "0.601819", "0.5985376", "0.5985376", "0.5985376", "0.5985376", "0.5985182", "0.5985182", "0.5985182", "0.5985182", "0.5985182", "0.5985182", "0.59845227", "0.59845227", "0.5890195", "0.5890195", "0.5890195", "0.5890195", "0.58668905", "0.5862108", "0.58431154", "0.5834011", "0.58325666", "0.58325666", "0.5819601", "0.5819601", "0.5819601", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.5719268", "0.571312", "0.571312", "0.571312", "0.57104695", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.56872386", "0.5659581", "0.56530905", "0.56530905", "0.56530905", "0.56530905", "0.56472796", "0.56472796", "0.56416124", "0.5626008", "0.5626008", "0.5626008", "0.5625803", "0.5624859", "0.5620519", "0.56109864", "0.5608637", "0.55893147", "0.5579231", "0.55792123", "0.55753684", "0.5556922", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974" ]
0.0
-1
Make this functionality better.
public function removeRole($title) { $role = Role::where('title', $title)->first(); if(!$role) { return false; } $userRole = $this->userRoles()->where('role_id', $role->id)->first(); if($userRole) { return $userRole->delete(); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "protected function __init__() { }", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "protected function _process() {}", "final private function __construct(){\r\r\n\t}", "private function __() {\n }", "protected final function __construct() {}", "protected function init() {return;}", "final private function __construct() {}", "final private function __construct() {}", "protected function __construct(){}", "protected function __construct(){}", "protected function __construct(){}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct() {}", "protected function __construct () {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "private function __construct()\t{}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "final private function __construct() {\n\t\t\t}", "public function __init(){}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function initialize() {}", "protected function __construct() {\n\t\t\n\t}", "protected function __construct() {\n\t\t\n\t}", "private function __construct() {\r\n\t\r\n\t}", "private function __construct() {\n \n }", "private function __construct() {\n \n }", "private function __construct() {\n \n }", "private function __construct() {\r\n\t\t\r\n\t}", "protected function _response() {}", "protected function __construct() {\r\r\n // contain shared code in its constructor\r\r\n parent::__construct();\t\r\r\n\t}", "protected function _request() {}", "private function __construct () {}", "protected function init()\n\t{\n\t\t\n\t}", "protected function preProcess() {}", "protected function __construct() {\n // contain shared code in its constructor\n parent::__construct();\n }", "final private function __construct()\n {\n }", "protected function collectInformation() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}" ]
[ "0.60854626", "0.601819", "0.5985376", "0.5985376", "0.5985376", "0.5985376", "0.5985182", "0.5985182", "0.5985182", "0.5985182", "0.5985182", "0.5985182", "0.59845227", "0.59845227", "0.5890195", "0.5890195", "0.5890195", "0.5890195", "0.58668905", "0.5862108", "0.58431154", "0.5834011", "0.58325666", "0.58325666", "0.5819601", "0.5819601", "0.5819601", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.57318836", "0.5719268", "0.571312", "0.571312", "0.571312", "0.57104695", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.57104504", "0.56872386", "0.5659581", "0.56530905", "0.56530905", "0.56530905", "0.56530905", "0.56472796", "0.56472796", "0.56416124", "0.5626008", "0.5626008", "0.5626008", "0.5625803", "0.5624859", "0.5620519", "0.56109864", "0.5608637", "0.55893147", "0.5579231", "0.55792123", "0.55753684", "0.5556922", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974", "0.55453974" ]
0.0
-1
Builds a unique userId that can be used to identify users for security tracking.
public function id(\Psr\Http\Message\ServerRequestInterface $request): string { $headersToHash = [ 'accept' => '', 'accept-encoding' => '', 'accept-language' => '', 'user-agent' => '', 'x-forwarded-for' => '' ]; // pull each header value out (if it exists) foreach ($headersToHash as $header => $value) { $headersToHash[$header] = $request->hasHeader($header) ? $request->getHeader($header)[0] : $header; } $this->logger->debug( 'Identity of incoming request built', ['prehash_id' => implode('', $headersToHash)] ); return hash('sha256', implode('', $headersToHash)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function UserID()\n\t\t{\n\t\treturn sprintf\n\t\t\t(\n\t\t\t'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0x0fff) | 0x4000,\n\t\t\tmt_rand(0, 0x3fff) | 0x8000,\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff),\n\t\t\tmt_rand(0, 0xffff)\n\t\t\t);\n\t\t}", "protected function make_uid()\n\t{\n\t\t$date = date('Ymd\\THisT');\n\t\t$unique = substr(microtime(), 2, 4);\n\t\t$base = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPrRsStTuUvVxXuUvVwWzZ1234567890';\n\t\t$start = 0;\n\t\t$end = strlen( $base ) - 1;\n\t\t$length = 6;\n\t\t$str = null;\n\t\tfor( $p = 0; $p < $length; $p++ )\n\t\t{\n\t\t\t$unique .= $base{mt_rand( $start, $end )};\n\t\t}\n\t\treturn $date . '-' . $unique . ($this->num_to_letter(++$this->uid_counter));\n\t}", "public static function generateUniqueId()\n {\n $request = Request::createFromGlobals();\n $leftHandString = time(). '-';\n $rightHandString = '@' . $request->server->get('SERVER_NAME');\n $fillValue = bin2hex(get_current_user()) . '-' . mt_rand(1000000,9999999);\n\n $fillLength = self::MAX_LENGTH_PER_LINE - strlen($leftHandString) - strlen($rightHandString);\n if (strlen($fillValue) > $fillLength){\n $fillValue = substr($fillValue, 0, $fillLength);\n }\n\n $uniqueIdCandidate = $leftHandString . $fillValue . $rightHandString;\n $uniqueId = substr($leftHandString . $fillValue . $rightHandString, (strlen($uniqueIdCandidate) > self::MAX_LENGTH_PER_LINE) ? strlen($uniqueIdCandidate)-self::MAX_LENGTH_PER_LINE : 0);\n\n return $uniqueId;\n }", "public function uniqueId(): string\n {\n return strval($this->user->id);\n }", "function getUserId(){\n\t//replace with actual\n\treturn '123';\n}", "private function genUser() {\r\n $random = 0;\r\n $rand78 = \"\";\r\n $randuser = \"\";\r\n $userid = \"\";\r\n $maxcount = rand( 4, 9 );\r\n if ( ($maxcount > 8) or ( $maxcount < 5) ) {\r\n do {\r\n $maxcount = rand( 4, 9 );\r\n } while ( ($maxcount > 8) or ( $maxcount < 5) );\r\n }\r\n $rand62 = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n for ( $count = 0; $count <= $maxcount; $count++ ) {\r\n $random = rand( 0, 61 );\r\n $randuser = substr( $rand62, $random, 1 );\r\n $userid = $userid . $randuser;\r\n }\r\n $userid = substr( $userid, 0, 8 ); // Just in case\r\n return($userid);\r\n }", "public static function uid() {\n\t\t$length = 10;\n\t\t$characters = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\t\t$uid = \"\";\n\t\t\n\t\tdo {\n\t\tfor ($i=0; $i<$length; $i++)\n\t\t\t$uid .= $characters[mt_rand(0, strlen($characters) - 1)];\n\t\t} while (array_key_exists($uid, self::$uids));\n\t\t\n\t\treturn $uid;\n\t}", "public function getuserId() : Uuid {\n\t\treturn($this->userId);\n\t}", "function generateUid()\n{\n $uid = uniqid(md5(mt_rand()), true);\n $formid = hash(\"sha256\", $uid);\n return $formid;\n}", "private function generateUID(){\n if(function_exists(\"random_bytes\")){\n return md5(bin2hex(random_bytes(16)) . time());\n } else if(function_exists(\"openssl_random_pseudo_bytes\")){\n return md5(bin2hex(openssl_random_pseudo_bytes(16)) . time());\n }\n return md5(uniqid() . time());\n }", "function generate_uid($length=8) {\r\n\t$allChars = 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','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','0','1','2','3','4','5','6','7','8','9','_');\r\n\tfor($i=0;$i<$length;$i++) \r\n\t\t$uid.=$allChars[rand(0,62)];\r\n\treturn $uid;\r\n}", "final protected function userId()\n {\n return $this->container->make(LashyGuard::class)->id();\n }", "public function generateUniqueId(){\n //PHPs uniquid function is time based and therefor guessable\n //A stright random MD5 sum is too long for email and tends to line break causing usability problems\n //So we get unique through uniquid and we get random by prefixing it with a part of an MD5\n //hopefully this results in a URL friendly short, but unguessable string\n $prefix = substr(md5(mt_rand()*mt_rand()),rand(0,24), rand(6,8));\n $this->uniqueId = \\uniqid($prefix);\n }", "public function getUserId() \n {\n if (!$this->hasUserId()) \n {\n $this->userId = 0;\n }\n\n return $this->userId;\n }", "function Uuid()\n {\n $unid = uniqid() . str_replace('-', '', Guid());\n $uuid = substr($unid, 0, 8) . '-' . substr($unid, 8, 4) . '-' . substr($unid, 12, 4) . '-' . substr($unid, 16, 4) . '-' . substr($unid, 20, 12);\n return $uuid;\n }", "public function generateUniqueId()\n {\n //PHPs uniquid function is time based and therefor guessable\n //A stright random MD5 sum is too long for email and tends to line break causing usability problems\n //So we get unique through uniquid and we get random by prefixing it with a part of an MD5\n //hopefully this results in a URL friendly short, but unguessable string\n $prefix = substr(md5(mt_rand() * mt_rand()), rand(0, 24), rand(6, 8));\n $this->uniqueId = \\uniqid($prefix);\n }", "public function getUid() {}", "public function getUid() {}", "public function getUid() {}", "public function getUid() {}", "public function getUid() {}", "public function getUid() {}", "private function generateId()\n {\n $startHex = dechex((int)$this->startTime);\n $uuid = bin2hex(random_bytes(12));\n\n return \"1-{$startHex}-{$uuid}\";\n }", "public function generate_unique_id() {\n\n\t\t\trequire_once ABSPATH . 'wp-includes/class-phpass.php';\n\t\t\t$hasher = new PasswordHash( 8, false );\n\t\t\treturn md5( $hasher->get_random_bytes( 32 ) );\n\n\t\t}", "function _createId( )\n\t{\n\t\t$agent = $_SERVER['HTTP_USER_AGENT'];\n\t\t$id = md5( $agent . uniqid(dechex(rand())) . $_SERVER['REMOTE_ADDR'] );\n\t\treturn $id;\n\t}", "protected function _createUniqueId()\n {\n $id = '';\n $id .= function_exists('microtime') ? microtime(true) : (time() . ' ' . rand(0, 100000));\n $id .= '.' . (function_exists('posix_getpid') ? posix_getpid() : rand(50, 65535));\n $id .= '.' . php_uname('n');\n\n return $id;\n }", "Public Function UserId() {\n\t\treturn $this->userId;\n\t\n\t}", "protected function createUid() {\n\t\tdo {\n\t\t\t$uid = $this->getUid();\n\t\t\t$contact = $this->backend->getContact($this->getKey(), $uid . '.vcf');\n\t\t} while (!empty($contact));\n\n\t\treturn $uid;\n\t}", "function gen_id() {\n\t\t$this->id = get_uid();\n\t\t$this->mk_paths($this->id);\n\t}", "private static function get_unique_id(){\n\t\tself::$u_id+=1;\n\t\treturn (string) self::$u_id;\n\t}", "static function uniqueID()\n {\n return substr(str_pad(str_replace('.', '', microtime(true)), 12, 0), 0, 12);\n }", "protected function _getSanitizedUserId($userId)\n {\n if (!empty(static::$USER_PREFIX)) {\n return static::$USER_PREFIX . $userId;\n }\n \n return $userId;\n }", "protected function generateUid(int $length = 29): string\n\t{\n\t\treturn self::$faker->format('regexify', ['[a-zA-Z0-9]{' . $length . '}']);\n\t}", "protected function getUid() {\n\t\treturn UUIDUtil::getUUID();\n\t}", "private function getCustomerIdParameter()\n {\n return sprintf('uid-%s-%s', time(), $this->generateRandomString());\n }", "public function getUserId()\n {\n if (sfContext::hasInstance())\n {\n if ($userId = sfContext::getInstance()->getUser()->getAttribute('user_id'))\n {\n return $userId;\n }\n }\n return 1;\n }", "public function getUid();", "public function getUid();", "public function getUid ();", "function generateRandID(){\n\t\t$userid = $this->getPasswordSalt();\n\t\treturn hash('sha256',$userid);\n\t}", "protected function getUserId(): int|string|null\n {\n if (!isset($this->userId)) {\n $this->userId = Auth::guard(config('nova.guard'))->id() ?? null;\n }\n\n return $this->userId;\n }", "protected function determine_user_id() {\n\t\t$user_id = $this->context->site_user_id;\n\n\t\t/**\n\t\t * Filter: 'wpseo_schema_person_user_id' - Allows filtering of user ID used for person output.\n\t\t *\n\t\t * @api int|bool $user_id The user ID currently determined.\n\t\t */\n\t\treturn apply_filters( 'wpseo_schema_person_user_id', $user_id );\n\t}", "static public function uid ()\n\t{\n\t\t$t = gettimeofday();\n\t\treturn $t['sec'] . $t['usec'] . mt_rand(100, 999);\n\t}", "public function getUserId ()\n {\n return $this->storage->get(self::$prefix . 'userId');\n }", "function gen_user_id()\n{\n global $dbc;\n\n $query = \"SELECT `id` FROM `users` ORDER BY `id` DESC LIMIT 1\";\n $result = mysqli_query($dbc, $query);\n\n list($id) = mysqli_fetch_array($result);\n\n $prefix = 'DIOCE-' . date(\"y\") . 'U';\n\n $idd = $id + 1;\n\n if($idd < 10)\n $value = '000' . $idd;\n elseif($idd < 100)\n $value = '00' . $idd;\n elseif($idd < 1000)\n $value = '0' . $idd;\n else\n $value = $idd;\n\n return $prefix . $value;\n}", "protected function getUserId() {}", "protected function getUserId() {}", "public function getUserIdentifier()\n {\n // that's why I am sending the id here\n return $this->id;\n }", "function get_id() : string {\n\t$current_user = wp_get_current_user();\n\treturn sha1( $current_user->user_email );\n}", "protected function userId()\n {\n return Auth::id();\n }", "protected function generateId() {\n return $this->id = md5(uniqid());\n }", "public function generateId(){\n\n global $verificationId,$id;\n $verificationId = true;\n $id = 0;\n while($verificationId == true){\n $id=$this->idgenerate();\n if(is_null(User::find($id))) {\n $verificationId = false;\n }\n }\n return $id;\n\n }", "static function makeID() {\n return uniqid();\n }", "public function getUserId () {\n\t\treturn ($this->userId);\n\t}", "public static function get_uniqueid() {\n global $USER;\n\n $uniqueid = new \\stdClass();\n\n // at first, have a look if a specific user for course exports has been defined\n $specific_export_user = self::get_specific_export_user();\n if ($specific_export_user !== false){\n if (!empty($specific_export_user->username)){\n $uniqueid->value = $specific_export_user->username;\n $uniqueid->type = 'username';\n return $uniqueid;\n }\n }\n\n // if no specific export user could be found, we continue...\n $uniqueid->type = get_config('local_remote_backup_provider', 'uniqueid');\n switch ($uniqueid->type) {\n case 'username':\n $uniqueid->value = $USER->username;\n break;\n case 'email':\n $uniqueid->value = $USER->email;\n break;\n case 'idnumber':\n $uniqueid->value = $USER->idnumber;\n break;\n default:\n $uniqueid->value = $USER->username;\n $uniqueid->type = 'username';\n }\n return $uniqueid;\n }", "public function getUserId(): int\n {\n return $this->userId;\n }", "public function generateUserIdentifier($length = User::USER_IDENTIFIER_LENGTH)\n {\n $result = substr(preg_replace('/[^a-zA-Z0-9]/', '', base64_encode(openssl_random_pseudo_bytes($length + 1))), 0, $length);\n\n return $result;\n }", "private static function getAuthTokenUserId() {\n global $_iform_warehouse_override;\n if ($_iform_warehouse_override || !function_exists('hostsite_get_user_field')) {\n // If linking to a different warehouse, don't do user authentication as\n // it causes an infinite loop.\n return '';\n }\n else {\n $indiciaUserId = hostsite_get_user_field('indicia_user_id');\n // Include user ID if logged in.\n return $indiciaUserId ? \":$indiciaUserId\" : '';\n }\n }", "public function getUserId() {\n\t\treturn($this->userId);\n\t}", "public function generateUID()\n {\n do {\n $key = md5(uniqid(mt_rand(), true));\n } while ($this->objectUidExists($key));\n\n return $key;\n }", "private function getuserid() {\n\n $user_security = $this->container->get('security.context');\n // authenticated REMEMBERED, FULLY will imply REMEMBERED (NON anonymous)\n if ($user_security->isGranted('IS_AUTHENTICATED_FULLY')) {\n $user = $this->get('security.context')->getToken()->getUser();\n $user_id = $user->getId();\n } else {\n $user_id = 0;\n }\n return $user_id;\n }", "protected function _generateId()\n {\n return str_replace('.', '', microtime(true));\n }", "public function getUserId() {\n return($this->userId);\n }", "public static function getCurrentUserId()\n {\n $profile = self::getProfile();\n\n return $profile ? $profile->getProfileId() : 0;\n }", "public function getUserId()\n {\n return UsniAdaptor::app()->user->getId();\n }", "public function getUserId() : int\n {\n return $this->userId;\n }", "protected function getSimulatingUserId()\n {\n return session(static::SIMULATING_USER_PROFILE_ID);\n }", "private function make_id () {\n // http://sourceforge.net/projects/phunction/\n return sprintf('%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));\n }", "abstract protected function getUserId() ;", "private static function makeRpcUid()\n {\n return bin2hex(openssl_random_pseudo_bytes(90));\n }", "public static function getUniqueIdFromUserId($userId) {\n\t\t$query = \"SELECT uniqId FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $userId);\n\t\t$row = executeSQLSingleRow($query, $query_params);\n\t\treturn $row['uniqId'];\n\t}", "protected function getFrontendUserId()\n {\n // is $GLOBALS set?\n if (\n ($GLOBALS['TSFE'])\n && ($GLOBALS['TSFE']->loginUser)\n && ($GLOBALS['TSFE']->fe_user->user['uid'])\n ) {\n return intval($GLOBALS['TSFE']->fe_user->user['uid']);\n //===\n }\n\n return 0;\n //===\n }", "public function getUid(): string\n {\n return $this->uid;\n }", "public function getuserId()\n {\n return $this->userId;\n }", "public function getUserID() {\n\t\tif (is_numeric($this->user_id)) {\n\t\t\treturn $this->user_id;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "public function createUid()\n {\n $uid = uniqid();\n while (AutoEvent::where('uid', '=', $uid)->count() > 0) {\n $uid = uniqid();\n }\n $this->uid = $uid;\n }", "function GenerateUserID(int $autoID, int $flag){\n\tif ($flag == 0){\n\t\tif ($autoID < 10){\n\t\t\t$Spr_id = \"S00\".$autoID;\n\t\t\treturn $Spr_id;\n\t\t}\n\t\telse if($autoID < 100){\n\t\t\t$Spr_id = \"S0\".$autoID;\n\t\t\treturn $Spr_id;\n\t\t}\n\t\telse{\n\t\t\t$Spr_id = \"S\".$autoID;\n\t\t\treturn $Spr_id;\n\t\t}\n\t}\n\telse{\n\t\tif ($autoID < 10){\n\t\t\t$Spr_id = \"U00\".$autoID;\n\t\t\treturn $Spr_id;\n\t\t}\n\t\telse if($autoID < 100){\n\t\t\t$Spr_id = \"U0\".$autoID;\n\t\t\treturn $Spr_id;\n\t\t}\n\t\telse{\n\t\t\t$Spr_id = \"U\".$autoID;\n\t\t\treturn $Spr_id;\n\t\t}\n\t}\n}", "protected function _getUid()\n {\n $key = (string)Mage::getConfig()->getNode('global/crypt/key');\n $salt = $this->_getShopSystemType();\n if (!$salt) {\n $salt = '5h0p6473.c0m';\n }\n\n return md5($key . $salt);\n }", "public static function userId()\r\n {\r\n return (new Session())->get(static::$userIdField);\r\n }", "protected function generateSessionId()\n\t{\n\t\t//\\Log::info('custom session id created');\n\t\t//return sha1(uniqid('', true).Str::random(25).microtime(true));\n\n\n\t\t// use our own ID generation mechanism\n\t\t$id_hash = str_random(64);\n\n\t\treturn $id_hash;\n\n\t}", "public function generateNewUid()\n {\n $this->uid = gmdate('Ymd') . 'T' . gmdate('His') . 'Z-' . uniqid('', true) . '@' . gethostname();\n\n return $this;\n }", "public function getUserId()\n {\n \treturn $this->getCurrentUserid();\n }", "public function getUserId() {\n\t\treturn ($this->userId);\n\t}", "public function getCustomUserId();", "public function generateId()\n {\n $session_id = $this->request->param($this->sid_key, '');\n $_session_id = explode('-',$session_id ? xn_decrypt($session_id):'');\n $this->ip = isset($this->request->server['REMOTE_ADDR'])?$this->request->server['REMOTE_ADDR']:'127.0.0.1';\n $this->useragent = isset($this->request->server['USER-AGENT'])? md5($this->request->server['USER-AGENT']):'';\n $this->sid = ($_session_id[2]&&$this->useragent==$_session_id[1]) ? $_session_id[2] : get_uniqid(32);\n $this->sess_key = $_session_id[2]==$this->sid ? $session_id : xn_encrypt(getut().'-'.$this->useragent.'-'.$this->sid.'-'.$this->ip);\n }", "static public function generateSID() {\n\t\treturn md5( $_SERVER['HTTP_USER_AGENT'] + $_SERVER['REMOTE_ADDR'] + time() + rand() );\n\t}", "public function get_userId()\n {\n return $this->_userId;\n }", "protected function _uniqueId()\n {\n $t = explode(\" \", microtime());\n\n return sprintf(\n '%08s-%08s-%04s-%04x%04x',\n $this->_ipToHex(),\n substr(\"00000000\" . dechex($t[1]), -8),\n substr(\"0000\" . dechex(round($t[0] * 65536)), -4),\n mt_rand(0, 0xffff),\n mt_rand(0, 0xffff)\n );\n }", "public function getUserId() {\n\t\t$currentUser = $this->getLoggedUser();\n\t\tif ($currentUser) {\n\t\t\treturn $currentUser->getId();\n\t\t}\n\t}", "function generateId(){\n $a = date('Ymd');\n $b = rand(1000, 9999);\n $c = rand(100, 999);\n $d = $a.$b.$c;\n if(strlen($d) !== 15){\n return str_pad($d, 15, '0', STR_PAD_RIGHT);\n }\n return $d;\n}", "function suid(int $length = 6, int $base = 62): string\n{\n return Uuid::generateSuid($length, $base);\n}", "protected function generateId() : string\n {\n return '';\n\n }", "public function getCurrentUserId();", "public function baru(){\n $six_digit_random_number = mt_rand(000001, 999999);\n $s=new userId;\n $userid = $s->create($six_digit_random_number);\n return $six_digit_random_number.$userid;\n }", "public function getBackendUserUid() {}", "protected static function getUserID()\r\n {\r\n $userID = \\CAT\\Helper\\Validate::sanitizePost('user_id','numeric');\r\n\r\n if(!$userID)\r\n $userID = \\CAT\\Helper\\Validate::sanitizeGet('user_id','numeric');\r\n\r\n if(!$userID)\r\n $userID = self::router()->getParam(-1);\r\n\r\n if(!$userID || !is_numeric($userID) || !\\CAT\\Helper\\Users::exists($userID))\r\n Base::printFatalError('Invalid data')\r\n . (self::$debug ? '(\\CAT\\Backend\\Users::getUserID())' : '');;\r\n\r\n return $userID;\r\n }", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();", "public function getUserId();" ]
[ "0.74894655", "0.7283555", "0.7030845", "0.6988689", "0.6946525", "0.69347286", "0.6848702", "0.6822486", "0.6822164", "0.6767921", "0.6670018", "0.66589653", "0.66290283", "0.6593945", "0.65781456", "0.65668744", "0.65627027", "0.6561592", "0.6561026", "0.6561026", "0.6561026", "0.6561026", "0.6555673", "0.65218884", "0.64917505", "0.64613473", "0.644887", "0.64482945", "0.64409226", "0.6439846", "0.64348805", "0.64159286", "0.64104205", "0.6408898", "0.63939255", "0.63846534", "0.6354987", "0.6354987", "0.6354902", "0.63536197", "0.6342767", "0.6332517", "0.6328568", "0.63049096", "0.630399", "0.6300143", "0.6300143", "0.6287739", "0.62836856", "0.62728035", "0.6266466", "0.6256982", "0.62478656", "0.6237284", "0.6236327", "0.62291723", "0.6223915", "0.6222169", "0.62212706", "0.6218447", "0.6213796", "0.62036633", "0.6201313", "0.62000173", "0.6199188", "0.61987793", "0.61907876", "0.6183169", "0.61738575", "0.6169666", "0.61694986", "0.6169279", "0.61666805", "0.61649495", "0.61614376", "0.6160208", "0.615997", "0.61551744", "0.61509824", "0.61433977", "0.6139993", "0.6138593", "0.6129238", "0.6124961", "0.61224115", "0.6118773", "0.6102453", "0.60989624", "0.60941786", "0.6089587", "0.6082551", "0.6080838", "0.6075887", "0.6070316", "0.60702205", "0.60692483", "0.60676354", "0.60676354", "0.60676354", "0.60676354", "0.60676354" ]
0.0
-1
Specify Model class name
public function model() { return 'App\Models\ChartKeywords'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getModelName()\n {\n if (isset($this->options[\"type\"])) {\n $type = ucfirst($this->options[\"type\"]);\n $class = \"\\\\app\\\\models\\\\feeds\\\\\" . $type;\n if (class_exists($class)) {\n return $class;\n }\n }\n \n return \"\\\\app\\\\models\\\\\" . $this->objectName;\n }", "public function getModelNameBasedOnClassName(): string\n {\n $fqn = explode(\"\\\\\", get_class($this));\n\n return strtolower(end($fqn));\n }", "public static function model($className=__CLASS__)\r\n\t{\r\n return parent::className();\r\n\t}", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "static public function model($className = __CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n \treturn parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) \n { \n return parent::model($className); \n }", "public static function model($className=__CLASS__) \n { \n return parent::model($className); \n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model ($className = __CLASS__) {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n\treturn parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) \n\t{\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__) {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\n return parent::model($className);\n }", "public function getModelClass(): string\n {\n return static::${'modelClass'};\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\r\n {\r\n return parent::model($className);\r\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model($className = __CLASS__) {\r\n return parent::model($className);\r\n }", "public static function model ($className = __CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className = __CLASS__){\n return parent::model($className);\n }", "public static function model($className = __CLASS__){\n return parent::model($className);\n }", "public function getModelClass();", "public function getModelClass();", "public function getModelClass();", "public static function model($className = __CLASS__) {\n return parent::model( $className );\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }", "public static function model($className=__CLASS__)\n {\n return parent::model($className);\n }" ]
[ "0.768929", "0.76618075", "0.7585344", "0.7583571", "0.7583571", "0.7542252", "0.75075734", "0.74778146", "0.74702877", "0.74578375", "0.74578375", "0.7453601", "0.7453601", "0.7447208", "0.7444998", "0.7435527", "0.74304074", "0.7416409", "0.74128395", "0.74125767", "0.74125767", "0.74125767", "0.741222", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.7407984", "0.740793", "0.74018055", "0.7400949", "0.739494", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.73907846", "0.7390499", "0.7390499", "0.7384692", "0.7384692", "0.7384692", "0.7384692", "0.7384692", "0.7384692", "0.7383603", "0.7379902", "0.7379902", "0.73766464", "0.73766464", "0.73766464", "0.73750174", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766", "0.7373766" ]
0.0
-1
Show the form for creating a new resource.
public function create(Request $request) { }
{ "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 {\n return view('url.form');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "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 {\n return view('saldo.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\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 $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\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\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "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 {\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.75936973", "0.75936973", "0.7585464", "0.7576766", "0.7571166", "0.7498768", "0.7434969", "0.7432511", "0.7387868", "0.7351811", "0.7336364", "0.73113805", "0.7293885", "0.72812635", "0.7273037", "0.72410345", "0.7228987", "0.7225174", "0.718589", "0.71786976", "0.7172516", "0.71492815", "0.7143504", "0.7143484", "0.71349627", "0.71274126", "0.7122271", "0.7115064", "0.7115064", "0.7115064", "0.7110841", "0.70930386", "0.70841706", "0.7079425", "0.7079275", "0.70567256", "0.70567256", "0.7054091", "0.70386195", "0.7038531", "0.7034834", "0.7032825", "0.7029208", "0.70263356", "0.7025177", "0.7018699", "0.70156187", "0.7004536", "0.7002615", "0.7000439", "0.69960874", "0.6992934", "0.6991493", "0.6988563", "0.698635", "0.69649065", "0.6963641", "0.69552153", "0.6950279", "0.69498897", "0.69465077", "0.6943029", "0.6940043", "0.6939427", "0.69359136", "0.69359136", "0.69357383", "0.6933012", "0.6929994", "0.69270134", "0.69259113", "0.6923401", "0.6917057", "0.69144267", "0.6911519", "0.6909902", "0.690978", "0.6905855", "0.6903688", "0.6900189", "0.68999064", "0.6898482", "0.6893158", "0.6892387", "0.6891021", "0.68905854", "0.6890334", "0.6890334", "0.68871844", "0.68864834", "0.68854547", "0.6881966", "0.68814063", "0.68788683", "0.68738896", "0.6871671", "0.68716353", "0.68688464", "0.6868651", "0.68685114", "0.686829" ]
0.0
-1
Display the specified resource.
public function show($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($id) { $management = management::find($id); return response()->json($management); }
{ "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(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\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(form $form)\n {\n //\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\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($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($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(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()\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() {\n return view('routes::edit');\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($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($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\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 return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::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 $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($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) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "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 $data = Restful::find($id);\n return view('restful.edit', compact('data'));\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 return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\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\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.7854417", "0.7692986", "0.72741747", "0.72416574", "0.7173436", "0.706246", "0.70551765", "0.698488", "0.6948513", "0.694731", "0.69425464", "0.6929177", "0.6902573", "0.6899662", "0.6899662", "0.6878983", "0.6865711", "0.6861037", "0.6858774", "0.6847512", "0.6836162", "0.68129057", "0.68083996", "0.68082106", "0.6803853", "0.67966306", "0.6794222", "0.6794222", "0.6789979", "0.67861426", "0.678112", "0.677748", "0.67702436", "0.67625374", "0.6748088", "0.67475355", "0.67475355", "0.67446774", "0.6742005", "0.67374676", "0.6727497", "0.6714345", "0.6696231", "0.6693851", "0.6689907", "0.6689746", "0.6687102", "0.66870165", "0.6684574", "0.6670877", "0.66705006", "0.6667089", "0.6667089", "0.6663205", "0.66626745", "0.66603845", "0.66593564", "0.66560745", "0.66545844", "0.66447026", "0.6633528", "0.66319114", "0.66298395", "0.66298395", "0.6622365", "0.6621021", "0.66170275", "0.661664", "0.6612467", "0.66107714", "0.6608453", "0.65979743", "0.659645", "0.6596389", "0.6592672", "0.6591205", "0.6588125", "0.6582166", "0.6581656", "0.65811247", "0.65785724", "0.65782833", "0.6576397", "0.6570971", "0.6569483", "0.6568432", "0.656811", "0.6563493", "0.6563493", "0.65622604", "0.65602434", "0.65585065", "0.6557997", "0.65574414", "0.6556701", "0.65565753", "0.6556226", "0.6556107", "0.6549118", "0.65485924", "0.65463555" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $mem_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